Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <string.h>
int main()
{
char a[11], b[11], c[11];
scanf("%s%s%s",a, b, c);
if (a[strlen(a)-1] == b[0] && b[strlen(b)-1] == c[0]) {
printf("YES\n");
} else {
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136977/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136977/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [11 x i8], align 1
%b = alloca [11 x i8], align 1
%c = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%sub = add i64 %call4, -1
%arrayidx = getelementptr inbounds [11 x i8], ptr %a, i64 0, i64 %sub
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%1 = load i8, ptr %b, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%call9 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #6
%sub10 = add i64 %call9, -1
%arrayidx11 = getelementptr inbounds [11 x i8], ptr %b, i64 0, i64 %sub10
%2 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%3 = load i8, ptr %c, align 1, !tbaa !5
%cmp15 = icmp eq i8 %2, %3
br i1 %cmp15, 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
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
char a[100],c[100],b[100];
scanf("%s %s %s",a,b,c);
int i=0,j=0;
while(a[i+1]!='\0')
i++;
while(b[j+1]!='\0')
j++;
if(a[i]==b[0] && b[j]==c[0])
printf("YES\n");
else printf("NO\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137019/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137019/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x i8], align 16
%c = alloca [100 x i8], align 16
%b = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %indvars.iv.next
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
br i1 %cmp.not, label %while.cond4, label %while.cond, !llvm.loop !8
while.cond4: ; preds = %while.cond, %while.cond4
%indvars.iv36 = phi i64 [ %indvars.iv.next37, %while.cond4 ], [ 0, %while.cond ]
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%arrayidx7 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv.next37
%1 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%cmp9.not = icmp eq i8 %1, 0
br i1 %cmp9.not, label %while.end13, label %while.cond4, !llvm.loop !10
while.end13: ; preds = %while.cond4
%idxprom14 = and i64 %indvars.iv, 4294967295
%arrayidx15 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %idxprom14
%2 = load i8, ptr %arrayidx15, align 1, !tbaa !5
%3 = load i8, ptr %b, align 16, !tbaa !5
%cmp19 = icmp eq i8 %2, %3
br i1 %cmp19, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %while.end13
%idxprom21 = and i64 %indvars.iv36, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %idxprom21
%4 = load i8, ptr %arrayidx22, align 1, !tbaa !5
%5 = load i8, ptr %c, align 16, !tbaa !5
%cmp26 = icmp eq i8 %4, %5
br i1 %cmp26, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %while.end13
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 100, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
int main(void)
{
char a[100], b[100], c[100];
int i, j, flag1, flag2;
flag1 = flag2 = 0;
scanf("%s %s %s", a, b, c);
i = 0;
while (a[i] != '\0') i++;
if (a[i - 1] == b[0]) flag1 = 1;
i = 0;
while (b[i] != '\0') i++;
if (b[i - 1] == c[0]) flag2 = 1;
if (flag1 + flag2 == 2) printf("YES\n");
else printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s %s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x i8], align 16
%b = alloca [100 x i8], align 16
%c = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %a, 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
%idxprom4 = ashr exact i64 %sext, 32
%arrayidx5 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %idxprom4
%1 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%2 = load i8, ptr %b, align 16, !tbaa !5
br label %while.cond11
while.cond11: ; preds = %while.cond11, %while.end
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %while.cond11 ], [ 0, %while.end ]
%arrayidx13 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %indvars.iv44
%3 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%cmp15.not = icmp eq i8 %3, 0
%indvars.iv.next45 = add nuw i64 %indvars.iv44, 1
br i1 %cmp15.not, label %while.end19, label %while.cond11, !llvm.loop !10
while.end19: ; preds = %while.cond11
%cmp9 = icmp eq i8 %1, %2
%sub20 = shl i64 %indvars.iv44, 32
%sext47 = add i64 %sub20, -4294967296
%idxprom21 = ashr exact i64 %sext47, 32
%arrayidx22 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 %idxprom21
%4 = load i8, ptr %arrayidx22, align 1, !tbaa !5
%5 = load i8, ptr %c, align 16, !tbaa !5
%cmp26 = icmp eq i8 %4, %5
%cmp30 = and i1 %cmp9, %cmp26
%str.3.str = select i1 %cmp30, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 100, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include<stdio.h>
int main() {
char a[11], b[11], c[11];
int i,j;
scanf("%s%s%s", &a, &b, &c);
for (i = 0; a[i] != '\0'; i++);
i--;
for (j = 0; b[j] != '\0'; j++);
j--;
if (a[i] == b[0] && b[j] == c[0])
printf("YES\n");
else
printf("NO\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137112/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137112/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [11 x i8], align 1
%b = alloca [11 x i8], align 1
%c = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i8], ptr %a, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %for.cond2, label %for.cond, !llvm.loop !8
for.cond2: ; preds = %for.cond, %for.cond2
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.cond2 ], [ 0, %for.cond ]
%arrayidx4 = getelementptr inbounds [11 x i8], ptr %b, i64 0, i64 %indvars.iv37
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%cmp6.not = icmp eq i8 %1, 0
%indvars.iv.next38 = add nuw i64 %indvars.iv37, 1
br i1 %cmp6.not, label %for.end11, label %for.cond2, !llvm.loop !10
for.end11: ; preds = %for.cond2
%dec = shl i64 %indvars.iv, 32
%sext = add i64 %dec, -4294967296
%idxprom13 = ashr exact i64 %sext, 32
%arrayidx14 = getelementptr inbounds [11 x i8], ptr %a, i64 0, i64 %idxprom13
%2 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%3 = load i8, ptr %b, align 1, !tbaa !5
%cmp18 = icmp eq i8 %2, %3
br i1 %cmp18, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %for.end11
%dec12 = shl i64 %indvars.iv37, 32
%sext40 = add i64 %dec12, -4294967296
%idxprom20 = ashr exact i64 %sext40, 32
%arrayidx21 = getelementptr inbounds [11 x i8], ptr %b, i64 0, i64 %idxprom20
%4 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%5 = load i8, ptr %c, align 1, !tbaa !5
%cmp25 = icmp eq i8 %4, %5
br i1 %cmp25, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %for.end11
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 11, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char a[20] ={0};
char b[20] ={0};
char c[20] ={0};
int na,nb;
scanf("%s",a);
scanf("%s",b);
scanf("%s",c);
na = strlen(a);
nb = strlen(b);
if(a[na-1] == b[0] && b[nb-1] == c[0]){
printf("YES\n");
}else{
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137156/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137156/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [20 x i8], align 16
%b = alloca [20 x i8], align 16
%c = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %a) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %a, i8 0, i64 20, i1 false)
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %b) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %b, i8 0, i64 20, i1 false)
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %c) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %c, i8 0, i64 20, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #7
%sub = shl i64 %call6, 32
%sext = add i64 %sub, -4294967296
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [20 x i8], ptr %a, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%1 = load i8, ptr %b, align 16, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%call8 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #7
%sub14 = shl i64 %call8, 32
%sext24 = add i64 %sub14, -4294967296
%idxprom15 = ashr exact i64 %sext24, 32
%arrayidx16 = getelementptr inbounds [20 x i8], ptr %b, i64 0, i64 %idxprom15
%2 = load i8, ptr %arrayidx16, align 1, !tbaa !5
%3 = load i8, ptr %c, align 16, !tbaa !5
%cmp20 = icmp eq i8 %2, %3
br i1 %cmp20, 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
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 20, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: 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 #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int t,n,b,c,p,sum;
int a[200];
scanf("%d",&t);
while (t--){
scanf("%d",&n);
p=0;
for (int i=1;i<=50;i++)a[i]=0;
while (n--){
scanf("%d",&b);
c=1;
while (b!=0){
if (b%2) a[c]=1;
b/=2;++c;
}
if (c>p)p=c;
}
sum=0;
for (int i=p;i>=1;i--)
sum=sum*2+a[i];
printf("%d\n",sum);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1372/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1372/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%t = alloca i32, align 4
%n = alloca i32, align 4
%b = alloca i32, align 4
%a = alloca [200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec50 = add nsw i32 %0, -1
store i32 %dec50, ptr %t, align 4, !tbaa !5
%tobool.not51 = icmp eq i32 %0, 0
br i1 %tobool.not51, label %while.end29, label %while.body.preheader
while.body.preheader: ; preds = %entry
%scevgep = getelementptr inbounds i8, ptr %a, i64 4
br label %while.body
while.body: ; preds = %while.body.preheader, %for.cond.cleanup21
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(200) %scevgep, i8 0, i64 200, i1 false), !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%dec342 = add nsw i32 %1, -1
store i32 %dec342, ptr %n, align 4, !tbaa !5
%tobool4.not43 = icmp eq i32 %1, 0
br i1 %tobool4.not43, label %for.cond.cleanup21, label %while.body5
for.cond19.preheader: ; preds = %while.end
%cmp2046 = icmp sgt i32 %spec.select, 0
br i1 %cmp2046, label %for.body22.preheader, label %for.cond.cleanup21
for.body22.preheader: ; preds = %for.cond19.preheader
%2 = zext i32 %spec.select to i64
br label %for.body22
while.body5: ; preds = %while.body, %while.end
%p.044 = phi i32 [ %spec.select, %while.end ], [ 0, %while.body ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%.pr = load i32, ptr %b, align 4, !tbaa !5
%cmp8.not40 = icmp eq i32 %.pr, 0
br i1 %cmp8.not40, label %while.end, label %while.body9
while.body9: ; preds = %while.body5, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %while.body5 ]
%3 = phi i32 [ %div, %if.end ], [ %.pr, %while.body5 ]
%4 = and i32 %3, 1
%tobool10.not = icmp eq i32 %4, 0
br i1 %tobool10.not, label %if.end, label %if.then
if.then: ; preds = %while.body9
%arrayidx12 = getelementptr inbounds [200 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 1, ptr %arrayidx12, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body9
%div = sdiv i32 %3, 2
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%.off = add i32 %3, 1
%cmp8.not = icmp ult i32 %.off, 3
br i1 %cmp8.not, label %while.cond7.while.end_crit_edge, label %while.body9, !llvm.loop !9
while.cond7.while.end_crit_edge: ; preds = %if.end
%5 = trunc i64 %indvars.iv.next to i32
store i32 %div, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond7.while.end_crit_edge, %while.body5
%c.0.lcssa = phi i32 [ %5, %while.cond7.while.end_crit_edge ], [ 1, %while.body5 ]
%spec.select = call i32 @llvm.smax.i32(i32 %c.0.lcssa, i32 %p.044)
%6 = load i32, ptr %n, align 4, !tbaa !5
%dec3 = add nsw i32 %6, -1
store i32 %dec3, ptr %n, align 4, !tbaa !5
%tobool4.not = icmp eq i32 %6, 0
br i1 %tobool4.not, label %for.cond19.preheader, label %while.body5, !llvm.loop !11
for.cond.cleanup21: ; preds = %for.body22, %while.body, %for.cond19.preheader
%sum.0.lcssa = phi i32 [ 0, %for.cond19.preheader ], [ 0, %while.body ], [ %add, %for.body22 ]
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%7 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %7, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %7, 0
br i1 %tobool.not, label %while.end29, label %while.body, !llvm.loop !12
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv54 = phi i64 [ %2, %for.body22.preheader ], [ %indvars.iv.next55, %for.body22 ]
%sum.047 = phi i32 [ 0, %for.body22.preheader ], [ %add, %for.body22 ]
%mul = shl nsw i32 %sum.047, 1
%arrayidx24 = getelementptr inbounds [200 x i32], ptr %a, i64 0, i64 %indvars.iv54
%8 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%add = add nsw i32 %8, %mul
%indvars.iv.next55 = add nsw i64 %indvars.iv54, -1
%cmp20 = icmp ugt i64 %indvars.iv54, 1
br i1 %cmp20, label %for.body22, label %for.cond.cleanup21, !llvm.loop !13
while.end29: ; preds = %for.cond.cleanup21, %entry
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
while(~scanf("%d",&n))
{
if(n%3==0)
printf("%d\n",n/3);
else if(n%3!=0&&n>3)
printf("%d\n",n/3);
else
printf("0\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137242/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137242/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not12 = icmp eq i32 %call11, -1
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end10
%0 = load i32, ptr %n, align 4
%rem = srem i32 %0, 3
%div = sdiv i32 %0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.body
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
br label %if.end10
if.else: ; preds = %while.body
%cmp4 = icmp sgt i32 %0, 3
br i1 %cmp4, label %if.then5, label %if.else8
if.then5: ; preds = %if.else
%div6 = udiv i32 %0, 3
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div6)
br label %if.end10
if.else8: ; preds = %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end10
if.end10: ; preds = %if.then5, %if.else8, %if.then
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int i, j, k;
int m, n;
int a[55][55];
int x, y;
scanf("%d", &n);
for (i = 0; i < n; i++)
{
for (j = 0; j < n; j++)
{
scanf("%d", &a[i][j]);
}
}
int flag = 1;
int flag2;
for (i = 0; i < n && flag; i++)
{
for (j = 0; j < n &&flag; j++)
{
flag2 = 1;
if (a[i][j] == 1)
{
continue;
}
else
{
for (x = 0; x < n && flag2; x++)
{
for (y = 0; y < n && flag2; y++)
{
if ((a[i][j] == a[i][x] + a[y][j]) && x!=j && y!=i)
{
flag2 = 0;
}
}
}
if (flag2)
{
flag = 0;
}
}
}
}
if (flag)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13738/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13738/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [55 x [55 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 12100, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp105 = icmp sgt i32 %0, 0
br i1 %cmp105, label %for.cond1.preheader, label %if.end74
for.cond1.preheader: ; preds = %entry, %for.inc7
%1 = phi i32 [ %12, %for.inc7 ], [ %0, %entry ]
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.inc7 ], [ 0, %entry ]
%cmp2103 = icmp sgt i32 %1, 0
br i1 %cmp2103, label %for.body3, label %for.cond1.preheader.for.inc7_crit_edge
for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader
%.pre = sext i32 %1 to i64
br label %for.inc7
for.cond10.preheader: ; preds = %for.inc7
%cmp11119 = icmp sgt i32 %12, 0
br i1 %cmp11119, label %for.cond13.preheader.us.preheader, label %if.end74
for.cond13.preheader.us.preheader: ; preds = %for.cond10.preheader
%2 = zext i32 %12 to i64
br label %for.cond13.preheader.us
for.cond13.preheader.us: ; preds = %for.cond13.preheader.us.preheader, %for.cond13.for.inc66_crit_edge.split.us.us
%indvars.iv138 = phi i64 [ 0, %for.cond13.preheader.us.preheader ], [ %indvars.iv.next139, %for.cond13.for.inc66_crit_edge.split.us.us ]
br label %for.body18.us.us
for.body18.us.us: ; preds = %for.inc63.us.us, %for.cond13.preheader.us
%indvars.iv135 = phi i64 [ %indvars.iv.next136, %for.inc63.us.us ], [ 0, %for.cond13.preheader.us ]
%arrayidx22.us.us = getelementptr inbounds [55 x [55 x i32]], ptr %a, i64 0, i64 %indvars.iv138, i64 %indvars.iv135
%3 = load i32, ptr %arrayidx22.us.us, align 4, !tbaa !5
%cmp23.us.us = icmp eq i32 %3, 1
br i1 %cmp23.us.us, label %for.inc63.us.us, label %for.cond30.preheader.us.us.us
for.inc63.us.us: ; preds = %for.cond24.for.end58_crit_edge.split.us.us.us, %for.body18.us.us
%flag.2.us.us = phi i1 [ true, %for.body18.us.us ], [ %not.tobool27.us.us, %for.cond24.for.end58_crit_edge.split.us.us.us ]
%indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
%cmp14.us.us = icmp ult i64 %indvars.iv.next136, %2
%4 = and i1 %cmp14.us.us, %flag.2.us.us
br i1 %4, label %for.body18.us.us, label %for.cond13.for.inc66_crit_edge.split.us.us, !llvm.loop !9
for.cond30.preheader.us.us.us: ; preds = %for.body18.us.us, %for.cond30.for.inc56_crit_edge.us.us.us
%indvars.iv132 = phi i64 [ %indvars.iv.next133, %for.cond30.for.inc56_crit_edge.us.us.us ], [ 0, %for.body18.us.us ]
%arrayidx43.us.us.us = getelementptr inbounds [55 x [55 x i32]], ptr %a, i64 0, i64 %indvars.iv138, i64 %indvars.iv132
%5 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5
%cmp49.not.us.us.us = icmp eq i64 %indvars.iv132, %indvars.iv135
br label %for.body35.us.us.us
for.body35.us.us.us: ; preds = %for.body35.us.us.us, %for.cond30.preheader.us.us.us
%indvars.iv129 = phi i64 [ %indvars.iv.next130, %for.body35.us.us.us ], [ 0, %for.cond30.preheader.us.us.us ]
%arrayidx47.us.us.us = getelementptr inbounds [55 x [55 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 %indvars.iv135
%6 = load i32, ptr %arrayidx47.us.us.us, align 4, !tbaa !5
%add.us.us.us = add nsw i32 %6, %5
%cmp48.us.us.us = icmp ne i32 %3, %add.us.us.us
%or.cond.us.us.us = or i1 %cmp49.not.us.us.us, %cmp48.us.us.us
%cmp51.not.us.us.us = icmp eq i64 %indvars.iv129, %indvars.iv138
%or.cond102.us.us.us = or i1 %cmp51.not.us.us.us, %or.cond.us.us.us
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%cmp31.us.us.us = icmp ult i64 %indvars.iv.next130, %2
%7 = and i1 %cmp31.us.us.us, %or.cond102.us.us.us
br i1 %7, label %for.body35.us.us.us, label %for.cond30.for.inc56_crit_edge.us.us.us, !llvm.loop !11
for.cond30.for.inc56_crit_edge.us.us.us: ; preds = %for.body35.us.us.us
%indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
%cmp25.us.us.us = icmp ult i64 %indvars.iv.next133, %2
%8 = and i1 %cmp25.us.us.us, %or.cond102.us.us.us
br i1 %8, label %for.cond30.preheader.us.us.us, label %for.cond24.for.end58_crit_edge.split.us.us.us, !llvm.loop !12
for.cond24.for.end58_crit_edge.split.us.us.us: ; preds = %for.cond30.for.inc56_crit_edge.us.us.us
%not.tobool27.us.us = xor i1 %or.cond102.us.us.us, true
br label %for.inc63.us.us
for.cond13.for.inc66_crit_edge.split.us.us: ; preds = %for.inc63.us.us
%indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
%cmp11.us = icmp ult i64 %indvars.iv.next139, %2
%9 = and i1 %cmp11.us, %flag.2.us.us
br i1 %9, label %for.cond13.preheader.us, label %for.end68, !llvm.loop !13
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [55 x [55 x i32]], ptr %a, i64 0, i64 %indvars.iv126, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !14
for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %11, %for.body3 ]
%12 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %10, %for.body3 ]
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%cmp = icmp slt i64 %indvars.iv.next127, %.pre-phi
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !15
for.end68: ; preds = %for.cond13.for.inc66_crit_edge.split.us.us
%spec.select = select i1 %flag.2.us.us, ptr @str.3, ptr @str
br label %if.end74
if.end74: ; preds = %for.end68, %for.cond10.preheader, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str.3, %for.cond10.preheader ], [ %spec.select, %for.end68 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 12100, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
|
#include<stdio.h>
int a[10010];
int main(){
int n;
scanf("%d",&n);
int m=0,mi=1;
for(int i=2;i<=n;i++){
printf("? 1 %d\n",i);
fflush(0);
int t;
scanf("%d",&t);
if(t>m){
m=t;
mi=i;
}
}
for(int i=1;i<=n;i++){
printf("? %d %d\n",mi,i);
fflush(0);
int t;
scanf("%d",&t);
a[t]=i;
}
printf("!");
for(int i=0;i<n;i++)printf(" %d",a[i]);
puts("");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137473/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137473/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"? 1 %d\0A\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"? %d %d\0A\00", align 1
@a = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16
@.str.4 = 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:
%n = alloca i32, align 4
%t = alloca i32, align 4
%t12 = 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
%cmp.not40 = icmp slt i32 %0, 2
br i1 %cmp.not40, label %for.cond6.preheader, label %for.body
for.cond6.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%mi.0.lcssa = phi i32 [ 1, %entry ], [ %spec.select39, %for.body ]
%cmp7.not44 = icmp slt i32 %1, 1
br i1 %cmp7.not44, label %for.cond.cleanup8, label %for.body9
for.body: ; preds = %entry, %for.body
%i.043 = phi i32 [ %inc, %for.body ], [ 2, %entry ]
%mi.042 = phi i32 [ %spec.select39, %for.body ], [ 1, %entry ]
%m.041 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.043)
%call2 = call i32 @fflush(ptr noundef null)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %2, %m.041
%spec.select = call i32 @llvm.smax.i32(i32 %2, i32 %m.041)
%spec.select39 = select i1 %cmp4, i32 %i.043, i32 %mi.042
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
%inc = add nuw nsw i32 %i.043, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.043, %3
br i1 %cmp.not.not, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.cond.cleanup8: ; preds = %for.body9, %for.cond6.preheader
%putchar = call i32 @putchar(i32 33)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp2046 = icmp sgt i32 %4, 0
br i1 %cmp2046, label %for.body22, label %for.cond.cleanup21
for.body9: ; preds = %for.cond6.preheader, %for.body9
%i5.045 = phi i32 [ %inc15, %for.body9 ], [ 1, %for.cond6.preheader ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mi.0.lcssa, i32 noundef %i5.045)
%call11 = call i32 @fflush(ptr noundef null)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t12) #5
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t12)
%5 = load i32, ptr %t12, align 4, !tbaa !5
%idxprom = sext i32 %5 to i64
%arrayidx = getelementptr inbounds [10010 x i32], ptr @a, i64 0, i64 %idxprom
store i32 %i5.045, ptr %arrayidx, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t12) #5
%inc15 = add nuw nsw i32 %i5.045, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp7.not.not = icmp slt i32 %i5.045, %6
br i1 %cmp7.not.not, label %for.body9, label %for.cond.cleanup8, !llvm.loop !11
for.cond.cleanup21: ; preds = %for.body22, %for.cond.cleanup8
%putchar38 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body22: ; preds = %for.cond.cleanup8, %for.body22
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body22 ], [ 0, %for.cond.cleanup8 ]
%arrayidx24 = getelementptr inbounds [10010 x i32], ptr @a, i64 0, i64 %indvars.iv
%7 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %7)
%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
%cmp20 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp20, label %for.body22, label %for.cond.cleanup21, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int N,i;
scanf("%d%d",&N,&i);
printf("%d",(N-i)+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137523/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137523/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%i = 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 %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %i)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %i, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%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 %i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int N,i;
scanf("%d %d",&N,&i);
printf("%d\n",N-i+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137567/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137567/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%i = 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 %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %i)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %i, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%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 %i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define MOD 1000000007LL
long long M[50][2][2];
long long X, Y, N, F[2][2], T[2][2];
long long A;
int main()
{
//FILE *input;
//input = fopen("sequence.in", "r");
//fscanf(input, "%lld %lld\n%lld\n", &X, &Y, &N);
scanf("%I64d %I64d\n%I64d\n", &X, &Y, &N);
int i;
N--;
M[0][0][0] = 1;
M[0][1][0] = 1;
M[0][0][1] = -1;
for(i=1; i<50; i++)
{
M[i][0][0] = ((M[i-1][0][0]*M[i-1][0][0])%MOD + (M[i-1][0][1]*M[i-1][1][0])%MOD)%MOD;
M[i][0][1] = ((M[i-1][0][0]*M[i-1][0][1])%MOD + (M[i-1][0][1]*M[i-1][1][1])%MOD)%MOD;
M[i][1][0] = ((M[i-1][1][0]*M[i-1][0][0])%MOD + (M[i-1][1][1]*M[i-1][1][0])%MOD)%MOD;
M[i][1][1] = ((M[i-1][1][0]*M[i-1][0][1])%MOD + (M[i-1][1][1]*M[i-1][1][1])%MOD)%MOD;
}
for(i=0, F[0][0] = 1, F[1][1] = 1; N>0; i++)
{
if(N%2 == 1)
{
T[0][0] = F[0][0];
T[0][1] = F[0][1];
T[1][0] = F[1][0];
T[1][1] = F[1][1];
F[0][0] = ((T[0][0]*M[i][0][0])%MOD + (T[0][1]*M[i][1][0])%MOD)%MOD;
F[0][1] = ((T[0][0]*M[i][0][1])%MOD + (T[0][1]*M[i][1][1])%MOD)%MOD;
F[1][0] = ((T[1][0]*M[i][0][0])%MOD + (T[1][1]*M[i][1][0])%MOD)%MOD;
F[1][1] = ((T[1][0]*M[i][0][1])%MOD + (T[1][1]*M[i][1][1])%MOD)%MOD;
}
N /= 2;
}
A = ((F[1][0]*Y%MOD+F[1][1]*X%MOD)%MOD);
while(A < 0)
A += MOD;
//printf("%lld\n", A);
printf("%I64d\n", A);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13761/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13761/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [19 x i8] c"%I64d %I64d\0A%I64d\0A\00", align 1
@X = dso_local global i64 0, align 8
@Y = dso_local global i64 0, align 8
@N = dso_local global i64 0, align 8
@M = dso_local local_unnamed_addr global [50 x [2 x [2 x i64]]] zeroinitializer, align 16
@F = dso_local local_unnamed_addr global [2 x [2 x i64]] zeroinitializer, align 16
@T = dso_local local_unnamed_addr global [2 x [2 x i64]] zeroinitializer, align 16
@A = dso_local local_unnamed_addr global i64 0, align 8
@.str.1 = private unnamed_addr constant [7 x i8] c"%I64d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @X, ptr noundef nonnull @Y, ptr noundef nonnull @N)
%0 = load i64, ptr @N, align 8, !tbaa !5
%dec = add nsw i64 %0, -1
store i64 %dec, ptr @N, align 8, !tbaa !5
store i64 1, ptr @M, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 0, i64 1), align 16, !tbaa !5
store i64 -1, ptr getelementptr inbounds ([50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 0, i64 0, i64 1), align 8, !tbaa !5
%.pre = load i64, ptr getelementptr inbounds ([50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 0, i64 1, i64 1), align 8, !tbaa !5
br label %for.body
for.body: ; preds = %entry, %for.body
%1 = phi i64 [ %.pre, %entry ], [ %rem110.sext, %for.body ]
%2 = phi i64 [ 1, %entry ], [ %rem80.sext, %for.body ]
%3 = phi i64 [ -1, %entry ], [ %rem50.sext, %for.body ]
%4 = phi i64 [ 1, %entry ], [ %rem20.sext, %for.body ]
%indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next, %for.body ]
%mul = mul nsw i64 %4, %4
%rem = urem i64 %mul, 1000000007
%mul18 = mul nsw i64 %2, %3
%rem19 = srem i64 %mul18, 1000000007
%add = add nsw i64 %rem19, %rem
%rem20.lhs.trunc = trunc i64 %add to i32
%rem20219 = srem i32 %rem20.lhs.trunc, 1000000007
%rem20.sext = sext i32 %rem20219 to i64
%arrayidx22 = getelementptr inbounds [50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 %indvars.iv
store i64 %rem20.sext, ptr %arrayidx22, align 16, !tbaa !5
%mul35 = mul nsw i64 %4, %3
%rem36 = srem i64 %mul35, 1000000007
%mul47 = mul nsw i64 %1, %3
%rem48 = srem i64 %mul47, 1000000007
%add49 = add nsw i64 %rem48, %rem36
%rem50.lhs.trunc = trunc i64 %add49 to i32
%rem50220 = srem i32 %rem50.lhs.trunc, 1000000007
%rem50.sext = sext i32 %rem50220 to i64
%arrayidx54 = getelementptr inbounds [2 x i64], ptr %arrayidx22, i64 0, i64 1
store i64 %rem50.sext, ptr %arrayidx54, align 8, !tbaa !5
%mul65 = mul nsw i64 %4, %2
%rem66 = srem i64 %mul65, 1000000007
%mul77 = mul nsw i64 %1, %2
%rem78 = srem i64 %mul77, 1000000007
%add79 = add nsw i64 %rem78, %rem66
%rem80.lhs.trunc = trunc i64 %add79 to i32
%rem80221 = srem i32 %rem80.lhs.trunc, 1000000007
%rem80.sext = sext i32 %rem80221 to i64
%arrayidx83 = getelementptr inbounds [50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 %indvars.iv, i64 1
store i64 %rem80.sext, ptr %arrayidx83, align 16, !tbaa !5
%mul107 = mul nsw i64 %1, %1
%rem108 = urem i64 %mul107, 1000000007
%add109 = add nsw i64 %rem19, %rem108
%rem110.lhs.trunc = trunc i64 %add109 to i32
%rem110222 = srem i32 %rem110.lhs.trunc, 1000000007
%rem110.sext = sext i32 %rem110222 to i64
%arrayidx114 = getelementptr inbounds [50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 %indvars.iv, i64 1, i64 1
store i64 %rem110.sext, ptr %arrayidx114, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 50
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body
store i64 1, ptr @F, align 16, !tbaa !5
store i64 1, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @F, i64 0, i64 1, i64 1), align 8, !tbaa !5
%.promoted235 = load i64, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @F, i64 0, i64 1), align 16, !tbaa !5
%cmp116241 = icmp sgt i64 %0, 1
br i1 %cmp116241, label %for.body117.preheader, label %for.end178
for.body117.preheader: ; preds = %for.end
%.promoted = load i64, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @F, i64 0, i64 0, i64 1), align 8, !tbaa !5
br label %for.body117
for.body117: ; preds = %for.body117.preheader, %if.end
%indvars.iv250 = phi i64 [ 0, %for.body117.preheader ], [ %indvars.iv.next251, %if.end ]
%5 = phi i64 [ %dec, %for.body117.preheader ], [ %div223229, %if.end ]
%rem133.sext232245 = phi i64 [ 1, %for.body117.preheader ], [ %rem133.sext231, %if.end ]
%rem147.sext234244 = phi i64 [ %.promoted, %for.body117.preheader ], [ %rem147.sext233, %if.end ]
%rem161.sext237243 = phi i64 [ %.promoted235, %for.body117.preheader ], [ %rem161.sext236, %if.end ]
%rem175.sext240242 = phi i64 [ 1, %for.body117.preheader ], [ %rem175.sext239, %if.end ]
%rem118 = and i64 %5, 1
%cmp119.not = icmp eq i64 %rem118, 0
br i1 %cmp119.not, label %if.end, label %if.then
if.then: ; preds = %for.body117
store i64 %rem133.sext232245, ptr @T, align 16, !tbaa !5
store i64 %rem147.sext234244, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @T, i64 0, i64 0, i64 1), align 8, !tbaa !5
store i64 %rem161.sext237243, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @T, i64 0, i64 1), align 16, !tbaa !5
store i64 %rem175.sext240242, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @T, i64 0, i64 1, i64 1), align 8, !tbaa !5
%arrayidx121 = getelementptr inbounds [50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 %indvars.iv250
%6 = load i64, ptr %arrayidx121, align 16, !tbaa !5
%mul124 = mul nsw i64 %6, %rem133.sext232245
%rem125 = srem i64 %mul124, 1000000007
%arrayidx128 = getelementptr inbounds [50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 %indvars.iv250, i64 1
%7 = load i64, ptr %arrayidx128, align 16, !tbaa !5
%mul130 = mul nsw i64 %7, %rem147.sext234244
%rem131 = srem i64 %mul130, 1000000007
%add132 = add nsw i64 %rem131, %rem125
%rem133.lhs.trunc = trunc i64 %add132 to i32
%rem133224 = srem i32 %rem133.lhs.trunc, 1000000007
%rem133.sext = sext i32 %rem133224 to i64
store i64 %rem133.sext, ptr @F, align 16, !tbaa !5
%arrayidx137 = getelementptr inbounds [2 x i64], ptr %arrayidx121, i64 0, i64 1
%8 = load i64, ptr %arrayidx137, align 8, !tbaa !5
%mul138 = mul nsw i64 %8, %rem133.sext232245
%rem139 = srem i64 %mul138, 1000000007
%arrayidx143 = getelementptr inbounds [50 x [2 x [2 x i64]]], ptr @M, i64 0, i64 %indvars.iv250, i64 1, i64 1
%9 = load i64, ptr %arrayidx143, align 8, !tbaa !5
%mul144 = mul nsw i64 %9, %rem147.sext234244
%rem145 = srem i64 %mul144, 1000000007
%add146 = add nsw i64 %rem145, %rem139
%rem147.lhs.trunc = trunc i64 %add146 to i32
%rem147225 = srem i32 %rem147.lhs.trunc, 1000000007
%rem147.sext = sext i32 %rem147225 to i64
store i64 %rem147.sext, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @F, i64 0, i64 0, i64 1), align 8, !tbaa !5
%mul152 = mul nsw i64 %6, %rem161.sext237243
%rem153 = srem i64 %mul152, 1000000007
%mul158 = mul nsw i64 %7, %rem175.sext240242
%rem159 = srem i64 %mul158, 1000000007
%add160 = add nsw i64 %rem159, %rem153
%rem161.lhs.trunc = trunc i64 %add160 to i32
%rem161226 = srem i32 %rem161.lhs.trunc, 1000000007
%rem161.sext = sext i32 %rem161226 to i64
store i64 %rem161.sext, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @F, i64 0, i64 1), align 16, !tbaa !5
%mul166 = mul nsw i64 %8, %rem161.sext237243
%rem167 = srem i64 %mul166, 1000000007
%mul172 = mul nsw i64 %9, %rem175.sext240242
%rem173 = srem i64 %mul172, 1000000007
%add174 = add nsw i64 %rem173, %rem167
%rem175.lhs.trunc = trunc i64 %add174 to i32
%rem175227 = srem i32 %rem175.lhs.trunc, 1000000007
%rem175.sext = sext i32 %rem175227 to i64
store i64 %rem175.sext, ptr getelementptr inbounds ([2 x [2 x i64]], ptr @F, i64 0, i64 1, i64 1), align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body117
%rem175.sext239 = phi i64 [ %rem175.sext, %if.then ], [ %rem175.sext240242, %for.body117 ]
%rem161.sext236 = phi i64 [ %rem161.sext, %if.then ], [ %rem161.sext237243, %for.body117 ]
%rem147.sext233 = phi i64 [ %rem147.sext, %if.then ], [ %rem147.sext234244, %for.body117 ]
%rem133.sext231 = phi i64 [ %rem133.sext, %if.then ], [ %rem133.sext232245, %for.body117 ]
%div223229 = lshr i64 %5, 1
%indvars.iv.next251 = add nuw nsw i64 %indvars.iv250, 1
%cmp116.not = icmp ult i64 %5, 2
br i1 %cmp116.not, label %for.cond115.for.end178_crit_edge, label %for.body117, !llvm.loop !11
for.cond115.for.end178_crit_edge: ; preds = %if.end
store i64 %div223229, ptr @N, align 8, !tbaa !5
br label %for.end178
for.end178: ; preds = %for.cond115.for.end178_crit_edge, %for.end
%10 = phi i64 [ %rem175.sext239, %for.cond115.for.end178_crit_edge ], [ 1, %for.end ]
%11 = phi i64 [ %rem161.sext236, %for.cond115.for.end178_crit_edge ], [ %.promoted235, %for.end ]
%12 = load i64, ptr @Y, align 8, !tbaa !5
%mul179 = mul nsw i64 %12, %11
%rem180 = srem i64 %mul179, 1000000007
%13 = load i64, ptr @X, align 8, !tbaa !5
%mul181 = mul nsw i64 %13, %10
%rem182 = srem i64 %mul181, 1000000007
%add183 = add nsw i64 %rem182, %rem180
%rem184.lhs.trunc = trunc i64 %add183 to i32
%rem184228 = srem i32 %rem184.lhs.trunc, 1000000007
%rem184.sext = sext i32 %rem184228 to i64
%smax = tail call i64 @llvm.smax.i64(i64 %rem184.sext, i64 0)
%rem184228.lobit = lshr i32 %rem184228, 31
%umin = zext i32 %rem184228.lobit to i64
%14 = add nsw i64 %umin, %rem184.sext
%15 = sub nsw i64 %smax, %14
%16 = udiv i64 %15, 1000000007
%17 = add nuw nsw i64 %16, %umin
%18 = mul i64 %17, 1000000007
%19 = add i64 %18, %rem184.sext
store i64 %19, ptr @A, align 8, !tbaa !5
%call187 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %19)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
//set many funcs template
//Ver.20181228
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
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 nHr(int a,int b){return nCr(a+b-1,b);}
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;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
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 llzt(long long a,long long b){return llmax(a,b)-llmin(a,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 llnHr(long long a,long long b){return llnCr(a+b-1,b);}
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;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
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;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,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 strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
void shuffledget(int x[],int n){
srand(time(0));
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
void prarr(int arr[],int n){
int i;
for(i=0;i<n;i++){
if(i){printf(" ");}
printf("%d",arr[i]);
}
printf("\n");
return;
}
typedef struct{
int val;
int node;
}sd;
int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}
int main(void){
int i,j,n,m,k,a[524288],b,c,h,w,r=0,l,t;
double d;
char s[524288];
scanf("%d%d",&n,&k);
printf("%d\n",n+1-k);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137653/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137653/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
@.str.3 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @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 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 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 %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; 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: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; 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 nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; 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 !16
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 !16
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 !17
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 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; 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 !18
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 !19
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 !21
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 !22
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 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; 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(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; 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 !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%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 !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%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 !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%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 !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%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 !31
%1 = load double, ptr %b, align 8, !tbaa !31
%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 !31
%1 = load double, ptr %b, align 8, !tbaa !31
%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: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #14
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #14
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp sgt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 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 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 {
entry:
%b = alloca [524288 x i32], align 16
%call = tail call i64 @time(ptr noundef null) #15
%conv = trunc i64 %call to i32
tail call void @srand(i32 noundef %conv) #15
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #15
%cmp44 = icmp sgt i32 %n, 0
br i1 %cmp44, label %for.body.preheader, label %for.end29
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader61, 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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61
for.body.preheader61: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block
br i1 %cmp44, label %for.body5.preheader, label %for.end29
for.body5.preheader: ; preds = %for.cond2.preheader
%3 = zext i32 %n to i64
br label %for.body5
for.body: ; preds = %for.body.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !25
%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.cond2.preheader, label %for.body, !llvm.loop !35
for.cond18.preheader: ; preds = %for.body5
br i1 %cmp44, label %for.body21.preheader, label %for.end29
for.body21.preheader: ; preds = %for.cond18.preheader
%wide.trip.count58 = zext i32 %n to i64
br label %for.body21
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ]
%call6 = tail call i32 @rand() #15
%5 = trunc i64 %indvars.iv51 to i32
%rem = srem i32 %call6, %5
%indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
%idxprom7 = and i64 %indvars.iv.next52, 4294967295
%arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !25
%idxprom9 = sext i32 %rem to i64
%arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !25
store i32 %7, ptr %arrayidx8, align 4, !tbaa !25
store i32 %6, ptr %arrayidx10, align 4, !tbaa !25
%cmp3 = icmp ugt i64 %indvars.iv51, 1
br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !36
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ]
%arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54
%8 = load i32, ptr %arrayidx23, align 4, !tbaa !25
%idxprom24 = sext i32 %8 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24
%call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58
br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !37
for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #15
ret void
}
; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #11 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !25
%call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar6 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !41
%1 = load i32, ptr %b, align 4, !tbaa !41
%cmp = icmp slt i32 %0, %1
%cmp4 = icmp sgt i32 %0, %1
%. = zext 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 #11 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #15
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #15
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !25
%add = add nsw i32 %0, 1
%1 = load i32, ptr %k, align 4, !tbaa !25
%sub = sub i32 %add, %1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #15
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #13
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 = { 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 #6 = { 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree norecurse nosync nounwind memory(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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind willreturn memory(read) }
attributes #15 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
!25 = !{!26, !26, i64 0}
!26 = !{!"int", !27, i64 0}
!27 = !{!"omnipotent char", !28, i64 0}
!28 = !{!"Simple C/C++ TBAA"}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !27, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !27, i64 0}
!33 = !{!27, !27, i64 0}
!34 = distinct !{!34, !6, !9, !10}
!35 = distinct !{!35, !6, !10, !9}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !40}
!40 = !{!"llvm.loop.peeled.count", i32 1}
!41 = !{!42, !26, i64 0}
!42 = !{!"", !26, i64 0, !26, i64 4}
|
#include<stdio.h>
int main(){
int n,i;
scanf("%d%d", &n, &i);
printf("%d\n",n+1-i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137703/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137703/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%i = 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 %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %i)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = load i32, ptr %i, align 4, !tbaa !5
%sub = sub i32 %add, %1
%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 %i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int n,a;
scanf("%d%d",&n,&a);
printf("%d",n-a+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137747/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137747/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = 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 %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%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 %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"}
|
#include <stdio.h>
int main(void){
int N, i;
scanf("%d %d", &N, &i);
printf("%d", N-i+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%i = 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 %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %i)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %i, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%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 %i) #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"}
|
// AOJ 2730: Line Gimmick
// 2017.10.27 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
char buf[100002];
int main()
{
int n, i, j;
fgets(buf, 20, stdin); n = atoi(buf);
fgets(buf, 100002, stdin);
i = 0; while (buf[i] == '<') i++;
j = n-1; while (buf[j] == '>') j--;
if (i > n-1-j) i = n-1-j;
printf("%d\n", n-i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137833/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137833/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@buf = dso_local global [100002 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 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 20, ptr noundef %0)
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #4
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 100002, ptr noundef %1)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100002 x i8], ptr @buf, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp = icmp eq i8 %2, 60
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp, label %while.cond, label %while.end, !llvm.loop !10
while.end: ; preds = %while.cond
%conv.i = trunc i64 %call.i to i32
%sub = add i32 %conv.i, -1
%3 = sext i32 %sub to i64
br label %while.cond4
while.cond4: ; preds = %while.cond4, %while.end
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %while.cond4 ], [ %3, %while.end ]
%arrayidx6 = getelementptr inbounds [100002 x i8], ptr @buf, i64 0, i64 %indvars.iv30
%4 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp eq i8 %4, 62
%indvars.iv.next31 = add i64 %indvars.iv30, -1
br i1 %cmp8, label %while.cond4, label %while.end11, !llvm.loop !12
while.end11: ; preds = %while.cond4
%5 = trunc i64 %indvars.iv to i32
%6 = trunc i64 %indvars.iv30 to i32
%sub13 = sub nsw i32 %sub, %6
%spec.select = tail call i32 @llvm.smin.i32(i32 %5, i32 %sub13)
%sub18 = sub nsw i32 %conv.i, %spec.select
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub18)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(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 #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 = { nofree nounwind "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define MOD 1000000009
#define MAX(a,b) (a>b?a:b)
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MIN(a,b) (a<b?a:b)
#define MIN3(a,b,c) MIN(a, MIN(b,c))
#define top(i,j) val[i*m+j]
#define s(a,b) strcmp(a,b)
typedef long long lli;
typedef unsigned short int usi;
int main()
{
int n, i;
int ans=0;
scanf("%d",&n);
char a[n], b[n], c[n];
scanf("%s %s %s",a,b,c);
for(i=0; i<n; i++) {
//printf("%c %c %c\n",a[i],b[i],c[i]);
if(a[i]==b[i] && b[i]==c[i]) {
ans+=0;
//puts("0");
} else if(a[i]==b[i] || b[i]==c[i] || c[i]==a[i]) {
ans+=1;
//puts("1");
} else {
ans+=2;
//puts("2");
}
}
printf("%d",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137877/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137877/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%s %s %s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i8, i64 %4, align 16
%vla2 = alloca i8, i64 %4, align 16
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla, ptr noundef nonnull %vla1, ptr noundef nonnull %vla2)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp62 = icmp sgt i32 %5, 0
br i1 %cmp62, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body.preheader79, 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 ], [ %predphi73, %vector.body ]
%vec.phi66 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %predphi74, %vector.body ]
%6 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <4 x i8>, ptr %6, align 8, !tbaa !9
%7 = getelementptr inbounds i8, ptr %6, i64 4
%wide.load67 = load <4 x i8>, ptr %7, align 4, !tbaa !9
%8 = getelementptr inbounds i8, ptr %vla1, i64 %index
%wide.load68 = load <4 x i8>, ptr %8, align 8, !tbaa !9
%9 = getelementptr inbounds i8, ptr %8, i64 4
%wide.load69 = load <4 x i8>, ptr %9, align 4, !tbaa !9
%10 = icmp eq <4 x i8> %wide.load, %wide.load68
%11 = icmp eq <4 x i8> %wide.load67, %wide.load69
%12 = getelementptr inbounds i8, ptr %vla2, i64 %index
%wide.load70 = load <4 x i8>, ptr %12, align 8, !tbaa !9
%13 = getelementptr inbounds i8, ptr %12, i64 4
%wide.load71 = load <4 x i8>, ptr %13, align 4, !tbaa !9
%14 = icmp ne <4 x i8> %wide.load68, %wide.load70
%15 = icmp ne <4 x i8> %wide.load69, %wide.load71
%16 = icmp ne <4 x i8> %wide.load70, %wide.load
%17 = icmp ne <4 x i8> %wide.load71, %wide.load67
%.not76 = and <4 x i1> %14, %16
%.not78 = and <4 x i1> %15, %17
%18 = icmp eq <4 x i8> %wide.load, %wide.load70
%19 = icmp eq <4 x i8> %wide.load67, %wide.load71
%20 = xor <4 x i1> %10, <i1 true, i1 true, i1 true, i1 true>
%21 = xor <4 x i1> %11, <i1 true, i1 true, i1 true, i1 true>
%22 = select <4 x i1> %20, <4 x i1> %.not76, <4 x i1> zeroinitializer
%23 = select <4 x i1> %21, <4 x i1> %.not78, <4 x i1> zeroinitializer
%24 = select <4 x i1> %10, <4 x i1> %18, <4 x i1> zeroinitializer
%25 = select <4 x i1> %11, <4 x i1> %19, <4 x i1> zeroinitializer
%predphi.v = select <4 x i1> %22, <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%predphi72.v = select <4 x i1> %23, <4 x i32> <i32 2, i32 2, i32 2, i32 2>, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%predphi = select <4 x i1> %24, <4 x i32> zeroinitializer, <4 x i32> %predphi.v
%predphi73 = add <4 x i32> %vec.phi, %predphi
%predphi72 = select <4 x i1> %25, <4 x i32> zeroinitializer, <4 x i32> %predphi72.v
%predphi74 = add <4 x i32> %vec.phi66, %predphi72
%index.next = add nuw i64 %index, 8
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %predphi74, %predphi73
%27 = 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.preheader79
for.body.preheader79: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%ans.063.ph = phi i32 [ 0, %for.body.preheader ], [ %27, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader79, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %indvars.iv.ph, %for.body.preheader79 ]
%ans.063 = phi i32 [ %ans.1, %for.inc ], [ %ans.063.ph, %for.body.preheader79 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%28 = load i8, ptr %arrayidx, align 1, !tbaa !9
%arrayidx5 = getelementptr inbounds i8, ptr %vla1, i64 %indvars.iv
%29 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp eq i8 %28, %29
%arrayidx13 = getelementptr inbounds i8, ptr %vla2, i64 %indvars.iv
%30 = load i8, ptr %arrayidx13, align 1, !tbaa !9
br i1 %cmp7, label %land.lhs.true, label %lor.lhs.false
land.lhs.true: ; preds = %for.body
%cmp15 = icmp eq i8 %28, %30
br i1 %cmp15, label %for.inc, label %if.then42
lor.lhs.false: ; preds = %for.body
%cmp31 = icmp eq i8 %29, %30
%cmp40 = icmp eq i8 %30, %28
%or.cond = or i1 %cmp31, %cmp40
br i1 %or.cond, label %if.then42, label %if.else44
if.then42: ; preds = %land.lhs.true, %lor.lhs.false
%add43 = add nsw i32 %ans.063, 1
br label %for.inc
if.else44: ; preds = %lor.lhs.false
%add45 = add nsw i32 %ans.063, 2
br label %for.inc
for.inc: ; preds = %land.lhs.true, %if.else44, %if.then42
%ans.1 = phi i32 [ %add43, %if.then42 ], [ %add45, %if.else44 ], [ %ans.063, %land.lhs.true ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.inc, %middle.block, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %27, %middle.block ], [ %ans.1, %for.inc ]
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
|
#include<stdio.h>
void Print(long long a)
{
if(a>=0)
{
printf("%I64d",a%1000000007);
return ;
}
while(a<0)
{
a+=1000000007;
}
printf("%I64d",a%1000000007);
return ;
}
int main()
{
long long a,b,k,c,i;
scanf("%I64d%I64d",&a,&b);
scanf("%I64d",&k);
if(k%6==1)
Print(a);
if(k%6==2)
Print(b);
if(k%6==3)
Print(b-a);
if(k%6==4)
Print(-a);
if(k%6==5)
Print(-b);
if(k%6==0)
Print(a-b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13792/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13792/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%I64d\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"%I64d%I64d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @Print(i64 noundef %a) local_unnamed_addr #0 {
entry:
%cmp = icmp sgt i64 %a, -1
br i1 %cmp, label %return, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%0 = xor i64 %a, -1
%1 = urem i64 %0, 1000000007
%2 = sub nuw nsw i64 %0, %1
%3 = add nuw i64 %2, 1000000007
%4 = add i64 %3, %a
br label %return
return: ; preds = %entry, %while.cond.preheader
%.sink = phi i64 [ %4, %while.cond.preheader ], [ %a, %entry ]
%rem2 = urem i64 %.sink, 1000000007
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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
%k = 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 void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i64, ptr %k, align 8, !tbaa !5
%rem = srem i64 %0, 6
%cmp = icmp eq i64 %rem, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%1 = load i64, ptr %a, align 8, !tbaa !5
%cmp.i = icmp sgt i64 %1, -1
br i1 %cmp.i, label %Print.exit, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %if.then
%2 = xor i64 %1, -1
%3 = urem i64 %2, 1000000007
%4 = sub nuw nsw i64 1000000006, %3
br label %Print.exit
Print.exit: ; preds = %if.then, %while.cond.preheader.i
%.sink.i = phi i64 [ %4, %while.cond.preheader.i ], [ %1, %if.then ]
%rem2.i = urem i64 %.sink.i, 1000000007
%call3.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2.i)
%.pre = load i64, ptr %k, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %Print.exit, %entry
%5 = phi i64 [ %.pre, %Print.exit ], [ %0, %entry ]
%rem2 = srem i64 %5, 6
%cmp3 = icmp eq i64 %rem2, 2
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
%6 = load i64, ptr %b, align 8, !tbaa !5
%cmp.i25 = icmp sgt i64 %6, -1
br i1 %cmp.i25, label %Print.exit30, label %while.cond.preheader.i26
while.cond.preheader.i26: ; preds = %if.then4
%7 = xor i64 %6, -1
%8 = urem i64 %7, 1000000007
%9 = sub nuw nsw i64 1000000006, %8
br label %Print.exit30
Print.exit30: ; preds = %if.then4, %while.cond.preheader.i26
%.sink.i27 = phi i64 [ %9, %while.cond.preheader.i26 ], [ %6, %if.then4 ]
%rem2.i28 = urem i64 %.sink.i27, 1000000007
%call3.i29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2.i28)
%.pre62 = load i64, ptr %k, align 8, !tbaa !5
br label %if.end5
if.end5: ; preds = %Print.exit30, %if.end
%10 = phi i64 [ %.pre62, %Print.exit30 ], [ %5, %if.end ]
%rem6 = srem i64 %10, 6
%cmp7 = icmp eq i64 %rem6, 3
br i1 %cmp7, label %if.then8, label %if.end9
if.then8: ; preds = %if.end5
%11 = load i64, ptr %b, align 8, !tbaa !5
%12 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %11, %12
%cmp.i31 = icmp sgt i64 %sub, -1
br i1 %cmp.i31, label %Print.exit36, label %while.cond.preheader.i32
while.cond.preheader.i32: ; preds = %if.then8
%13 = xor i64 %sub, -1
%14 = urem i64 %13, 1000000007
%15 = sub nuw nsw i64 1000000006, %14
br label %Print.exit36
Print.exit36: ; preds = %if.then8, %while.cond.preheader.i32
%.sink.i33 = phi i64 [ %15, %while.cond.preheader.i32 ], [ %sub, %if.then8 ]
%rem2.i34 = urem i64 %.sink.i33, 1000000007
%call3.i35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2.i34)
%.pre63 = load i64, ptr %k, align 8, !tbaa !5
br label %if.end9
if.end9: ; preds = %Print.exit36, %if.end5
%16 = phi i64 [ %.pre63, %Print.exit36 ], [ %10, %if.end5 ]
%rem10 = srem i64 %16, 6
%cmp11 = icmp eq i64 %rem10, 4
br i1 %cmp11, label %if.then12, label %if.end14
if.then12: ; preds = %if.end9
%17 = load i64, ptr %a, align 8, !tbaa !5
%sub13 = sub i64 0, %17
%cmp.i37 = icmp slt i64 %17, 1
br i1 %cmp.i37, label %Print.exit42, label %while.cond.preheader.i38
while.cond.preheader.i38: ; preds = %if.then12
%18 = add nsw i64 %17, -1
%19 = urem i64 %18, 1000000007
%20 = sub nuw nsw i64 1000000006, %19
br label %Print.exit42
Print.exit42: ; preds = %if.then12, %while.cond.preheader.i38
%.sink.i39 = phi i64 [ %20, %while.cond.preheader.i38 ], [ %sub13, %if.then12 ]
%rem2.i40 = urem i64 %.sink.i39, 1000000007
%call3.i41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2.i40)
%.pre64 = load i64, ptr %k, align 8, !tbaa !5
br label %if.end14
if.end14: ; preds = %Print.exit42, %if.end9
%21 = phi i64 [ %.pre64, %Print.exit42 ], [ %16, %if.end9 ]
%rem15 = srem i64 %21, 6
%cmp16 = icmp eq i64 %rem15, 5
br i1 %cmp16, label %if.then17, label %if.end19
if.then17: ; preds = %if.end14
%22 = load i64, ptr %b, align 8, !tbaa !5
%sub18 = sub i64 0, %22
%cmp.i43 = icmp slt i64 %22, 1
br i1 %cmp.i43, label %Print.exit48, label %while.cond.preheader.i44
while.cond.preheader.i44: ; preds = %if.then17
%23 = add nsw i64 %22, -1
%24 = urem i64 %23, 1000000007
%25 = sub nuw nsw i64 1000000006, %24
br label %Print.exit48
Print.exit48: ; preds = %if.then17, %while.cond.preheader.i44
%.sink.i45 = phi i64 [ %25, %while.cond.preheader.i44 ], [ %sub18, %if.then17 ]
%rem2.i46 = urem i64 %.sink.i45, 1000000007
%call3.i47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2.i46)
%.pre65 = load i64, ptr %k, align 8, !tbaa !5
br label %if.end19
if.end19: ; preds = %Print.exit48, %if.end14
%26 = phi i64 [ %.pre65, %Print.exit48 ], [ %21, %if.end14 ]
%rem20 = srem i64 %26, 6
%cmp21 = icmp eq i64 %rem20, 0
br i1 %cmp21, label %if.then22, label %if.end24
if.then22: ; preds = %if.end19
%27 = load i64, ptr %a, align 8, !tbaa !5
%28 = load i64, ptr %b, align 8, !tbaa !5
%sub23 = sub nsw i64 %27, %28
%cmp.i49 = icmp sgt i64 %sub23, -1
br i1 %cmp.i49, label %Print.exit54, label %while.cond.preheader.i50
while.cond.preheader.i50: ; preds = %if.then22
%29 = xor i64 %sub23, -1
%30 = urem i64 %29, 1000000007
%31 = sub nuw nsw i64 1000000006, %30
br label %Print.exit54
Print.exit54: ; preds = %if.then22, %while.cond.preheader.i50
%.sink.i51 = phi i64 [ %31, %while.cond.preheader.i50 ], [ %sub23, %if.then22 ]
%rem2.i52 = urem i64 %.sink.i51, 1000000007
%call3.i53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %rem2.i52)
br label %if.end24
if.end24: ; preds = %Print.exit54, %if.end19
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #3
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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"}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define lop(i, n) for(i=0; i<n; i++)
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
int main()
{
int n, i;
scanf("%d", &n);
float v[51];
lop(i, n){ scanf("%f", &v[i]); }
qsort(v, n, sizeof(int), compare_int);
float sum=v[0];
for(i=1; i<n; i++){
sum=(sum+v[i])/2.0;
}
printf("%f", sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_137963/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_137963/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%v = alloca [51 x float], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 204, ptr nonnull %v) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, 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 [51 x float], ptr %v, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %v, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #5
%3 = load float, ptr %v, align 16, !tbaa !11
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp424 = icmp sgt i32 %4, 1
br i1 %cmp424, label %for.body6.preheader, label %for.end13
for.body6.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %4 to i64
%5 = add nsw i64 %wide.trip.count, -1
%6 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %5, 3
%7 = icmp ult i64 %6, 3
br i1 %7, label %for.end13.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %5, -4
br label %for.body6
for.body6: ; preds = %for.body6, %for.body6.preheader.new
%indvars.iv30 = phi i64 [ 1, %for.body6.preheader.new ], [ %indvars.iv.next31.3, %for.body6 ]
%sum.026 = phi float [ %3, %for.body6.preheader.new ], [ %conv10.3, %for.body6 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.3, %for.body6 ]
%arrayidx8 = getelementptr inbounds [51 x float], ptr %v, i64 0, i64 %indvars.iv30
%8 = load float, ptr %arrayidx8, align 4, !tbaa !11
%add = fadd float %sum.026, %8
%conv10 = fmul float %add, 5.000000e-01
%indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
%arrayidx8.1 = getelementptr inbounds [51 x float], ptr %v, i64 0, i64 %indvars.iv.next31
%9 = load float, ptr %arrayidx8.1, align 4, !tbaa !11
%add.1 = fadd float %conv10, %9
%conv10.1 = fmul float %add.1, 5.000000e-01
%indvars.iv.next31.1 = add nuw nsw i64 %indvars.iv30, 2
%arrayidx8.2 = getelementptr inbounds [51 x float], ptr %v, i64 0, i64 %indvars.iv.next31.1
%10 = load float, ptr %arrayidx8.2, align 4, !tbaa !11
%add.2 = fadd float %conv10.1, %10
%conv10.2 = fmul float %add.2, 5.000000e-01
%indvars.iv.next31.2 = add nuw nsw i64 %indvars.iv30, 3
%arrayidx8.3 = getelementptr inbounds [51 x float], ptr %v, i64 0, i64 %indvars.iv.next31.2
%11 = load float, ptr %arrayidx8.3, align 4, !tbaa !11
%add.3 = fadd float %conv10.2, %11
%conv10.3 = fmul float %add.3, 5.000000e-01
%indvars.iv.next31.3 = add nuw nsw i64 %indvars.iv30, 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.end13.loopexit.unr-lcssa, label %for.body6, !llvm.loop !13
for.end13.loopexit.unr-lcssa: ; preds = %for.body6, %for.body6.preheader
%conv10.lcssa.ph = phi float [ undef, %for.body6.preheader ], [ %conv10.3, %for.body6 ]
%indvars.iv30.unr = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next31.3, %for.body6 ]
%sum.026.unr = phi float [ %3, %for.body6.preheader ], [ %conv10.3, %for.body6 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end13, label %for.body6.epil
for.body6.epil: ; preds = %for.end13.loopexit.unr-lcssa, %for.body6.epil
%indvars.iv30.epil = phi i64 [ %indvars.iv.next31.epil, %for.body6.epil ], [ %indvars.iv30.unr, %for.end13.loopexit.unr-lcssa ]
%sum.026.epil = phi float [ %conv10.epil, %for.body6.epil ], [ %sum.026.unr, %for.end13.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body6.epil ], [ 0, %for.end13.loopexit.unr-lcssa ]
%arrayidx8.epil = getelementptr inbounds [51 x float], ptr %v, i64 0, i64 %indvars.iv30.epil
%12 = load float, ptr %arrayidx8.epil, align 4, !tbaa !11
%add.epil = fadd float %sum.026.epil, %12
%conv10.epil = fmul float %add.epil, 5.000000e-01
%indvars.iv.next31.epil = add nuw nsw i64 %indvars.iv30.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.end13, label %for.body6.epil, !llvm.loop !14
for.end13: ; preds = %for.end13.loopexit.unr-lcssa, %for.body6.epil, %for.end
%sum.0.lcssa = phi float [ %3, %for.end ], [ %conv10.lcssa.ph, %for.end13.loopexit.unr-lcssa ], [ %conv10.epil, %for.body6.epil ]
%conv14 = fpext float %sum.0.lcssa to double
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv14)
call void @llvm.lifetime.end.p0(i64 204, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main()
{
int N,tmp,i,j;
float A[50];
scanf("%d", &N);
for (i = 0; i <= N-1; i++) {
scanf("%f", &A[i]);
}
for (i = 0; i <= N - 1; i++) {
for (j = i + 1; j <= N - 1; j++) {
if (A[i] > A[j]) {
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
}
float sum = A[0];
for (i = 1; i <= N - 1; i++) {
sum = (sum + A[i]) / 2;
}
printf("%f", sum);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138012/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138012/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\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 [50 x float], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 200, 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
%cmp.not.not61 = icmp sgt i32 %0, 0
br i1 %cmp.not.not61, label %for.body, label %for.end29.thread
for.cond2.preheader: ; preds = %for.body
%cmp4.not.not65 = icmp sgt i32 %2, 0
br i1 %cmp4.not.not65, label %for.body5.preheader, label %for.end29.thread
for.body5.preheader: ; preds = %for.cond2.preheader
%1 = zext i32 %2 to i64
%wide.trip.count81 = zext i32 %2 to i64
br label %for.body5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond2.loopexit: ; preds = %for.inc24, %for.body5
%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.end29, label %for.body5, !llvm.loop !11
for.body5: ; preds = %for.body5.preheader, %for.cond2.loopexit
%indvars.iv78 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next79, %for.cond2.loopexit ]
%indvars.iv73 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next74, %for.cond2.loopexit ]
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%cmp8.not.not63 = icmp ult i64 %indvars.iv.next79, %1
br i1 %cmp8.not.not63, label %for.body9.lr.ph, label %for.cond2.loopexit
for.body9.lr.ph: ; preds = %for.body5
%arrayidx11 = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv78
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.inc24
%indvars.iv75 = phi i64 [ %indvars.iv73, %for.body9.lr.ph ], [ %indvars.iv.next76, %for.inc24 ]
%4 = load float, ptr %arrayidx11, align 4, !tbaa !12
%arrayidx13 = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv75
%5 = load float, ptr %arrayidx13, align 4, !tbaa !12
%cmp14 = fcmp ogt float %4, %5
br i1 %cmp14, label %if.then, label %for.inc24
if.then: ; preds = %for.body9
%conv = fptosi float %4 to i32
store float %5, ptr %arrayidx11, align 4, !tbaa !12
%conv21 = sitofp i32 %conv to float
store float %conv21, ptr %arrayidx13, align 4, !tbaa !12
br label %for.inc24
for.inc24: ; preds = %for.body9, %if.then
%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.cond2.loopexit, label %for.body9, !llvm.loop !14
for.end29.thread: ; preds = %for.cond2.preheader, %entry
%6 = load float, ptr %A, align 16, !tbaa !12
br label %for.end41
for.end29: ; preds = %for.cond2.loopexit
%7 = load float, ptr %A, align 16, !tbaa !12
%cmp33.not.not67 = icmp sgt i32 %2, 1
br i1 %cmp33.not.not67, label %for.body35.preheader, label %for.end41
for.body35.preheader: ; preds = %for.end29
%8 = add nsw i64 %wide.trip.count81, -1
%9 = add nsw i64 %wide.trip.count81, -2
%xtraiter = and i64 %8, 3
%10 = icmp ult i64 %9, 3
br i1 %10, label %for.end41.loopexit.unr-lcssa, label %for.body35.preheader.new
for.body35.preheader.new: ; preds = %for.body35.preheader
%unroll_iter = and i64 %8, -4
br label %for.body35
for.body35: ; preds = %for.body35, %for.body35.preheader.new
%indvars.iv83 = phi i64 [ 1, %for.body35.preheader.new ], [ %indvars.iv.next84.3, %for.body35 ]
%sum.069 = phi float [ %7, %for.body35.preheader.new ], [ %div.3, %for.body35 ]
%niter = phi i64 [ 0, %for.body35.preheader.new ], [ %niter.next.3, %for.body35 ]
%arrayidx37 = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv83
%11 = load float, ptr %arrayidx37, align 4, !tbaa !12
%add38 = fadd float %sum.069, %11
%div = fmul float %add38, 5.000000e-01
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%arrayidx37.1 = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv.next84
%12 = load float, ptr %arrayidx37.1, align 4, !tbaa !12
%add38.1 = fadd float %div, %12
%div.1 = fmul float %add38.1, 5.000000e-01
%indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
%arrayidx37.2 = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv.next84.1
%13 = load float, ptr %arrayidx37.2, align 4, !tbaa !12
%add38.2 = fadd float %div.1, %13
%div.2 = fmul float %add38.2, 5.000000e-01
%indvars.iv.next84.2 = add nuw nsw i64 %indvars.iv83, 3
%arrayidx37.3 = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv.next84.2
%14 = load float, ptr %arrayidx37.3, align 4, !tbaa !12
%add38.3 = fadd float %div.2, %14
%div.3 = fmul float %add38.3, 5.000000e-01
%indvars.iv.next84.3 = add nuw nsw i64 %indvars.iv83, 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.end41.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15
for.end41.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.preheader
%div.lcssa.ph = phi float [ undef, %for.body35.preheader ], [ %div.3, %for.body35 ]
%indvars.iv83.unr = phi i64 [ 1, %for.body35.preheader ], [ %indvars.iv.next84.3, %for.body35 ]
%sum.069.unr = phi float [ %7, %for.body35.preheader ], [ %div.3, %for.body35 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end41, label %for.body35.epil
for.body35.epil: ; preds = %for.end41.loopexit.unr-lcssa, %for.body35.epil
%indvars.iv83.epil = phi i64 [ %indvars.iv.next84.epil, %for.body35.epil ], [ %indvars.iv83.unr, %for.end41.loopexit.unr-lcssa ]
%sum.069.epil = phi float [ %div.epil, %for.body35.epil ], [ %sum.069.unr, %for.end41.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body35.epil ], [ 0, %for.end41.loopexit.unr-lcssa ]
%arrayidx37.epil = getelementptr inbounds [50 x float], ptr %A, i64 0, i64 %indvars.iv83.epil
%15 = load float, ptr %arrayidx37.epil, align 4, !tbaa !12
%add38.epil = fadd float %sum.069.epil, %15
%div.epil = fmul float %add38.epil, 5.000000e-01
%indvars.iv.next84.epil = add nuw nsw i64 %indvars.iv83.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.end41, label %for.body35.epil, !llvm.loop !16
for.end41: ; preds = %for.end41.loopexit.unr-lcssa, %for.body35.epil, %for.end29.thread, %for.end29
%sum.0.lcssa = phi float [ %7, %for.end29 ], [ %6, %for.end29.thread ], [ %div.lcssa.ph, %for.end41.loopexit.unr-lcssa ], [ %div.epil, %for.body35.epil ]
%conv42 = fpext float %sum.0.lcssa to double
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv42)
call void @llvm.lifetime.end.p0(i64 200, 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 = !{!13, !13, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
#include <stdlib.h>
#define ll long long
void swap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
ll gcd(ll p,ll q){for(ll t;q;)t=p%q,p=q,q=t;return p;}
ll lcm(ll p,ll q){return p/gcd(p,q)*q;}
int asc(const void *a,const void *b){return *(double*)a-*(double*)b>0?1:-1;}
ll desc(const void *a,const void *b){return *(ll*)b-*(ll*)a;}
// qsort(array, length, sizeof(int), asc);
int main(void) {
int n;
scanf("%d", &n);
double v[1000]={0};
for(int i=0; i<n; i++) scanf("%lf", &v[i]);
qsort(v, n, sizeof(double), &asc);
for(int i=0; i<n-1; i++){
double tmp = (v[i]+v[i+1])/2.0;
v[i+1] = tmp;
}
printf("%g\n", v[n-1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138056/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138056/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%g\0A\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 i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %y, align 8, !tbaa !5
store i64 %1, ptr %x, align 8, !tbaa !5
store i64 %0, ptr %y, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %p, i64 noundef %q) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %q, 0
br i1 %tobool.not4, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%p.addr.0.lcssa = phi i64 [ %p, %entry ], [ %q.addr.05, %for.body ]
ret i64 %p.addr.0.lcssa
for.body: ; preds = %entry, %for.body
%p.addr.06 = phi i64 [ %q.addr.05, %for.body ], [ %p, %entry ]
%q.addr.05 = phi i64 [ %rem, %for.body ], [ %q, %entry ]
%rem = srem i64 %p.addr.06, %q.addr.05
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %p, i64 noundef %q) local_unnamed_addr #2 {
entry:
%tobool.not4.i = icmp eq i64 %q, 0
br i1 %tobool.not4.i, label %gcd.exit, label %for.body.i
for.body.i: ; preds = %entry, %for.body.i
%p.addr.06.i = phi i64 [ %q.addr.05.i, %for.body.i ], [ %p, %entry ]
%q.addr.05.i = phi i64 [ %rem.i, %for.body.i ], [ %q, %entry ]
%rem.i = srem i64 %p.addr.06.i, %q.addr.05.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %for.body.i, !llvm.loop !9
gcd.exit: ; preds = %for.body.i, %entry
%p.addr.0.lcssa.i = phi i64 [ %p, %entry ], [ %q.addr.05.i, %for.body.i ]
%div = sdiv i64 %p, %p.addr.0.lcssa.i
%mul = mul nsw i64 %div, %q
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #3 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !11
%1 = load double, ptr %b, align 8, !tbaa !11
%sub = fsub double %0, %1
%cmp = fcmp ogt double %sub, 0.000000e+00
%cond = select i1 %cmp, i32 1, i32 -1
ret i32 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i64 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
ret i64 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%v = alloca [1000 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %v) #8
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) %v, i8 0, i64 8000, i1 false)
%0 = load i32, ptr %n, align 4, !tbaa !13
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre39 = sext i32 %0 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre39, %entry.for.cond.cleanup_crit_edge ], [ %5, %for.body ]
call void @qsort(ptr noundef nonnull %v, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @asc) #8
%1 = load i32, ptr %n, align 4, !tbaa !13
%sub = add i32 %1, -1
%cmp431 = icmp sgt i32 %1, 1
br i1 %cmp431, label %for.body7.preheader, label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %sub to i64
%.pre = load double, ptr %v, align 16, !tbaa !11
%2 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 3
%3 = icmp ult i64 %2, 3
br i1 %3, label %for.cond.cleanup6.loopexit.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x double], ptr %v, 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
%4 = load i32, ptr %n, align 4, !tbaa !13
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15
for.cond.cleanup6.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%.unr = phi double [ %.pre, %for.body7.preheader ], [ %div.3, %for.body7 ]
%indvars.iv36.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next37.3, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup6, label %for.body7.epil
for.body7.epil: ; preds = %for.cond.cleanup6.loopexit.unr-lcssa, %for.body7.epil
%6 = phi double [ %div.epil, %for.body7.epil ], [ %.unr, %for.cond.cleanup6.loopexit.unr-lcssa ]
%indvars.iv36.epil = phi i64 [ %indvars.iv.next37.epil, %for.body7.epil ], [ %indvars.iv36.unr, %for.cond.cleanup6.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.cond.cleanup6.loopexit.unr-lcssa ]
%indvars.iv.next37.epil = add nuw nsw i64 %indvars.iv36.epil, 1
%arrayidx11.epil = getelementptr inbounds [1000 x double], ptr %v, i64 0, i64 %indvars.iv.next37.epil
%7 = load double, ptr %arrayidx11.epil, align 8, !tbaa !11
%add12.epil = fadd double %6, %7
%div.epil = fmul double %add12.epil, 5.000000e-01
store double %div.epil, ptr %arrayidx11.epil, align 8, !tbaa !11
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup6, label %for.body7.epil, !llvm.loop !16
for.cond.cleanup6: ; preds = %for.cond.cleanup6.loopexit.unr-lcssa, %for.body7.epil, %for.cond.cleanup
%idxprom20 = sext i32 %sub to i64
%arrayidx21 = getelementptr inbounds [1000 x double], ptr %v, i64 0, i64 %idxprom20
%8 = load double, ptr %arrayidx21, align 8, !tbaa !11
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %8)
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %v) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%9 = phi double [ %.pre, %for.body7.preheader.new ], [ %div.3, %for.body7 ]
%indvars.iv36 = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next37.3, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.3, %for.body7 ]
%indvars.iv.next37 = or i64 %indvars.iv36, 1
%arrayidx11 = getelementptr inbounds [1000 x double], ptr %v, i64 0, i64 %indvars.iv.next37
%10 = load double, ptr %arrayidx11, align 8, !tbaa !11
%add12 = fadd double %9, %10
%div = fmul double %add12, 5.000000e-01
store double %div, ptr %arrayidx11, align 8, !tbaa !11
%indvars.iv.next37.1 = or i64 %indvars.iv36, 2
%arrayidx11.1 = getelementptr inbounds [1000 x double], ptr %v, i64 0, i64 %indvars.iv.next37.1
%11 = load double, ptr %arrayidx11.1, align 16, !tbaa !11
%add12.1 = fadd double %div, %11
%div.1 = fmul double %add12.1, 5.000000e-01
store double %div.1, ptr %arrayidx11.1, align 16, !tbaa !11
%indvars.iv.next37.2 = or i64 %indvars.iv36, 3
%arrayidx11.2 = getelementptr inbounds [1000 x double], ptr %v, i64 0, i64 %indvars.iv.next37.2
%12 = load double, ptr %arrayidx11.2, align 8, !tbaa !11
%add12.2 = fadd double %div.1, %12
%div.2 = fmul double %add12.2, 5.000000e-01
store double %div.2, ptr %arrayidx11.2, align 8, !tbaa !11
%indvars.iv.next37.3 = add nuw nsw i64 %indvars.iv36, 4
%arrayidx11.3 = getelementptr inbounds [1000 x double], ptr %v, i64 0, i64 %indvars.iv.next37.3
%13 = load double, ptr %arrayidx11.3, align 16, !tbaa !11
%add12.3 = fadd double %div.2, %13
%div.3 = fmul double %add12.3, 5.000000e-01
store double %div.3, ptr %arrayidx11.3, align 16, !tbaa !11
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup6.loopexit.unr-lcssa, label %for.body7, !llvm.loop !18
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; 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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int max(long long int n,long long a[n],long long i)
{
if(i<1 || i>n-2)
{
return 0;
}
else{
if(a[i]>a[i-1] && a[i]>a[i+1])
{
return 1;
}
else
{
return 0;
}
}
}
int min(long long int n,long long a[n],long long i)
{
if(i<1 || i>n-2)
{
return 0;
}
else{
if(a[i]<a[i-1] && a[i]<a[i+1])
{
return 1;
}
else
{
return 0;
}
}
}
long long int maxi(long long a, long long b)
{
return a>b ? a:b;
}
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
long long n;
scanf("%lld",&n);
long int count=0;
long long int a[n];
for(long long i=0;i<n;i++)
{
scanf("%lld",&a[i]);
}
for(long long i=0;i<n;i++)
{
if(i>1)
{
if(max(n,a,i-1)==1 && max(n,a,i+1)==1 && min(n,a,i)==1)
{
count++;
a[i]=maxi(a[i-1],a[i+1]);
}
}
}
for(long long i=0;i<n;i++)
{
//scanf("%lld",&a[i]);
if(i>1)
{
if(a[i-1]>a[i-2] && a[i-1]>a[i])
{
a[i-1]=maxi(a[i],a[i-2]);
count++;
}
}
}
printf("%ld\n",count);
for(long long i=0;i<n;i++)
{
printf("%lld ",a[i]);
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1381/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @max(i64 noundef %n, ptr nocapture noundef readonly %a, i64 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i64 %i, 1
%sub = add nsw i64 %n, -2
%cmp1 = icmp slt i64 %sub, %i
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %return, label %if.else
if.else: ; preds = %entry
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx3 = getelementptr i64, ptr %arrayidx, i64 -1
%1 = load i64, ptr %arrayidx3, align 8, !tbaa !5
%cmp4 = icmp sgt i64 %0, %1
br i1 %cmp4, label %land.lhs.true, label %if.else9
land.lhs.true: ; preds = %if.else
%arrayidx6 = getelementptr i64, ptr %arrayidx, i64 1
%2 = load i64, ptr %arrayidx6, align 8, !tbaa !5
%cmp7 = icmp sgt i64 %0, %2
br i1 %cmp7, label %return, label %if.else9
if.else9: ; preds = %land.lhs.true, %if.else
br label %return
return: ; preds = %land.lhs.true, %entry, %if.else9
%retval.0 = phi i32 [ 0, %if.else9 ], [ 0, %entry ], [ 1, %land.lhs.true ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @min(i64 noundef %n, ptr nocapture noundef readonly %a, i64 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i64 %i, 1
%sub = add nsw i64 %n, -2
%cmp1 = icmp slt i64 %sub, %i
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %return, label %if.else
if.else: ; preds = %entry
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i
%0 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx3 = getelementptr i64, ptr %arrayidx, i64 -1
%1 = load i64, ptr %arrayidx3, align 8, !tbaa !5
%cmp4 = icmp slt i64 %0, %1
br i1 %cmp4, label %land.lhs.true, label %if.else9
land.lhs.true: ; preds = %if.else
%arrayidx6 = getelementptr i64, ptr %arrayidx, i64 1
%2 = load i64, ptr %arrayidx6, align 8, !tbaa !5
%cmp7 = icmp slt i64 %0, %2
br i1 %cmp7, label %return, label %if.else9
if.else9: ; preds = %land.lhs.true, %if.else
br label %return
return: ; preds = %land.lhs.true, %entry, %if.else9
%retval.0 = phi i32 [ 0, %if.else9 ], [ 0, %entry ], [ 1, %land.lhs.true ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @maxi(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%T = alloca i32, align 4
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !9
%dec140 = add nsw i32 %0, -1
store i32 %dec140, ptr %T, align 4, !tbaa !9
%tobool.not141 = icmp eq i32 %0, 0
br i1 %tobool.not141, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup62
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #8
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp128 = icmp sgt i64 %3, 0
br i1 %cmp128, label %for.body, label %for.cond.cleanup31
for.cond4.preheader: ; preds = %for.body
%cmp5130 = icmp slt i64 %4, 1
br i1 %cmp5130, label %for.cond.cleanup31, label %for.inc25.peel
for.inc25.peel: ; preds = %for.cond4.preheader
%sub.i = add nsw i64 %4, -2
%switch = icmp ult i64 %4, 3
br i1 %switch, label %for.cond.cleanup31, label %if.then
for.body: ; preds = %while.body, %for.body
%i.0129 = phi i64 [ %inc, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.0129
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.0129, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !11
for.cond29.preheader: ; preds = %for.inc25
%or.cond = icmp slt i64 %4, 3
br i1 %or.cond, label %for.cond.cleanup31, label %if.then34.preheader
if.then34.preheader: ; preds = %for.cond29.preheader
%xtraiter = and i64 %4, 1
%5 = icmp eq i64 %4, 3
br i1 %5, label %for.cond.cleanup31.loopexit.unr-lcssa, label %if.then34.preheader.new
if.then34.preheader.new: ; preds = %if.then34.preheader
%6 = and i64 %4, -2
%7 = add i64 %6, -4
br label %if.then34
if.then: ; preds = %for.inc25.peel, %for.inc25
%i3.0132 = phi i64 [ %inc26, %for.inc25 ], [ 2, %for.inc25.peel ]
%count.0131 = phi i64 [ %count.1, %for.inc25 ], [ 0, %for.inc25.peel ]
%8 = getelementptr i64, ptr %vla, i64 %i3.0132
%arrayidx.i = getelementptr i64, ptr %8, i64 -1
%9 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%arrayidx3.i = getelementptr i64, ptr %8, i64 -2
%10 = load i64, ptr %arrayidx3.i, align 8, !tbaa !5
%cmp4.i = icmp sgt i64 %9, %10
br i1 %cmp4.i, label %land.lhs.true.i, label %for.inc25
land.lhs.true.i: ; preds = %if.then
%arrayidx6.i = getelementptr i64, ptr %vla, i64 %i3.0132
%11 = load i64, ptr %arrayidx6.i, align 8, !tbaa !5
%cmp7.i = icmp sgt i64 %9, %11
%cmp1.i97.not = icmp sgt i64 %sub.i, %i3.0132
%or.cond227 = select i1 %cmp7.i, i1 %cmp1.i97.not, i1 false
br i1 %or.cond227, label %if.else.i98, label %for.inc25
if.else.i98: ; preds = %land.lhs.true.i
%12 = getelementptr i64, ptr %vla, i64 %i3.0132
%arrayidx.i99 = getelementptr i64, ptr %12, i64 1
%13 = load i64, ptr %arrayidx.i99, align 8, !tbaa !5
%cmp4.i101 = icmp sgt i64 %13, %11
br i1 %cmp4.i101, label %land.lhs.true.i104, label %for.inc25
land.lhs.true.i104: ; preds = %if.else.i98
%arrayidx6.i105 = getelementptr i64, ptr %12, i64 2
%14 = load i64, ptr %arrayidx6.i105, align 8, !tbaa !5
%cmp7.i106.not = icmp sgt i64 %13, %14
br i1 %cmp7.i106.not, label %if.then16, label %for.inc25
if.then16: ; preds = %land.lhs.true.i104
%inc17 = add nsw i64 %count.0131, 1
%cond.i = call i64 @llvm.smax.i64(i64 %9, i64 %13)
store i64 %cond.i, ptr %arrayidx6.i, align 8, !tbaa !5
br label %for.inc25
for.inc25: ; preds = %if.else.i98, %land.lhs.true.i104, %if.then, %land.lhs.true.i, %if.then16
%count.1 = phi i64 [ %inc17, %if.then16 ], [ %count.0131, %land.lhs.true.i ], [ %count.0131, %if.then ], [ %count.0131, %land.lhs.true.i104 ], [ %count.0131, %if.else.i98 ]
%inc26 = add nuw nsw i64 %i3.0132, 1
%exitcond.not = icmp eq i64 %inc26, %4
br i1 %exitcond.not, label %for.cond29.preheader, label %if.then, !llvm.loop !13
for.cond.cleanup31.loopexit.unr-lcssa: ; preds = %for.inc55.1, %if.then34.preheader
%count.3.lcssa.ph = phi i64 [ undef, %if.then34.preheader ], [ %count.3.1, %for.inc55.1 ]
%i28.0136.unr = phi i64 [ 2, %if.then34.preheader ], [ %inc56.1, %for.inc55.1 ]
%count.2135.unr = phi i64 [ %count.1, %if.then34.preheader ], [ %count.3.1, %for.inc55.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup31, label %if.then34.epil
if.then34.epil: ; preds = %for.cond.cleanup31.loopexit.unr-lcssa
%15 = getelementptr i64, ptr %vla, i64 %i28.0136.unr
%arrayidx36.epil = getelementptr i64, ptr %15, i64 -1
%16 = load i64, ptr %arrayidx36.epil, align 8, !tbaa !5
%arrayidx38.epil = getelementptr i64, ptr %15, i64 -2
%17 = load i64, ptr %arrayidx38.epil, align 8, !tbaa !5
%cmp39.epil = icmp sgt i64 %16, %17
br i1 %cmp39.epil, label %land.lhs.true40.epil, label %for.cond.cleanup31
land.lhs.true40.epil: ; preds = %if.then34.epil
%18 = load i64, ptr %15, align 8, !tbaa !5
%cmp44.epil = icmp sgt i64 %16, %18
br i1 %cmp44.epil, label %if.then45.epil, label %for.cond.cleanup31
if.then45.epil: ; preds = %land.lhs.true40.epil
%cond.i121.epil = call i64 @llvm.smax.i64(i64 %18, i64 %17)
store i64 %cond.i121.epil, ptr %arrayidx36.epil, align 8, !tbaa !5
%inc52.epil = add nsw i64 %count.2135.unr, 1
br label %for.cond.cleanup31
for.cond.cleanup31: ; preds = %for.cond.cleanup31.loopexit.unr-lcssa, %if.then45.epil, %land.lhs.true40.epil, %if.then34.epil, %for.cond29.preheader, %for.inc25.peel, %while.body, %for.cond4.preheader
%count.2.lcssa = phi i64 [ 0, %for.cond4.preheader ], [ 0, %while.body ], [ 0, %for.inc25.peel ], [ %count.1, %for.cond29.preheader ], [ %count.3.lcssa.ph, %for.cond.cleanup31.loopexit.unr-lcssa ], [ %inc52.epil, %if.then45.epil ], [ %count.2135.unr, %land.lhs.true40.epil ], [ %count.2135.unr, %if.then34.epil ]
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.2.lcssa)
%19 = load i64, ptr %n, align 8, !tbaa !5
%cmp61138 = icmp sgt i64 %19, 0
br i1 %cmp61138, label %for.body63, label %for.cond.cleanup62
if.then34: ; preds = %for.inc55.1, %if.then34.preheader.new
%i28.0136 = phi i64 [ 2, %if.then34.preheader.new ], [ %inc56.1, %for.inc55.1 ]
%count.2135 = phi i64 [ %count.1, %if.then34.preheader.new ], [ %count.3.1, %for.inc55.1 ]
%niter = phi i64 [ 0, %if.then34.preheader.new ], [ %niter.next.1, %for.inc55.1 ]
%20 = getelementptr i64, ptr %vla, i64 %i28.0136
%arrayidx36 = getelementptr i64, ptr %20, i64 -1
%21 = load i64, ptr %arrayidx36, align 8, !tbaa !5
%arrayidx38 = getelementptr i64, ptr %20, i64 -2
%22 = load i64, ptr %arrayidx38, align 16, !tbaa !5
%cmp39 = icmp sgt i64 %21, %22
br i1 %cmp39, label %land.lhs.true40, label %for.inc55
land.lhs.true40: ; preds = %if.then34
%23 = load i64, ptr %20, align 16, !tbaa !5
%cmp44 = icmp sgt i64 %21, %23
br i1 %cmp44, label %if.then45, label %for.inc55
if.then45: ; preds = %land.lhs.true40
%cond.i121 = call i64 @llvm.smax.i64(i64 %23, i64 %22)
store i64 %cond.i121, ptr %arrayidx36, align 8, !tbaa !5
%inc52 = add nsw i64 %count.2135, 1
br label %for.inc55
for.inc55: ; preds = %if.then45, %land.lhs.true40, %if.then34
%count.3 = phi i64 [ %inc52, %if.then45 ], [ %count.2135, %land.lhs.true40 ], [ %count.2135, %if.then34 ]
%inc56 = or i64 %i28.0136, 1
%24 = getelementptr i64, ptr %vla, i64 %inc56
%arrayidx36.1 = getelementptr i64, ptr %24, i64 -1
%25 = load i64, ptr %arrayidx36.1, align 16, !tbaa !5
%arrayidx38.1 = getelementptr i64, ptr %24, i64 -2
%26 = load i64, ptr %arrayidx38.1, align 8, !tbaa !5
%cmp39.1 = icmp sgt i64 %25, %26
br i1 %cmp39.1, label %land.lhs.true40.1, label %for.inc55.1
land.lhs.true40.1: ; preds = %for.inc55
%27 = load i64, ptr %24, align 8, !tbaa !5
%cmp44.1 = icmp sgt i64 %25, %27
br i1 %cmp44.1, label %if.then45.1, label %for.inc55.1
if.then45.1: ; preds = %land.lhs.true40.1
%cond.i121.1 = call i64 @llvm.smax.i64(i64 %27, i64 %26)
store i64 %cond.i121.1, ptr %arrayidx36.1, align 16, !tbaa !5
%inc52.1 = add nsw i64 %count.3, 1
br label %for.inc55.1
for.inc55.1: ; preds = %if.then45.1, %land.lhs.true40.1, %for.inc55
%count.3.1 = phi i64 [ %inc52.1, %if.then45.1 ], [ %count.3, %land.lhs.true40.1 ], [ %count.3, %for.inc55 ]
%inc56.1 = add nuw nsw i64 %i28.0136, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter, %7
br i1 %niter.ncmp.1, label %for.cond.cleanup31.loopexit.unr-lcssa, label %if.then34, !llvm.loop !15
for.cond.cleanup62: ; preds = %for.body63, %for.cond.cleanup31
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #8
%28 = load i32, ptr %T, align 4, !tbaa !9
%dec = add nsw i32 %28, -1
store i32 %dec, ptr %T, align 4, !tbaa !9
%tobool.not = icmp eq i32 %28, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !16
for.body63: ; preds = %for.cond.cleanup31, %for.body63
%i59.0139 = phi i64 [ %inc67, %for.body63 ], [ 0, %for.cond.cleanup31 ]
%arrayidx64 = getelementptr inbounds i64, ptr %vla, i64 %i59.0139
%29 = load i64, ptr %arrayidx64, align 8, !tbaa !5
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %29)
%inc67 = add nuw nsw i64 %i59.0139, 1
%30 = load i64, ptr %n, align 8, !tbaa !5
%cmp61 = icmp slt i64 %inc67, %30
br i1 %cmp61, label %for.body63, label %for.cond.cleanup62, !llvm.loop !17
while.end: ; preds = %for.cond.cleanup62, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.peeled.count", i32 2}
!15 = distinct !{!15, !12, !14}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
|
#include<stdio.h>
int partition(double *num, int start, int end, double p);
void quicksort(double *num, int start, int end);
int main(void){
int N = 0;
int i = 0;
double v[128];
double value = 0.0;
scanf("%d", &N);
for(i = 0; i <N; i++){
scanf("%lf", &v[i]);
}
quicksort(v, 0, N-1);
value = v[0];
for(i = 1; i < N; i++){
value = (v[i]+value)/2;
}
printf("%f", value);
return 0;
}
int partition(double *num, int start,int end, double p){
int i = start, j = end;
double temp = 0.0;
while(i <= j){
while(i <= end && num[i] <= p){
i++;
}
while(j >= start && num[j] > p){
j--;
}
if(i > j){
break;
}
temp = num[i];
num[i] = num[j];
num[j] = temp;
}
return i;
}
void quicksort(double *num, int start, int end){
if(start == end){
return ;
}
double p = num[start];
int flg = 0;
int base = start;
int k = 0;
while(base <= end){
if(num[base] < p){
flg = 1;
p = num[base];
break;
}else if(num[base] > p){
flg = 1;
break;
}
base++;
}
if(flg == 1){
k = partition(num, start, end, p);
quicksort(num, start, k-1);
quicksort(num, k, end);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138142/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138142/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%v = alloca [128 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
store i32 0, ptr %N, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %v) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [128 x double], ptr %v, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%sub = add nsw i32 %.lcssa, -1
call void @quicksort(ptr noundef nonnull %v, i32 noundef 0, i32 noundef %sub)
%3 = load double, ptr %v, align 16, !tbaa !11
%cmp420 = icmp sgt i32 %.lcssa, 1
br i1 %cmp420, label %for.body5.preheader, label %for.end10
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %.lcssa to i64
%4 = add nsw i64 %wide.trip.count, -1
%5 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %4, 3
%6 = icmp ult i64 %5, 3
br i1 %6, label %for.end10.loopexit.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %4, -4
br label %for.body5
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%indvars.iv26 = phi i64 [ 1, %for.body5.preheader.new ], [ %indvars.iv.next27.3, %for.body5 ]
%value.022 = phi double [ %3, %for.body5.preheader.new ], [ %div.3, %for.body5 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.3, %for.body5 ]
%arrayidx7 = getelementptr inbounds [128 x double], ptr %v, i64 0, i64 %indvars.iv26
%7 = load double, ptr %arrayidx7, align 8, !tbaa !11
%add = fadd double %value.022, %7
%div = fmul double %add, 5.000000e-01
%indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1
%arrayidx7.1 = getelementptr inbounds [128 x double], ptr %v, i64 0, i64 %indvars.iv.next27
%8 = load double, ptr %arrayidx7.1, align 8, !tbaa !11
%add.1 = fadd double %div, %8
%div.1 = fmul double %add.1, 5.000000e-01
%indvars.iv.next27.1 = add nuw nsw i64 %indvars.iv26, 2
%arrayidx7.2 = getelementptr inbounds [128 x double], ptr %v, i64 0, i64 %indvars.iv.next27.1
%9 = load double, ptr %arrayidx7.2, align 8, !tbaa !11
%add.2 = fadd double %div.1, %9
%div.2 = fmul double %add.2, 5.000000e-01
%indvars.iv.next27.2 = add nuw nsw i64 %indvars.iv26, 3
%arrayidx7.3 = getelementptr inbounds [128 x double], ptr %v, i64 0, i64 %indvars.iv.next27.2
%10 = load double, ptr %arrayidx7.3, align 8, !tbaa !11
%add.3 = fadd double %div.2, %10
%div.3 = fmul double %add.3, 5.000000e-01
%indvars.iv.next27.3 = add nuw nsw i64 %indvars.iv26, 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.end10.loopexit.unr-lcssa, label %for.body5, !llvm.loop !13
for.end10.loopexit.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%div.lcssa.ph = phi double [ undef, %for.body5.preheader ], [ %div.3, %for.body5 ]
%indvars.iv26.unr = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next27.3, %for.body5 ]
%value.022.unr = phi double [ %3, %for.body5.preheader ], [ %div.3, %for.body5 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end10, label %for.body5.epil
for.body5.epil: ; preds = %for.end10.loopexit.unr-lcssa, %for.body5.epil
%indvars.iv26.epil = phi i64 [ %indvars.iv.next27.epil, %for.body5.epil ], [ %indvars.iv26.unr, %for.end10.loopexit.unr-lcssa ]
%value.022.epil = phi double [ %div.epil, %for.body5.epil ], [ %value.022.unr, %for.end10.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body5.epil ], [ 0, %for.end10.loopexit.unr-lcssa ]
%arrayidx7.epil = getelementptr inbounds [128 x double], ptr %v, i64 0, i64 %indvars.iv26.epil
%11 = load double, ptr %arrayidx7.epil, align 8, !tbaa !11
%add.epil = fadd double %value.022.epil, %11
%div.epil = fmul double %add.epil, 5.000000e-01
%indvars.iv.next27.epil = add nuw nsw i64 %indvars.iv26.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.end10, label %for.body5.epil, !llvm.loop !14
for.end10: ; preds = %for.end10.loopexit.unr-lcssa, %for.body5.epil, %for.end
%value.0.lcssa = phi double [ %3, %for.end ], [ %div.lcssa.ph, %for.end10.loopexit.unr-lcssa ], [ %div.epil, %for.body5.epil ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %value.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quicksort(ptr nocapture noundef %num, i32 noundef %start, i32 noundef %end) local_unnamed_addr #3 {
entry:
%cmp45 = icmp eq i32 %start, %end
br i1 %cmp45, label %return, label %if.end.lr.ph
if.end.lr.ph: ; preds = %entry
%0 = sext i32 %end to i64
%1 = add i32 %end, 1
br label %if.end
if.end: ; preds = %if.end.lr.ph, %partition.exit
%start.tr46 = phi i32 [ %start, %if.end.lr.ph ], [ %i.1.lcssa.i, %partition.exit ]
%idxprom = sext i32 %start.tr46 to i64
%arrayidx = getelementptr inbounds double, ptr %num, i64 %idxprom
%2 = load double, ptr %arrayidx, align 8, !tbaa !11
%cmp1.not.not43 = icmp sgt i32 %start.tr46, %end
br i1 %cmp1.not.not43, label %return, label %while.body
while.cond: ; preds = %if.else
%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 %return, label %while.body, !llvm.loop !16
while.body: ; preds = %if.end, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ %idxprom, %if.end ]
%arrayidx3 = getelementptr inbounds double, ptr %num, i64 %indvars.iv
%3 = load double, ptr %arrayidx3, align 8, !tbaa !11
%cmp4 = fcmp olt double %3, %2
br i1 %cmp4, label %while.cond1.preheader.preheader.i, label %if.else
if.else: ; preds = %while.body
%cmp10 = fcmp ogt double %3, %2
br i1 %cmp10, label %while.cond1.preheader.preheader.i, label %while.cond
while.cond1.preheader.preheader.i: ; preds = %while.body, %if.else
%p.0.ph = phi double [ %2, %if.else ], [ %3, %while.body ]
%4 = add i32 %start.tr46, -1
br label %while.cond1.preheader.i
while.cond1.preheader.i: ; preds = %if.end.i, %while.cond1.preheader.preheader.i
%j.054.i = phi i32 [ %j.1.lcssa.i, %if.end.i ], [ %end, %while.cond1.preheader.preheader.i ]
%i.053.i = phi i32 [ %i.1.lcssa.i, %if.end.i ], [ %start.tr46, %while.cond1.preheader.preheader.i ]
%cmp2.not45.i = icmp sgt i32 %i.053.i, %end
br i1 %cmp2.not45.i, label %while.end.i, label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.cond1.preheader.i
%5 = sext i32 %i.053.i to i64
br label %land.rhs.i
land.rhs.i: ; preds = %while.body4.i, %land.rhs.preheader.i
%indvars.iv.i = phi i64 [ %5, %land.rhs.preheader.i ], [ %indvars.iv.next.i, %while.body4.i ]
%arrayidx.i = getelementptr inbounds double, ptr %num, i64 %indvars.iv.i
%6 = load double, ptr %arrayidx.i, align 8, !tbaa !11
%cmp3.i = fcmp ugt double %6, %p.0.ph
br i1 %cmp3.i, label %while.end.loopexit.split.loop.exit61.i, label %while.body4.i
while.body4.i: ; preds = %land.rhs.i
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%cmp2.not.not.i = icmp slt i64 %indvars.iv.i, %0
br i1 %cmp2.not.not.i, label %land.rhs.i, label %while.end.i, !llvm.loop !17
while.end.loopexit.split.loop.exit61.i: ; preds = %land.rhs.i
%7 = trunc i64 %indvars.iv.i to i32
br label %while.end.i
while.end.i: ; preds = %while.body4.i, %while.end.loopexit.split.loop.exit61.i, %while.cond1.preheader.i
%i.1.lcssa.i = phi i32 [ %i.053.i, %while.cond1.preheader.i ], [ %7, %while.end.loopexit.split.loop.exit61.i ], [ %1, %while.body4.i ]
%cmp6.not48.i = icmp slt i32 %j.054.i, %start.tr46
br i1 %cmp6.not48.i, label %while.end13.i, label %land.rhs7.preheader.i
land.rhs7.preheader.i: ; preds = %while.end.i
%8 = sext i32 %j.054.i to i64
br label %land.rhs7.i
land.rhs7.i: ; preds = %while.body12.i, %land.rhs7.preheader.i
%indvars.iv58.i = phi i64 [ %8, %land.rhs7.preheader.i ], [ %indvars.iv.next59.i, %while.body12.i ]
%arrayidx9.i = getelementptr inbounds double, ptr %num, i64 %indvars.iv58.i
%9 = load double, ptr %arrayidx9.i, align 8, !tbaa !11
%cmp10.i = fcmp ogt double %9, %p.0.ph
br i1 %cmp10.i, label %while.body12.i, label %while.end13.loopexit.split.loop.exit63.i
while.body12.i: ; preds = %land.rhs7.i
%indvars.iv.next59.i = add nsw i64 %indvars.iv58.i, -1
%cmp6.not.not.i = icmp sgt i64 %indvars.iv58.i, %idxprom
br i1 %cmp6.not.not.i, label %land.rhs7.i, label %while.end13.i, !llvm.loop !18
while.end13.loopexit.split.loop.exit63.i: ; preds = %land.rhs7.i
%10 = trunc i64 %indvars.iv58.i to i32
br label %while.end13.i
while.end13.i: ; preds = %while.body12.i, %while.end13.loopexit.split.loop.exit63.i, %while.end.i
%j.1.lcssa.i = phi i32 [ %j.054.i, %while.end.i ], [ %10, %while.end13.loopexit.split.loop.exit63.i ], [ %4, %while.body12.i ]
%cmp14.i = icmp sgt i32 %i.1.lcssa.i, %j.1.lcssa.i
br i1 %cmp14.i, label %partition.exit, label %if.end.i
if.end.i: ; preds = %while.end13.i
%idxprom15.i = sext i32 %i.1.lcssa.i to i64
%arrayidx16.i = getelementptr inbounds double, ptr %num, i64 %idxprom15.i
%11 = load double, ptr %arrayidx16.i, align 8, !tbaa !11
%idxprom17.i = sext i32 %j.1.lcssa.i to i64
%arrayidx18.i = getelementptr inbounds double, ptr %num, i64 %idxprom17.i
%12 = load double, ptr %arrayidx18.i, align 8, !tbaa !11
store double %12, ptr %arrayidx16.i, align 8, !tbaa !11
store double %11, ptr %arrayidx18.i, align 8, !tbaa !11
br label %while.cond1.preheader.i, !llvm.loop !19
partition.exit: ; preds = %while.end13.i
%sub = add nsw i32 %i.1.lcssa.i, -1
tail call void @quicksort(ptr noundef %num, i32 noundef %start.tr46, i32 noundef %sub)
%cmp = icmp eq i32 %i.1.lcssa.i, %end
br i1 %cmp, label %return, label %if.end
return: ; preds = %partition.exit, %if.end, %while.cond, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %num, i32 noundef %start, i32 noundef %end, double noundef %p) local_unnamed_addr #4 {
entry:
%cmp.not52 = icmp sgt i32 %start, %end
br i1 %cmp.not52, label %while.end23, label %while.cond1.preheader.preheader
while.cond1.preheader.preheader: ; preds = %entry
%0 = sext i32 %end to i64
%1 = add i32 %end, 1
%2 = sext i32 %start to i64
%3 = add i32 %start, -1
br label %while.cond1.preheader
while.cond1.preheader: ; preds = %while.cond1.preheader.preheader, %if.end
%j.054 = phi i32 [ %j.1.lcssa, %if.end ], [ %end, %while.cond1.preheader.preheader ]
%i.053 = phi i32 [ %i.1.lcssa, %if.end ], [ %start, %while.cond1.preheader.preheader ]
%cmp2.not45 = icmp sgt i32 %i.053, %end
br i1 %cmp2.not45, label %while.end, label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.cond1.preheader
%4 = sext i32 %i.053 to i64
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body4
%indvars.iv = phi i64 [ %4, %land.rhs.preheader ], [ %indvars.iv.next, %while.body4 ]
%arrayidx = getelementptr inbounds double, ptr %num, i64 %indvars.iv
%5 = load double, ptr %arrayidx, align 8, !tbaa !11
%cmp3 = fcmp ugt double %5, %p
br i1 %cmp3, label %while.end.loopexit.split.loop.exit61, label %while.body4
while.body4: ; preds = %land.rhs
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%cmp2.not.not = icmp slt i64 %indvars.iv, %0
br i1 %cmp2.not.not, label %land.rhs, label %while.end, !llvm.loop !17
while.end.loopexit.split.loop.exit61: ; preds = %land.rhs
%6 = trunc i64 %indvars.iv to i32
br label %while.end
while.end: ; preds = %while.body4, %while.end.loopexit.split.loop.exit61, %while.cond1.preheader
%i.1.lcssa = phi i32 [ %i.053, %while.cond1.preheader ], [ %6, %while.end.loopexit.split.loop.exit61 ], [ %1, %while.body4 ]
%cmp6.not48 = icmp slt i32 %j.054, %start
br i1 %cmp6.not48, label %while.end13, label %land.rhs7.preheader
land.rhs7.preheader: ; preds = %while.end
%7 = sext i32 %j.054 to i64
br label %land.rhs7
land.rhs7: ; preds = %land.rhs7.preheader, %while.body12
%indvars.iv58 = phi i64 [ %7, %land.rhs7.preheader ], [ %indvars.iv.next59, %while.body12 ]
%arrayidx9 = getelementptr inbounds double, ptr %num, i64 %indvars.iv58
%8 = load double, ptr %arrayidx9, align 8, !tbaa !11
%cmp10 = fcmp ogt double %8, %p
br i1 %cmp10, label %while.body12, label %while.end13.loopexit.split.loop.exit63
while.body12: ; preds = %land.rhs7
%indvars.iv.next59 = add nsw i64 %indvars.iv58, -1
%cmp6.not.not = icmp sgt i64 %indvars.iv58, %2
br i1 %cmp6.not.not, label %land.rhs7, label %while.end13, !llvm.loop !18
while.end13.loopexit.split.loop.exit63: ; preds = %land.rhs7
%9 = trunc i64 %indvars.iv58 to i32
br label %while.end13
while.end13: ; preds = %while.body12, %while.end13.loopexit.split.loop.exit63, %while.end
%j.1.lcssa = phi i32 [ %j.054, %while.end ], [ %9, %while.end13.loopexit.split.loop.exit63 ], [ %3, %while.body12 ]
%cmp14 = icmp sgt i32 %i.1.lcssa, %j.1.lcssa
br i1 %cmp14, label %while.end23, label %if.end
if.end: ; preds = %while.end13
%idxprom15 = sext i32 %i.1.lcssa to i64
%arrayidx16 = getelementptr inbounds double, ptr %num, i64 %idxprom15
%10 = load double, ptr %arrayidx16, align 8, !tbaa !11
%idxprom17 = sext i32 %j.1.lcssa to i64
%arrayidx18 = getelementptr inbounds double, ptr %num, i64 %idxprom17
%11 = load double, ptr %arrayidx18, align 8, !tbaa !11
store double %11, ptr %arrayidx16, align 8, !tbaa !11
store double %10, ptr %arrayidx18, align 8, !tbaa !11
br label %while.cond1.preheader, !llvm.loop !19
while.end23: ; preds = %while.end13, %entry
%i.2 = phi i32 [ %start, %entry ], [ %i.1.lcssa, %while.end13 ]
ret i32 %i.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 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>
int compare (const void *a, const void *b)
{
if(*(intmax_t *)a - *(intmax_t *)b < 0)
return -1;
if(*(intmax_t *)a - *(intmax_t *)b > 0)
return 1;
return 0;
}
int main (void)
{
intmax_t N, v[50];
double ans = 0;
scanf("%jd", &N);
for (size_t i = 0; i < N; i++) {
scanf("%jd", &v[i]);
}
qsort(v, N, sizeof(intmax_t), compare);
ans = (v[0] + v[1]) / 2.0;
for (size_t i = 2; i < N; i++) {
ans = (ans + v[i]) / 2.0;
}
printf("%.6f\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138186/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138186/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%jd\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%.6f\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp2.not = icmp ne i64 %0, %1
%. = zext i1 %cmp2.not 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 i64, align 8
%v = alloca [50 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %v) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%cmp23.not = icmp eq i64 %0, 0
br i1 %cmp23.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i64 [ 0, %entry ], [ %7, %for.body ]
call void @qsort(ptr noundef nonnull %v, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @compare) #5
%1 = load i64, ptr %v, align 16, !tbaa !5
%arrayidx3 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 1
%2 = load i64, ptr %arrayidx3, align 8, !tbaa !5
%add = add nsw i64 %2, %1
%conv = sitofp i64 %add to double
%3 = load i64, ptr %N, align 8, !tbaa !5
%ans.025 = fmul double %conv, 5.000000e-01
%cmp626 = icmp ugt i64 %3, 2
br i1 %cmp626, label %for.body9.preheader, label %for.cond.cleanup8
for.body9.preheader: ; preds = %for.cond.cleanup
%4 = add i64 %3, -2
%5 = add i64 %3, -3
%xtraiter = and i64 %4, 3
%6 = icmp ult i64 %5, 3
br i1 %6, label %for.cond.cleanup8.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %4, -4
br label %for.body9
for.body: ; preds = %entry, %for.body
%i.024 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %i.024
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw i64 %i.024, 1
%7 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup8.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%ans.0.lcssa36.ph = phi double [ undef, %for.body9.preheader ], [ %ans.0.3, %for.body9 ]
%ans.028.unr = phi double [ %ans.025, %for.body9.preheader ], [ %ans.0.3, %for.body9 ]
%i4.027.unr = phi i64 [ 2, %for.body9.preheader ], [ %inc15.3, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup8, label %for.body9.epil
for.body9.epil: ; preds = %for.cond.cleanup8.loopexit.unr-lcssa, %for.body9.epil
%ans.028.epil = phi double [ %ans.0.epil, %for.body9.epil ], [ %ans.028.unr, %for.cond.cleanup8.loopexit.unr-lcssa ]
%i4.027.epil = phi i64 [ %inc15.epil, %for.body9.epil ], [ %i4.027.unr, %for.cond.cleanup8.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.cond.cleanup8.loopexit.unr-lcssa ]
%arrayidx10.epil = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %i4.027.epil
%8 = load i64, ptr %arrayidx10.epil, align 8, !tbaa !5
%conv11.epil = sitofp i64 %8 to double
%add12.epil = fadd double %ans.028.epil, %conv11.epil
%inc15.epil = add nuw i64 %i4.027.epil, 1
%ans.0.epil = fmul double %add12.epil, 5.000000e-01
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup8, label %for.body9.epil, !llvm.loop !11
for.cond.cleanup8: ; preds = %for.cond.cleanup8.loopexit.unr-lcssa, %for.body9.epil, %for.cond.cleanup
%ans.0.lcssa = phi double [ %ans.025, %for.cond.cleanup ], [ %ans.0.lcssa36.ph, %for.cond.cleanup8.loopexit.unr-lcssa ], [ %ans.0.epil, %for.body9.epil ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #5
ret i32 0
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%ans.028 = phi double [ %ans.025, %for.body9.preheader.new ], [ %ans.0.3, %for.body9 ]
%i4.027 = phi i64 [ 2, %for.body9.preheader.new ], [ %inc15.3, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx10 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %i4.027
%9 = load i64, ptr %arrayidx10, align 16, !tbaa !5
%conv11 = sitofp i64 %9 to double
%add12 = fadd double %ans.028, %conv11
%inc15 = or i64 %i4.027, 1
%ans.0 = fmul double %add12, 5.000000e-01
%arrayidx10.1 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %inc15
%10 = load i64, ptr %arrayidx10.1, align 8, !tbaa !5
%conv11.1 = sitofp i64 %10 to double
%add12.1 = fadd double %ans.0, %conv11.1
%inc15.1 = add nuw i64 %i4.027, 2
%ans.0.1 = fmul double %add12.1, 5.000000e-01
%arrayidx10.2 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %inc15.1
%11 = load i64, ptr %arrayidx10.2, align 16, !tbaa !5
%conv11.2 = sitofp i64 %11 to double
%add12.2 = fadd double %ans.0.1, %conv11.2
%inc15.2 = add nuw i64 %i4.027, 3
%ans.0.2 = fmul double %add12.2, 5.000000e-01
%arrayidx10.3 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %inc15.2
%12 = load i64, ptr %arrayidx10.3, align 8, !tbaa !5
%conv11.3 = sitofp i64 %12 to double
%add12.3 = fadd double %ans.0.2, %conv11.3
%inc15.3 = add nuw i64 %i4.027, 4
%ans.0.3 = fmul double %add12.3, 5.000000e-01
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond.cleanup8.loopexit.unr-lcssa, label %for.body9, !llvm.loop !13
}
; 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
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int i,j,n,m,k,a[50],b[50],c[50],d[50];
scanf("%d%d",&n,&m);
for(i=0;i<n;i++) scanf("%d%d",&a[i],&b[i]);
for(i=0;i<m;i++) scanf("%d%d",&c[i],&d[i]);
for(i=0;i<n;i++){
int r=4e8;
for(j=0;j<m;j++){
if(r>abs(a[i]-c[j])+abs(b[i]-d[j])){
r=abs(a[i]-c[j])+abs(b[i]-d[j]);
k=j;
}
}
printf("%d\n",k+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138229/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138229/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [50 x i32], align 16
%b = alloca [50 x i32], align 16
%c = alloca [50 x i32], align 16
%d = alloca [50 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %d) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp70 = icmp sgt i32 %0, 0
br i1 %cmp70, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp572 = icmp sgt i32 %2, 0
br i1 %cmp572, label %for.body6, label %for.cond15.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond15.preheader.loopexit: ; preds = %for.body6
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.cond4.preheader
%5 = phi i32 [ %.pre, %for.cond15.preheader.loopexit ], [ %1, %for.cond4.preheader ]
%cmp1678 = icmp sgt i32 %5, 0
br i1 %cmp1678, label %for.cond18.preheader, label %for.end49
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv82 = phi i64 [ %indvars.iv.next83, %for.body6 ], [ 0, %for.cond4.preheader ]
%arrayidx8 = getelementptr inbounds [50 x i32], ptr %c, i64 0, i64 %indvars.iv82
%arrayidx10 = getelementptr inbounds [50 x i32], ptr %d, i64 0, i64 %indvars.iv82
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx10)
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp5 = icmp slt i64 %indvars.iv.next83, %7
br i1 %cmp5, label %for.body6, label %for.cond15.preheader.loopexit, !llvm.loop !11
for.cond18.preheader: ; preds = %for.cond15.preheader, %for.end44
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.end44 ], [ 0, %for.cond15.preheader ]
%k.080 = phi i32 [ %k.1.lcssa, %for.end44 ], [ undef, %for.cond15.preheader ]
%8 = load i32, ptr %m, align 4, !tbaa !5
%cmp1974 = icmp sgt i32 %8, 0
br i1 %cmp1974, label %for.body20.lr.ph, label %for.end44
for.body20.lr.ph: ; preds = %for.cond18.preheader
%arrayidx22 = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %indvars.iv88
%9 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%arrayidx26 = getelementptr inbounds [50 x i32], ptr %b, i64 0, i64 %indvars.iv88
%10 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%wide.trip.count = zext i32 %8 to i64
br label %for.body20
for.body20: ; preds = %for.body20.lr.ph, %for.body20
%indvars.iv85 = phi i64 [ 0, %for.body20.lr.ph ], [ %indvars.iv.next86, %for.body20 ]
%r.077 = phi i32 [ 400000000, %for.body20.lr.ph ], [ %spec.select69, %for.body20 ]
%k.176 = phi i32 [ %k.080, %for.body20.lr.ph ], [ %spec.select, %for.body20 ]
%arrayidx24 = getelementptr inbounds [50 x i32], ptr %c, i64 0, i64 %indvars.iv85
%11 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%sub = sub nsw i32 %9, %11
%12 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%arrayidx28 = getelementptr inbounds [50 x i32], ptr %d, i64 0, i64 %indvars.iv85
%13 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%sub29 = sub nsw i32 %10, %13
%14 = call i32 @llvm.abs.i32(i32 %sub29, i1 true)
%add = add nuw nsw i32 %14, %12
%cmp30 = icmp sgt i32 %r.077, %add
%15 = trunc i64 %indvars.iv85 to i32
%spec.select = select i1 %cmp30, i32 %15, i32 %k.176
%spec.select69 = call i32 @llvm.smin.i32(i32 %r.077, i32 %add)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%exitcond.not = icmp eq i64 %indvars.iv.next86, %wide.trip.count
br i1 %exitcond.not, label %for.end44, label %for.body20, !llvm.loop !12
for.end44: ; preds = %for.body20, %for.cond18.preheader
%k.1.lcssa = phi i32 [ %k.080, %for.cond18.preheader ], [ %spec.select, %for.body20 ]
%add45 = add nsw i32 %k.1.lcssa, 1
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add45)
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp16 = icmp slt i64 %indvars.iv.next89, %17
br i1 %cmp16, label %for.cond18.preheader, label %for.end49, !llvm.loop !13
for.end49: ; preds = %for.end44, %for.cond15.preheader
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main()
{
int a, b, c, d, e;
int ZA[100];
scanf("%d%d", &a, &b);
for (c = 0; c < a; ++c)
scanf("%d", ZA + c);
for (c = 0; c < a; ++c)
ZA[c] = (ZA[c] + b - 1) / b;
d = 0;
for (c = a - 1; c >= 0; --c)
if (ZA[c] > d) {
d = ZA[c];
e = c;
}
printf("%d\n", e + 1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13828/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13828/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%ZA = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %ZA) #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
%cmp36 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp36)
br label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp338 = icmp sgt i32 %4, 0
call void @llvm.assume(i1 %cmp338)
%1 = load i32, ptr %b, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
%2 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i64 %2, 0
br i1 %3, label %for.cond11.preheader.unr-lcssa, label %for.cond2.preheader.new
for.cond2.preheader.new: ; preds = %for.cond2.preheader
%unroll_iter = and i64 %wide.trip.count, 2147483646
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %ZA, 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
%4 = load i32, ptr %a, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond11.preheader.unr-lcssa: ; preds = %for.body4, %for.cond2.preheader
%indvars.iv47.unr = phi i64 [ 0, %for.cond2.preheader ], [ %indvars.iv.next48.1, %for.body4 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond11.preheader, label %for.body4.epil
for.body4.epil: ; preds = %for.cond11.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [100 x i32], ptr %ZA, i64 0, i64 %indvars.iv47.unr
%6 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%add.epil = add i32 %6, -1
%sub.epil = add i32 %add.epil, %1
%div.epil = sdiv i32 %sub.epil, %1
store i32 %div.epil, ptr %arrayidx.epil, align 4, !tbaa !5
br label %for.cond11.preheader
for.cond11.preheader: ; preds = %for.cond11.preheader.unr-lcssa, %for.body4.epil
%7 = zext i32 %4 to i64
%xtraiter59 = and i64 %wide.trip.count, 1
%8 = icmp eq i64 %2, 0
br i1 %8, label %for.end20.loopexit.unr-lcssa, label %for.cond11.preheader.new
for.cond11.preheader.new: ; preds = %for.cond11.preheader
%unroll_iter62 = and i64 %wide.trip.count, 2147483646
br label %for.body13
for.body4: ; preds = %for.body4, %for.cond2.preheader.new
%indvars.iv47 = phi i64 [ 0, %for.cond2.preheader.new ], [ %indvars.iv.next48.1, %for.body4 ]
%niter = phi i64 [ 0, %for.cond2.preheader.new ], [ %niter.next.1, %for.body4 ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %ZA, i64 0, i64 %indvars.iv47
%9 = load i32, ptr %arrayidx, align 8, !tbaa !5
%add = add i32 %9, -1
%sub = add i32 %add, %1
%div = sdiv i32 %sub, %1
store i32 %div, ptr %arrayidx, align 8, !tbaa !5
%indvars.iv.next48 = or i64 %indvars.iv47, 1
%arrayidx.1 = getelementptr inbounds [100 x i32], ptr %ZA, i64 0, i64 %indvars.iv.next48
%10 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%add.1 = add i32 %10, -1
%sub.1 = add i32 %add.1, %1
%div.1 = sdiv i32 %sub.1, %1
store i32 %div.1, ptr %arrayidx.1, align 4, !tbaa !5
%indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 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.cond11.preheader.unr-lcssa, label %for.body4, !llvm.loop !11
for.body13: ; preds = %for.body13, %for.cond11.preheader.new
%indvars.iv50 = phi i64 [ %7, %for.cond11.preheader.new ], [ %indvars.iv.next51.1, %for.body13 ]
%e.043 = phi i32 [ undef, %for.cond11.preheader.new ], [ %spec.select35.1, %for.body13 ]
%d.042 = phi i32 [ 0, %for.cond11.preheader.new ], [ %spec.select.1, %for.body13 ]
%niter63 = phi i64 [ 0, %for.cond11.preheader.new ], [ %niter63.next.1, %for.body13 ]
%indvars.iv.next51 = add nsw i64 %indvars.iv50, -1
%indvars = trunc i64 %indvars.iv.next51 to i32
%idxprom14 = and i64 %indvars.iv.next51, 4294967295
%arrayidx15 = getelementptr inbounds [100 x i32], ptr %ZA, i64 0, i64 %idxprom14
%11 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %11, %d.042
%spec.select = call i32 @llvm.smax.i32(i32 %11, i32 %d.042)
%spec.select35 = select i1 %cmp16, i32 %indvars, i32 %e.043
%indvars.iv.next51.1 = add nsw i64 %indvars.iv50, -2
%indvars.1 = trunc i64 %indvars.iv.next51.1 to i32
%idxprom14.1 = and i64 %indvars.iv.next51.1, 4294967295
%arrayidx15.1 = getelementptr inbounds [100 x i32], ptr %ZA, i64 0, i64 %idxprom14.1
%12 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%cmp16.1 = icmp sgt i32 %12, %spec.select
%spec.select.1 = call i32 @llvm.smax.i32(i32 %12, i32 %spec.select)
%spec.select35.1 = select i1 %cmp16.1, i32 %indvars.1, i32 %spec.select35
%niter63.next.1 = add i64 %niter63, 2
%niter63.ncmp.1.not = icmp eq i64 %niter63.next.1, %unroll_iter62
br i1 %niter63.ncmp.1.not, label %for.end20.loopexit.unr-lcssa, label %for.body13, !llvm.loop !12
for.end20.loopexit.unr-lcssa: ; preds = %for.body13, %for.cond11.preheader
%indvars.iv50.unr = phi i64 [ %7, %for.cond11.preheader ], [ %indvars.iv.next51.1, %for.body13 ]
%e.043.unr = phi i32 [ undef, %for.cond11.preheader ], [ %spec.select35.1, %for.body13 ]
%d.042.unr = phi i32 [ 0, %for.cond11.preheader ], [ %spec.select.1, %for.body13 ]
%lcmp.mod60.not = icmp eq i64 %xtraiter59, 0
br i1 %lcmp.mod60.not, label %for.end20.loopexit, label %for.body13.epil
for.body13.epil: ; preds = %for.end20.loopexit.unr-lcssa
%indvars.iv.next51.epil = add nsw i64 %indvars.iv50.unr, -1
%indvars.epil = trunc i64 %indvars.iv.next51.epil to i32
%idxprom14.epil = and i64 %indvars.iv.next51.epil, 4294967295
%arrayidx15.epil = getelementptr inbounds [100 x i32], ptr %ZA, i64 0, i64 %idxprom14.epil
%13 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5
%cmp16.epil = icmp sgt i32 %13, %d.042.unr
%spec.select35.epil = select i1 %cmp16.epil, i32 %indvars.epil, i32 %e.043.unr
br label %for.end20.loopexit
for.end20.loopexit: ; preds = %for.end20.loopexit.unr-lcssa, %for.body13.epil
%spec.select35.lcssa = phi i32 [ %e.043.unr, %for.end20.loopexit.unr-lcssa ], [ %spec.select35.epil, %for.body13.epil ]
%14 = add nsw i32 %spec.select35.lcssa, 1
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %ZA) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include"stdlib.h"
int main(void){
int N,M;
scanf("%d %d",&N,&M);
int a[N],b[N];
int ans[N];
for(int i=0;i<N;i++)scanf("%d %d",&a[i],&b[i]);
int c[M],d[M];
for(int i=0;i<M;i++)scanf("%d %d",&c[i],&d[i]);
for(int i=0;i<N;i++){
int minkyori=500000000;
for(int j=0;j<M;j++){
if(abs(a[i]-c[j])+abs(b[i]-d[j])<minkyori){ans[i]=j;minkyori=abs(a[i]-c[j])+abs(b[i]-d[j]);}
}
}
for(int i=0;i<N;i++)printf("%d\n",ans[i]+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138322/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138322/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%vla2 = alloca i32, i64 %4, align 16
%cmp91 = icmp sgt i32 %3, 0
br i1 %cmp91, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%5 = phi i32 [ %3, %entry ], [ %8, %for.body ]
%6 = load i32, ptr %M, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla6 = alloca i32, i64 %7, align 16
%vla7 = alloca i32, i64 %7, align 16
%cmp1093 = icmp sgt i32 %6, 0
br i1 %cmp1093, label %for.body12, label %for.cond22.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%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.cond.cleanup, !llvm.loop !9
for.cond22.preheader.loopexit: ; preds = %for.body12
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.cond22.preheader.loopexit, %for.cond.cleanup
%10 = phi i32 [ %5, %for.cond.cleanup ], [ %.pre, %for.cond22.preheader.loopexit ]
%.lcssa = phi i32 [ %6, %for.cond.cleanup ], [ %18, %for.cond22.preheader.loopexit ]
%cmp2398 = icmp sgt i32 %10, 0
br i1 %cmp2398, label %for.cond26.preheader.lr.ph, label %for.cond.cleanup62
for.cond26.preheader.lr.ph: ; preds = %for.cond22.preheader
%cmp2795 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2795, label %for.cond26.preheader.us.preheader, label %for.body63.preheader
for.cond26.preheader.us.preheader: ; preds = %for.cond26.preheader.lr.ph
%wide.trip.count114 = zext i32 %10 to i64
%wide.trip.count = zext i32 %.lcssa to i64
br label %for.cond26.preheader.us
for.cond26.preheader.us: ; preds = %for.cond26.preheader.us.preheader, %for.cond26.for.cond.cleanup28_crit_edge.us
%indvars.iv111 = phi i64 [ 0, %for.cond26.preheader.us.preheader ], [ %indvars.iv.next112, %for.cond26.for.cond.cleanup28_crit_edge.us ]
%arrayidx31.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv111
%11 = load i32, ptr %arrayidx31.us, align 4, !tbaa !5
%arrayidx35.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv111
%12 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5
%arrayidx41.us = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv111
br label %for.body29.us
for.body29.us: ; preds = %for.cond26.preheader.us, %for.inc53.us
%indvars.iv108 = phi i64 [ 0, %for.cond26.preheader.us ], [ %indvars.iv.next109, %for.inc53.us ]
%minkyori.096.us = phi i32 [ 500000000, %for.cond26.preheader.us ], [ %minkyori.1.us, %for.inc53.us ]
%arrayidx33.us = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv108
%13 = load i32, ptr %arrayidx33.us, align 4, !tbaa !5
%sub.us = sub nsw i32 %11, %13
%14 = call i32 @llvm.abs.i32(i32 %sub.us, i1 true)
%arrayidx37.us = getelementptr inbounds i32, ptr %vla7, i64 %indvars.iv108
%15 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5
%sub38.us = sub nsw i32 %12, %15
%16 = call i32 @llvm.abs.i32(i32 %sub38.us, i1 true)
%add.us = add nuw nsw i32 %16, %14
%cmp39.us = icmp slt i32 %add.us, %minkyori.096.us
br i1 %cmp39.us, label %if.then.us, label %for.inc53.us
if.then.us: ; preds = %for.body29.us
%17 = trunc i64 %indvars.iv108 to i32
store i32 %17, ptr %arrayidx41.us, align 4, !tbaa !5
br label %for.inc53.us
for.inc53.us: ; preds = %if.then.us, %for.body29.us
%minkyori.1.us = phi i32 [ %add.us, %if.then.us ], [ %minkyori.096.us, %for.body29.us ]
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count
br i1 %exitcond.not, label %for.cond26.for.cond.cleanup28_crit_edge.us, label %for.body29.us, !llvm.loop !11
for.cond26.for.cond.cleanup28_crit_edge.us: ; preds = %for.inc53.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.cond60.preheader, label %for.cond26.preheader.us, !llvm.loop !12
for.body12: ; preds = %for.cond.cleanup, %for.body12
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body12 ], [ 0, %for.cond.cleanup ]
%arrayidx14 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv105
%arrayidx16 = getelementptr inbounds i32, ptr %vla7, i64 %indvars.iv105
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx14, ptr noundef nonnull %arrayidx16)
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%18 = load i32, ptr %M, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp10 = icmp slt i64 %indvars.iv.next106, %19
br i1 %cmp10, label %for.body12, label %for.cond22.preheader.loopexit, !llvm.loop !13
for.cond60.preheader: ; preds = %for.cond26.for.cond.cleanup28_crit_edge.us
br i1 %cmp2398, label %for.body63.preheader, label %for.cond.cleanup62
for.body63.preheader: ; preds = %for.cond26.preheader.lr.ph, %for.cond60.preheader
br label %for.body63
for.cond.cleanup62: ; preds = %for.body63, %for.cond22.preheader, %for.cond60.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
for.body63: ; preds = %for.body63.preheader, %for.body63
%indvars.iv116 = phi i64 [ %indvars.iv.next117, %for.body63 ], [ 0, %for.body63.preheader ]
%arrayidx65 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv116
%20 = load i32, ptr %arrayidx65, align 4, !tbaa !5
%add66 = add nsw i32 %20, 1
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add66)
%indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
%21 = load i32, ptr %N, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp61 = icmp slt i64 %indvars.iv.next117, %22
br i1 %cmp61, label %for.body63, label %for.cond.cleanup62, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree 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 = distinct !{!14, !10}
|
#include <stdio.h>
typedef struct{
int x;
int y;
}Stu;
typedef struct{
int x;
int y;
}Cp;
int abs(int num)
{
if(num < 0)
return -1*num;
else
return num;
}
int main(void)
{
int n, m;
Stu stu[50];
Cp cp[50];
int i, j;
scanf("%d %d", &n, &m);
for(i=0; i<n; i++)
scanf("%d %d", &stu[i].x, &stu[i].y);
for(i=0; i<m; i++)
scanf("%d %d", &cp[i].x, &cp[i].y);
for(i=0; i<n; i++){
int best_cp = 1;
int mht = abs(stu[i].x-cp[0].x)+abs(stu[i].y-cp[0].y); //マンハッタン距離
for(j=1; j<m; j++){
if( mht > abs(stu[i].x-cp[j].x)+abs(stu[i].y-cp[j].y) ){
mht = abs(stu[i].x-cp[j].x)+abs(stu[i].y-cp[j].y);
best_cp = j+1;
}
}
printf("%d\n", best_cp);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138366/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138366/source.c"
target datalayout = "e-m:e-p270: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.Stu = type { i32, i32 }
%struct.Cp = type { i32, i32 }
@.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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @abs(i32 noundef %num) local_unnamed_addr #0 {
entry:
%retval.0 = tail call i32 @llvm.abs.i32(i32 %num, i1 true)
ret i32 %retval.0
}
; 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
%stu = alloca [50 x %struct.Stu], align 16
%cp = alloca [50 x %struct.Cp], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %stu) #6
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %cp) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp95 = icmp sgt i32 %0, 0
br i1 %cmp95, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp597 = icmp sgt i32 %2, 0
br i1 %cmp597, label %for.body6, label %for.cond17.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x %struct.Stu], ptr %stu, i64 0, i64 %indvars.iv
%y = getelementptr inbounds [50 x %struct.Stu], ptr %stu, i64 0, i64 %indvars.iv, i32 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %y)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond17.preheader.loopexit: ; preds = %for.body6
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.cond17.preheader.loopexit, %for.cond4.preheader
%5 = phi i32 [ %.pre, %for.cond17.preheader.loopexit ], [ %1, %for.cond4.preheader ]
%cmp18103 = icmp sgt i32 %5, 0
br i1 %cmp18103, label %for.body19.lr.ph, label %for.end72
for.body19.lr.ph: ; preds = %for.cond17.preheader
%y29 = getelementptr inbounds %struct.Cp, ptr %cp, i64 0, i32 1
br label %for.body19
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body6 ], [ 0, %for.cond4.preheader ]
%arrayidx8 = getelementptr inbounds [50 x %struct.Cp], ptr %cp, i64 0, i64 %indvars.iv106
%y12 = getelementptr inbounds [50 x %struct.Cp], ptr %cp, i64 0, i64 %indvars.iv106, i32 1
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %y12)
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%6 = load i32, ptr %m, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp5 = icmp slt i64 %indvars.iv.next107, %7
br i1 %cmp5, label %for.body6, label %for.cond17.preheader.loopexit, !llvm.loop !11
for.body19: ; preds = %for.body19.lr.ph, %for.end68
%indvars.iv112 = phi i64 [ 0, %for.body19.lr.ph ], [ %indvars.iv.next113, %for.end68 ]
%arrayidx21 = getelementptr inbounds [50 x %struct.Stu], ptr %stu, i64 0, i64 %indvars.iv112
%8 = load i32, ptr %arrayidx21, align 8, !tbaa !12
%y27 = getelementptr inbounds [50 x %struct.Stu], ptr %stu, i64 0, i64 %indvars.iv112, i32 1
%9 = load i32, ptr %y27, align 4, !tbaa !14
%10 = load i32, ptr %m, align 4, !tbaa !5
%cmp3299 = icmp sgt i32 %10, 1
br i1 %cmp3299, label %for.body33.preheader, label %for.end68
for.body33.preheader: ; preds = %for.body19
%11 = load i32, ptr %y29, align 4, !tbaa !14
%sub30 = sub nsw i32 %9, %11
%12 = call i32 @llvm.abs.i32(i32 %sub30, i1 true)
%13 = load i32, ptr %cp, align 16, !tbaa !12
%sub = sub nsw i32 %8, %13
%14 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%add = add nuw nsw i32 %12, %14
%wide.trip.count = zext i32 %10 to i64
br label %for.body33
for.body33: ; preds = %for.body33.preheader, %for.body33
%indvars.iv109 = phi i64 [ 1, %for.body33.preheader ], [ %indvars.iv.next110, %for.body33 ]
%mht.0102 = phi i32 [ %add, %for.body33.preheader ], [ %spec.select94, %for.body33 ]
%best_cp.0101 = phi i32 [ 1, %for.body33.preheader ], [ %spec.select, %for.body33 ]
%arrayidx38 = getelementptr inbounds [50 x %struct.Cp], ptr %cp, i64 0, i64 %indvars.iv109
%15 = load i32, ptr %arrayidx38, align 8, !tbaa !12
%sub40 = sub nsw i32 %8, %15
%16 = call i32 @llvm.abs.i32(i32 %sub40, i1 true)
%y46 = getelementptr inbounds [50 x %struct.Cp], ptr %cp, i64 0, i64 %indvars.iv109, i32 1
%17 = load i32, ptr %y46, align 4, !tbaa !14
%sub47 = sub nsw i32 %9, %17
%18 = call i32 @llvm.abs.i32(i32 %sub47, i1 true)
%add48 = add nuw nsw i32 %18, %16
%cmp49 = icmp sgt i32 %mht.0102, %add48
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
%19 = trunc i64 %indvars.iv.next110 to i32
%spec.select = select i1 %cmp49, i32 %19, i32 %best_cp.0101
%spec.select94 = call i32 @llvm.smin.i32(i32 %mht.0102, i32 %add48)
%exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count
br i1 %exitcond.not, label %for.end68, label %for.body33, !llvm.loop !15
for.end68: ; preds = %for.body33, %for.body19
%best_cp.0.lcssa = phi i32 [ 1, %for.body19 ], [ %spec.select, %for.body33 ]
%call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %best_cp.0.lcssa)
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp18 = icmp slt i64 %indvars.iv.next113, %21
br i1 %cmp18, label %for.body19, label %for.end72, !llvm.loop !16
for.end72: ; preds = %for.end68, %for.cond17.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %cp) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %stu) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 0}
!13 = !{!"", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!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);
int turn = 1;
while(A > 0 && C > 0){
if(turn == 1){
C = C - B;
}else if(turn == -1){
A = A - D;
}
turn = -turn;
}
if( A > 0 ){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138409/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138409/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%A.promoted = load i32, ptr %A, align 4, !tbaa !5
%C.promoted = load i32, ptr %C, align 4
%cmp22 = icmp sgt i32 %A.promoted, 0
%cmp123 = icmp sgt i32 %C.promoted, 0
%0 = select i1 %cmp22, i1 %cmp123, i1 false
br i1 %0, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %D, align 4
%2 = load i32, ptr %B, align 4
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end6
%turn.026 = phi i32 [ 1, %while.body.lr.ph ], [ %sub7, %if.end6 ]
%sub51925 = phi i32 [ %A.promoted, %while.body.lr.ph ], [ %sub518, %if.end6 ]
%sub2124 = phi i32 [ %C.promoted, %while.body.lr.ph ], [ %sub20, %if.end6 ]
switch i32 %turn.026, label %if.end6 [
i32 1, label %if.then
i32 -1, label %if.then4
]
if.then: ; preds = %while.body
%sub = sub nsw i32 %sub2124, %2
store i32 %sub, ptr %C, align 4, !tbaa !5
br label %if.end6
if.then4: ; preds = %while.body
%sub5 = sub nsw i32 %sub51925, %1
store i32 %sub5, ptr %A, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %while.body, %if.then4, %if.then
%sub20 = phi i32 [ %sub2124, %while.body ], [ %sub2124, %if.then4 ], [ %sub, %if.then ]
%sub518 = phi i32 [ %sub51925, %while.body ], [ %sub5, %if.then4 ], [ %sub51925, %if.then ]
%sub7 = sub nsw i32 0, %turn.026
%cmp = icmp sgt i32 %sub518, 0
%cmp1 = icmp sgt i32 %sub20, 0
%3 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %3, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end6, %entry
%cmp.lcssa = phi i1 [ %cmp22, %entry ], [ %cmp, %if.end6 ]
%str.3.str = select i1 %cmp.lcssa, 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 %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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int A,B,C,D;
scanf("%d%d%d%d",&A,&B,&C,&D);
int a=A/D;
int b=A%D;
int c=C/B;
int d=C%B;
if(b!=0){
a=a+1;
}
if(d!=0){
c=c+1;
}
if(a<c){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138452/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138452/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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) #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 %D, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%2 = load i32, ptr %C, align 4, !tbaa !5
%3 = load i32, ptr %B, align 4, !tbaa !5
%div1 = sdiv i32 %2, %3
%rem2 = srem i32 %2, %3
%cmp.not = icmp ne i32 %rem, 0
%add = zext i1 %cmp.not to i32
%spec.select = add nsw i32 %div, %add
%cmp3.not = icmp ne i32 %rem2, 0
%add5 = zext i1 %cmp3.not to i32
%c.0 = add nsw i32 %div1, %add5
%cmp7 = icmp slt i32 %spec.select, %c.0
%str.3.str = select i1 %cmp7, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 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 main(void)
{
int flag=0;
int A,B,C,D;
scanf("%d %d %d %d",&A,&B,&C,&D);
while(A>0)
{
C=C-B;
if(C<=0){
flag=1;
break;
}
A=A-D;
}
if(flag)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138496/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138496/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%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)
%.pr = load i32, ptr %A, align 4, !tbaa !5
%cmp8 = icmp slt i32 %.pr, 1
br i1 %cmp8, label %if.end6, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%C.promoted = load i32, ptr %C, align 4, !tbaa !5
%0 = load i32, ptr %B, align 4, !tbaa !5
%1 = load i32, ptr %D, align 4
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end
%2 = phi i32 [ %.pr, %while.body.lr.ph ], [ %sub2, %if.end ]
%sub79 = phi i32 [ %C.promoted, %while.body.lr.ph ], [ %sub, %if.end ]
%sub = sub nsw i32 %sub79, %0
%cmp1 = icmp slt i32 %sub, 1
br i1 %cmp1, label %if.then3, label %if.end
if.end: ; preds = %while.body
%sub2 = sub nsw i32 %2, %1
store i32 %sub2, ptr %A, align 4, !tbaa !5
%cmp = icmp slt i32 %sub2, 1
br i1 %cmp, label %while.cond.if.else_crit_edge, label %while.body, !llvm.loop !9
if.then3: ; preds = %while.body
store i32 %sub, ptr %C, align 4, !tbaa !5
br label %if.end6
while.cond.if.else_crit_edge: ; preds = %if.end
store i32 %sub, ptr %C, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %entry, %while.cond.if.else_crit_edge, %if.then3
%.str.2.sink = phi ptr [ @.str.1, %if.then3 ], [ @.str.2, %while.cond.if.else_crit_edge ], [ @.str.2, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a,b,c,d,i;
scanf("%d%d%d%d",&a,&b,&c,&d);
for(i=2;i<104;i++){
c-=b;
if(c<=0){ puts("Yes");break;}
a-=d;
if(a<=0){ puts("No");break;}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138546/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138546/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%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 %b, align 4, !tbaa !5
%c.promoted = load i32, ptr %c, align 4, !tbaa !5
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4
br label %for.body
for.cond: ; preds = %if.end
%sub.1 = sub nsw i32 %sub, %0
%cmp1.1 = icmp slt i32 %sub.1, 1
br i1 %cmp1.1, label %for.end.sink.split, label %if.end.1
if.end.1: ; preds = %for.cond
%sub3.1 = sub nsw i32 %sub3, %1
store i32 %sub3.1, ptr %a, align 4, !tbaa !5
%cmp4.1 = icmp slt i32 %sub3.1, 1
br i1 %cmp4.1, label %for.end.sink.split, label %for.cond.1
for.cond.1: ; preds = %if.end.1
%sub.2 = sub nsw i32 %sub.1, %0
%cmp1.2 = icmp slt i32 %sub.2, 1
br i1 %cmp1.2, label %for.end.sink.split, label %if.end.2
if.end.2: ; preds = %for.cond.1
%sub3.2 = sub nsw i32 %sub3.1, %1
store i32 %sub3.2, ptr %a, align 4, !tbaa !5
%cmp4.2 = icmp slt i32 %sub3.2, 1
br i1 %cmp4.2, label %for.end.sink.split, label %for.cond.2
for.cond.2: ; preds = %if.end.2
%inc.2 = add nuw nsw i32 %i.014, 3
%exitcond.not.2 = icmp eq i32 %inc.2, 104
br i1 %exitcond.not.2, label %for.end, label %for.body, !llvm.loop !9
for.body: ; preds = %for.cond.2, %entry
%i.014 = phi i32 [ 2, %entry ], [ %inc.2, %for.cond.2 ]
%sub913 = phi i32 [ %c.promoted, %entry ], [ %sub.2, %for.cond.2 ]
%sub31112 = phi i32 [ %a.promoted, %entry ], [ %sub3.2, %for.cond.2 ]
%sub = sub nsw i32 %sub913, %0
%cmp1 = icmp slt i32 %sub, 1
br i1 %cmp1, label %for.end.sink.split, label %if.end
if.end: ; preds = %for.body
%sub3 = sub nsw i32 %sub31112, %1
store i32 %sub3, ptr %a, align 4, !tbaa !5
%cmp4 = icmp slt i32 %sub3, 1
br i1 %cmp4, label %for.end.sink.split, label %for.cond
for.end.sink.split: ; preds = %if.end.2, %for.cond.1, %if.end.1, %for.cond, %if.end, %for.body
%sub.lcssa = phi i32 [ %sub, %if.end ], [ %sub, %for.body ], [ %sub.1, %for.cond ], [ %sub.1, %if.end.1 ], [ %sub.2, %for.cond.1 ], [ %sub.2, %if.end.2 ]
%.str.2.sink = phi ptr [ @.str.2, %if.end ], [ @.str.1, %for.body ], [ @.str.1, %for.cond ], [ @.str.2, %if.end.1 ], [ @.str.1, %for.cond.1 ], [ @.str.2, %if.end.2 ]
store i32 %sub.lcssa, ptr %c, align 4, !tbaa !5
%call6 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
br label %for.end
for.end: ; preds = %for.cond.2, %for.end.sink.split
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int N,M,arr,temp,i,rem;
int max=1,index=-1;
scanf("%d %d",&N,&M);
for(i=0;i<N;i++){
scanf("%d",&arr);
temp = (arr+M-1)/M;
if(max<temp){
max=temp;
index=i+1;
}
else if(max==temp)
{
index=i+1;
}
}
if(index==-1)
index=N;
printf("%d\n",index);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13859/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13859/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%arr = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %arr) #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
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end.thread
for.body: ; preds = %entry, %for.body
%index.023 = phi i32 [ %index.1.fr, %for.body ], [ -1, %entry ]
%max.022 = phi i32 [ %max.1, %for.body ], [ 1, %entry ]
%i.021 = phi i32 [ %add3, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arr)
%1 = load i32, ptr %arr, align 4, !tbaa !5
%2 = load i32, ptr %M, align 4, !tbaa !5
%add = add i32 %1, -1
%sub = add i32 %add, %2
%div = sdiv i32 %sub, %2
%add3 = add nuw nsw i32 %i.021, 1
%max.1 = call i32 @llvm.smax.i32(i32 %max.022, i32 %div)
%.not = icmp sgt i32 %max.022, %div
%index.1 = select i1 %.not, i32 %index.023, i32 %add3
%index.1.fr = freeze i32 %index.1
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %add3, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%cmp8 = icmp eq i32 %index.1.fr, -1
br i1 %cmp8, label %for.end.thread, label %4
for.end.thread: ; preds = %entry, %for.end
%.lcssa30 = phi i32 [ %3, %for.end ], [ %0, %entry ]
br label %4
4: ; preds = %for.end, %for.end.thread
%5 = phi i32 [ %.lcssa30, %for.end.thread ], [ %index.1.fr, %for.end ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %arr) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
long i,n,m;
long a[1000],b[1000];
scanf("%d%d",&n,&m);
long temp=0;
long temp1;
for (i=0;i<n;i++){
scanf("%d",&a[i]);
b[i]=(a[i]-1)/m;
if (b[i]>=temp)
{
temp=b[i];temp1=i;
}
}
printf("%d",temp1+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13864/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13864/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%a = alloca [1000 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp16 = icmp sgt i64 %0, 0
call void @llvm.assume(i1 %cmp16)
br label %for.body
for.body: ; preds = %entry, %for.body
%temp1.019 = phi i64 [ %spec.select15, %for.body ], [ undef, %entry ]
%temp.018 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ]
%i.017 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i64], ptr %a, i64 0, i64 %i.017
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%sub = add nsw i64 %1, -1
%2 = load i64, ptr %m, align 8, !tbaa !5
%div = sdiv i64 %sub, %2
%cmp5.not = icmp slt i64 %div, %temp.018
%spec.select = call i64 @llvm.smax.i64(i64 %div, i64 %temp.018)
%spec.select15 = select i1 %cmp5.not, i64 %temp1.019, i64 %i.017
%inc = add nuw nsw i64 %i.017, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = add nsw i64 %spec.select15, 1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4)
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c,d;
int count = 0;
scanf("%d %d %d %d",&a,&b,&c,&d);
do{
if( count % 2 == 0 ){
c = c - b;
}else{
a = a - d;
}
//printf("%d %d %d\n",a,c,count);
count++;
}while( a > 0 && c > 0 );
if( a > c ){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138683/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138683/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%c.promoted = load i32, ptr %c, align 4
%0 = load i32, ptr %d, align 4
%1 = load i32, ptr %b, align 4
br label %do.body
do.body: ; preds = %if.end, %entry
%2 = phi i32 [ %c.promoted, %entry ], [ %4, %if.end ]
%3 = phi i32 [ %a.promoted, %entry ], [ %5, %if.end ]
%count.0 = phi i32 [ 0, %entry ], [ %inc, %if.end ]
%rem = and i32 %count.0, 1
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %do.body
%sub = sub nsw i32 %2, %1
store i32 %sub, ptr %c, align 4, !tbaa !5
br label %if.end
if.else: ; preds = %do.body
%sub1 = sub nsw i32 %3, %0
store i32 %sub1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
%4 = phi i32 [ %2, %if.else ], [ %sub, %if.then ]
%5 = phi i32 [ %sub1, %if.else ], [ %3, %if.then ]
%inc = add nuw nsw i32 %count.0, 1
%cmp2 = icmp sgt i32 %5, 0
%cmp3 = icmp sgt i32 %4, 0
%6 = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %6, label %do.body, label %do.end, !llvm.loop !9
do.end: ; preds = %if.end
%cmp4 = icmp sgt i32 %5, %4
%str.3.str = select i1 %cmp4, 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 %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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int A,B,C,D;
int judge; //勝利判定
int count; //ターンカウント
scanf("%d %d %d %d",&A, &B, &C, &D);
judge = 0;
count = 2;
while(judge == 0){
if(count % 2 == 0) //高橋の攻撃
{
C = C - B;
if(C <= 0)
judge = 1;
}
else //青木の攻撃
{
A = A - D;
if(A <= 0)
judge = 2;
}
count += 1;
}
if(judge == 1) //高橋の勝利
printf("Yes\n");
else if(judge == 2) //青木の勝利
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138726/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138726/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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)
%A.promoted = load i32, ptr %A, align 4, !tbaa !5
%C.promoted = load i32, ptr %C, align 4, !tbaa !5
%0 = load i32, ptr %D, align 4
%1 = load i32, ptr %B, align 4
br label %while.cond
while.cond: ; preds = %if.end8, %entry
%sub26 = phi i32 [ %C.promoted, %entry ], [ %sub25, %if.end8 ]
%sub424 = phi i32 [ %A.promoted, %entry ], [ %sub423, %if.end8 ]
%judge.0 = phi i32 [ 0, %entry ], [ %judge.1, %if.end8 ]
%count.0 = phi i32 [ 2, %entry ], [ %add, %if.end8 ]
switch i32 %judge.0, label %if.end17 [
i32 0, label %while.body
i32 1, label %if.end17.sink.split
i32 2, label %if.end17.sink.split.loopexit27
]
while.body: ; preds = %while.cond
%rem = and i32 %count.0, 1
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.then, label %if.else
if.then: ; preds = %while.body
%sub = sub nsw i32 %sub26, %1
store i32 %sub, ptr %C, align 4, !tbaa !5
%cmp2 = icmp slt i32 %sub, 1
%spec.select = zext i1 %cmp2 to i32
br label %if.end8
if.else: ; preds = %while.body
%sub4 = sub nsw i32 %sub424, %0
store i32 %sub4, ptr %A, align 4, !tbaa !5
%cmp5.inv = icmp sgt i32 %sub4, 0
%spec.select22 = select i1 %cmp5.inv, i32 0, i32 2
br label %if.end8
if.end8: ; preds = %if.else, %if.then
%sub25 = phi i32 [ %sub, %if.then ], [ %sub26, %if.else ]
%sub423 = phi i32 [ %sub424, %if.then ], [ %sub4, %if.else ]
%judge.1 = phi i32 [ %spec.select, %if.then ], [ %spec.select22, %if.else ]
%add = add nuw nsw i32 %count.0, 1
br label %while.cond, !llvm.loop !9
if.end17.sink.split.loopexit27: ; preds = %while.cond
br label %if.end17.sink.split
if.end17.sink.split: ; preds = %while.cond, %if.end17.sink.split.loopexit27
%str.sink = phi ptr [ @str, %if.end17.sink.split.loopexit27 ], [ @str.3, %while.cond ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %if.end17
if.end17: ; preds = %while.cond, %if.end17.sink.split
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int min(int a, int b)
{
if (a < b)return a;
else return b;
}
int main()
{
int q;
scanf("%d", &q);
int i;
int c, m, x;
int ans;
for (i = 0; i < q; i++)
{
scanf("%d %d %d", &c, &m, &x);
if (min(c, m) < x)
printf("%d\n", min(c, m));
else
{
c -= x;
m -= x;
ans = x;
int x1, x2, x3;
x1 = 0;
x3 = c + m;
while (x3 - x1 > 1)
{
x2 = (x1 + x3) / 2;
if (c >= x2 && m >= x2 && c + m - 2 * x2 >= x2)
x1 = x2;
else
x3 = x2;
}
ans += x1;
printf("%d\n", ans);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13877/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13877/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%q = alloca i32, align 4
%c = alloca i32, align 4
%m = alloca i32, align 4
%x = alloca i32, align 4
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 %q)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp37 = icmp sgt i32 %0, 0
br i1 %cmp37, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.038 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %m, ptr noundef nonnull %x)
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %m, align 4, !tbaa !5
%a.b.i = call i32 @llvm.smin.i32(i32 %1, i32 %2)
%3 = load i32, ptr %x, align 4, !tbaa !5
%cmp3 = icmp slt i32 %a.b.i, %3
br i1 %cmp3, label %for.inc, label %if.else
if.else: ; preds = %for.body
%sub = sub nsw i32 %1, %3
store i32 %sub, ptr %c, align 4, !tbaa !5
%sub6 = sub nsw i32 %2, %3
%sub6.fr = freeze i32 %sub6
store i32 %sub6.fr, ptr %m, align 4, !tbaa !5
%add = add nsw i32 %sub, %sub6.fr
%invariant.smin = call i32 @llvm.smin.i32(i32 %sub, i32 %sub6.fr)
%cmp834 = icmp sgt i32 %add, 1
br i1 %cmp834, label %while.body, label %while.end
while.body: ; preds = %if.else, %if.end
%x3.036 = phi i32 [ %x3.1, %if.end ], [ %add, %if.else ]
%x1.035 = phi i32 [ %x1.1, %if.end ], [ 0, %if.else ]
%add9 = add nsw i32 %x3.036, %x1.035
%div = sdiv i32 %add9, 2
%or.cond = icmp sgt i32 %div, %invariant.smin
br i1 %or.cond, label %if.else17, label %land.lhs.true12
land.lhs.true12: ; preds = %while.body
%mul = shl nsw i32 %div, 1
%sub14 = sub nsw i32 %add, %mul
%cmp15.not = icmp slt i32 %sub14, %div
br i1 %cmp15.not, label %if.else17, label %if.end
if.else17: ; preds = %land.lhs.true12, %while.body
br label %if.end
if.end: ; preds = %land.lhs.true12, %if.else17
%x1.1 = phi i32 [ %x1.035, %if.else17 ], [ %div, %land.lhs.true12 ]
%x3.1 = phi i32 [ %div, %if.else17 ], [ %x3.036, %land.lhs.true12 ]
%sub7 = sub nsw i32 %x3.1, %x1.1
%cmp8 = icmp sgt i32 %sub7, 1
br i1 %cmp8, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end, %if.else
%x1.0.lcssa = phi i32 [ 0, %if.else ], [ %x1.1, %if.end ]
%add18 = add nsw i32 %x1.0.lcssa, %3
br label %for.inc
for.inc: ; preds = %for.body, %while.end
%a.b.i.sink = phi i32 [ %add18, %while.end ], [ %a.b.i, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a.b.i.sink)
%inc = add nuw nsw i32 %i.038, 1
%4 = load i32, ptr %q, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int a,b,c,d;
int x,y;
scanf("%d%d%d%d",&a,&b,&c,&d);
while(1)
{
c-=b;
if(c<=0)
{
printf("Yes\n");
break;
}
a-=d;
if(a<=0)
{
printf("No\n");
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138856/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138856/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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 %b, align 4, !tbaa !5
%c.promoted = load i32, ptr %c, align 4, !tbaa !5
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4
br label %while.cond
while.cond: ; preds = %if.end, %entry
%sub210 = phi i32 [ %sub2, %if.end ], [ %a.promoted, %entry ]
%sub8 = phi i32 [ %sub, %if.end ], [ %c.promoted, %entry ]
%sub = sub nsw i32 %sub8, %0
%cmp = icmp slt i32 %sub, 1
br i1 %cmp, label %while.end, label %if.end
if.end: ; preds = %while.cond
%sub2 = sub nsw i32 %sub210, %1
store i32 %sub2, ptr %a, align 4, !tbaa !5
%cmp3 = icmp slt i32 %sub2, 1
br i1 %cmp3, label %while.end, label %while.cond
while.end: ; preds = %if.end, %while.cond
%str.sink = phi ptr [ @str.3, %while.cond ], [ @str, %if.end ]
store i32 %sub, ptr %c, align 4, !tbaa !5
%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 main() {
int a;
scanf("%d", &a);
while(a--) {
int n, s=0, b;
scanf("%d", &n);
for(int i=1; i<=n; i++)
scanf("%d", &b), s|=b;
printf("%d\n", s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1389/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%n = alloca i32, align 4
%b = 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
%dec9 = add nsw i32 %0, -1
store i32 %dec9, ptr %a, align 4, !tbaa !5
%tobool.not10 = icmp eq i32 %0, 0
br i1 %tobool.not10, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not6 = icmp slt i32 %1, 1
br i1 %cmp.not6, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %while.body
%s.0.lcssa = phi i32 [ 0, %while.body ], [ %or, %for.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
%2 = load i32, ptr %a, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
for.body: ; preds = %while.body, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 1, %while.body ]
%s.07 = phi i32 [ %or, %for.body ], [ 0, %while.body ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%3 = load i32, ptr %b, align 4, !tbaa !5
%or = or i32 %3, %s.07
%inc = add nuw nsw i32 %i.08, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.08, %4
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !11
while.end: ; preds = %for.cond.cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
#define charsize 100005 //10^5+5
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;}
ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); }
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}
int main(void){
// char ;
ll a,b,c,d;
// ll ans=0;
scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
// ll [n];
// rep(i,0,n){
// scanf("%lld",&[i]);
// }
// while(1)
ll tt,ta;
tt = c%b==0 ? c/b : c/b+1;
ta = a%d==0 ? a/d : a/d+1;
if(tt<=ta){
YES;
}else{
NO;
}
// printf("%lld\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_138993/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_138993/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [17 x i8] c"%lld%lld%lld%lld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %a, %b
%cmp1.not = icmp sgt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 {
entry:
%cmp.not = icmp slt i64 %a, %b
%cmp1.not = icmp slt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6)
%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 !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6)
%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 !15
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %c.04.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %c.04, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #5 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%n.nonneg = sub i64 0, %n
%0 = urem i64 %n.nonneg, 1000000007
%1 = add nsw i64 %0, %n
%mul = sub i64 1000000007, %1
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, 1000000007
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #5 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%div7 = sdiv i64 %n, %p
%add = sub i64 1, %div7
%mul = mul nsw i64 %add, %p
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, %p
ret i64 %rem
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #6 {
entry:
%tobool.not11 = icmp eq i64 %p, 0
br i1 %tobool.not11, label %cond.end, label %cond.false.preheader
cond.false.preheader: ; preds = %entry
%0 = add i64 %p, -2
br label %cond.false
cond.false: ; preds = %cond.false.preheader, %POW.exit
%indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ]
%p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ]
%accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ]
%1 = xor i64 %indvar, -1
%2 = add i64 %1, %p
%sub = add nsw i64 %p.tr13, -1
%cmp3.i = icmp sgt i64 %p.tr13, 1
br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit
for.body.i.preheader: ; preds = %cond.false
%3 = sub i64 %0, %indvar
%xtraiter = and i64 %2, 7
%4 = icmp ult i64 %3, 7
br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %2, -8
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ]
%mul.i.7 = mul i64 %c.04.i, 100000000
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18
POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ]
%c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil
%c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul nsw i64 %c.04.i.epil, 10
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %POW.exit, label %for.body.i.epil, !llvm.loop !19
POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false
%c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ]
%sub1 = sub nsw i64 %len, %p.tr13
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1
%5 = load i8, ptr %arrayidx, align 1, !tbaa !20
%conv = sext i8 %5 to i64
%sub2 = add nsw i64 %conv, -48
%mul = mul nsw i64 %sub2, %c.0.lcssa.i
%add = add nsw i64 %mul, %accumulator.tr12
%tobool.not = icmp eq i64 %sub, 0
%indvar.next = add i64 %indvar, 1
br i1 %tobool.not, label %cond.end, label %cond.false
cond.end: ; preds = %POW.exit, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ]
ret i64 %accumulator.tr.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #7 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #7 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #13
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #9
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #7 {
entry:
%0 = load i64, ptr %p, align 8, !tbaa !21
%1 = load i64, ptr %q, align 8, !tbaa !21
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #7 {
entry:
%0 = load i64, ptr %q, align 8, !tbaa !21
%1 = load i64, ptr %p, align 8, !tbaa !21
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #8 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%d = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #13
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #13
%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 i64, ptr %c, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%rem = srem i64 %0, %1
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %0, %1
%add = zext i1 %cmp to i64
%cond = add nsw i64 %div, %add
%2 = load i64, ptr %a, align 8, !tbaa !5
%3 = load i64, ptr %d, align 8, !tbaa !5
%rem2 = srem i64 %2, %3
%cmp3 = icmp ne i64 %rem2, 0
%div5 = sdiv i64 %2, %3
%add8 = zext i1 %cmp3 to i64
%cond10 = add nsw i64 %div5, %add8
%cmp11.not = icmp sgt i64 %cond, %cond10
%str.str.3 = select i1 %cmp11.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #13
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #11
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree 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 #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nofree nounwind }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !17}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !6, i64 0}
!22 = !{!"", !6, i64 0, !6, i64 8}
|
#include <stdio.h>
long long mod=1000000007;
long long modp(long long d,long long p){
if (p==0){
return 1 ;
} else if (p==1){
return d%mod ;
} else if (p%2==0){
return ((modp(d,p/2)%mod)*(modp(d,p/2))%mod)%mod;
} else {
return ((modp(d,p/2)%mod)*(modp(d,p/2))%mod)*d%mod;
}
}
int main(void){
int h,w,a,b;
scanf("%d%d%d%d",&h,&w,&a,&b);
long long p[h+w],q[h+w],ans=0,tmp;
p[0]=1;
for (int i=1; i<h+w; i++){
p[i]=(i*p[i-1])%mod;
}
q[h+w-1]=modp(p[h+w-1],mod-2);
for (int i=h+w-2; i>=0; i--){
q[i]=q[i+1]*(i+1)%mod;
}
for (int i=b+1; i<=w; i++){
tmp=p[h-a-1+i-1]%mod;
tmp=(tmp*q[i-1])%mod;
tmp=(tmp*q[h-a-1])%mod;
tmp=(tmp*p[a-1+w-i])%mod;
tmp=(tmp*q[w-i])%mod;
tmp=(tmp*q[a-1])%mod;
ans=(ans+tmp)%mod;
}
printf("%lld\n",ans%mod);
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139035/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139035/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr global i64 1000000007, align 8
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @modp(i64 noundef %d, i64 noundef %p) local_unnamed_addr #0 {
entry:
switch i64 %p, label %if.else3 [
i64 0, label %common.ret
i64 1, label %if.then2
]
if.then2: ; preds = %entry
%0 = load i64, ptr @mod, align 8, !tbaa !5
%rem = srem i64 %d, %0
br label %common.ret
if.else3: ; preds = %entry
%1 = and i64 %p, 1
%cmp5 = icmp eq i64 %1, 0
%div = sdiv i64 %p, 2
%call = tail call i64 @modp(i64 noundef %d, i64 noundef %div)
%2 = load i64, ptr @mod, align 8, !tbaa !5
%rem7 = srem i64 %call, %2
%mul = mul nsw i64 %rem7, %call
%rem10 = srem i64 %mul, %2
br i1 %cmp5, label %common.ret, label %if.else12
common.ret: ; preds = %if.else3, %if.then2, %entry, %if.else12
%common.ret.op = phi i64 [ %rem21, %if.else12 ], [ %rem, %if.then2 ], [ 1, %entry ], [ %rem10, %if.else3 ]
ret i64 %common.ret.op
if.else12: ; preds = %if.else3
%mul20 = mul nsw i64 %rem10, %d
%rem21 = srem i64 %mul20, %2
br label %common.ret
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%a = alloca i32, align 4
%b = 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 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 %h, ptr noundef nonnull %w, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %h, align 4, !tbaa !9
%1 = load i32, ptr %w, align 4, !tbaa !9
%add = add nsw i32 %1, %0
%2 = zext i32 %add to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %2, align 16
%4 = load i32, ptr %h, align 4, !tbaa !9
%5 = load i32, ptr %w, align 4, !tbaa !9
%add1 = add nsw i32 %5, %4
%6 = zext i32 %add1 to i64
%vla2 = alloca i64, i64 %6, align 16
store i64 1, ptr %vla, align 16, !tbaa !5
%cmp104 = icmp sgt i32 %add1, 1
%.pre = load i64, ptr @mod, align 8, !tbaa !5
br i1 %cmp104, label %for.body.preheader, label %for.cond.cleanup23.critedge
for.body.preheader: ; preds = %entry
%7 = add nsw i64 %6, -1
%xtraiter = and i64 %7, 1
%8 = icmp eq i32 %add1, 2
br i1 %8, label %for.cond.cleanup.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %7, -2
br label %for.body
for.cond.cleanup.unr-lcssa: ; preds = %for.body, %for.body.preheader
%.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.1, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa
%mul.epil = mul nsw i64 %.unr, %indvars.iv.unr
%rem.epil = srem i64 %mul.epil, %.pre
%arrayidx6.epil = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.unr
store i64 %rem.epil, ptr %arrayidx6.epil, align 8, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.unr-lcssa, %for.body.epil
%sub8 = add nsw i32 %add1, -1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds i64, ptr %vla, i64 %idxprom9
%9 = load i64, ptr %arrayidx10, align 8, !tbaa !5
%sub11 = add nsw i64 %.pre, -2
%call12 = call i64 @modp(i64 noundef %9, i64 noundef %sub11)
%arrayidx16 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom9
store i64 %call12, ptr %arrayidx16, align 8, !tbaa !5
br i1 %cmp104, label %for.body24.preheader, label %for.cond.cleanup23
for.body24.preheader: ; preds = %for.cond.cleanup
%sub19 = add i32 %add1, -2
%10 = zext i32 %sub19 to i64
%11 = shl nuw nsw i64 %10, 3
%12 = getelementptr i8, ptr %vla2, i64 %11
%scevgep = getelementptr i8, ptr %12, i64 8
%load_initial = load i64, ptr %scevgep, align 8
br label %for.body24
for.body: ; preds = %for.body, %for.body.preheader.new
%13 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.1, %for.body ]
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%mul = mul nsw i64 %13, %indvars.iv
%rem = srem i64 %mul, %.pre
%arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
store i64 %rem, ptr %arrayidx6, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, %.pre
%arrayidx6.1 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next
store i64 %rem.1, ptr %arrayidx6.1, align 8, !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.cond.cleanup.unr-lcssa, label %for.body, !llvm.loop !11
for.cond.cleanup23.critedge: ; preds = %entry
%sub8.c = add nsw i32 %add1, -1
%idxprom9.c = sext i32 %sub8.c to i64
%arrayidx10.c = getelementptr inbounds i64, ptr %vla, i64 %idxprom9.c
%14 = load i64, ptr %arrayidx10.c, align 8, !tbaa !5
%sub11.c = add nsw i64 %.pre, -2
%call12.c = call i64 @modp(i64 noundef %14, i64 noundef %sub11.c)
%arrayidx16.c = getelementptr inbounds i64, ptr %vla2, i64 %idxprom9.c
store i64 %call12.c, ptr %arrayidx16.c, align 8, !tbaa !5
br label %for.cond.cleanup23
for.cond.cleanup23: ; preds = %for.body24, %for.cond.cleanup23.critedge, %for.cond.cleanup
%15 = load i32, ptr %b, align 4, !tbaa !9
%cmp39.not.not108 = icmp slt i32 %15, %5
br i1 %cmp39.not.not108, label %for.body42.lr.ph, label %for.cond.cleanup41
for.body42.lr.ph: ; preds = %for.cond.cleanup23
%16 = load i32, ptr %a, align 4, !tbaa !9
%17 = xor i32 %16, -1
%sub44 = add i32 %4, %17
%idxprom57 = sext i32 %sub44 to i64
%arrayidx58 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom57
%18 = load i64, ptr %arrayidx58, align 8, !tbaa !5
%sub61 = add nsw i32 %16, -1
%idxprom74 = sext i32 %sub61 to i64
%arrayidx75 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom74
%19 = load i64, ptr %arrayidx75, align 8, !tbaa !5
%20 = sext i32 %15 to i64
%21 = sext i32 %5 to i64
br label %for.body42
for.body24: ; preds = %for.body24.preheader, %for.body24
%store_forwarded = phi i64 [ %load_initial, %for.body24.preheader ], [ %rem31, %for.body24 ]
%indvars.iv113 = phi i64 [ %10, %for.body24.preheader ], [ %indvars.iv.next114, %for.body24 ]
%22 = add nuw nsw i64 %indvars.iv113, 1
%mul30 = mul nsw i64 %store_forwarded, %22
%rem31 = srem i64 %mul30, %.pre
%arrayidx33 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv113
store i64 %rem31, ptr %arrayidx33, align 8, !tbaa !5
%indvars.iv.next114 = add nsw i64 %indvars.iv113, -1
%23 = trunc i64 %indvars.iv113 to i32
%cmp21 = icmp sgt i32 %23, 0
br i1 %cmp21, label %for.body24, label %for.cond.cleanup23, !llvm.loop !13
for.cond.cleanup41: ; preds = %for.body42, %for.cond.cleanup23
%ans.0.lcssa = phi i64 [ 0, %for.cond.cleanup23 ], [ %rem79, %for.body42 ]
%rem83 = srem i64 %ans.0.lcssa, %.pre
%call84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem83)
call void @llvm.stackrestore.p0(ptr %3)
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 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
for.body42: ; preds = %for.body42.lr.ph, %for.body42
%indvars.iv117 = phi i64 [ %20, %for.body42.lr.ph ], [ %indvars.iv.next118, %for.body42 ]
%ans.0109 = phi i64 [ 0, %for.body42.lr.ph ], [ %rem79, %for.body42 ]
%indvars.iv.next118 = add nsw i64 %indvars.iv117, 1
%24 = trunc i64 %indvars.iv117 to i32
%sub46 = add i32 %sub44, %24
%idxprom47 = sext i32 %sub46 to i64
%arrayidx48 = getelementptr inbounds i64, ptr %vla, i64 %idxprom47
%25 = load i64, ptr %arrayidx48, align 8, !tbaa !5
%rem49 = srem i64 %25, %.pre
%arrayidx52 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv117
%26 = load i64, ptr %arrayidx52, align 8, !tbaa !5
%mul53 = mul nsw i64 %26, %rem49
%rem54 = srem i64 %mul53, %.pre
%mul59 = mul nsw i64 %18, %rem54
%rem60 = srem i64 %mul59, %.pre
%i36.0.neg = xor i32 %24, -1
%add62 = add i32 %5, %i36.0.neg
%sub63 = add i32 %add62, %sub61
%idxprom64 = sext i32 %sub63 to i64
%arrayidx65 = getelementptr inbounds i64, ptr %vla, i64 %idxprom64
%27 = load i64, ptr %arrayidx65, align 8, !tbaa !5
%mul66 = mul nsw i64 %27, %rem60
%rem67 = srem i64 %mul66, %.pre
%28 = sub nsw i64 %21, %indvars.iv.next118
%arrayidx70 = getelementptr inbounds i64, ptr %vla2, i64 %28
%29 = load i64, ptr %arrayidx70, align 8, !tbaa !5
%mul71 = mul nsw i64 %29, %rem67
%rem72 = srem i64 %mul71, %.pre
%mul76 = mul nsw i64 %19, %rem72
%rem77 = srem i64 %mul76, %.pre
%add78 = add nsw i64 %rem77, %ans.0109
%rem79 = srem i64 %add78, %.pre
%exitcond122.not = icmp eq i64 %indvars.iv.next118, %21
br i1 %exitcond122.not, label %for.cond.cleanup41, label %for.body42, !llvm.loop !14
}
; 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 nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include<stdio.h>
char c;
int N, A, i;
int main(void){
c=getchar();
while(c!=10){N=N*10+(c-'0'); c=getchar();}
for(i=0; i<N; i++){
c=getchar();
while(c!=10){A=c; c=getchar();}
if(A%2){
printf("first\n");
return 0;
}
}
printf("second\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139079/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139079/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@c = dso_local local_unnamed_addr global i8 0, align 1
@N = dso_local local_unnamed_addr global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@A = dso_local local_unnamed_addr global i32 0, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [7 x i8] c"second\00", align 1
@str.2 = private unnamed_addr constant [6 x i8] c"first\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.i = tail call i32 @getc(ptr noundef %0)
%storemerge28 = trunc i32 %call.i to i8
store i8 %storemerge28, ptr @c, align 1, !tbaa !9
%sext29 = shl i32 %call.i, 24
%cmp.not30 = icmp eq i32 %sext29, 167772160
br i1 %cmp.not30, label %for.cond.preheader, label %while.body
for.cond.preheader: ; preds = %while.body, %entry
store i32 0, ptr @i, align 4, !tbaa !10
%1 = load i32, ptr @N, align 4, !tbaa !10
%cmp636 = icmp sgt i32 %1, 0
br i1 %cmp636, label %for.body, label %return
while.body: ; preds = %entry, %while.body
%sext31 = phi i32 [ %sext, %while.body ], [ %sext29, %entry ]
%conv1 = ashr exact i32 %sext31, 24
%2 = load i32, ptr @N, align 4, !tbaa !10
%mul = mul nsw i32 %2, 10
%sub = add nsw i32 %conv1, -48
%add = add nsw i32 %sub, %mul
store i32 %add, ptr @N, align 4, !tbaa !10
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i25 = tail call i32 @getc(ptr noundef %3)
%storemerge = trunc i32 %call.i25 to i8
store i8 %storemerge, ptr @c, align 1, !tbaa !9
%sext = shl i32 %call.i25, 24
%cmp.not = icmp eq i32 %sext, 167772160
br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !12
for.body: ; preds = %for.cond.preheader, %for.inc
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i26 = tail call i32 @getc(ptr noundef %4)
%storemerge2232 = trunc i32 %call.i26 to i8
store i8 %storemerge2232, ptr @c, align 1, !tbaa !9
%sext2333 = shl i32 %call.i26, 24
%cmp12.not34 = icmp eq i32 %sext2333, 167772160
br i1 %cmp12.not34, label %while.end18, label %while.body14
while.body14: ; preds = %for.body, %while.body14
%sext2335 = phi i32 [ %sext23, %while.body14 ], [ %sext2333, %for.body ]
%conv11 = ashr exact i32 %sext2335, 24
store i32 %conv11, ptr @A, align 4, !tbaa !10
%5 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i27 = tail call i32 @getc(ptr noundef %5)
%storemerge22 = trunc i32 %call.i27 to i8
store i8 %storemerge22, ptr @c, align 1, !tbaa !9
%sext23 = shl i32 %call.i27, 24
%cmp12.not = icmp eq i32 %sext23, 167772160
br i1 %cmp12.not, label %while.end18, label %while.body14, !llvm.loop !14
while.end18: ; preds = %while.body14, %for.body
%6 = load i32, ptr @A, align 4, !tbaa !10
%7 = and i32 %6, 1
%tobool.not = icmp eq i32 %7, 0
br i1 %tobool.not, label %for.inc, label %return
for.inc: ; preds = %while.end18
%8 = load i32, ptr @i, align 4, !tbaa !10
%inc = add nsw i32 %8, 1
store i32 %inc, ptr @i, align 4, !tbaa !10
%9 = load i32, ptr @N, align 4, !tbaa !10
%cmp6 = icmp slt i32 %inc, %9
br i1 %cmp6, label %for.body, label %return, !llvm.loop !15
return: ; preds = %for.inc, %while.end18, %for.cond.preheader
%str.sink = phi ptr [ @str, %for.cond.preheader ], [ @str.2, %while.end18 ], [ @str, %for.inc ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !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,N1,N2,N3;
scanf("%d",&N);
N1=N%10;
N2=(N/10)%10;
N3=N/100;
if(N1==7 || N2==7 || N3==7){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139121/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139121/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 10
%div = sdiv i32 %0, 10
%rem1 = srem i32 %div, 10
%cmp = icmp eq i32 %rem, 7
%cmp3 = icmp eq i32 %rem1, 7
%or.cond = or i1 %cmp, %cmp3
%.off = add i32 %0, -700
%cmp5 = icmp ult i32 %.off, 100
%or.cond8 = or i1 %cmp5, %or.cond
%str.3.str = select i1 %or.cond8, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
char num[5];
scanf("%s", num);
for (int i = 0; i < 3; i++)
{
if (num[i] == '7')
{
printf("Yes\n");
return 0;
}
}
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139165/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139165/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i8, ptr %num, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 55
%arrayidx.1 = getelementptr inbounds [5 x i8], ptr %num, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1
%cmp1.1 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp1, i1 true, i1 %cmp1.1
%arrayidx.2 = getelementptr inbounds [5 x i8], ptr %num, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1
%cmp1.2 = icmp eq i8 %2, 55
%or.cond11 = select i1 %or.cond, i1 true, i1 %cmp1.2
%str.str.3 = select i1 %or.cond11, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
char a[4];
scanf("%s",a);
if(a[0]=='7'||a[1]=='7'||a[2]=='7'){
printf("Yes");
}
else{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139208/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139208/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i8], align 1
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 i8, ptr %a, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 55
%arrayidx2 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp4
%arrayidx7 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 2
%2 = load i8, ptr %arrayidx7, align 1
%cmp9 = icmp eq i8 %2, 55
%or.cond13 = select i1 %or.cond, i1 true, i1 %cmp9
%.str.1..str.2 = select i1 %or.cond13, ptr @.str.1, ptr @.str.2
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n;
int a,b,c;
scanf("%d",&n);
a=n/100;
n=n%100;
b=n/10;
c=n%10;
if(a==7||b==7||c==7){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139251/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139251/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 100
store i32 %rem, ptr %n, align 4, !tbaa !5
%rem2.lhs.trunc = trunc i32 %rem to i8
%rem210 = srem i8 %rem2.lhs.trunc, 10
%.off = add i32 %0, -700
%cmp = icmp ult i32 %.off, 100
%rem.off = add nsw i32 %rem, -70
%cmp3 = icmp ult i32 %rem.off, 10
%or.cond = select i1 %cmp, i1 true, i1 %cmp3
%cmp5 = icmp eq i8 %rem210, 7
%or.cond8 = or i1 %or.cond, %cmp5
%str.3.str = select i1 %or.cond8, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,i,count=0;
scanf("%d",&a);
for(i=0;i<3;i++){
if(a%10==7) count++;
a=a/10;}
if(count>=1)
puts("Yes");
else
{
puts("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139295/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139295/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %a.promoted, 10
%cmp1 = icmp eq i32 %rem, 7
%inc = zext i1 %cmp1 to i32
%div = sdiv i32 %a.promoted, 10
%rem.1 = srem i32 %div, 10
%cmp1.1 = icmp eq i32 %rem.1, 7
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %inc, %inc.1
%div.1 = sdiv i32 %a.promoted, 100
%rem.2 = srem i32 %div.1, 10
%cmp1.2 = icmp eq i32 %rem.2, 7
%inc.2.neg = sext i1 %cmp1.2 to i32
%div.2 = sdiv i32 %a.promoted, 1000
store i32 %div.2, ptr %a, align 4, !tbaa !5
%cmp3.not = icmp eq i32 %spec.select.1, %inc.2.neg
%.str.2..str.1 = select i1 %cmp3.not, ptr @.str.2, ptr @.str.1
%call6 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
char N[4];
scanf("%s",N);
if(N[2]=='7')
printf("Yes");
else if(N[1]=='7')
printf("Yes");
else if(N[0]=='7')
printf("Yes");
else
printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139345/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139345/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca [4 x i8], align 1
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)
%arrayidx = getelementptr inbounds [4 x i8], ptr %N, i64 0, i64 2
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 55
%arrayidx3 = getelementptr inbounds [4 x i8], ptr %N, i64 0, i64 1
%1 = load i8, ptr %arrayidx3, align 1
%cmp5 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp5
%2 = load i8, ptr %N, align 1
%cmp12 = icmp eq i8 %2, 55
%3 = select i1 %or.cond, i1 true, i1 %cmp12
%.str.1.sink = select i1 %3, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
char s[4];
scanf("%s", &s);
int i;
if ((s[0] == '7') || (s[1] == '7') || (s[2] == '7')) {
printf("Yes");
}
else {
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139389/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [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
%cmp = icmp eq i8 %0, 55
%arrayidx2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp4
%arrayidx7 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx7, align 1
%cmp9 = icmp eq i8 %2, 55
%or.cond13 = select i1 %or.cond, i1 true, i1 %cmp9
%.str.1..str.2 = select i1 %or.cond13, ptr @.str.1, ptr @.str.2
%call12 = 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<3;i++){
if(n%10==7){
printf("Yes\n");
return 0;
}
n = n/10;
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139431/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139431/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %n.promoted, 10
%div = sdiv i32 %n.promoted, 10
%cmp1 = icmp eq i32 %rem, 7
br i1 %cmp1, label %cleanup4, label %if.end
if.end: ; preds = %entry
store i32 %div, ptr %n, align 4, !tbaa !5
%rem.1 = srem i32 %div, 10
%cmp1.1 = icmp eq i32 %rem.1, 7
br i1 %cmp1.1, label %cleanup4, label %if.end.1
if.end.1: ; preds = %if.end
%div.1 = sdiv i32 %n.promoted, 100
store i32 %div.1, ptr %n, align 4, !tbaa !5
%rem.2 = srem i32 %div.1, 10
%cmp1.2 = icmp eq i32 %rem.2, 7
br i1 %cmp1.2, label %cleanup4, label %if.end.2
if.end.2: ; preds = %if.end.1
%div.2 = sdiv i32 %n.promoted, 1000
store i32 %div.2, ptr %n, align 4, !tbaa !5
br label %cleanup4
cleanup4: ; preds = %entry, %if.end, %if.end.1, %if.end.2
%str.sink = phi ptr [ @str.3, %if.end.2 ], [ @str, %if.end.1 ], [ @str, %if.end ], [ @str, %entry ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int i;
char moji[4];
scanf("%s",moji);
for(i=0; i<3; i++)
if(moji[i]=='7')
{
printf("Yes");
return 0;
}
printf("No");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139475/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139475/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%moji = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %moji) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %moji)
%0 = load i8, ptr %moji, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 55
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %moji, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1
%cmp1.1 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp1, i1 true, i1 %cmp1.1
%arrayidx.2 = getelementptr inbounds [4 x i8], ptr %moji, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1
%cmp1.2 = icmp eq i8 %2, 55
%or.cond10 = select i1 %or.cond, i1 true, i1 %cmp1.2
%.str.1..str.2 = select i1 %or.cond10, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %moji) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,i,j,k;
scanf("%d", &n);
i=n%10;
j=n%100;
j=j/10;
k=n/100;
if(i==7 || j==7 || k==7)
printf("Yes");
else
printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139518/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139518/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 10
%rem1 = srem i32 %0, 100
%cmp = icmp eq i32 %rem, 7
%rem1.off = add nsw i32 %rem1, -70
%cmp3 = icmp ult i32 %rem1.off, 10
%or.cond = select i1 %cmp, i1 true, i1 %cmp3
%.off = add i32 %0, -700
%cmp5 = icmp ult i32 %.off, 100
%or.cond8 = or i1 %cmp5, %or.cond
%.str.1..str.2 = select i1 %or.cond8, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main ()
{
int i;
char s[4];
scanf("%s",s);
for(i=0;i<3;i++)
if(s[i]=='7')
{
printf("Yes");return 0;
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139561/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139561/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [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
%cmp1 = icmp eq i8 %0, 55
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1
%cmp1.1 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp1, i1 true, i1 %cmp1.1
%arrayidx.2 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1
%cmp1.2 = icmp eq i8 %2, 55
%or.cond10 = select i1 %or.cond, i1 true, i1 %cmp1.2
%.str.1..str.2 = select i1 %or.cond10, ptr @.str.1, ptr @.str.2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int N;
scanf("%d", &N);
int j = 100;
for (int i = 0; i < 3; i++) {
int t = N / j;
if (t == 7) {
printf("Yes");
return 0;
}
N = N - j * t;
j = j / 10;
//printf("%d %d %d\n",N, t, j);
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%N.promoted = load i32, ptr %N, align 4, !tbaa !5
%N.promoted.fr = freeze i32 %N.promoted
%N.promoted.off = add i32 %N.promoted.fr, -700
%cmp1.not = icmp ult i32 %N.promoted.off, 100
br i1 %cmp1.not, label %cleanup7, label %for.inc
for.inc: ; preds = %entry
%0 = srem i32 %N.promoted.fr, 100
store i32 %0, ptr %N, align 4, !tbaa !5
%.off = add nsw i32 %0, -70
%cmp1.not.1 = icmp ult i32 %.off, 10
br i1 %cmp1.not.1, label %cleanup7, label %for.inc.1
for.inc.1: ; preds = %for.inc
%.lhs.trunc = trunc i32 %0 to i8
%1 = srem i8 %.lhs.trunc, 10
%cmp1.not.2 = icmp eq i8 %1, 7
%spec.store.select = select i1 %cmp1.not.2, i32 7, i32 0
store i32 %spec.store.select, ptr %N, align 4
%spec.select = select i1 %cmp1.not.2, ptr @.str.1, ptr @.str.2
br label %cleanup7
cleanup7: ; preds = %for.inc.1, %entry, %for.inc
%.str.1.sink = phi ptr [ @.str.1, %for.inc ], [ @.str.1, %entry ], [ %spec.select, %for.inc.1 ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int i;
scanf("%d", &i);
if(i % 10 == 7)
puts("Yes");
else if(i / 10 % 10 == 7)
puts("Yes");
else if(i / 100 == 7)
puts("Yes");
else
puts("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139655/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139655/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
%rem = srem i32 %0, 10
%div = sdiv i32 %0, 10
%cmp = icmp eq i32 %rem, 7
%rem2 = srem i32 %div, 10
%cmp3 = icmp eq i32 %rem2, 7
%or.cond = or i1 %cmp, %cmp3
%.off = add i32 %0, -700
%cmp8 = icmp ult i32 %.off, 100
%.str.1..str.2 = select i1 %cmp8, ptr @.str.1, ptr @.str.2
%.str.1.sink = select i1 %or.cond, ptr @.str.1, ptr %.str.1..str.2
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define F(i,a,n) for(int i=a; i<n; i++)
int main(){
int n;
scanf("%d",&n);
int n1,n2,n3;
F(i,0,3){
n1=n%10;
n2=(n/10)%10;
n3=(n/100)%10;
}
if(n1==7 || n2==7 || n3==7){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139699/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139699/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %0, 10
%div2 = sdiv i32 %0, 100
%rem = srem i32 %0, 10
%rem1 = srem i32 %div, 10
%rem3 = srem i32 %div2, 10
%cmp4 = icmp eq i32 %rem, 7
%cmp5 = icmp eq i32 %rem1, 7
%or.cond = or i1 %cmp4, %cmp5
%cmp7 = icmp eq i32 %rem3, 7
%or.cond10 = or i1 %or.cond, %cmp7
%str.3.str = select i1 %or.cond10, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
char s[3];
scanf("%s",&s);
for(int i=0;i<3;i++){
if(s[i]=='7'){
printf("Yes");
return 0;
}
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139741/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 55
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1
%cmp1.1 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp1, i1 true, i1 %cmp1.1
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1
%cmp1.2 = icmp eq i8 %2, 55
%or.cond10 = select i1 %or.cond, i1 true, i1 %cmp1.2
%.str.1..str.2 = select i1 %or.cond10, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include <math.h>
int ASC(const void *a, const void *b) {
return *(int *)b - *(int *)a;//降順
}
int main(void)
{
char a[4];
scanf("%s",a);
if (a[0] == '7' || a[1] == '7' || a[2] == '7')
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ASC(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
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, !tbaa !9
%cmp = icmp eq i8 %0, 55
%arrayidx2 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 1
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp, i1 true, i1 %cmp4
%arrayidx7 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 2
%2 = load i8, ptr %arrayidx7, align 1
%cmp9 = icmp eq i8 %2, 55
%or.cond13 = select i1 %or.cond, i1 true, i1 %cmp9
%.str.1..str.2 = select i1 %or.cond13, ptr @.str.1, ptr @.str.2
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <string.h>
#define ll long long
int main()
{
char ch[3];
scanf("%s",ch);
for (int i = 0; i<3;i++)
{
if (ch[i]=='7'){printf("Yes");
return 0;}
}
printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139828/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139828/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %ch) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%0 = load i8, ptr %ch, align 1, !tbaa !5
%cmp1 = icmp eq i8 %0, 55
%arrayidx.1 = getelementptr inbounds [3 x i8], ptr %ch, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1
%cmp1.1 = icmp eq i8 %1, 55
%or.cond = select i1 %cmp1, i1 true, i1 %cmp1.1
%arrayidx.2 = getelementptr inbounds [3 x i8], ptr %ch, i64 0, i64 2
%2 = load i8, ptr %arrayidx.2, align 1
%cmp1.2 = icmp eq i8 %2, 55
%or.cond10 = select i1 %or.cond, i1 true, i1 %cmp1.2
%.str.1..str.2 = select i1 %or.cond10, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %ch) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
int main(void){
while(1){
char n[9];
int i, index, c[3] = {0};
double min = 1000, d;
scanf(" %s", n);
if(strcmp(n, "0") == 0) break;
for(i=0; i<3; i++){
if(n[2*i+1] <= '9') c[i] += 16*(n[2*i+1]-'0');
else c[i] += 16*(n[2*i+1]-'a'+10);
if(n[2*i+2] <= '9') c[i] += n[2*i+2]-'0';
else c[i] += n[2*i+2]-'a'+10;
}
/*for(i=0; i<3; i++)
printf("%d ", c[i]);*/
for(i=0; i<8; i++){
int p;
if(i%4==0 || i%4==1) p=0;
else p=1;
d=sqrt( pow(c[0]-(i/4)*255, 2) + pow(c[1]-p*255, 2) + pow(c[2]-(i%2)*255, 2) );
if(min > d){
min = d;
index = i;
}
}
if(index==0) printf("black\n");
else if(index==1) printf("blue\n");
else if(index==2) printf("lime\n");
else if(index==3) printf("aqua\n");
else if(index==4) printf("red\n");
else if(index==5) printf("fuchsia\n");
else if(index==6) printf("yellow\n");
else if(index==7) printf("white\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139879/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139879/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %s\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"0\00", align 1
@str = private unnamed_addr constant [6 x i8] c"white\00", align 1
@str.10 = private unnamed_addr constant [7 x i8] c"yellow\00", align 1
@str.11 = private unnamed_addr constant [8 x i8] c"fuchsia\00", align 1
@str.12 = private unnamed_addr constant [4 x i8] c"red\00", align 1
@str.13 = private unnamed_addr constant [5 x i8] c"aqua\00", align 1
@str.14 = private unnamed_addr constant [5 x i8] c"lime\00", align 1
@str.15 = private unnamed_addr constant [5 x i8] c"blue\00", align 1
@str.16 = private unnamed_addr constant [6 x i8] c"black\00", align 1
@reltable.main = private unnamed_addr constant [8 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.16 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.15 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.14 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca [9 x i8], align 1
call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %n) #7
%call191 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%bcmp192 = call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %n, ptr noundef nonnull dereferenceable(2) @.str.1, i64 2)
%cmp193 = icmp eq i32 %bcmp192, 0
br i1 %cmp193, label %while.end, label %for.cond.preheader.lr.ph
for.cond.preheader.lr.ph: ; preds = %entry
%arrayidx = getelementptr inbounds [9 x i8], ptr %n, i64 0, i64 1
%arrayidx31 = getelementptr inbounds [9 x i8], ptr %n, i64 0, i64 2
%arrayidx.1 = getelementptr inbounds [9 x i8], ptr %n, i64 0, i64 3
%arrayidx31.1 = getelementptr inbounds [9 x i8], ptr %n, i64 0, i64 4
%arrayidx.2 = getelementptr inbounds [9 x i8], ptr %n, i64 0, i64 5
%arrayidx31.2 = getelementptr inbounds [9 x i8], ptr %n, i64 0, i64 6
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %cleanup
%index.0194 = phi i32 [ undef, %for.cond.preheader.lr.ph ], [ %index.3, %cleanup ]
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%cmp4 = icmp slt i8 %0, 58
%sub = shl nsw i32 %conv, 4
%. = select i1 %cmp4, i32 -768, i32 -1392
%mul23 = add nsw i32 %sub, %.
%1 = load i8, ptr %arrayidx31, align 1, !tbaa !5
%conv32 = sext i8 %1 to i32
%cmp33 = icmp slt i8 %1, 58
%.sink222 = select i1 %cmp33, i32 -48, i32 -87
%sub41 = add nsw i32 %.sink222, %conv32
%c.sroa.0.2 = add nsw i32 %sub41, %mul23
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %2 to i32
%cmp4.1 = icmp slt i8 %2, 58
%.sink223 = select i1 %cmp4.1, i32 -768, i32 -1392
%sub.1 = shl nsw i32 %conv.1, 4
%mul12.1 = add nsw i32 %sub.1, %.sink223
%3 = load i8, ptr %arrayidx31.1, align 1, !tbaa !5
%conv32.1 = sext i8 %3 to i32
%cmp33.1 = icmp slt i8 %3, 58
%.sink224 = select i1 %cmp33.1, i32 -48, i32 -87
%sub41.1 = add nsw i32 %.sink224, %conv32.1
%c.sroa.15.2 = add nsw i32 %sub41.1, %mul12.1
%4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%conv.2 = sext i8 %4 to i32
%cmp4.2 = icmp slt i8 %4, 58
%.sink225 = select i1 %cmp4.2, i32 -768, i32 -1392
%sub.2 = shl nsw i32 %conv.2, 4
%mul12.2 = add nsw i32 %sub.2, %.sink225
%5 = load i8, ptr %arrayidx31.2, align 1, !tbaa !5
%conv32.2 = sext i8 %5 to i32
%cmp33.2 = icmp slt i8 %5, 58
%.sink226 = select i1 %cmp33.2, i32 -48, i32 -87
%sub41.2 = add nsw i32 %.sink226, %conv32.2
%c.sroa.24.2 = add nsw i32 %sub41.2, %mul12.2
%conv72 = sitofp i32 %c.sroa.0.2 to double
%square = fmul double %conv72, %conv72
%conv77 = sitofp i32 %c.sroa.15.2 to double
%square181 = fmul double %conv77, %conv77
%add79 = fadd double %square, %square181
%conv84 = sitofp i32 %c.sroa.24.2 to double
%square182 = fmul double %conv84, %conv84
%add86 = fadd double %add79, %square182
%sqrt = call double @llvm.sqrt.f64(double %add86)
%cmp88 = fcmp olt double %sqrt, 1.000000e+03
%index.2 = select i1 %cmp88, i32 0, i32 %index.0194
%min.1 = select i1 %cmp88, double %sqrt, double 1.000000e+03
%sub83.1 = add nsw i32 %c.sroa.24.2, -255
%conv84.1 = sitofp i32 %sub83.1 to double
%square182.1 = fmul double %conv84.1, %conv84.1
%add86.1 = fadd double %add79, %square182.1
%sqrt.1 = call double @llvm.sqrt.f64(double %add86.1)
%cmp88.1 = fcmp ogt double %min.1, %sqrt.1
%index.2.1 = select i1 %cmp88.1, i32 1, i32 %index.2
%min.1.1 = select i1 %cmp88.1, double %sqrt.1, double %min.1
%sub76.2 = add nsw i32 %c.sroa.15.2, -255
%conv77.2 = sitofp i32 %sub76.2 to double
%square181.2 = fmul double %conv77.2, %conv77.2
%add79.2 = fadd double %square, %square181.2
%add86.2 = fadd double %add79.2, %square182
%sqrt.2 = call double @llvm.sqrt.f64(double %add86.2)
%cmp88.2 = fcmp ogt double %min.1.1, %sqrt.2
%index.2.2 = select i1 %cmp88.2, i32 2, i32 %index.2.1
%min.1.2 = select i1 %cmp88.2, double %sqrt.2, double %min.1.1
%add86.3 = fadd double %add79.2, %square182.1
%sqrt.3 = call double @llvm.sqrt.f64(double %add86.3)
%cmp88.3 = fcmp ogt double %min.1.2, %sqrt.3
%index.2.3 = select i1 %cmp88.3, i32 3, i32 %index.2.2
%min.1.3 = select i1 %cmp88.3, double %sqrt.3, double %min.1.2
%sub71.4 = add nsw i32 %c.sroa.0.2, -255
%conv72.4 = sitofp i32 %sub71.4 to double
%square.4 = fmul double %conv72.4, %conv72.4
%add79.4 = fadd double %square.4, %square181
%add86.4 = fadd double %add79.4, %square182
%sqrt.4 = call double @llvm.sqrt.f64(double %add86.4)
%cmp88.4 = fcmp ogt double %min.1.3, %sqrt.4
%index.2.4 = select i1 %cmp88.4, i32 4, i32 %index.2.3
%min.1.4 = select i1 %cmp88.4, double %sqrt.4, double %min.1.3
%add86.5 = fadd double %add79.4, %square182.1
%sqrt.5 = call double @llvm.sqrt.f64(double %add86.5)
%cmp88.5 = fcmp ogt double %min.1.4, %sqrt.5
%index.2.5 = select i1 %cmp88.5, i32 5, i32 %index.2.4
%min.1.5 = select i1 %cmp88.5, double %sqrt.5, double %min.1.4
%add79.6 = fadd double %square.4, %square181.2
%add86.6 = fadd double %add79.6, %square182
%sqrt.6 = call double @llvm.sqrt.f64(double %add86.6)
%cmp88.6 = fcmp ogt double %min.1.5, %sqrt.6
%index.2.6 = select i1 %cmp88.6, i32 6, i32 %index.2.5
%min.1.6 = select i1 %cmp88.6, double %sqrt.6, double %min.1.5
%add86.7 = fadd double %add79.6, %square182.1
%sqrt.7 = call double @llvm.sqrt.f64(double %add86.7)
%cmp88.7 = fcmp ogt double %min.1.6, %sqrt.7
%index.2.7 = select i1 %cmp88.7, i32 7, i32 %index.2.6
%6 = icmp ult i32 %index.2.7, 8
br i1 %6, label %switch.lookup, label %cleanup
switch.lookup: ; preds = %for.cond.preheader
%7 = sext i32 %index.2.7 to i64
%reltable.shift = shl i64 %7, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts179 = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %cleanup
cleanup: ; preds = %for.cond.preheader, %switch.lookup
%index.3 = phi i32 [ %index.2.6, %for.cond.preheader ], [ %index.2.7, %switch.lookup ]
call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(2) %n, ptr noundef nonnull dereferenceable(2) @.str.1, i64 2)
%cmp = icmp eq i32 %bcmp, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #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 = { nofree nounwind willreturn memory(argmem: read) }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define LIMIT 10000
int divisor[LIMIT+10],md;
void maked(ll n){md=max(md,n);n=min(LIMIT,n);divisor[0]=-1;divisor[1]=1;ll i=2;for(;i*i<=n;i++)if(!divisor[i]){divisor[i]=i;for(ll j=i*i;j<=n;j+=i)if(!divisor[j])divisor[j]=i;}for(;i<=n;i++)if(!divisor[i])divisor[i]=i;}
ll n;
ll d[1010];
int main(){
maked(2000);
scanf("%lld",&n);
rep(i,2,n+1){
ll t=i;
while(t!=1){
d[divisor[t]]++;
t/=divisor[t];
}
}
ll ans=1;
rep(i,2,n+1)ans=ans*(d[i]+1)%1000000007;
printf("%lld\n",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_139929/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_139929/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@md = dso_local local_unnamed_addr global i32 0, align 4
@divisor = dso_local local_unnamed_addr global [10010 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@n = dso_local global i64 0, align 8
@d = dso_local local_unnamed_addr global [1010 x i64] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @maked(i64 noundef %n) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @md, align 4
%conv = sext i32 %0 to i64
%cond = tail call i64 @llvm.smax.i64(i64 %conv, i64 %n)
%conv3 = trunc i64 %cond to i32
store i32 %conv3, ptr @md, align 4, !tbaa !5
%cond9 = tail call i64 @llvm.smin.i64(i64 %n, i64 10000)
store i32 -1, ptr @divisor, align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1), align 4, !tbaa !5
%cmp10.not65 = icmp slt i64 %n, 4
br i1 %cmp10.not65, label %for.cond27.preheader, label %for.body
for.cond27.preheader: ; preds = %for.inc25, %entry
%i.0.lcssa = phi i64 [ 2, %entry ], [ %inc, %for.inc25 ]
%cmp28.not69 = icmp sgt i64 %i.0.lcssa, %cond9
br i1 %cmp28.not69, label %for.end39, label %for.body30.preheader
for.body30.preheader: ; preds = %for.cond27.preheader
%1 = add nsw i64 %cond9, 1
%2 = sub i64 %1, %i.0.lcssa
%min.iters.check = icmp ult i64 %2, 8
br i1 %min.iters.check, label %for.body30.preheader87, label %vector.ph
vector.ph: ; preds = %for.body30.preheader
%n.vec = and i64 %2, -8
%ind.end = add i64 %i.0.lcssa, %n.vec
br label %vector.body
vector.body: ; preds = %pred.store.continue86, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue86 ]
%offset.idx = add i64 %i.0.lcssa, %index
%3 = trunc i64 %offset.idx to i32
%offset.idx71 = add i64 %i.0.lcssa, %index
%4 = add i64 %offset.idx71, 4
%5 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %offset.idx71
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load72 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = icmp eq <4 x i32> %wide.load, zeroinitializer
%8 = icmp eq <4 x i32> %wide.load72, zeroinitializer
%9 = extractelement <4 x i1> %7, i64 0
br i1 %9, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%10 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %offset.idx71
store i32 %3, ptr %10, align 4, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%11 = extractelement <4 x i1> %7, i64 1
br i1 %11, label %pred.store.if73, label %pred.store.continue74
pred.store.if73: ; preds = %pred.store.continue
%12 = add i64 %offset.idx71, 1
%13 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %12
%14 = add i32 %3, 1
store i32 %14, ptr %13, align 4, !tbaa !5
br label %pred.store.continue74
pred.store.continue74: ; preds = %pred.store.if73, %pred.store.continue
%15 = extractelement <4 x i1> %7, i64 2
br i1 %15, label %pred.store.if75, label %pred.store.continue76
pred.store.if75: ; preds = %pred.store.continue74
%16 = add i64 %offset.idx71, 2
%17 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %16
%18 = add i32 %3, 2
store i32 %18, ptr %17, align 4, !tbaa !5
br label %pred.store.continue76
pred.store.continue76: ; preds = %pred.store.if75, %pred.store.continue74
%19 = extractelement <4 x i1> %7, i64 3
br i1 %19, label %pred.store.if77, label %pred.store.continue78
pred.store.if77: ; preds = %pred.store.continue76
%20 = add i64 %offset.idx71, 3
%21 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %20
%22 = add i32 %3, 3
store i32 %22, ptr %21, align 4, !tbaa !5
br label %pred.store.continue78
pred.store.continue78: ; preds = %pred.store.if77, %pred.store.continue76
%23 = extractelement <4 x i1> %8, i64 0
br i1 %23, label %pred.store.if79, label %pred.store.continue80
pred.store.if79: ; preds = %pred.store.continue78
%24 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %4
%25 = add i32 %3, 4
store i32 %25, ptr %24, align 4, !tbaa !5
br label %pred.store.continue80
pred.store.continue80: ; preds = %pred.store.if79, %pred.store.continue78
%26 = extractelement <4 x i1> %8, i64 1
br i1 %26, label %pred.store.if81, label %pred.store.continue82
pred.store.if81: ; preds = %pred.store.continue80
%27 = add i64 %offset.idx71, 5
%28 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %27
%29 = add i32 %3, 5
store i32 %29, ptr %28, align 4, !tbaa !5
br label %pred.store.continue82
pred.store.continue82: ; preds = %pred.store.if81, %pred.store.continue80
%30 = extractelement <4 x i1> %8, i64 2
br i1 %30, label %pred.store.if83, label %pred.store.continue84
pred.store.if83: ; preds = %pred.store.continue82
%31 = add i64 %offset.idx71, 6
%32 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %31
%33 = add i32 %3, 6
store i32 %33, ptr %32, align 4, !tbaa !5
br label %pred.store.continue84
pred.store.continue84: ; preds = %pred.store.if83, %pred.store.continue82
%34 = extractelement <4 x i1> %8, i64 3
br i1 %34, label %pred.store.if85, label %pred.store.continue86
pred.store.if85: ; preds = %pred.store.continue84
%35 = add i64 %offset.idx71, 7
%36 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %35
%37 = add i32 %3, 7
store i32 %37, ptr %36, align 4, !tbaa !5
br label %pred.store.continue86
pred.store.continue86: ; preds = %pred.store.if85, %pred.store.continue84
%index.next = add nuw i64 %index, 8
%38 = icmp eq i64 %index.next, %n.vec
br i1 %38, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %pred.store.continue86
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.end39, label %for.body30.preheader87
for.body30.preheader87: ; preds = %for.body30.preheader, %middle.block
%i.170.ph = phi i64 [ %i.0.lcssa, %for.body30.preheader ], [ %ind.end, %middle.block ]
br label %for.body30
for.body: ; preds = %entry, %for.inc25
%mul68 = phi i64 [ %mul, %for.inc25 ], [ 4, %entry ]
%i.066 = phi i64 [ %inc, %for.inc25 ], [ 2, %entry ]
%arrayidx = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %i.066
%39 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool.not = icmp eq i32 %39, 0
br i1 %tobool.not, label %if.then, label %for.inc25
if.then: ; preds = %for.body
%conv12 = trunc i64 %i.066 to i32
store i32 %conv12, ptr %arrayidx, align 4, !tbaa !5
%cmp16.not63 = icmp sgt i64 %mul68, %cond9
br i1 %cmp16.not63, label %for.inc25, label %for.body18
for.body18: ; preds = %if.then, %for.inc
%j.064 = phi i64 [ %add, %for.inc ], [ %mul68, %if.then ]
%arrayidx19 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %j.064
%40 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%tobool20.not = icmp eq i32 %40, 0
br i1 %tobool20.not, label %if.then21, label %for.inc
if.then21: ; preds = %for.body18
store i32 %conv12, ptr %arrayidx19, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body18, %if.then21
%add = add nuw nsw i64 %j.064, %i.066
%cmp16.not = icmp sgt i64 %add, %cond9
br i1 %cmp16.not, label %for.inc25, label %for.body18, !llvm.loop !13
for.inc25: ; preds = %for.inc, %if.then, %for.body
%inc = add nuw nsw i64 %i.066, 1
%mul = mul nsw i64 %inc, %inc
%cmp10.not = icmp sgt i64 %mul, %cond9
br i1 %cmp10.not, label %for.cond27.preheader, label %for.body, !llvm.loop !14
for.body30: ; preds = %for.body30.preheader87, %for.inc37
%i.170 = phi i64 [ %inc38, %for.inc37 ], [ %i.170.ph, %for.body30.preheader87 ]
%arrayidx31 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %i.170
%41 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%tobool32.not = icmp eq i32 %41, 0
br i1 %tobool32.not, label %if.then33, label %for.inc37
if.then33: ; preds = %for.body30
%conv34 = trunc i64 %i.170 to i32
store i32 %conv34, ptr %arrayidx31, align 4, !tbaa !5
br label %for.inc37
for.inc37: ; preds = %for.body30, %if.then33
%inc38 = add nuw nsw i64 %i.170, 1
%cmp28.not.not = icmp slt i64 %i.170, %cond9
br i1 %cmp28.not.not, label %for.body30, label %for.end39, !llvm.loop !15
for.end39: ; preds = %for.inc37, %middle.block, %for.cond27.preheader
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%0 = load i32, ptr @md, align 4
%1 = tail call i32 @llvm.smax.i32(i32 %0, i32 2000)
store i32 %1, ptr @md, align 4, !tbaa !5
store i32 -1, ptr @divisor, align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1), align 4, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.inc25.i, %entry
%mul68.i = phi i64 [ %mul.i, %for.inc25.i ], [ 4, %entry ]
%i.066.i = phi i64 [ %inc.i, %for.inc25.i ], [ 2, %entry ]
%arrayidx.i = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %i.066.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%tobool.not.i = icmp eq i32 %2, 0
br i1 %tobool.not.i, label %if.then.i, label %for.inc25.i
if.then.i: ; preds = %for.body.i
%conv12.i = trunc i64 %i.066.i to i32
store i32 %conv12.i, ptr %arrayidx.i, align 4, !tbaa !5
br label %for.body18.i
for.body18.i: ; preds = %if.then.i, %for.inc.i
%j.064.i = phi i64 [ %add.i, %for.inc.i ], [ %mul68.i, %if.then.i ]
%arrayidx19.i = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %j.064.i
%3 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
%tobool20.not.i = icmp eq i32 %3, 0
br i1 %tobool20.not.i, label %if.then21.i, label %for.inc.i
if.then21.i: ; preds = %for.body18.i
store i32 %conv12.i, ptr %arrayidx19.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then21.i, %for.body18.i
%add.i = add nuw nsw i64 %j.064.i, %i.066.i
%cmp16.not.i = icmp ugt i64 %add.i, 2000
br i1 %cmp16.not.i, label %for.inc25.i, label %for.body18.i, !llvm.loop !13
for.inc25.i: ; preds = %for.inc.i, %for.body.i
%inc.i = add nuw nsw i64 %i.066.i, 1
%mul.i = mul nsw i64 %inc.i, %inc.i
%exitcond = icmp eq i64 %inc.i, 45
br i1 %exitcond, label %vector.body, label %for.body.i, !llvm.loop !14
vector.body: ; preds = %for.inc25.i, %pred.store.continue51
%index = phi i64 [ %index.next, %pred.store.continue51 ], [ 0, %for.inc25.i ]
%4 = trunc i64 %index to i32
%offset.idx36 = add i64 %index, 45
%5 = add i64 %index, 49
%6 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %offset.idx36
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load37 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = icmp eq <4 x i32> %wide.load, zeroinitializer
%9 = icmp eq <4 x i32> %wide.load37, zeroinitializer
%10 = extractelement <4 x i1> %8, i64 0
br i1 %10, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%11 = add i32 %4, 45
%12 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %offset.idx36
store i32 %11, ptr %12, align 4, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%13 = extractelement <4 x i1> %8, i64 1
br i1 %13, label %pred.store.if38, label %pred.store.continue39
pred.store.if38: ; preds = %pred.store.continue
%14 = add i64 %index, 46
%15 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %14
%16 = add i32 %4, 46
store i32 %16, ptr %15, align 8, !tbaa !5
br label %pred.store.continue39
pred.store.continue39: ; preds = %pred.store.if38, %pred.store.continue
%17 = extractelement <4 x i1> %8, i64 2
br i1 %17, label %pred.store.if40, label %pred.store.continue41
pred.store.if40: ; preds = %pred.store.continue39
%18 = add i64 %index, 47
%19 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %18
%20 = add i32 %4, 47
store i32 %20, ptr %19, align 4, !tbaa !5
br label %pred.store.continue41
pred.store.continue41: ; preds = %pred.store.if40, %pred.store.continue39
%21 = extractelement <4 x i1> %8, i64 3
br i1 %21, label %pred.store.if42, label %pred.store.continue43
pred.store.if42: ; preds = %pred.store.continue41
%22 = add i64 %index, 48
%23 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %22
%24 = add i32 %4, 48
store i32 %24, ptr %23, align 16, !tbaa !5
br label %pred.store.continue43
pred.store.continue43: ; preds = %pred.store.if42, %pred.store.continue41
%25 = extractelement <4 x i1> %9, i64 0
br i1 %25, label %pred.store.if44, label %pred.store.continue45
pred.store.if44: ; preds = %pred.store.continue43
%26 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %5
%27 = add i32 %4, 49
store i32 %27, ptr %26, align 4, !tbaa !5
br label %pred.store.continue45
pred.store.continue45: ; preds = %pred.store.if44, %pred.store.continue43
%28 = extractelement <4 x i1> %9, i64 1
br i1 %28, label %pred.store.if46, label %pred.store.continue47
pred.store.if46: ; preds = %pred.store.continue45
%29 = add i64 %index, 50
%30 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %29
%31 = add i32 %4, 50
store i32 %31, ptr %30, align 8, !tbaa !5
br label %pred.store.continue47
pred.store.continue47: ; preds = %pred.store.if46, %pred.store.continue45
%32 = extractelement <4 x i1> %9, i64 2
br i1 %32, label %pred.store.if48, label %pred.store.continue49
pred.store.if48: ; preds = %pred.store.continue47
%33 = add i64 %index, 51
%34 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %33
%35 = add i32 %4, 51
store i32 %35, ptr %34, align 4, !tbaa !5
br label %pred.store.continue49
pred.store.continue49: ; preds = %pred.store.if48, %pred.store.continue47
%36 = extractelement <4 x i1> %9, i64 3
br i1 %36, label %pred.store.if50, label %pred.store.continue51
pred.store.if50: ; preds = %pred.store.continue49
%37 = add i64 %index, 52
%38 = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %37
%39 = add i32 %4, 52
store i32 %39, ptr %38, align 16, !tbaa !5
br label %pred.store.continue51
pred.store.continue51: ; preds = %pred.store.if50, %pred.store.continue49
%index.next = add nuw i64 %index, 8
%40 = icmp eq i64 %index.next, 1952
br i1 %40, label %for.body30.i, label %vector.body, !llvm.loop !16
for.body30.i: ; preds = %pred.store.continue51
%41 = load i32, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1997), align 4, !tbaa !5
%tobool32.not.i = icmp eq i32 %41, 0
br i1 %tobool32.not.i, label %if.then33.i, label %for.inc37.i
if.then33.i: ; preds = %for.body30.i
store i32 1997, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1997), align 4, !tbaa !5
br label %for.inc37.i
for.inc37.i: ; preds = %if.then33.i, %for.body30.i
%42 = load i32, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1998), align 8, !tbaa !5
%tobool32.not.i.1 = icmp eq i32 %42, 0
br i1 %tobool32.not.i.1, label %if.then33.i.1, label %for.inc37.i.1
if.then33.i.1: ; preds = %for.inc37.i
store i32 1998, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1998), align 8, !tbaa !5
br label %for.inc37.i.1
for.inc37.i.1: ; preds = %if.then33.i.1, %for.inc37.i
%43 = load i32, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1999), align 4, !tbaa !5
%tobool32.not.i.2 = icmp eq i32 %43, 0
br i1 %tobool32.not.i.2, label %if.then33.i.2, label %for.inc37.i.2
if.then33.i.2: ; preds = %for.inc37.i.1
store i32 1999, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 1999), align 4, !tbaa !5
br label %for.inc37.i.2
for.inc37.i.2: ; preds = %if.then33.i.2, %for.inc37.i.1
%44 = load i32, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 2000), align 16, !tbaa !5
%tobool32.not.i.3 = icmp eq i32 %44, 0
br i1 %tobool32.not.i.3, label %if.then33.i.3, label %for.inc37.i.3
if.then33.i.3: ; preds = %for.inc37.i.2
store i32 2000, ptr getelementptr inbounds ([10010 x i32], ptr @divisor, i64 0, i64 2000), align 16, !tbaa !5
br label %for.inc37.i.3
for.inc37.i.3: ; preds = %if.then33.i.3, %for.inc37.i.2
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%45 = load i64, ptr @n, align 8, !tbaa !17
%cmp.not27 = icmp slt i64 %45, 2
br i1 %cmp.not27, label %for.cond.cleanup10, label %while.cond.preheader
while.cond.preheader: ; preds = %for.inc37.i.3, %while.end
%i.028 = phi i64 [ %inc4, %while.end ], [ 2, %for.inc37.i.3 ]
br label %while.body
for.cond6.preheader: ; preds = %while.end
br i1 %cmp.not27, label %for.cond.cleanup10, label %for.body11.preheader
for.body11.preheader: ; preds = %for.cond6.preheader
%46 = add i64 %45, -1
%xtraiter = and i64 %46, 1
%47 = icmp eq i64 %45, 2
br i1 %47, label %for.cond.cleanup10.loopexit.unr-lcssa, label %for.body11.preheader.new
for.body11.preheader.new: ; preds = %for.body11.preheader
%unroll_iter = and i64 %46, -2
br label %for.body11
while.body: ; preds = %while.cond.preheader, %while.body
%t.026 = phi i64 [ %i.028, %while.cond.preheader ], [ %div, %while.body ]
%arrayidx = getelementptr inbounds [10010 x i32], ptr @divisor, i64 0, i64 %t.026
%48 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom = sext i32 %48 to i64
%arrayidx2 = getelementptr inbounds [1010 x i64], ptr @d, i64 0, i64 %idxprom
%49 = load i64, ptr %arrayidx2, align 8, !tbaa !17
%inc = add nsw i64 %49, 1
store i64 %inc, ptr %arrayidx2, align 8, !tbaa !17
%div = sdiv i64 %t.026, %idxprom
%cmp1.not = icmp eq i64 %div, 1
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %while.body
%inc4 = add nuw i64 %i.028, 1
%exitcond34.not = icmp eq i64 %i.028, %45
br i1 %exitcond34.not, label %for.cond6.preheader, label %while.cond.preheader, !llvm.loop !20
for.cond.cleanup10.loopexit.unr-lcssa: ; preds = %for.body11, %for.body11.preheader
%rem.lcssa.ph = phi i64 [ undef, %for.body11.preheader ], [ %rem.1, %for.body11 ]
%i5.031.unr = phi i64 [ 2, %for.body11.preheader ], [ %inc15.1, %for.body11 ]
%ans.030.unr = phi i64 [ 1, %for.body11.preheader ], [ %rem.1, %for.body11 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup10, label %for.body11.epil
for.body11.epil: ; preds = %for.cond.cleanup10.loopexit.unr-lcssa
%arrayidx12.epil = getelementptr inbounds [1010 x i64], ptr @d, i64 0, i64 %i5.031.unr
%50 = load i64, ptr %arrayidx12.epil, align 8, !tbaa !17
%add13.epil = add nsw i64 %50, 1
%mul.epil = mul nsw i64 %add13.epil, %ans.030.unr
%rem.epil = srem i64 %mul.epil, 1000000007
br label %for.cond.cleanup10
for.cond.cleanup10: ; preds = %for.body11.epil, %for.cond.cleanup10.loopexit.unr-lcssa, %for.inc37.i.3, %for.cond6.preheader
%ans.0.lcssa = phi i64 [ 1, %for.cond6.preheader ], [ 1, %for.inc37.i.3 ], [ %rem.lcssa.ph, %for.cond.cleanup10.loopexit.unr-lcssa ], [ %rem.epil, %for.body11.epil ]
%call17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
ret i32 0
for.body11: ; preds = %for.body11, %for.body11.preheader.new
%i5.031 = phi i64 [ 2, %for.body11.preheader.new ], [ %inc15.1, %for.body11 ]
%ans.030 = phi i64 [ 1, %for.body11.preheader.new ], [ %rem.1, %for.body11 ]
%niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.body11 ]
%arrayidx12 = getelementptr inbounds [1010 x i64], ptr @d, i64 0, i64 %i5.031
%51 = load i64, ptr %arrayidx12, align 16, !tbaa !17
%add13 = add nsw i64 %51, 1
%mul = mul nsw i64 %add13, %ans.030
%rem = srem i64 %mul, 1000000007
%inc15 = or i64 %i5.031, 1
%arrayidx12.1 = getelementptr inbounds [1010 x i64], ptr @d, i64 0, i64 %inc15
%52 = load i64, ptr %arrayidx12.1, align 8, !tbaa !17
%add13.1 = add nsw i64 %52, 1
%mul.1 = mul nsw i64 %add13.1, %rem
%rem.1 = srem i64 %mul.1, 1000000007
%inc15.1 = add nuw i64 %i5.031, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup10.loopexit.unr-lcssa, label %for.body11, !llvm.loop !21
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="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) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !11, !12}
!17 = !{!18, !18, i64 0}
!18 = !{!"long long", !7, i64 0}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
|
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CL while (getchar() != '\n') /*clear line*/
#define FOR(a, b, c) \
for (int(a) = (b); \
(b) < (c) ? (a) <= (c) : (a) >= (c); \
(b) < (c) ? (a)++ : (a)--)
#define FN(x) /*input x and run x times*/ \
int x; \
scanf("%d", &x); \
while (x--)
#define min(a, b) (a > b ? b : a)
#define max(a, b) (a < b ? b : a)
#define LL long long
#define eps 0.000001
#define pf printf
#define sf scanf
#define vp const void*
int cmp(vp a, vp b) {
int k1 = *(int*)(a), k2 = *(int*)(b);
return (k1 > k2) * 2 - 1;
}
int a[20000] = {};
int main() {
FN(q) {
int n, p = 1,pre[200]={};
sf("%d", &n);
FOR(i, 1, n) {
scanf("%d", a + i);
pre[i]=pre[i-1]+1+(a[i]==0);
}
int ans=0;
FOR(i,0,n)FOR(j,0,n){
if(j>i)ans+=pre[j]-pre[i];
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@a = dso_local global [20000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: 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 #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%sub = select i1 %cmp, i32 1, i32 -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:
%q = alloca i32, align 4
%n = alloca i32, align 4
%pre = alloca [200 x i32], align 16
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 %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%dec118 = add nsw i32 %0, -1
store i32 %dec118, ptr %q, align 4, !tbaa !5
%tobool.not119 = icmp eq i32 %0, 0
br i1 %tobool.not119, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup34
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %pre) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %pre, i8 0, i64 800, i1 false)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp101 = icmp sgt i32 %1, 1
%cmp2102 = icmp sgt i32 %1, 0
%cmp3103 = icmp slt i32 %1, 2
%cond.in104 = select i1 %cmp101, i1 %cmp2102, i1 %cmp3103
br i1 %cond.in104, label %for.body, label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.body, %while.body
%.lcssa = phi i32 [ %1, %while.body ], [ %7, %for.body ]
%cmp23 = icmp sgt i32 %.lcssa, 0
%cmp26112 = icmp sgt i32 %.lcssa, -1
%cmp29113 = icmp slt i32 %.lcssa, 1
%cond32.in114 = select i1 %cmp23, i1 %cmp26112, i1 %cmp29113
br i1 %cond32.in114, label %for.cond36.preheader.us.preheader, label %for.cond.cleanup34
for.cond36.preheader.us.preheader: ; preds = %for.cond22.preheader
%j.1.v = select i1 %cmp23, i64 1, i64 -1
%2 = sext i32 %.lcssa to i64
br label %for.cond36.preheader.us
for.cond36.preheader.us: ; preds = %for.cond36.preheader.us.preheader, %for.cond36.for.cond.cleanup48_crit_edge.us
%indvars.iv123 = phi i64 [ 0, %for.cond36.preheader.us.preheader ], [ %indvars.iv.next124, %for.cond36.for.cond.cleanup48_crit_edge.us ]
%ans.0115.us = phi i32 [ 0, %for.cond36.preheader.us.preheader ], [ %ans.2.us, %for.cond36.for.cond.cleanup48_crit_edge.us ]
%arrayidx55.us = getelementptr inbounds [200 x i32], ptr %pre, i64 0, i64 %indvars.iv123
br label %for.body49.us
for.body49.us: ; preds = %for.cond36.preheader.us, %for.inc58.us
%indvars.iv = phi i64 [ 0, %for.cond36.preheader.us ], [ %indvars.iv.next, %for.inc58.us ]
%ans.1109.us = phi i32 [ %ans.0115.us, %for.cond36.preheader.us ], [ %ans.2.us, %for.inc58.us ]
%cmp50.us = icmp sgt i64 %indvars.iv, %indvars.iv123
br i1 %cmp50.us, label %if.then.us, label %for.inc58.us
if.then.us: ; preds = %for.body49.us
%arrayidx53.us = getelementptr inbounds [200 x i32], ptr %pre, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx53.us, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx55.us, align 4, !tbaa !5
%sub56.us = add i32 %3, %ans.1109.us
%add57.us = sub i32 %sub56.us, %4
br label %for.inc58.us
for.inc58.us: ; preds = %if.then.us, %for.body49.us
%ans.2.us = phi i32 [ %add57.us, %if.then.us ], [ %ans.1109.us, %for.body49.us ]
%indvars.iv.next = add i64 %indvars.iv, %j.1.v
%cmp40.us = icmp sle i64 %indvars.iv.next, %2
%cmp43.us = icmp sge i64 %indvars.iv.next, %2
%cond46.in.us = select i1 %cmp23, i1 %cmp40.us, i1 %cmp43.us
br i1 %cond46.in.us, label %for.body49.us, label %for.cond36.for.cond.cleanup48_crit_edge.us, !llvm.loop !9
for.cond36.for.cond.cleanup48_crit_edge.us: ; preds = %for.inc58.us
%indvars.iv.next124 = add i64 %indvars.iv123, %j.1.v
%cmp26.us = icmp sle i64 %indvars.iv.next124, %2
%cmp29.us = icmp sge i64 %indvars.iv.next124, %2
%cond32.in.us = select i1 %cmp23, i1 %cmp26.us, i1 %cmp29.us
br i1 %cond32.in.us, label %for.cond36.preheader.us, label %for.cond.cleanup34, !llvm.loop !11
for.body: ; preds = %while.body, %for.body
%i.0105 = phi i32 [ %i.1, %for.body ], [ 1, %while.body ]
%idx.ext = sext i32 %i.0105 to i64
%add.ptr = getelementptr inbounds i32, ptr @a, i64 %idx.ext
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%sub = add nsw i32 %i.0105, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [200 x i32], ptr %pre, i64 0, i64 %idxprom
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %5, 1
%6 = load i32, ptr %add.ptr, align 4, !tbaa !5
%cmp9 = icmp eq i32 %6, 0
%conv10 = zext i1 %cmp9 to i32
%add11 = add nsw i32 %add, %conv10
%arrayidx13 = getelementptr inbounds [200 x i32], ptr %pre, i64 0, i64 %idx.ext
store i32 %add11, ptr %arrayidx13, align 4, !tbaa !5
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %7, 1
%inc = add nsw i32 %i.0105, 1
%i.1 = select i1 %cmp14, i32 %inc, i32 %sub
%cmp2 = icmp sle i32 %i.1, %7
%cmp3 = icmp sge i32 %i.1, %7
%cond.in = select i1 %cmp14, i1 %cmp2, i1 %cmp3
br i1 %cond.in, label %for.body, label %for.cond22.preheader, !llvm.loop !12
for.cond.cleanup34: ; preds = %for.cond36.for.cond.cleanup48_crit_edge.us, %for.cond22.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond22.preheader ], [ %ans.2.us, %for.cond36.for.cond.cleanup48_crit_edge.us ]
%call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %pre) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
%8 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %8, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%tobool.not = icmp eq i32 %8, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %for.cond.cleanup34, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_ARRAY_MAX 100000 // 最大配列数
// 内部変数
static FILE *szpFpI; // 入力
static int si1Array[D_ARRAY_MAX]; // 配列
static int siACnt; // 配列数
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
static int siTNo;
#endif
// 出力
int
fOut(
char *pcpLine // <I> 1行
)
{
char lc1Buf[1024];
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, pcpLine)) {
siRes = -1;
}
#else
printf("%s", pcpLine);
#endif
return 0;
}
// 実行メイン
long long
fMain(
)
{
int i;
char lc1Buf[1024];
// 配列数 - 取得
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%d", &siACnt);
// 配列 - 取得
for (i = 0; i < siACnt; i++) {
fscanf(szpFpI, "%d", &si1Array[i]);
}
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
// 合計値・最小値・負の数・0の数 - 取得
long long llSum = 0;
int liMin = INT_MAX;
int liMCnt = 0;
int liZCnt = 0;
for (i = 0; i < siACnt; i++) {
int liVal = abs(si1Array[i]);
llSum += liVal;
if (liMin > liVal) {
liMin = liVal;
}
if (si1Array[i] < 0) {
liMCnt++;
}
else if (si1Array[i] == 0) {
liZCnt++;
}
}
// 合計値 - 補正
if (liMCnt % 2 == 1) {
if (liZCnt == 0) {
llSum -= liMin * 2;
}
}
return llSum;
}
// 1回実行
int
fOne(
)
{
long long llRet;
char lc1Buf[1024];
// データ - 初期化
memset(si1Array, 0, sizeof(si1Array)); // 配列
// 入力 - セット
#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
// 実行メイン
llRet = fMain();
// 出力
sprintf(lc1Buf, "%lld\n", llRet);
fOut(lc1Buf);
// 残データ有無
#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_140020/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140020/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@siACnt = internal global i32 0, align 4
@si1Array = internal global [100000 x i32] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOut(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: nounwind uwtable
define dso_local i64 @fMain() local_unnamed_addr #3 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #8
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%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 @siACnt) #8
%1 = load i32, ptr @siACnt, align 4, !tbaa !9
%cmp55 = icmp sgt i32 %1, 0
br i1 %cmp55, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%2 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%arrayidx = getelementptr inbounds [100000 x i32], ptr @si1Array, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %2, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) #8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @siACnt, align 4, !tbaa !9
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%5 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call5 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %5)
%6 = load i32, ptr @siACnt, align 4, !tbaa !9
%cmp757 = icmp sgt i32 %6, 0
br i1 %cmp757, label %for.body8.preheader, label %for.end29
for.body8.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 4
br i1 %min.iters.check, label %for.body8.preheader83, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%vec.phi70 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
%vec.phi71 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%vec.phi72 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
%vec.phi73 = phi <2 x i32> [ <i32 2147483647, i32 2147483647>, %vector.ph ], [ %15, %vector.body ]
%vec.phi74 = phi <2 x i32> [ <i32 2147483647, i32 2147483647>, %vector.ph ], [ %16, %vector.body ]
%vec.phi75 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi76 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%7 = getelementptr inbounds [100000 x i32], ptr @si1Array, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %7, align 16, !tbaa !9
%8 = getelementptr inbounds i32, ptr %7, i64 2
%wide.load77 = load <2 x i32>, ptr %8, align 8, !tbaa !9
%9 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %wide.load, i1 true)
%10 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %wide.load77, i1 true)
%11 = zext <2 x i32> %9 to <2 x i64>
%12 = zext <2 x i32> %10 to <2 x i64>
%13 = add <2 x i64> %vec.phi75, %11
%14 = add <2 x i64> %vec.phi76, %12
%15 = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %vec.phi73, <2 x i32> %9)
%16 = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %vec.phi74, <2 x i32> %10)
%17 = icmp eq <2 x i32> %wide.load, zeroinitializer
%18 = icmp eq <2 x i32> %wide.load77, zeroinitializer
%19 = lshr <2 x i32> %wide.load, <i32 31, i32 31>
%20 = lshr <2 x i32> %wide.load77, <i32 31, i32 31>
%21 = add <2 x i32> %19, %vec.phi71
%22 = add <2 x i32> %20, %vec.phi72
%23 = zext <2 x i1> %17 to <2 x i32>
%24 = zext <2 x i1> %18 to <2 x i32>
%25 = add <2 x i32> %vec.phi, %23
%26 = add <2 x i32> %vec.phi70, %24
%index.next = add nuw i64 %index, 4
%27 = icmp eq i64 %index.next, %n.vec
br i1 %27, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx81 = add <2 x i64> %14, %13
%28 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx81)
%rdx.minmax = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %15, <2 x i32> %16)
%29 = call i32 @llvm.vector.reduce.smin.v2i32(<2 x i32> %rdx.minmax)
%bin.rdx78 = add <2 x i32> %22, %21
%30 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx78)
%bin.rdx = add <2 x i32> %26, %25
%31 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end29.loopexit, label %for.body8.preheader83
for.body8.preheader83: ; preds = %for.body8.preheader, %middle.block
%indvars.iv67.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ]
%liZCnt.061.ph = phi i32 [ 0, %for.body8.preheader ], [ %31, %middle.block ]
%liMCnt.060.ph = phi i32 [ 0, %for.body8.preheader ], [ %30, %middle.block ]
%liMin.059.ph = phi i32 [ 2147483647, %for.body8.preheader ], [ %29, %middle.block ]
%llSum.058.ph = phi i64 [ 0, %for.body8.preheader ], [ %28, %middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader83, %for.body8
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body8 ], [ %indvars.iv67.ph, %for.body8.preheader83 ]
%liZCnt.061 = phi i32 [ %liZCnt.1, %for.body8 ], [ %liZCnt.061.ph, %for.body8.preheader83 ]
%liMCnt.060 = phi i32 [ %liMCnt.1, %for.body8 ], [ %liMCnt.060.ph, %for.body8.preheader83 ]
%liMin.059 = phi i32 [ %spec.select, %for.body8 ], [ %liMin.059.ph, %for.body8.preheader83 ]
%llSum.058 = phi i64 [ %add, %for.body8 ], [ %llSum.058.ph, %for.body8.preheader83 ]
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr @si1Array, i64 0, i64 %indvars.iv67
%32 = load i32, ptr %arrayidx10, align 4, !tbaa !9
%33 = call i32 @llvm.abs.i32(i32 %32, i1 true)
%conv = zext i32 %33 to i64
%add = add nuw nsw i64 %llSum.058, %conv
%spec.select = call i32 @llvm.smin.i32(i32 %liMin.059, i32 %33)
%cmp21 = icmp eq i32 %32, 0
%.lobit = lshr i32 %32, 31
%liMCnt.1 = add nuw nsw i32 %.lobit, %liMCnt.060
%spec.select54 = zext i1 %cmp21 to i32
%liZCnt.1 = add nuw nsw i32 %liZCnt.061, %spec.select54
%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.end29.loopexit, label %for.body8, !llvm.loop !16
for.end29.loopexit: ; preds = %for.body8, %middle.block
%add.lcssa = phi i64 [ %28, %middle.block ], [ %add, %for.body8 ]
%spec.select.lcssa = phi i32 [ %29, %middle.block ], [ %spec.select, %for.body8 ]
%liMCnt.1.lcssa = phi i32 [ %30, %middle.block ], [ %liMCnt.1, %for.body8 ]
%liZCnt.1.lcssa = phi i32 [ %31, %middle.block ], [ %liZCnt.1, %for.body8 ]
%34 = and i32 %liMCnt.1.lcssa, 1
%35 = icmp ne i32 %34, 0
%36 = icmp eq i32 %liZCnt.1.lcssa, 0
%37 = select i1 %35, i1 %36, i1 false
%38 = shl nuw nsw i32 %spec.select.lcssa, 1
%39 = zext i32 %38 to i64
%40 = select i1 %37, i64 %39, i64 0
%41 = sub nsw i64 %add.lcssa, %40
br label %for.end29
for.end29: ; preds = %for.end29.loopexit, %for.end
%llSum.1 = phi i64 [ 0, %for.end ], [ %41, %for.end29.loopexit ]
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #8
ret i64 %llSum.1
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: nounwind uwtable
define dso_local i32 @fOne() local_unnamed_addr #3 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #8
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) @si1Array, i8 0, i64 400000, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call = tail call i64 @fMain()
%call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call) #8
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #8
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 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%lc1Buf.i = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf.i) #8
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) @si1Array, i8 0, i64 400000, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call.i = tail call i64 @fMain()
%call1.i = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf.i, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call.i) #8
%call.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf.i)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf.i) #8
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.abs.v2i32(<2 x i32>, i1 immarg) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v2i32(<2 x i32>) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 uwtable "min-legal-vector-width"="0" "no-trapping-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 = { "no-trapping-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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
|
#include <stdio.h>
#include <stdlib.h>
#define LL long long
void solve(long *arr, int len){
int min_pos = -1, i, n_count = 0;
long tmp, min = 1e9 + 100;
LL sum = 0;
for(i = 0; i < len; ++i) {
if(arr[i] < 0) { ++n_count; }
}
if(n_count % 2 != 0) {
for(i = 0; i < len; ++i) {
tmp = arr[i];
if(tmp < 0) { tmp *= -1; }
if(tmp < min) { min = tmp; min_pos = i;}
}
for(i = 0; i < len; ++i) {
if(i == min_pos) {
sum += (arr[i] > 0) ? -1*arr[i] : arr[i];
}
else {
sum += (arr[i] < 0)? -1*arr[i] : arr[i];
}
}
}
else {
for(i = 0; i < len; ++i) {
sum += (arr[i] < 0)? -1*arr[i] : arr[i];
}
}
printf("%lld\n", sum);
}
int main()
{
int n, i;
scanf("%d", &n);
long *a = (long*)malloc((n+7)*sizeof(long));
for(i = 0; i < n; ++i) { scanf("%ld", &a[i]); }
solve(a, n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\0A\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 void @solve(ptr nocapture noundef readonly %arr, i32 noundef %len) local_unnamed_addr #0 {
entry:
%cmp118 = icmp sgt i32 %len, 0
br i1 %cmp118, label %for.body.preheader, label %if.end69
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %len to i64
%min.iters.check = icmp ult i32 %len, 4
br i1 %min.iters.check, label %for.body.preheader177, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi155 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%0 = getelementptr inbounds i64, ptr %arr, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load156 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = lshr <2 x i64> %wide.load, <i64 63, i64 63>
%3 = lshr <2 x i64> %wide.load156, <i64 63, i64 63>
%4 = trunc <2 x i64> %2 to <2 x i32>
%5 = trunc <2 x i64> %3 to <2 x i32>
%6 = add <2 x i32> %vec.phi, %4
%7 = add <2 x i32> %vec.phi155, %5
%index.next = add nuw i64 %index, 4
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i32> %7, %6
%9 = tail call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader177
for.body.preheader177: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%n_count.0120.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader177, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader177 ]
%n_count.0120 = phi i32 [ %spec.select, %for.body ], [ %n_count.0120.ph, %for.body.preheader177 ]
%arrayidx = getelementptr inbounds i64, ptr %arr, i64 %indvars.iv
%10 = load i64, ptr %arrayidx, align 8, !tbaa !5
%.lobit = lshr i64 %10, 63
%inc = trunc i64 %.lobit to i32
%spec.select = add nuw nsw i32 %n_count.0120, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block
%spec.select.lcssa = phi i32 [ %9, %middle.block ], [ %spec.select, %for.body ]
%11 = and i32 %spec.select.lcssa, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %for.cond50.preheader, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.end
br i1 %cmp118, label %for.body7.preheader, label %if.end69
for.body7.preheader: ; preds = %for.cond5.preheader
%xtraiter = and i64 %wide.trip.count, 1
%13 = icmp eq i32 %len, 1
br i1 %13, label %for.cond19.preheader.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body7
for.cond50.preheader: ; preds = %for.end
br i1 %cmp118, label %for.body52.preheader, label %if.end69
for.body52.preheader: ; preds = %for.cond50.preheader
%wide.trip.count149 = zext i32 %len to i64
%min.iters.check159 = icmp ult i32 %len, 4
br i1 %min.iters.check159, label %for.body52.preheader174, label %vector.ph160
vector.ph160: ; preds = %for.body52.preheader
%n.vec162 = and i64 %wide.trip.count, 4294967292
br label %vector.body165
vector.body165: ; preds = %vector.body165, %vector.ph160
%index166 = phi i64 [ 0, %vector.ph160 ], [ %index.next171, %vector.body165 ]
%vec.phi167 = phi <2 x i64> [ zeroinitializer, %vector.ph160 ], [ %18, %vector.body165 ]
%vec.phi168 = phi <2 x i64> [ zeroinitializer, %vector.ph160 ], [ %19, %vector.body165 ]
%14 = getelementptr inbounds i64, ptr %arr, i64 %index166
%wide.load169 = load <2 x i64>, ptr %14, align 8, !tbaa !5
%15 = getelementptr inbounds i64, ptr %14, i64 2
%wide.load170 = load <2 x i64>, ptr %15, align 8, !tbaa !5
%16 = tail call <2 x i64> @llvm.abs.v2i64(<2 x i64> %wide.load169, i1 true)
%17 = tail call <2 x i64> @llvm.abs.v2i64(<2 x i64> %wide.load170, i1 true)
%18 = add <2 x i64> %16, %vec.phi167
%19 = add <2 x i64> %17, %vec.phi168
%index.next171 = add nuw i64 %index166, 4
%20 = icmp eq i64 %index.next171, %n.vec162
br i1 %20, label %middle.block157, label %vector.body165, !llvm.loop !14
middle.block157: ; preds = %vector.body165
%bin.rdx172 = add <2 x i64> %19, %18
%21 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx172)
%cmp.n164 = icmp eq i64 %n.vec162, %wide.trip.count
br i1 %cmp.n164, label %if.end69, label %for.body52.preheader174
for.body52.preheader174: ; preds = %for.body52.preheader, %middle.block157
%indvars.iv146.ph = phi i64 [ 0, %for.body52.preheader ], [ %n.vec162, %middle.block157 ]
%sum.2132.ph = phi i64 [ 0, %for.body52.preheader ], [ %21, %middle.block157 ]
br label %for.body52
for.cond19.preheader.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%min_pos.1.lcssa.ph = phi i32 [ undef, %for.body7.preheader ], [ %min_pos.1.1, %for.body7 ]
%indvars.iv136.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next137.1, %for.body7 ]
%min.0124.unr = phi i64 [ 1000000100, %for.body7.preheader ], [ %min.1.1, %for.body7 ]
%min_pos.0122.unr = phi i32 [ -1, %for.body7.preheader ], [ %min_pos.1.1, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond19.preheader, label %for.body7.epil
for.body7.epil: ; preds = %for.cond19.preheader.unr-lcssa
%arrayidx9.epil = getelementptr inbounds i64, ptr %arr, i64 %indvars.iv136.unr
%22 = load i64, ptr %arrayidx9.epil, align 8, !tbaa !5
%spec.select116.epil = tail call i64 @llvm.abs.i64(i64 %22, i1 true)
%cmp13.epil = icmp slt i64 %spec.select116.epil, %min.0124.unr
%23 = trunc i64 %indvars.iv136.unr to i32
%min_pos.1.epil = select i1 %cmp13.epil, i32 %23, i32 %min_pos.0122.unr
br label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.cond19.preheader.unr-lcssa, %for.body7.epil
%min_pos.1.lcssa = phi i32 [ %min_pos.1.lcssa.ph, %for.cond19.preheader.unr-lcssa ], [ %min_pos.1.epil, %for.body7.epil ]
%24 = zext i32 %min_pos.1.lcssa to i64
br i1 %cmp118, label %for.body21.preheader, label %if.end69
for.body21.preheader: ; preds = %for.cond19.preheader
%wide.trip.count144 = zext i32 %len to i64
%arrayidx25 = getelementptr inbounds i64, ptr %arr, i64 %24
br label %for.body21
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%indvars.iv136 = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next137.1, %for.body7 ]
%min.0124 = phi i64 [ 1000000100, %for.body7.preheader.new ], [ %min.1.1, %for.body7 ]
%min_pos.0122 = phi i32 [ -1, %for.body7.preheader.new ], [ %min_pos.1.1, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.body7 ]
%arrayidx9 = getelementptr inbounds i64, ptr %arr, i64 %indvars.iv136
%25 = load i64, ptr %arrayidx9, align 8, !tbaa !5
%spec.select116 = tail call i64 @llvm.abs.i64(i64 %25, i1 true)
%cmp13 = icmp slt i64 %spec.select116, %min.0124
%26 = trunc i64 %indvars.iv136 to i32
%min_pos.1 = select i1 %cmp13, i32 %26, i32 %min_pos.0122
%min.1 = tail call i64 @llvm.smin.i64(i64 %spec.select116, i64 %min.0124)
%indvars.iv.next137 = or i64 %indvars.iv136, 1
%arrayidx9.1 = getelementptr inbounds i64, ptr %arr, i64 %indvars.iv.next137
%27 = load i64, ptr %arrayidx9.1, align 8, !tbaa !5
%spec.select116.1 = tail call i64 @llvm.abs.i64(i64 %27, i1 true)
%cmp13.1 = icmp slt i64 %spec.select116.1, %min.1
%28 = trunc i64 %indvars.iv.next137 to i32
%min_pos.1.1 = select i1 %cmp13.1, i32 %28, i32 %min_pos.1
%min.1.1 = tail call i64 @llvm.smin.i64(i64 %spec.select116.1, i64 %min.1)
%indvars.iv.next137.1 = add nuw nsw i64 %indvars.iv136, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond19.preheader.unr-lcssa, label %for.body7, !llvm.loop !15
for.body21: ; preds = %for.body21.preheader, %for.inc46
%indvars.iv141 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next142, %for.inc46 ]
%sum.0128 = phi i64 [ 0, %for.body21.preheader ], [ %sum.1, %for.inc46 ]
%cmp22 = icmp eq i64 %indvars.iv141, %24
br i1 %cmp22, label %if.then23, label %if.else
if.then23: ; preds = %for.body21
%29 = load i64, ptr %arrayidx25, align 8, !tbaa !5
%30 = tail call i64 @llvm.abs.i64(i64 %29, i1 false)
%cond = sub i64 0, %30
br label %for.inc46
if.else: ; preds = %for.body21
%arrayidx33 = getelementptr inbounds i64, ptr %arr, i64 %indvars.iv141
%31 = load i64, ptr %arrayidx33, align 8, !tbaa !5
%cond43 = tail call i64 @llvm.abs.i64(i64 %31, i1 true)
br label %for.inc46
for.inc46: ; preds = %if.then23, %if.else
%cond.pn = phi i64 [ %cond, %if.then23 ], [ %cond43, %if.else ]
%sum.1 = add nsw i64 %cond.pn, %sum.0128
%indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
%exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
br i1 %exitcond145.not, label %if.end69, label %for.body21, !llvm.loop !16
for.body52: ; preds = %for.body52.preheader174, %for.body52
%indvars.iv146 = phi i64 [ %indvars.iv.next147, %for.body52 ], [ %indvars.iv146.ph, %for.body52.preheader174 ]
%sum.2132 = phi i64 [ %add65, %for.body52 ], [ %sum.2132.ph, %for.body52.preheader174 ]
%arrayidx54 = getelementptr inbounds i64, ptr %arr, i64 %indvars.iv146
%32 = load i64, ptr %arrayidx54, align 8, !tbaa !5
%cond64 = tail call i64 @llvm.abs.i64(i64 %32, i1 true)
%add65 = add nuw nsw i64 %cond64, %sum.2132
%indvars.iv.next147 = add nuw nsw i64 %indvars.iv146, 1
%exitcond150.not = icmp eq i64 %indvars.iv.next147, %wide.trip.count149
br i1 %exitcond150.not, label %if.end69, label %for.body52, !llvm.loop !17
if.end69: ; preds = %for.inc46, %for.body52, %middle.block157, %for.cond5.preheader, %entry, %for.cond19.preheader, %for.cond50.preheader
%sum.3 = phi i64 [ 0, %for.cond50.preheader ], [ 0, %for.cond19.preheader ], [ 0, %entry ], [ 0, %for.cond5.preheader ], [ %21, %middle.block157 ], [ %add65, %for.body52 ], [ %sum.1, %for.inc46 ]
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.3)
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: 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 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.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !18
%add = add nsw i32 %0, 7
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #6
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %solve.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr %n, align 4, !tbaa !18
%1 = sext i32 %.pr to i64
%cmp = icmp slt i64 %indvars.iv.next, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.body
%cmp118.i = icmp sgt i32 %.pr, 0
br i1 %cmp118.i, label %for.body.preheader.i, label %solve.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %.pr to i64
%min.iters.check = icmp ult i32 %.pr, 4
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi16 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%2 = getelementptr inbounds i64, ptr %call1, i64 %index
%wide.load = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = getelementptr inbounds i64, ptr %2, i64 2
%wide.load17 = load <2 x i64>, ptr %3, align 8, !tbaa !5
%4 = lshr <2 x i64> %wide.load, <i64 63, i64 63>
%5 = lshr <2 x i64> %wide.load17, <i64 63, i64 63>
%6 = trunc <2 x i64> %4 to <2 x i32>
%7 = trunc <2 x i64> %5 to <2 x i32>
%8 = add <2 x i32> %vec.phi, %6
%9 = add <2 x i32> %vec.phi16, %7
%index.next = add nuw i64 %index, 4
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.end.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%n_count.0120.i.ph = phi i32 [ 0, %for.body.preheader.i ], [ %11, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%n_count.0120.i = phi i32 [ %spec.select.i, %for.body.i ], [ %n_count.0120.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv.i
%12 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%.lobit.i = lshr i64 %12, 63
%inc.i = trunc i64 %.lobit.i to i32
%spec.select.i = add nuw nsw i32 %n_count.0120.i, %inc.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.end.i, label %for.body.i, !llvm.loop !22
for.end.i: ; preds = %for.body.i, %middle.block
%spec.select.i.lcssa = phi i32 [ %11, %middle.block ], [ %spec.select.i, %for.body.i ]
%13 = and i32 %spec.select.i.lcssa, 1
%14 = icmp eq i32 %13, 0
br i1 %14, label %for.body52.i.preheader, label %for.body7.i.preheader
for.body7.i.preheader: ; preds = %for.end.i
%xtraiter = and i64 %wide.trip.count.i, 1
%15 = icmp eq i32 %.pr, 1
br i1 %15, label %for.body21.preheader.i.unr-lcssa, label %for.body7.i.preheader.new
for.body7.i.preheader.new: ; preds = %for.body7.i.preheader
%unroll_iter = and i64 %wide.trip.count.i, 4294967294
br label %for.body7.i
for.body52.i.preheader: ; preds = %for.end.i
%min.iters.check20 = icmp ult i32 %.pr, 4
br i1 %min.iters.check20, label %for.body52.i.preheader35, label %vector.ph21
vector.ph21: ; preds = %for.body52.i.preheader
%n.vec23 = and i64 %wide.trip.count.i, 4294967292
br label %vector.body26
vector.body26: ; preds = %vector.body26, %vector.ph21
%index27 = phi i64 [ 0, %vector.ph21 ], [ %index.next32, %vector.body26 ]
%vec.phi28 = phi <2 x i64> [ zeroinitializer, %vector.ph21 ], [ %20, %vector.body26 ]
%vec.phi29 = phi <2 x i64> [ zeroinitializer, %vector.ph21 ], [ %21, %vector.body26 ]
%16 = getelementptr inbounds i64, ptr %call1, i64 %index27
%wide.load30 = load <2 x i64>, ptr %16, align 8, !tbaa !5
%17 = getelementptr inbounds i64, ptr %16, i64 2
%wide.load31 = load <2 x i64>, ptr %17, align 8, !tbaa !5
%18 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %wide.load30, i1 true)
%19 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %wide.load31, i1 true)
%20 = add <2 x i64> %18, %vec.phi28
%21 = add <2 x i64> %19, %vec.phi29
%index.next32 = add nuw i64 %index27, 4
%22 = icmp eq i64 %index.next32, %n.vec23
br i1 %22, label %middle.block18, label %vector.body26, !llvm.loop !23
middle.block18: ; preds = %vector.body26
%bin.rdx33 = add <2 x i64> %21, %20
%23 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx33)
%cmp.n25 = icmp eq i64 %n.vec23, %wide.trip.count.i
br i1 %cmp.n25, label %solve.exit, label %for.body52.i.preheader35
for.body52.i.preheader35: ; preds = %for.body52.i.preheader, %middle.block18
%indvars.iv146.i.ph = phi i64 [ 0, %for.body52.i.preheader ], [ %n.vec23, %middle.block18 ]
%sum.2132.i.ph = phi i64 [ 0, %for.body52.i.preheader ], [ %23, %middle.block18 ]
br label %for.body52.i
for.body21.preheader.i.unr-lcssa: ; preds = %for.body7.i, %for.body7.i.preheader
%min_pos.1.i.lcssa.ph = phi i32 [ undef, %for.body7.i.preheader ], [ %min_pos.1.i.1, %for.body7.i ]
%indvars.iv136.i.unr = phi i64 [ 0, %for.body7.i.preheader ], [ %indvars.iv.next137.i.1, %for.body7.i ]
%min.0124.i.unr = phi i64 [ 1000000100, %for.body7.i.preheader ], [ %min.1.i.1, %for.body7.i ]
%min_pos.0122.i.unr = phi i32 [ -1, %for.body7.i.preheader ], [ %min_pos.1.i.1, %for.body7.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body21.preheader.i, label %for.body7.i.epil
for.body7.i.epil: ; preds = %for.body21.preheader.i.unr-lcssa
%arrayidx9.i.epil = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv136.i.unr
%24 = load i64, ptr %arrayidx9.i.epil, align 8, !tbaa !5
%spec.select116.i.epil = call i64 @llvm.abs.i64(i64 %24, i1 true)
%cmp13.i.epil = icmp slt i64 %spec.select116.i.epil, %min.0124.i.unr
%25 = trunc i64 %indvars.iv136.i.unr to i32
%min_pos.1.i.epil = select i1 %cmp13.i.epil, i32 %25, i32 %min_pos.0122.i.unr
br label %for.body21.preheader.i
for.body21.preheader.i: ; preds = %for.body21.preheader.i.unr-lcssa, %for.body7.i.epil
%min_pos.1.i.lcssa = phi i32 [ %min_pos.1.i.lcssa.ph, %for.body21.preheader.i.unr-lcssa ], [ %min_pos.1.i.epil, %for.body7.i.epil ]
%26 = zext i32 %min_pos.1.i.lcssa to i64
%arrayidx25.i = getelementptr inbounds i64, ptr %call1, i64 %26
br label %for.body21.i
for.body7.i: ; preds = %for.body7.i, %for.body7.i.preheader.new
%indvars.iv136.i = phi i64 [ 0, %for.body7.i.preheader.new ], [ %indvars.iv.next137.i.1, %for.body7.i ]
%min.0124.i = phi i64 [ 1000000100, %for.body7.i.preheader.new ], [ %min.1.i.1, %for.body7.i ]
%min_pos.0122.i = phi i32 [ -1, %for.body7.i.preheader.new ], [ %min_pos.1.i.1, %for.body7.i ]
%niter = phi i64 [ 0, %for.body7.i.preheader.new ], [ %niter.next.1, %for.body7.i ]
%arrayidx9.i = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv136.i
%27 = load i64, ptr %arrayidx9.i, align 8, !tbaa !5
%spec.select116.i = call i64 @llvm.abs.i64(i64 %27, i1 true)
%cmp13.i = icmp slt i64 %spec.select116.i, %min.0124.i
%28 = trunc i64 %indvars.iv136.i to i32
%min_pos.1.i = select i1 %cmp13.i, i32 %28, i32 %min_pos.0122.i
%min.1.i = call i64 @llvm.smin.i64(i64 %spec.select116.i, i64 %min.0124.i)
%indvars.iv.next137.i = or i64 %indvars.iv136.i, 1
%arrayidx9.i.1 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv.next137.i
%29 = load i64, ptr %arrayidx9.i.1, align 8, !tbaa !5
%spec.select116.i.1 = call i64 @llvm.abs.i64(i64 %29, i1 true)
%cmp13.i.1 = icmp slt i64 %spec.select116.i.1, %min.1.i
%30 = trunc i64 %indvars.iv.next137.i to i32
%min_pos.1.i.1 = select i1 %cmp13.i.1, i32 %30, i32 %min_pos.1.i
%min.1.i.1 = call i64 @llvm.smin.i64(i64 %spec.select116.i.1, i64 %min.1.i)
%indvars.iv.next137.i.1 = add nuw nsw i64 %indvars.iv136.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.body21.preheader.i.unr-lcssa, label %for.body7.i, !llvm.loop !15
for.body21.i: ; preds = %for.inc46.i, %for.body21.preheader.i
%indvars.iv141.i = phi i64 [ 0, %for.body21.preheader.i ], [ %indvars.iv.next142.i, %for.inc46.i ]
%sum.0128.i = phi i64 [ 0, %for.body21.preheader.i ], [ %sum.1.i, %for.inc46.i ]
%cmp22.i = icmp eq i64 %indvars.iv141.i, %26
br i1 %cmp22.i, label %if.then23.i, label %if.else.i
if.then23.i: ; preds = %for.body21.i
%31 = load i64, ptr %arrayidx25.i, align 8, !tbaa !5
%32 = call i64 @llvm.abs.i64(i64 %31, i1 false)
%cond.i = sub i64 0, %32
br label %for.inc46.i
if.else.i: ; preds = %for.body21.i
%arrayidx33.i = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv141.i
%33 = load i64, ptr %arrayidx33.i, align 8, !tbaa !5
%cond43.i = call i64 @llvm.abs.i64(i64 %33, i1 true)
br label %for.inc46.i
for.inc46.i: ; preds = %if.else.i, %if.then23.i
%cond.pn.i = phi i64 [ %cond.i, %if.then23.i ], [ %cond43.i, %if.else.i ]
%sum.1.i = add nsw i64 %cond.pn.i, %sum.0128.i
%indvars.iv.next142.i = add nuw nsw i64 %indvars.iv141.i, 1
%exitcond145.not.i = icmp eq i64 %indvars.iv.next142.i, %wide.trip.count.i
br i1 %exitcond145.not.i, label %solve.exit, label %for.body21.i, !llvm.loop !16
for.body52.i: ; preds = %for.body52.i.preheader35, %for.body52.i
%indvars.iv146.i = phi i64 [ %indvars.iv.next147.i, %for.body52.i ], [ %indvars.iv146.i.ph, %for.body52.i.preheader35 ]
%sum.2132.i = phi i64 [ %add65.i, %for.body52.i ], [ %sum.2132.i.ph, %for.body52.i.preheader35 ]
%arrayidx54.i = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv146.i
%34 = load i64, ptr %arrayidx54.i, align 8, !tbaa !5
%cond64.i = call i64 @llvm.abs.i64(i64 %34, i1 true)
%add65.i = add nuw nsw i64 %cond64.i, %sum.2132.i
%indvars.iv.next147.i = add nuw nsw i64 %indvars.iv146.i, 1
%exitcond150.not.i = icmp eq i64 %indvars.iv.next147.i, %wide.trip.count.i
br i1 %exitcond150.not.i, label %solve.exit, label %for.body52.i, !llvm.loop !24
solve.exit: ; preds = %for.inc46.i, %for.body52.i, %middle.block18, %entry, %for.end
%sum.3.i = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %23, %middle.block18 ], [ %add65.i, %for.body52.i ], [ %sum.1.i, %for.inc46.i ]
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.3.i)
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 #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4
; 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 i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.abs.v2i64(<2 x i64>, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !12, !11}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10, !11, !12}
!22 = distinct !{!22, !10, !12, !11}
!23 = distinct !{!23, !10, !11, !12}
!24 = distinct !{!24, !10, !12, !11}
|
#include <stdio.h>
#include <stdlib.h>
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
int main(void){
int i;
int len;
int ii[1000000];
int a,b,c,d=0;
scanf("%d",&len);
if(len <= 3){
printf("0\n");
return 0;
}
for(i=0;i<len;i++){
scanf("%d",&ii[i]);
}
qsort(ii, len, sizeof(int), compare_int);
for(i=0;i<len;i++){
// printf("i%d %d\n",i,ii[i]);
}
a = ii[len-1];
for(i=len-2;i>1;i--){
if(a == ii[i]){
b = ii[i];
i--;
break;
}
else{
a = ii[i];
}
}
// printf("i%d a%d b%d\n",i,a,b);
c = ii[i];
i--;
for(;i>=0;i--){
if(c == ii[i]){
d = ii[i];
break;
}
else{
c = ii[i];
}
}
if(d == 0){
printf("0\n");
}
else{
// printf("%d %d\n",a,c);
printf("%ld\n",(long)a*c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140114/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1
@str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%len = alloca i32, align 4
%ii = alloca [1000000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %len) #6
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %ii) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len)
%0 = load i32, ptr %len, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 4
br i1 %cmp, label %if.then, label %for.body
if.then: ; preds = %entry
%puts89 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %cleanup
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr %ii, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %len, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%conv = sext i32 %1 to i64
call void @qsort(ptr noundef nonnull %ii, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compare_int) #6
%3 = load i32, ptr %len, align 4, !tbaa !5
%sub = add nsw i32 %3, -1
%idxprom11 = sext i32 %sub to i64
%arrayidx12 = getelementptr inbounds [1000000 x i32], ptr %ii, i64 0, i64 %idxprom11
%4 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%sub13 = add nsw i32 %3, -2
%cmp1598 = icmp sgt i32 %3, 3
br i1 %cmp1598, label %for.body17, label %for.end30
for.body17: ; preds = %for.end, %if.else
%a.0100 = phi i32 [ %5, %if.else ], [ %4, %for.end ]
%i.299 = phi i32 [ %dec, %if.else ], [ %sub13, %for.end ]
%idxprom18 = zext i32 %i.299 to i64
%arrayidx19 = getelementptr inbounds [1000000 x i32], ptr %ii, i64 0, i64 %idxprom18
%5 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %a.0100, %5
%dec = add nsw i32 %i.299, -1
br i1 %cmp20, label %for.end30, label %if.else
if.else: ; preds = %for.body17
%cmp15 = icmp sgt i32 %i.299, 2
br i1 %cmp15, label %for.body17, label %for.end30, !llvm.loop !11
for.end30: ; preds = %if.else, %for.body17, %for.end
%a.092 = phi i32 [ %4, %for.end ], [ %5, %if.else ], [ %a.0100, %for.body17 ]
%i.3 = phi i32 [ %sub13, %for.end ], [ 1, %if.else ], [ %dec, %for.body17 ]
%idxprom31 = sext i32 %i.3 to i64
%arrayidx32 = getelementptr inbounds [1000000 x i32], ptr %ii, i64 0, i64 %idxprom31
%6 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%7 = zext i32 %i.3 to i64
br label %for.cond34
for.cond34: ; preds = %for.body37, %for.end30
%indvars.iv110 = phi i64 [ %9, %for.body37 ], [ %7, %for.end30 ]
%c.0 = phi i32 [ %10, %for.body37 ], [ %6, %for.end30 ]
%8 = trunc i64 %indvars.iv110 to i32
%cmp35 = icmp sgt i32 %8, 0
br i1 %cmp35, label %for.body37, label %if.then54
for.body37: ; preds = %for.cond34
%9 = add nsw i64 %indvars.iv110, -1
%arrayidx39 = getelementptr inbounds [1000000 x i32], ptr %ii, i64 0, i64 %9
%10 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%cmp40 = icmp eq i32 %c.0, %10
br i1 %cmp40, label %if.then42, label %for.cond34, !llvm.loop !12
if.then42: ; preds = %for.body37
%11 = icmp eq i32 %c.0, 0
br i1 %11, label %if.then54, label %if.else56
if.then54: ; preds = %for.cond34, %if.then42
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %cleanup
if.else56: ; preds = %if.then42
%conv57 = sext i32 %a.092 to i64
%conv58 = sext i32 %c.0 to i64
%mul = mul nsw i64 %conv58, %conv57
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul)
br label %cleanup
cleanup: ; preds = %if.then54, %if.else56, %if.then
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %ii) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %len) #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: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
// ABC047 B - すぬけ君の塗り絵 2 イージー
#include <stdio.h>
int main(void)
{
int W, H, N;
scanf("%d %d %d", &W, &H, &N);
int S[N][3];
int i = 0;
for (i = 0; i < N; i++) {
scanf("%d %d %d", &S[i][0], &S[i][1], &S[i][2]);
}
int xStart = 0, xEnd = W, yStart = 0, yEnd = H;
for (i = 0; i < N; i++) {
switch (S[i][2]) {
case 1:
if (xStart < S[i][0]) {
xStart = S[i][0];
}
break;
case 2:
if (xEnd > S[i][0]) {
xEnd = S[i][0];
}
break;
case 3:
if (yStart < S[i][1]) {
yStart = S[i][1];
}
break;
case 4:
if (yEnd > S[i][1]) {
yEnd = S[i][1];
}
break;
default:
break;
}
}
int result = (xEnd - xStart) * (yEnd - yStart);
if (xEnd <= xStart || yEnd <= yStart) {
result = 0;
}
printf("%d\n", result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140165/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140165/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca [3 x i32], i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp90 = icmp sgt i32 %3, 0
br i1 %cmp90, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%4 = load i32, ptr %W, align 4, !tbaa !5
%5 = load i32, ptr %H, align 4, !tbaa !5
br label %for.end54
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv, i64 1
%arrayidx7 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv, i64 2
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%8 = load i32, ptr %W, align 4, !tbaa !5
%9 = load i32, ptr %H, align 4, !tbaa !5
%cmp1092 = icmp sgt i32 %6, 0
br i1 %cmp1092, label %for.body11.preheader, label %for.end54
for.body11.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %6 to i64
br label %for.body11
for.body11: ; preds = %for.body11.preheader, %for.inc52
%indvars.iv104 = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next105, %for.inc52 ]
%yEnd.097 = phi i32 [ %9, %for.body11.preheader ], [ %yEnd.1, %for.inc52 ]
%yStart.096 = phi i32 [ 0, %for.body11.preheader ], [ %yStart.1, %for.inc52 ]
%xEnd.095 = phi i32 [ %8, %for.body11.preheader ], [ %xEnd.1, %for.inc52 ]
%xStart.094 = phi i32 [ 0, %for.body11.preheader ], [ %xStart.1, %for.inc52 ]
%arrayidx13 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv104
%arrayidx14 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv104, i64 2
%10 = load i32, ptr %arrayidx14, align 4, !tbaa !5
switch i32 %10, label %for.inc52 [
i32 1, label %sw.bb
i32 2, label %sw.bb22
i32 3, label %sw.bb32
i32 4, label %sw.bb42
]
sw.bb: ; preds = %for.body11
%11 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %xStart.094, i32 %11)
br label %for.inc52
sw.bb22: ; preds = %for.body11
%12 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%spec.select87 = call i32 @llvm.smin.i32(i32 %xEnd.095, i32 %12)
br label %for.inc52
sw.bb32: ; preds = %for.body11
%arrayidx35 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv104, i64 1
%13 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%spec.select88 = call i32 @llvm.smax.i32(i32 %yStart.096, i32 %13)
br label %for.inc52
sw.bb42: ; preds = %for.body11
%arrayidx45 = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv104, i64 1
%14 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%spec.select89 = call i32 @llvm.smin.i32(i32 %yEnd.097, i32 %14)
br label %for.inc52
for.inc52: ; preds = %sw.bb42, %sw.bb32, %sw.bb22, %sw.bb, %for.body11
%xStart.1 = phi i32 [ %xStart.094, %for.body11 ], [ %spec.select, %sw.bb ], [ %xStart.094, %sw.bb22 ], [ %xStart.094, %sw.bb32 ], [ %xStart.094, %sw.bb42 ]
%xEnd.1 = phi i32 [ %xEnd.095, %for.body11 ], [ %xEnd.095, %sw.bb ], [ %spec.select87, %sw.bb22 ], [ %xEnd.095, %sw.bb32 ], [ %xEnd.095, %sw.bb42 ]
%yStart.1 = phi i32 [ %yStart.096, %for.body11 ], [ %yStart.096, %sw.bb ], [ %yStart.096, %sw.bb22 ], [ %spec.select88, %sw.bb32 ], [ %yStart.096, %sw.bb42 ]
%yEnd.1 = phi i32 [ %yEnd.097, %for.body11 ], [ %yEnd.097, %sw.bb ], [ %yEnd.097, %sw.bb22 ], [ %yEnd.097, %sw.bb32 ], [ %spec.select89, %sw.bb42 ]
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%exitcond.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count
br i1 %exitcond.not, label %for.end54, label %for.body11, !llvm.loop !11
for.end54: ; preds = %for.inc52, %for.end.thread, %for.end
%xStart.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %xStart.1, %for.inc52 ]
%xEnd.0.lcssa = phi i32 [ %8, %for.end ], [ %4, %for.end.thread ], [ %xEnd.1, %for.inc52 ]
%yStart.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %yStart.1, %for.inc52 ]
%yEnd.0.lcssa = phi i32 [ %9, %for.end ], [ %5, %for.end.thread ], [ %yEnd.1, %for.inc52 ]
%cmp56.not = icmp sgt i32 %xEnd.0.lcssa, %xStart.0.lcssa
br i1 %cmp56.not, label %lor.lhs.false, label %if.then58
lor.lhs.false: ; preds = %for.end54
%sub = sub nsw i32 %xEnd.0.lcssa, %xStart.0.lcssa
%sub55 = sub nsw i32 %yEnd.0.lcssa, %yStart.0.lcssa
%mul = mul nsw i32 %sub55, %sub
%cmp57.not = icmp sgt i32 %yEnd.0.lcssa, %yStart.0.lcssa
br i1 %cmp57.not, label %if.end59, label %if.then58
if.then58: ; preds = %lor.lhs.false, %for.end54
br label %if.end59
if.end59: ; preds = %if.then58, %lor.lhs.false
%result.0 = phi i32 [ 0, %if.then58 ], [ %mul, %lor.lhs.false ]
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.0)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int w,h,n;
scanf("%d",&w);
scanf("%d",&h);
scanf("%d",&n);
int point[h][w];
int x[n];
int y[n];
int a[n];
int s = 0;
for(int i = 0;i < h;i++){
for(int j = 0;j < w;j++){
point[i][j] = 0;
}
}
for(int i = 0;i < n;i++){
scanf("%d",&x[i]);
scanf("%d",&y[i]);
scanf("%d",&a[i]);
}
for(int i = 0;i < n;i++){
if(a[i] == 1){
for(int j = 0;j < h;j++){
for(int k = 0;k < x[i];k++){
point[j][k] = 1;
}
}
}else if(a[i] == 2){
for(int j = 0;j < h;j++){
for(int k = x[i];k < w;k++){
point[j][k] = 1;
}
}
}else if(a[i] == 3){
for(int j = 0;j < y[i];j++){
for(int k = 0;k < w;k++){
point[j][k] = 1;
}
}
}else if(a[i] == 4){
for(int j = y[i];j < h;j++){
for(int k = 0;k < w;k++){
point[j][k] = 1;
}
}
}
}
for(int i = 0;i < h;i++){
for(int j = 0;j < w;j++){
if(point[i][j] == 0){
s++;
}
}
}
printf("%d",s);
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140208/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140208/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%w = alloca i32, align 4
%h = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %w, align 4, !tbaa !5
%3 = zext i32 %2 to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i32, i64 %5, align 16
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%vla4 = alloca i32, i64 %7, align 16
%vla5 = alloca i32, i64 %7, align 16
%8 = load i32, ptr %h, align 4
%cmp216 = icmp sgt i32 %8, 0
br i1 %cmp216, label %for.cond6.preheader.lr.ph, label %for.cond16.preheader
for.cond6.preheader.lr.ph: ; preds = %entry
%9 = load i32, ptr %w, align 4, !tbaa !5
%cmp7214 = icmp sgt i32 %9, 0
br i1 %cmp7214, label %for.cond6.preheader.us.preheader, label %for.cond16.preheader
for.cond6.preheader.us.preheader: ; preds = %for.cond6.preheader.lr.ph
%10 = shl nuw nsw i64 %3, 2
%11 = zext i32 %9 to i64
%12 = shl nuw nsw i64 %11, 2
%wide.trip.count = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count, 7
%13 = icmp ult i32 %8, 8
br i1 %13, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.cond6.preheader.us.preheader.new
for.cond6.preheader.us.preheader.new: ; preds = %for.cond6.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
br label %for.cond6.preheader.us
for.cond6.preheader.us: ; preds = %for.cond6.preheader.us, %for.cond6.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond6.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond6.preheader.us ]
%niter = phi i64 [ 0, %for.cond6.preheader.us.preheader.new ], [ %niter.next.7, %for.cond6.preheader.us ]
%14 = mul nuw nsw i64 %10, %indvar
%scevgep = getelementptr i8, ptr %vla, i64 %14
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next = or i64 %indvar, 1
%15 = mul nuw nsw i64 %10, %indvar.next
%scevgep.1 = getelementptr i8, ptr %vla, i64 %15
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.1, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.1 = or i64 %indvar, 2
%16 = mul nuw nsw i64 %10, %indvar.next.1
%scevgep.2 = getelementptr i8, ptr %vla, i64 %16
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.2, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.2 = or i64 %indvar, 3
%17 = mul nuw nsw i64 %10, %indvar.next.2
%scevgep.3 = getelementptr i8, ptr %vla, i64 %17
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.3, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.3 = or i64 %indvar, 4
%18 = mul nuw nsw i64 %10, %indvar.next.3
%scevgep.4 = getelementptr i8, ptr %vla, i64 %18
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.4 = or i64 %indvar, 5
%19 = mul nuw nsw i64 %10, %indvar.next.4
%scevgep.5 = getelementptr i8, ptr %vla, i64 %19
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.5, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.5 = or i64 %indvar, 6
%20 = mul nuw nsw i64 %10, %indvar.next.5
%scevgep.6 = getelementptr i8, ptr %vla, i64 %20
call void @llvm.memset.p0.i64(ptr align 8 %scevgep.6, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.6 = or i64 %indvar, 7
%21 = mul nuw nsw i64 %10, %indvar.next.6
%scevgep.7 = getelementptr i8, ptr %vla, i64 %21
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.7, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.7 = add nuw nsw i64 %indvar, 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.cond16.preheader.loopexit.unr-lcssa, label %for.cond6.preheader.us, !llvm.loop !9
for.cond16.preheader.loopexit.unr-lcssa: ; preds = %for.cond6.preheader.us, %for.cond6.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond6.preheader.us.preheader ], [ %indvar.next.7, %for.cond6.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.cond6.preheader.us.epil
for.cond6.preheader.us.epil: ; preds = %for.cond16.preheader.loopexit.unr-lcssa, %for.cond6.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond6.preheader.us.epil ], [ %indvar.unr, %for.cond16.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond6.preheader.us.epil ], [ 0, %for.cond16.preheader.loopexit.unr-lcssa ]
%22 = mul nuw nsw i64 %10, %indvar.epil
%scevgep.epil = getelementptr i8, ptr %vla, i64 %22
call void @llvm.memset.p0.i64(ptr align 4 %scevgep.epil, i8 0, i64 %12, i1 false), !tbaa !5
%indvar.next.epil = add nuw nsw i64 %indvar.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.cond16.preheader, label %for.cond6.preheader.us.epil, !llvm.loop !11
for.cond16.preheader: ; preds = %for.cond16.preheader.loopexit.unr-lcssa, %for.cond6.preheader.us.epil, %for.cond6.preheader.lr.ph, %entry
%cmp17218 = icmp sgt i32 %6, 0
br i1 %cmp17218, label %for.body19, label %for.cond148.preheader
for.cond33.preheader: ; preds = %for.body19
%.pre.pre = load i32, ptr %h, align 4
%cmp34236 = icmp sgt i32 %24, 0
br i1 %cmp34236, label %for.body36.lr.ph, label %for.cond148.preheader
for.body36.lr.ph: ; preds = %for.cond33.preheader
%23 = load i32, ptr %w, align 4
%cmp128220 = icmp slt i32 %23, 1
%cmp67230 = icmp sgt i32 %.pre.pre, 0
%wide.trip.count302 = zext i32 %24 to i64
%wide.trip.count267 = sext i32 %.pre.pre to i64
%wide.trip.count262 = zext i32 %23 to i64
%wide.trip.count272 = zext i32 %23 to i64
%wide.trip.count287 = zext i32 %.pre.pre to i64
%wide.trip.count282 = sext i32 %23 to i64
%wide.trip.count297 = zext i32 %.pre.pre to i64
%min.iters.check351 = icmp ult i32 %23, 8
%n.vec354 = and i64 %wide.trip.count262, 4294967288
%cmp.n356 = icmp eq i64 %n.vec354, %wide.trip.count262
%min.iters.check340 = icmp ult i32 %23, 8
%n.vec343 = and i64 %wide.trip.count262, 4294967288
%cmp.n345 = icmp eq i64 %n.vec343, %wide.trip.count262
br label %for.body36
for.body19: ; preds = %for.cond16.preheader, %for.body19
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body19 ], [ 0, %for.cond16.preheader ]
%arrayidx21 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx21)
%arrayidx24 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx24)
%arrayidx27 = getelementptr inbounds i32, ptr %vla5, i64 %indvars.iv
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx27)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%24 = load i32, ptr %n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp17 = icmp slt i64 %indvars.iv.next, %25
br i1 %cmp17, label %for.body19, label %for.cond33.preheader, !llvm.loop !13
for.cond148.preheader: ; preds = %for.inc144, %for.cond16.preheader, %for.cond33.preheader
%.pre318 = phi i32 [ %.pre.pre, %for.cond33.preheader ], [ %8, %for.cond16.preheader ], [ %.pre.pre, %for.inc144 ]
%cmp149242 = icmp sgt i32 %.pre318, 0
br i1 %cmp149242, label %for.cond153.preheader.lr.ph, label %for.cond.cleanup150
for.cond153.preheader.lr.ph: ; preds = %for.cond148.preheader
%26 = load i32, ptr %w, align 4, !tbaa !5
%cmp154238 = icmp sgt i32 %26, 0
br i1 %cmp154238, label %for.cond153.preheader.us.preheader, label %for.cond.cleanup150
for.cond153.preheader.us.preheader: ; preds = %for.cond153.preheader.lr.ph
%wide.trip.count312 = zext i32 %.pre318 to i64
%wide.trip.count307 = zext i32 %26 to i64
%min.iters.check362 = icmp ult i32 %26, 8
%n.vec365 = and i64 %wide.trip.count307, 4294967288
%cmp.n367 = icmp eq i64 %n.vec365, %wide.trip.count307
br label %for.cond153.preheader.us
for.cond153.preheader.us: ; preds = %for.cond153.preheader.us.preheader, %for.cond153.for.cond.cleanup155_crit_edge.us
%indvars.iv309 = phi i64 [ 0, %for.cond153.preheader.us.preheader ], [ %indvars.iv.next310, %for.cond153.for.cond.cleanup155_crit_edge.us ]
%s.0243.us = phi i32 [ 0, %for.cond153.preheader.us.preheader ], [ %spec.select.us.lcssa, %for.cond153.for.cond.cleanup155_crit_edge.us ]
%27 = mul nuw nsw i64 %indvars.iv309, %3
%arrayidx158.us = getelementptr inbounds i32, ptr %vla, i64 %27
br i1 %min.iters.check362, label %for.body156.us.preheader, label %vector.ph363
vector.ph363: ; preds = %for.cond153.preheader.us
%28 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %s.0243.us, i64 0
br label %vector.body368
vector.body368: ; preds = %vector.body368, %vector.ph363
%index369 = phi i64 [ 0, %vector.ph363 ], [ %index.next372, %vector.body368 ]
%vec.phi = phi <4 x i32> [ %28, %vector.ph363 ], [ %35, %vector.body368 ]
%vec.phi370 = phi <4 x i32> [ zeroinitializer, %vector.ph363 ], [ %36, %vector.body368 ]
%29 = getelementptr inbounds i32, ptr %arrayidx158.us, i64 %index369
%wide.load = load <4 x i32>, ptr %29, align 4, !tbaa !5
%30 = getelementptr inbounds i32, ptr %29, i64 4
%wide.load371 = load <4 x i32>, ptr %30, align 4, !tbaa !5
%31 = icmp eq <4 x i32> %wide.load, zeroinitializer
%32 = icmp eq <4 x i32> %wide.load371, zeroinitializer
%33 = zext <4 x i1> %31 to <4 x i32>
%34 = zext <4 x i1> %32 to <4 x i32>
%35 = add <4 x i32> %vec.phi, %33
%36 = add <4 x i32> %vec.phi370, %34
%index.next372 = add nuw i64 %index369, 8
%37 = icmp eq i64 %index.next372, %n.vec365
br i1 %37, label %middle.block360, label %vector.body368, !llvm.loop !14
middle.block360: ; preds = %vector.body368
%bin.rdx = add <4 x i32> %36, %35
%38 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n367, label %for.cond153.for.cond.cleanup155_crit_edge.us, label %for.body156.us.preheader
for.body156.us.preheader: ; preds = %for.cond153.preheader.us, %middle.block360
%indvars.iv304.ph = phi i64 [ 0, %for.cond153.preheader.us ], [ %n.vec365, %middle.block360 ]
%s.1239.us.ph = phi i32 [ %s.0243.us, %for.cond153.preheader.us ], [ %38, %middle.block360 ]
br label %for.body156.us
for.body156.us: ; preds = %for.body156.us.preheader, %for.body156.us
%indvars.iv304 = phi i64 [ %indvars.iv.next305, %for.body156.us ], [ %indvars.iv304.ph, %for.body156.us.preheader ]
%s.1239.us = phi i32 [ %spec.select.us, %for.body156.us ], [ %s.1239.us.ph, %for.body156.us.preheader ]
%arrayidx160.us = getelementptr inbounds i32, ptr %arrayidx158.us, i64 %indvars.iv304
%39 = load i32, ptr %arrayidx160.us, align 4, !tbaa !5
%cmp161.us = icmp eq i32 %39, 0
%inc163.us = zext i1 %cmp161.us to i32
%spec.select.us = add nsw i32 %s.1239.us, %inc163.us
%indvars.iv.next305 = add nuw nsw i64 %indvars.iv304, 1
%exitcond308.not = icmp eq i64 %indvars.iv.next305, %wide.trip.count307
br i1 %exitcond308.not, label %for.cond153.for.cond.cleanup155_crit_edge.us, label %for.body156.us, !llvm.loop !17
for.cond153.for.cond.cleanup155_crit_edge.us: ; preds = %for.body156.us, %middle.block360
%spec.select.us.lcssa = phi i32 [ %38, %middle.block360 ], [ %spec.select.us, %for.body156.us ]
%indvars.iv.next310 = add nuw nsw i64 %indvars.iv309, 1
%exitcond313.not = icmp eq i64 %indvars.iv.next310, %wide.trip.count312
br i1 %exitcond313.not, label %for.cond.cleanup150, label %for.cond153.preheader.us, !llvm.loop !18
for.body36: ; preds = %for.body36.lr.ph, %for.inc144
%indvars.iv299 = phi i64 [ 0, %for.body36.lr.ph ], [ %indvars.iv.next300, %for.inc144 ]
%arrayidx38 = getelementptr inbounds i32, ptr %vla5, i64 %indvars.iv299
%40 = load i32, ptr %arrayidx38, align 4, !tbaa !5
switch i32 %40, label %for.inc144 [
i32 1, label %for.cond41.preheader
i32 2, label %for.cond66.preheader
i32 3, label %for.cond93.preheader
i32 4, label %if.then118
]
for.cond93.preheader: ; preds = %for.body36
%arrayidx95 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv299
%41 = load i32, ptr %arrayidx95, align 4, !tbaa !5
%cmp96226 = icmp slt i32 %41, 1
%brmerge = select i1 %cmp96226, i1 true, i1 %cmp128220
br i1 %brmerge, label %for.inc144, label %for.cond100.preheader.us.preheader
for.cond100.preheader.us.preheader: ; preds = %for.cond93.preheader
%wide.trip.count277 = zext i32 %41 to i64
br label %for.cond100.preheader.us
for.cond100.preheader.us: ; preds = %for.cond100.preheader.us.preheader, %for.cond100.for.cond.cleanup102_crit_edge.us
%indvars.iv274 = phi i64 [ 0, %for.cond100.preheader.us.preheader ], [ %indvars.iv.next275, %for.cond100.for.cond.cleanup102_crit_edge.us ]
%42 = mul nuw nsw i64 %indvars.iv274, %3
%arrayidx105.us = getelementptr inbounds i32, ptr %vla, i64 %42
br i1 %min.iters.check340, label %for.body103.us.preheader, label %vector.body346
vector.body346: ; preds = %for.cond100.preheader.us, %vector.body346
%index347 = phi i64 [ %index.next348, %vector.body346 ], [ 0, %for.cond100.preheader.us ]
%43 = getelementptr inbounds i32, ptr %arrayidx105.us, i64 %index347
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %43, align 4, !tbaa !5
%44 = getelementptr inbounds i32, ptr %43, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %44, align 4, !tbaa !5
%index.next348 = add nuw i64 %index347, 8
%45 = icmp eq i64 %index.next348, %n.vec343
br i1 %45, label %middle.block338, label %vector.body346, !llvm.loop !19
middle.block338: ; preds = %vector.body346
br i1 %cmp.n345, label %for.cond100.for.cond.cleanup102_crit_edge.us, label %for.body103.us.preheader
for.body103.us.preheader: ; preds = %for.cond100.preheader.us, %middle.block338
%indvars.iv269.ph = phi i64 [ 0, %for.cond100.preheader.us ], [ %n.vec343, %middle.block338 ]
br label %for.body103.us
for.body103.us: ; preds = %for.body103.us.preheader, %for.body103.us
%indvars.iv269 = phi i64 [ %indvars.iv.next270, %for.body103.us ], [ %indvars.iv269.ph, %for.body103.us.preheader ]
%arrayidx107.us = getelementptr inbounds i32, ptr %arrayidx105.us, i64 %indvars.iv269
store i32 1, ptr %arrayidx107.us, align 4, !tbaa !5
%indvars.iv.next270 = add nuw nsw i64 %indvars.iv269, 1
%exitcond273.not = icmp eq i64 %indvars.iv.next270, %wide.trip.count272
br i1 %exitcond273.not, label %for.cond100.for.cond.cleanup102_crit_edge.us, label %for.body103.us, !llvm.loop !20
for.cond100.for.cond.cleanup102_crit_edge.us: ; preds = %for.body103.us, %middle.block338
%indvars.iv.next275 = add nuw nsw i64 %indvars.iv274, 1
%exitcond278.not = icmp eq i64 %indvars.iv.next275, %wide.trip.count277
br i1 %exitcond278.not, label %for.inc144, label %for.cond100.preheader.us, !llvm.loop !21
for.cond66.preheader: ; preds = %for.body36
br i1 %cmp67230, label %for.body69.lr.ph, label %for.inc144
for.body69.lr.ph: ; preds = %for.cond66.preheader
%arrayidx72 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv299
%46 = load i32, ptr %arrayidx72, align 4, !tbaa !5
%cmp74228 = icmp slt i32 %46, %23
br i1 %cmp74228, label %for.body69.us.preheader, label %for.inc144
for.body69.us.preheader: ; preds = %for.body69.lr.ph
%47 = sext i32 %46 to i64
%48 = sub nsw i64 %wide.trip.count282, %47
%min.iters.check329 = icmp ult i64 %48, 8
%n.vec332 = and i64 %48, -8
%ind.end = add nsw i64 %n.vec332, %47
%cmp.n334 = icmp eq i64 %48, %n.vec332
br label %for.body69.us
for.body69.us: ; preds = %for.body69.us.preheader, %for.cond73.for.cond.cleanup75_crit_edge.us
%indvars.iv284 = phi i64 [ 0, %for.body69.us.preheader ], [ %indvars.iv.next285, %for.cond73.for.cond.cleanup75_crit_edge.us ]
%49 = mul nuw nsw i64 %indvars.iv284, %3
%arrayidx78.us = getelementptr inbounds i32, ptr %vla, i64 %49
br i1 %min.iters.check329, label %for.body76.us.preheader, label %vector.ph330
vector.ph330: ; preds = %for.body69.us
%invariant.gep = getelementptr i32, ptr %arrayidx78.us, i64 %47
br label %vector.body335
vector.body335: ; preds = %vector.body335, %vector.ph330
%index336 = phi i64 [ 0, %vector.ph330 ], [ %index.next337, %vector.body335 ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index336
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %gep, align 4, !tbaa !5
%50 = getelementptr inbounds i32, ptr %gep, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %50, align 4, !tbaa !5
%index.next337 = add nuw i64 %index336, 8
%51 = icmp eq i64 %index.next337, %n.vec332
br i1 %51, label %middle.block327, label %vector.body335, !llvm.loop !22
middle.block327: ; preds = %vector.body335
br i1 %cmp.n334, label %for.cond73.for.cond.cleanup75_crit_edge.us, label %for.body76.us.preheader
for.body76.us.preheader: ; preds = %for.body69.us, %middle.block327
%indvars.iv279.ph = phi i64 [ %47, %for.body69.us ], [ %ind.end, %middle.block327 ]
br label %for.body76.us
for.body76.us: ; preds = %for.body76.us.preheader, %for.body76.us
%indvars.iv279 = phi i64 [ %indvars.iv.next280, %for.body76.us ], [ %indvars.iv279.ph, %for.body76.us.preheader ]
%arrayidx80.us = getelementptr inbounds i32, ptr %arrayidx78.us, i64 %indvars.iv279
store i32 1, ptr %arrayidx80.us, align 4, !tbaa !5
%indvars.iv.next280 = add nsw i64 %indvars.iv279, 1
%exitcond283.not = icmp eq i64 %indvars.iv.next280, %wide.trip.count282
br i1 %exitcond283.not, label %for.cond73.for.cond.cleanup75_crit_edge.us, label %for.body76.us, !llvm.loop !23
for.cond73.for.cond.cleanup75_crit_edge.us: ; preds = %for.body76.us, %middle.block327
%indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1
%exitcond288.not = icmp eq i64 %indvars.iv.next285, %wide.trip.count287
br i1 %exitcond288.not, label %for.inc144, label %for.body69.us, !llvm.loop !24
for.cond41.preheader: ; preds = %for.body36
br i1 %cmp67230, label %for.cond45.preheader.lr.ph, label %for.inc144
for.cond45.preheader.lr.ph: ; preds = %for.cond41.preheader
%arrayidx47 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv299
%52 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%cmp48232 = icmp sgt i32 %52, 0
br i1 %cmp48232, label %for.cond45.preheader.us.preheader, label %for.inc144
for.cond45.preheader.us.preheader: ; preds = %for.cond45.preheader.lr.ph
%wide.trip.count292 = zext i32 %52 to i64
%min.iters.check = icmp ult i32 %52, 8
%n.vec = and i64 %wide.trip.count292, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count292
br label %for.cond45.preheader.us
for.cond45.preheader.us: ; preds = %for.cond45.preheader.us.preheader, %for.cond45.for.cond.cleanup49_crit_edge.us
%indvars.iv294 = phi i64 [ 0, %for.cond45.preheader.us.preheader ], [ %indvars.iv.next295, %for.cond45.for.cond.cleanup49_crit_edge.us ]
%53 = mul nuw nsw i64 %indvars.iv294, %3
%arrayidx52.us = getelementptr inbounds i32, ptr %vla, i64 %53
br i1 %min.iters.check, label %for.body50.us.preheader, label %vector.body
vector.body: ; preds = %for.cond45.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond45.preheader.us ]
%54 = getelementptr inbounds i32, ptr %arrayidx52.us, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %54, align 4, !tbaa !5
%55 = getelementptr inbounds i32, ptr %54, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %55, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%56 = icmp eq i64 %index.next, %n.vec
br i1 %56, label %middle.block, label %vector.body, !llvm.loop !25
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond45.for.cond.cleanup49_crit_edge.us, label %for.body50.us.preheader
for.body50.us.preheader: ; preds = %for.cond45.preheader.us, %middle.block
%indvars.iv289.ph = phi i64 [ 0, %for.cond45.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body50.us
for.body50.us: ; preds = %for.body50.us.preheader, %for.body50.us
%indvars.iv289 = phi i64 [ %indvars.iv.next290, %for.body50.us ], [ %indvars.iv289.ph, %for.body50.us.preheader ]
%arrayidx54.us = getelementptr inbounds i32, ptr %arrayidx52.us, i64 %indvars.iv289
store i32 1, ptr %arrayidx54.us, align 4, !tbaa !5
%indvars.iv.next290 = add nuw nsw i64 %indvars.iv289, 1
%exitcond293.not = icmp eq i64 %indvars.iv.next290, %wide.trip.count292
br i1 %exitcond293.not, label %for.cond45.for.cond.cleanup49_crit_edge.us, label %for.body50.us, !llvm.loop !26
for.cond45.for.cond.cleanup49_crit_edge.us: ; preds = %for.body50.us, %middle.block
%indvars.iv.next295 = add nuw nsw i64 %indvars.iv294, 1
%exitcond298.not = icmp eq i64 %indvars.iv.next295, %wide.trip.count297
br i1 %exitcond298.not, label %for.inc144, label %for.cond45.preheader.us, !llvm.loop !27
if.then118: ; preds = %for.body36
%arrayidx121 = getelementptr inbounds i32, ptr %vla4, i64 %indvars.iv299
%57 = load i32, ptr %arrayidx121, align 4, !tbaa !5
%cmp123222 = icmp sge i32 %57, %.pre.pre
%brmerge323 = select i1 %cmp123222, i1 true, i1 %cmp128220
br i1 %brmerge323, label %for.inc144, label %for.cond127.preheader.us.preheader
for.cond127.preheader.us.preheader: ; preds = %if.then118
%58 = sext i32 %57 to i64
br label %for.cond127.preheader.us
for.cond127.preheader.us: ; preds = %for.cond127.preheader.us.preheader, %for.cond127.for.cond.cleanup129_crit_edge.us
%indvars.iv264 = phi i64 [ %58, %for.cond127.preheader.us.preheader ], [ %indvars.iv.next265, %for.cond127.for.cond.cleanup129_crit_edge.us ]
%59 = mul nsw i64 %indvars.iv264, %3
%arrayidx132.us = getelementptr inbounds i32, ptr %vla, i64 %59
br i1 %min.iters.check351, label %for.body130.us.preheader, label %vector.body357
vector.body357: ; preds = %for.cond127.preheader.us, %vector.body357
%index358 = phi i64 [ %index.next359, %vector.body357 ], [ 0, %for.cond127.preheader.us ]
%60 = getelementptr inbounds i32, ptr %arrayidx132.us, i64 %index358
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %60, align 4, !tbaa !5
%61 = getelementptr inbounds i32, ptr %60, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %61, align 4, !tbaa !5
%index.next359 = add nuw i64 %index358, 8
%62 = icmp eq i64 %index.next359, %n.vec354
br i1 %62, label %middle.block349, label %vector.body357, !llvm.loop !28
middle.block349: ; preds = %vector.body357
br i1 %cmp.n356, label %for.cond127.for.cond.cleanup129_crit_edge.us, label %for.body130.us.preheader
for.body130.us.preheader: ; preds = %for.cond127.preheader.us, %middle.block349
%indvars.iv259.ph = phi i64 [ 0, %for.cond127.preheader.us ], [ %n.vec354, %middle.block349 ]
br label %for.body130.us
for.body130.us: ; preds = %for.body130.us.preheader, %for.body130.us
%indvars.iv259 = phi i64 [ %indvars.iv.next260, %for.body130.us ], [ %indvars.iv259.ph, %for.body130.us.preheader ]
%arrayidx134.us = getelementptr inbounds i32, ptr %arrayidx132.us, i64 %indvars.iv259
store i32 1, ptr %arrayidx134.us, align 4, !tbaa !5
%indvars.iv.next260 = add nuw nsw i64 %indvars.iv259, 1
%exitcond263.not = icmp eq i64 %indvars.iv.next260, %wide.trip.count262
br i1 %exitcond263.not, label %for.cond127.for.cond.cleanup129_crit_edge.us, label %for.body130.us, !llvm.loop !29
for.cond127.for.cond.cleanup129_crit_edge.us: ; preds = %for.body130.us, %middle.block349
%indvars.iv.next265 = add nsw i64 %indvars.iv264, 1
%exitcond268.not = icmp eq i64 %indvars.iv.next265, %wide.trip.count267
br i1 %exitcond268.not, label %for.inc144, label %for.cond127.preheader.us, !llvm.loop !30
for.inc144: ; preds = %for.cond127.for.cond.cleanup129_crit_edge.us, %for.cond100.for.cond.cleanup102_crit_edge.us, %for.cond73.for.cond.cleanup75_crit_edge.us, %for.cond45.for.cond.cleanup49_crit_edge.us, %if.then118, %for.cond93.preheader, %for.cond45.preheader.lr.ph, %for.body69.lr.ph, %for.cond66.preheader, %for.cond41.preheader, %for.body36
%indvars.iv.next300 = add nuw nsw i64 %indvars.iv299, 1
%exitcond303.not = icmp eq i64 %indvars.iv.next300, %wide.trip.count302
br i1 %exitcond303.not, label %for.cond148.preheader, label %for.body36, !llvm.loop !31
for.cond.cleanup150: ; preds = %for.cond153.for.cond.cleanup155_crit_edge.us, %for.cond153.preheader.lr.ph, %for.cond148.preheader
%s.0.lcssa = phi i32 [ 0, %for.cond148.preheader ], [ 0, %for.cond153.preheader.lr.ph ], [ %spec.select.us.lcssa, %for.cond153.for.cond.cleanup155_crit_edge.us ]
%call171 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %s.0.lcssa)
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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
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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !10, !16, !15}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !15, !16}
!20 = distinct !{!20, !10, !16, !15}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !15, !16}
!23 = distinct !{!23, !10, !16, !15}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10, !15, !16}
!26 = distinct !{!26, !10, !16, !15}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10, !15, !16}
!29 = distinct !{!29, !10, !16, !15}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}
|
#include <stdio.h>
int main(){
int W,H,N;
scanf("%d %d %d",&W,&H,&N);
int x[N],y[N],a[N];
for(int i=0; i<N; i++){
scanf("%d %d %d",&x[i],&y[i],&a[i]);
}
int color[W][H];
for(int i=0; i<W; i++){
for(int j=0; j<H; j++){
color[i][j] = 0;
}
}
for(int i=0; i<N; i++){
switch(a[i]){
case 1:
for(int j=0; j<x[i]; j++){
for(int k=0; k<H; k++){
color[j][k] = 1;
}
}
break;
case 2:
for(int j=x[i]; j<W; j++){
for(int k=0; k<H; k++){
color[j][k] = 1;
}
}
break;
case 3:
for(int j=0; j<W; j++){
for(int k=0; k<y[i]; k++){
color[j][k] = 1;
}
}
break;
default:
for(int j=0; j<W; j++){
for(int k=y[i]; k<H; k++){
color[j][k] = 1;
}
}
break;
}
/*for(int j=0; j<H; j++){
for(int i=0; i<W; i++){
printf("%d ",color[i][j]);
}
printf("\n");
}
printf("\n");*/
}
int count = 0;
for(int i=0; i<W; i++){
for(int j=0; j<H; j++){
if(!color[i][j]){count++;}
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140251/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140251/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%vla2 = alloca i32, i64 %4, align 16
%cmp187 = icmp sgt i32 %3, 0
br i1 %cmp187, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %3, %entry ], [ %11, %for.body ]
%5 = load i32, ptr %W, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%7 = load i32, ptr %H, align 4, !tbaa !5
%8 = zext i32 %7 to i64
%9 = mul nuw i64 %8, %6
%vla8 = alloca i32, i64 %9, align 16
%cmp11191 = icmp sgt i32 %5, 0
%cmp15189 = icmp sgt i32 %7, 0
%or.cond = select i1 %cmp11191, i1 %cmp15189, i1 false
br i1 %or.cond, label %for.cond14.preheader.us.preheader, label %for.cond29.preheader
for.cond14.preheader.us.preheader: ; preds = %for.cond.cleanup
%10 = shl i64 %9, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla8, i8 0, i64 %10, i1 false), !tbaa !5
br label %for.cond29.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%arrayidx6 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %N, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond29.preheader: ; preds = %for.cond14.preheader.us.preheader, %for.cond.cleanup
%cmp30209 = icmp sgt i32 %.lcssa, 0
br i1 %cmp30209, label %for.body32.lr.ph, label %for.cond128.preheader
for.body32.lr.ph: ; preds = %for.cond29.preheader
%cmp66197 = icmp slt i32 %7, 1
%wide.trip.count275 = zext i32 %.lcssa to i64
%wide.trip.count250 = sext i32 %5 to i64
%wide.trip.count265 = sext i32 %7 to i64
%min.iters.check311 = icmp ult i32 %7, 8
%n.vec314 = and i64 %8, 4294967288
%cmp.n316 = icmp eq i64 %n.vec314, %8
%min.iters.check300 = icmp ult i32 %7, 8
%n.vec303 = and i64 %8, 4294967288
%cmp.n305 = icmp eq i64 %n.vec303, %8
br label %for.body32
for.cond128.preheader: ; preds = %for.inc124, %for.cond29.preheader
%cmp134211 = icmp sgt i32 %7, 0
%or.cond291 = select i1 %cmp11191, i1 %cmp134211, i1 false
br i1 %or.cond291, label %for.cond133.preheader.us.preheader, label %for.cond.cleanup130
for.cond133.preheader.us.preheader: ; preds = %for.cond128.preheader
%min.iters.check333 = icmp ult i32 %7, 8
%n.vec336 = and i64 %8, 4294967288
%cmp.n338 = icmp eq i64 %n.vec336, %8
br label %for.cond133.preheader.us
for.cond133.preheader.us: ; preds = %for.cond133.preheader.us.preheader, %for.cond133.for.cond.cleanup135_crit_edge.us
%indvars.iv282 = phi i64 [ %indvars.iv.next283, %for.cond133.for.cond.cleanup135_crit_edge.us ], [ 0, %for.cond133.preheader.us.preheader ]
%count.0216.us = phi i32 [ %spec.select.us.lcssa, %for.cond133.for.cond.cleanup135_crit_edge.us ], [ 0, %for.cond133.preheader.us.preheader ]
%13 = mul nuw nsw i64 %indvars.iv282, %8
%arrayidx138.us = getelementptr inbounds i32, ptr %vla8, i64 %13
br i1 %min.iters.check333, label %for.body136.us.preheader, label %vector.ph334
vector.ph334: ; preds = %for.cond133.preheader.us
%14 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.0216.us, i64 0
br label %vector.body339
vector.body339: ; preds = %vector.body339, %vector.ph334
%index340 = phi i64 [ 0, %vector.ph334 ], [ %index.next343, %vector.body339 ]
%vec.phi = phi <4 x i32> [ %14, %vector.ph334 ], [ %21, %vector.body339 ]
%vec.phi341 = phi <4 x i32> [ zeroinitializer, %vector.ph334 ], [ %22, %vector.body339 ]
%15 = getelementptr inbounds i32, ptr %arrayidx138.us, i64 %index340
%wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load342 = load <4 x i32>, ptr %16, align 4, !tbaa !5
%17 = icmp eq <4 x i32> %wide.load, zeroinitializer
%18 = icmp eq <4 x i32> %wide.load342, zeroinitializer
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = zext <4 x i1> %18 to <4 x i32>
%21 = add <4 x i32> %vec.phi, %19
%22 = add <4 x i32> %vec.phi341, %20
%index.next343 = add nuw i64 %index340, 8
%23 = icmp eq i64 %index.next343, %n.vec336
br i1 %23, label %middle.block331, label %vector.body339, !llvm.loop !11
middle.block331: ; preds = %vector.body339
%bin.rdx = add <4 x i32> %22, %21
%24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n338, label %for.cond133.for.cond.cleanup135_crit_edge.us, label %for.body136.us.preheader
for.body136.us.preheader: ; preds = %for.cond133.preheader.us, %middle.block331
%indvars.iv277.ph = phi i64 [ 0, %for.cond133.preheader.us ], [ %n.vec336, %middle.block331 ]
%count.1212.us.ph = phi i32 [ %count.0216.us, %for.cond133.preheader.us ], [ %24, %middle.block331 ]
br label %for.body136.us
for.body136.us: ; preds = %for.body136.us.preheader, %for.body136.us
%indvars.iv277 = phi i64 [ %indvars.iv.next278, %for.body136.us ], [ %indvars.iv277.ph, %for.body136.us.preheader ]
%count.1212.us = phi i32 [ %spec.select.us, %for.body136.us ], [ %count.1212.us.ph, %for.body136.us.preheader ]
%arrayidx140.us = getelementptr inbounds i32, ptr %arrayidx138.us, i64 %indvars.iv277
%25 = load i32, ptr %arrayidx140.us, align 4, !tbaa !5
%tobool.not.us = icmp eq i32 %25, 0
%inc141.us = zext i1 %tobool.not.us to i32
%spec.select.us = add nsw i32 %count.1212.us, %inc141.us
%indvars.iv.next278 = add nuw nsw i64 %indvars.iv277, 1
%exitcond281.not = icmp eq i64 %indvars.iv.next278, %8
br i1 %exitcond281.not, label %for.cond133.for.cond.cleanup135_crit_edge.us, label %for.body136.us, !llvm.loop !14
for.cond133.for.cond.cleanup135_crit_edge.us: ; preds = %for.body136.us, %middle.block331
%spec.select.us.lcssa = phi i32 [ %24, %middle.block331 ], [ %spec.select.us, %for.body136.us ]
%indvars.iv.next283 = add nuw nsw i64 %indvars.iv282, 1
%exitcond286.not = icmp eq i64 %indvars.iv.next283, %6
br i1 %exitcond286.not, label %for.cond.cleanup130, label %for.cond133.preheader.us, !llvm.loop !15
for.body32: ; preds = %for.body32.lr.ph, %for.inc124
%indvars.iv272 = phi i64 [ 0, %for.body32.lr.ph ], [ %indvars.iv.next273, %for.inc124 ]
%arrayidx34 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv272
%26 = load i32, ptr %arrayidx34, align 4, !tbaa !5
switch i32 %26, label %for.cond103.preheader [
i32 1, label %for.cond36.preheader
i32 2, label %sw.bb56
i32 3, label %for.cond81.preheader
]
for.cond81.preheader: ; preds = %for.body32
br i1 %cmp11191, label %for.cond86.preheader.lr.ph, label %for.inc124
for.cond86.preheader.lr.ph: ; preds = %for.cond81.preheader
%arrayidx88 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv272
%27 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%cmp89193 = icmp sgt i32 %27, 0
br i1 %cmp89193, label %for.cond86.preheader.us.preheader, label %for.inc124
for.cond86.preheader.us.preheader: ; preds = %for.cond86.preheader.lr.ph
%wide.trip.count = zext i32 %27 to i64
%min.iters.check322 = icmp ult i32 %27, 8
%n.vec325 = and i64 %wide.trip.count, 4294967288
%cmp.n327 = icmp eq i64 %n.vec325, %wide.trip.count
br label %for.cond86.preheader.us
for.cond86.preheader.us: ; preds = %for.cond86.preheader.us.preheader, %for.cond86.for.cond.cleanup90_crit_edge.us
%indvars.iv237 = phi i64 [ 0, %for.cond86.preheader.us.preheader ], [ %indvars.iv.next238, %for.cond86.for.cond.cleanup90_crit_edge.us ]
%28 = mul nuw nsw i64 %indvars.iv237, %8
%arrayidx93.us = getelementptr inbounds i32, ptr %vla8, i64 %28
br i1 %min.iters.check322, label %for.body91.us.preheader, label %vector.body328
vector.body328: ; preds = %for.cond86.preheader.us, %vector.body328
%index329 = phi i64 [ %index.next330, %vector.body328 ], [ 0, %for.cond86.preheader.us ]
%29 = getelementptr inbounds i32, ptr %arrayidx93.us, i64 %index329
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %29, align 4, !tbaa !5
%30 = getelementptr inbounds i32, ptr %29, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %30, align 4, !tbaa !5
%index.next330 = add nuw i64 %index329, 8
%31 = icmp eq i64 %index.next330, %n.vec325
br i1 %31, label %middle.block320, label %vector.body328, !llvm.loop !16
middle.block320: ; preds = %vector.body328
br i1 %cmp.n327, label %for.cond86.for.cond.cleanup90_crit_edge.us, label %for.body91.us.preheader
for.body91.us.preheader: ; preds = %for.cond86.preheader.us, %middle.block320
%indvars.iv234.ph = phi i64 [ 0, %for.cond86.preheader.us ], [ %n.vec325, %middle.block320 ]
br label %for.body91.us
for.body91.us: ; preds = %for.body91.us.preheader, %for.body91.us
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %for.body91.us ], [ %indvars.iv234.ph, %for.body91.us.preheader ]
%arrayidx95.us = getelementptr inbounds i32, ptr %arrayidx93.us, i64 %indvars.iv234
store i32 1, ptr %arrayidx95.us, align 4, !tbaa !5
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%exitcond.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count
br i1 %exitcond.not, label %for.cond86.for.cond.cleanup90_crit_edge.us, label %for.body91.us, !llvm.loop !17
for.cond86.for.cond.cleanup90_crit_edge.us: ; preds = %for.body91.us, %middle.block320
%indvars.iv.next238 = add nuw nsw i64 %indvars.iv237, 1
%exitcond241.not = icmp eq i64 %indvars.iv.next238, %6
br i1 %exitcond241.not, label %for.inc124, label %for.cond86.preheader.us, !llvm.loop !18
for.cond36.preheader: ; preds = %for.body32
%arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv272
%32 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%cmp39203 = icmp slt i32 %32, 1
%brmerge = select i1 %cmp39203, i1 true, i1 %cmp66197
br i1 %brmerge, label %for.inc124, label %for.cond42.preheader.us.preheader
for.cond42.preheader.us.preheader: ; preds = %for.cond36.preheader
%wide.trip.count260 = zext i32 %32 to i64
br label %for.cond42.preheader.us
for.cond42.preheader.us: ; preds = %for.cond42.preheader.us.preheader, %for.cond42.for.cond.cleanup44_crit_edge.us
%indvars.iv257 = phi i64 [ 0, %for.cond42.preheader.us.preheader ], [ %indvars.iv.next258, %for.cond42.for.cond.cleanup44_crit_edge.us ]
%33 = mul nuw nsw i64 %indvars.iv257, %8
%arrayidx47.us = getelementptr inbounds i32, ptr %vla8, i64 %33
br i1 %min.iters.check300, label %for.body45.us.preheader, label %vector.body306
vector.body306: ; preds = %for.cond42.preheader.us, %vector.body306
%index307 = phi i64 [ %index.next308, %vector.body306 ], [ 0, %for.cond42.preheader.us ]
%34 = getelementptr inbounds i32, ptr %arrayidx47.us, i64 %index307
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %34, align 4, !tbaa !5
%35 = getelementptr inbounds i32, ptr %34, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %35, align 4, !tbaa !5
%index.next308 = add nuw i64 %index307, 8
%36 = icmp eq i64 %index.next308, %n.vec303
br i1 %36, label %middle.block298, label %vector.body306, !llvm.loop !19
middle.block298: ; preds = %vector.body306
br i1 %cmp.n305, label %for.cond42.for.cond.cleanup44_crit_edge.us, label %for.body45.us.preheader
for.body45.us.preheader: ; preds = %for.cond42.preheader.us, %middle.block298
%indvars.iv252.ph = phi i64 [ 0, %for.cond42.preheader.us ], [ %n.vec303, %middle.block298 ]
br label %for.body45.us
for.body45.us: ; preds = %for.body45.us.preheader, %for.body45.us
%indvars.iv252 = phi i64 [ %indvars.iv.next253, %for.body45.us ], [ %indvars.iv252.ph, %for.body45.us.preheader ]
%arrayidx49.us = getelementptr inbounds i32, ptr %arrayidx47.us, i64 %indvars.iv252
store i32 1, ptr %arrayidx49.us, align 4, !tbaa !5
%indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1
%exitcond256.not = icmp eq i64 %indvars.iv.next253, %8
br i1 %exitcond256.not, label %for.cond42.for.cond.cleanup44_crit_edge.us, label %for.body45.us, !llvm.loop !20
for.cond42.for.cond.cleanup44_crit_edge.us: ; preds = %for.body45.us, %middle.block298
%indvars.iv.next258 = add nuw nsw i64 %indvars.iv257, 1
%exitcond261.not = icmp eq i64 %indvars.iv.next258, %wide.trip.count260
br i1 %exitcond261.not, label %for.inc124, label %for.cond42.preheader.us, !llvm.loop !21
for.cond103.preheader: ; preds = %for.body32
br i1 %cmp11191, label %for.body106.lr.ph, label %for.inc124
for.body106.lr.ph: ; preds = %for.cond103.preheader
%arrayidx109 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv272
%37 = load i32, ptr %arrayidx109, align 4, !tbaa !5
%cmp111205 = icmp slt i32 %37, %7
br i1 %cmp111205, label %for.body106.us.preheader, label %for.inc124
for.body106.us.preheader: ; preds = %for.body106.lr.ph
%38 = sext i32 %37 to i64
%39 = sub nsw i64 %wide.trip.count265, %38
%min.iters.check = icmp ult i64 %39, 8
%n.vec = and i64 %39, -8
%ind.end = add nsw i64 %n.vec, %38
%cmp.n = icmp eq i64 %39, %n.vec
br label %for.body106.us
for.body106.us: ; preds = %for.body106.us.preheader, %for.cond110.for.cond.cleanup112_crit_edge.us
%indvars.iv267 = phi i64 [ 0, %for.body106.us.preheader ], [ %indvars.iv.next268, %for.cond110.for.cond.cleanup112_crit_edge.us ]
%40 = mul nuw nsw i64 %indvars.iv267, %8
%arrayidx115.us = getelementptr inbounds i32, ptr %vla8, i64 %40
br i1 %min.iters.check, label %for.body113.us.preheader, label %vector.ph
vector.ph: ; preds = %for.body106.us
%invariant.gep = getelementptr i32, ptr %arrayidx115.us, i64 %38
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %gep, align 4, !tbaa !5
%41 = getelementptr inbounds i32, ptr %gep, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %41, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%42 = icmp eq i64 %index.next, %n.vec
br i1 %42, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond110.for.cond.cleanup112_crit_edge.us, label %for.body113.us.preheader
for.body113.us.preheader: ; preds = %for.body106.us, %middle.block
%indvars.iv262.ph = phi i64 [ %38, %for.body106.us ], [ %ind.end, %middle.block ]
br label %for.body113.us
for.body113.us: ; preds = %for.body113.us.preheader, %for.body113.us
%indvars.iv262 = phi i64 [ %indvars.iv.next263, %for.body113.us ], [ %indvars.iv262.ph, %for.body113.us.preheader ]
%arrayidx117.us = getelementptr inbounds i32, ptr %arrayidx115.us, i64 %indvars.iv262
store i32 1, ptr %arrayidx117.us, align 4, !tbaa !5
%indvars.iv.next263 = add nsw i64 %indvars.iv262, 1
%exitcond266.not = icmp eq i64 %indvars.iv.next263, %wide.trip.count265
br i1 %exitcond266.not, label %for.cond110.for.cond.cleanup112_crit_edge.us, label %for.body113.us, !llvm.loop !23
for.cond110.for.cond.cleanup112_crit_edge.us: ; preds = %for.body113.us, %middle.block
%indvars.iv.next268 = add nuw nsw i64 %indvars.iv267, 1
%exitcond271.not = icmp eq i64 %indvars.iv.next268, %6
br i1 %exitcond271.not, label %for.inc124, label %for.body106.us, !llvm.loop !24
sw.bb56: ; preds = %for.body32
%arrayidx59 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv272
%43 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%cmp61199 = icmp sge i32 %43, %5
%brmerge293 = select i1 %cmp61199, i1 true, i1 %cmp66197
br i1 %brmerge293, label %for.inc124, label %for.cond65.preheader.us.preheader
for.cond65.preheader.us.preheader: ; preds = %sw.bb56
%44 = sext i32 %43 to i64
br label %for.cond65.preheader.us
for.cond65.preheader.us: ; preds = %for.cond65.preheader.us.preheader, %for.cond65.for.cond.cleanup67_crit_edge.us
%indvars.iv247 = phi i64 [ %44, %for.cond65.preheader.us.preheader ], [ %indvars.iv.next248, %for.cond65.for.cond.cleanup67_crit_edge.us ]
%45 = mul nsw i64 %indvars.iv247, %8
%arrayidx70.us = getelementptr inbounds i32, ptr %vla8, i64 %45
br i1 %min.iters.check311, label %for.body68.us.preheader, label %vector.body317
vector.body317: ; preds = %for.cond65.preheader.us, %vector.body317
%index318 = phi i64 [ %index.next319, %vector.body317 ], [ 0, %for.cond65.preheader.us ]
%46 = getelementptr inbounds i32, ptr %arrayidx70.us, i64 %index318
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %46, align 4, !tbaa !5
%47 = getelementptr inbounds i32, ptr %46, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %47, align 4, !tbaa !5
%index.next319 = add nuw i64 %index318, 8
%48 = icmp eq i64 %index.next319, %n.vec314
br i1 %48, label %middle.block309, label %vector.body317, !llvm.loop !25
middle.block309: ; preds = %vector.body317
br i1 %cmp.n316, label %for.cond65.for.cond.cleanup67_crit_edge.us, label %for.body68.us.preheader
for.body68.us.preheader: ; preds = %for.cond65.preheader.us, %middle.block309
%indvars.iv242.ph = phi i64 [ 0, %for.cond65.preheader.us ], [ %n.vec314, %middle.block309 ]
br label %for.body68.us
for.body68.us: ; preds = %for.body68.us.preheader, %for.body68.us
%indvars.iv242 = phi i64 [ %indvars.iv.next243, %for.body68.us ], [ %indvars.iv242.ph, %for.body68.us.preheader ]
%arrayidx72.us = getelementptr inbounds i32, ptr %arrayidx70.us, i64 %indvars.iv242
store i32 1, ptr %arrayidx72.us, align 4, !tbaa !5
%indvars.iv.next243 = add nuw nsw i64 %indvars.iv242, 1
%exitcond246.not = icmp eq i64 %indvars.iv.next243, %8
br i1 %exitcond246.not, label %for.cond65.for.cond.cleanup67_crit_edge.us, label %for.body68.us, !llvm.loop !26
for.cond65.for.cond.cleanup67_crit_edge.us: ; preds = %for.body68.us, %middle.block309
%indvars.iv.next248 = add nsw i64 %indvars.iv247, 1
%exitcond251.not = icmp eq i64 %indvars.iv.next248, %wide.trip.count250
br i1 %exitcond251.not, label %for.inc124, label %for.cond65.preheader.us, !llvm.loop !27
for.inc124: ; preds = %for.cond86.for.cond.cleanup90_crit_edge.us, %for.cond65.for.cond.cleanup67_crit_edge.us, %for.cond42.for.cond.cleanup44_crit_edge.us, %for.cond110.for.cond.cleanup112_crit_edge.us, %sw.bb56, %for.cond36.preheader, %for.body106.lr.ph, %for.cond86.preheader.lr.ph, %for.cond81.preheader, %for.cond103.preheader
%indvars.iv.next273 = add nuw nsw i64 %indvars.iv272, 1
%exitcond276.not = icmp eq i64 %indvars.iv.next273, %wide.trip.count275
br i1 %exitcond276.not, label %for.cond128.preheader, label %for.body32, !llvm.loop !28
for.cond.cleanup130: ; preds = %for.cond133.for.cond.cleanup135_crit_edge.us, %for.cond128.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond128.preheader ], [ %spec.select.us.lcssa, %for.cond133.for.cond.cleanup135_crit_edge.us ]
%call148 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !12, !13}
!17 = distinct !{!17, !10, !13, !12}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !12, !13}
!20 = distinct !{!20, !10, !13, !12}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !12, !13}
!23 = distinct !{!23, !10, !13, !12}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10, !12, !13}
!26 = distinct !{!26, !10, !13, !12}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
|
/*2019/07/29 */
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define MOD 1000000007
typedef long long int ll;
void llswap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
void swap(int *x,int *y){int tmp;tmp=*x;*x=*y;*y=tmp;}
int rmax(int x,int y){return x>y?x:y;}
int rmin(int x,int y){return x>y?y:x;}
ll llrmax(ll x,ll y){return x>y?x:y;}
ll llrmin(ll x,ll y){return x>y?y:x;}
int asc(const void *a,const void *b){return *(int*)a-*(int*)b;}
int desc(const void *a,const void *b){return *(int*)b-*(int*)a;}
typedef struct{
int num;
int p;
int y;
char str[20];
}group_t;
int asc_p(const void *a,const void *b){return ((group_t*)a)->p - ((group_t*)b)->p;}
int asc_y(const void *a,const void *b){return ((group_t*)a)->y - ((group_t*)b)->y;}
int asc_num(const void *a,const void *b){return ((group_t*)a)->num - ((group_t*)b)->num;}
//int desc_t(const void *a,const void *b){return ((user_t*)b)->score - ((user_t*)a)->score;}
int main(){
int n,m;
group_t gp[200000];
scanf("%d %d",&n,&m);
for(int i=0;i<m;i++){
scanf("%d %d",&gp[i].p,&gp[i].y);
gp[i].num=i;
}
//qsort(gp,m,sizeof(group_t),asc_p);
qsort(gp,m,sizeof(group_t),asc_y);
for(int i=0;i<m;i++){
//printf("%d %d\n",gp[i].p,gp[i].y);
}
int cnt[200000]={};
for(int i=0;i<m;i++){
sprintf(gp[i].str,"%06d%06d",gp[i].p,++cnt[gp[i].p-1]);
}
qsort(gp,m,sizeof(group_t),asc_num);
for(int i=0;i<m;i++){
printf("%s\n",gp[i].str);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140345/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140345/source.c"
target datalayout = "e-m:e-p270: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.group_t = type { i32, i32, i32, [20 x i8] }
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%06d%06d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @llswap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %y, align 8, !tbaa !5
store i64 %1, ptr %x, align 8, !tbaa !5
store i64 %0, ptr %y, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 !9
%1 = load i32, ptr %y, align 4, !tbaa !9
store i32 %1, ptr %x, align 4, !tbaa !9
store i32 %0, ptr %y, align 4, !tbaa !9
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @rmax(i32 noundef %x, i32 noundef %y) local_unnamed_addr #2 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @rmin(i32 noundef %x, i32 noundef %y) local_unnamed_addr #2 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llrmax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llrmin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !9
%1 = load i32, ptr %b, align 4, !tbaa !9
%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 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !9
%1 = load i32, ptr %a, align 4, !tbaa !9
%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 @asc_p(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #3 {
entry:
%p = getelementptr inbounds %struct.group_t, ptr %a, i64 0, i32 1
%0 = load i32, ptr %p, align 4, !tbaa !11
%p1 = getelementptr inbounds %struct.group_t, ptr %b, i64 0, i32 1
%1 = load i32, ptr %p1, align 4, !tbaa !11
%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 @asc_y(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #3 {
entry:
%y = getelementptr inbounds %struct.group_t, ptr %a, i64 0, i32 2
%0 = load i32, ptr %y, align 4, !tbaa !13
%y1 = getelementptr inbounds %struct.group_t, ptr %b, i64 0, i32 2
%1 = load i32, ptr %y1, align 4, !tbaa !13
%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 @asc_num(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !14
%1 = load i32, ptr %b, align 4, !tbaa !14
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%gp = alloca [200000 x %struct.group_t], align 16
%cnt = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #10
call void @llvm.lifetime.start.p0(i64 6400000, ptr nonnull %gp) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !9
%cmp67 = icmp sgt i32 %0, 0
br i1 %cmp67, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %4, %for.body ]
call void @qsort(ptr noundef nonnull %gp, i64 noundef %conv.pre-phi, i64 noundef 32, ptr noundef nonnull @asc_y) #10
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %cnt) #10
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800000) %cnt, i8 0, i64 800000, i1 false)
%1 = load i32, ptr %m, align 4, !tbaa !9
%cmp1769 = icmp sgt i32 %1, 0
br i1 %cmp1769, label %for.body20, label %for.cond.cleanup.for.cond.cleanup19_crit_edge
for.cond.cleanup.for.cond.cleanup19_crit_edge: ; preds = %for.cond.cleanup
%.pre83 = sext i32 %1 to i64
br label %for.cond.cleanup19
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x %struct.group_t], ptr %gp, i64 0, i64 %indvars.iv
%p = getelementptr inbounds [200000 x %struct.group_t], ptr %gp, i64 0, i64 %indvars.iv, i32 1
%y = getelementptr inbounds [200000 x %struct.group_t], ptr %gp, i64 0, i64 %indvars.iv, i32 2
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %y)
%2 = trunc i64 %indvars.iv to i32
store i32 %2, ptr %arrayidx, align 16, !tbaa !14
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %m, align 4, !tbaa !9
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15
for.cond.cleanup19: ; preds = %for.body20, %for.cond.cleanup.for.cond.cleanup19_crit_edge
%conv38.pre-phi = phi i64 [ %.pre83, %for.cond.cleanup.for.cond.cleanup19_crit_edge ], [ %9, %for.body20 ]
call void @qsort(ptr noundef nonnull %gp, i64 noundef %conv38.pre-phi, i64 noundef 32, ptr noundef nonnull @asc_num) #10
%5 = load i32, ptr %m, align 4, !tbaa !9
%cmp4172 = icmp sgt i32 %5, 0
br i1 %cmp4172, label %for.body44, label %for.cond.cleanup43
for.body20: ; preds = %for.cond.cleanup, %for.body20
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body20 ], [ 0, %for.cond.cleanup ]
%str = getelementptr inbounds [200000 x %struct.group_t], ptr %gp, i64 0, i64 %indvars.iv77, i32 3
%p26 = getelementptr inbounds [200000 x %struct.group_t], ptr %gp, i64 0, i64 %indvars.iv77, i32 1
%6 = load i32, ptr %p26, align 4, !tbaa !11
%sub = add nsw i32 %6, -1
%idxprom30 = sext i32 %sub to i64
%arrayidx31 = getelementptr inbounds [200000 x i32], ptr %cnt, i64 0, i64 %idxprom30
%7 = load i32, ptr %arrayidx31, align 4, !tbaa !9
%inc32 = add nsw i32 %7, 1
store i32 %inc32, ptr %arrayidx31, align 4, !tbaa !9
%call33 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %str, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %inc32) #10
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%8 = load i32, ptr %m, align 4, !tbaa !9
%9 = sext i32 %8 to i64
%cmp17 = icmp slt i64 %indvars.iv.next78, %9
br i1 %cmp17, label %for.body20, label %for.cond.cleanup19, !llvm.loop !17
for.cond.cleanup43: ; preds = %for.body44, %for.cond.cleanup19
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %cnt) #10
call void @llvm.lifetime.end.p0(i64 6400000, ptr nonnull %gp) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
ret i32 0
for.body44: ; preds = %for.cond.cleanup19, %for.body44
%indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body44 ], [ 0, %for.cond.cleanup19 ]
%str47 = getelementptr inbounds [200000 x %struct.group_t], ptr %gp, i64 0, i64 %indvars.iv80, i32 3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str47)
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%10 = load i32, ptr %m, align 4, !tbaa !9
%11 = sext i32 %10 to i64
%cmp41 = icmp slt i64 %indvars.iv.next81, %11
br i1 %cmp41, label %for.body44, label %for.cond.cleanup43, !llvm.loop !18
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) 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 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 4}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 12}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct {
int num;
int P;
long long int Y;
int y;
} bigint;
int cmp( const void *p, const void *q ) {
if(((bigint*)p)->Y - ((bigint*)q)->Y > 0){
return 1;
}else{
return -1;
}
}
int cmp2( const void *p, const void *q ) {
return ((bigint*)p)->num - ((bigint*)q)->num;
}
void sixint(int N){
int i;
int k[6];
for(i=5;i>=0;i--){
k[i]=N%10;
N=(int)N/10;
}
for(i=0;i<6;i++){
printf("%d",k[i]);
}
}
int main(){
int N,M,i;
scanf("%d%d",&N,&M);
bigint X[M];
for(i=0;i<M;i++){
scanf("%d%lld",&X[i].P,&X[i].Y);
X[i].num=i;
}
qsort(X, M, sizeof(bigint), cmp);
int c_P[N+1];
for(i=0;i<N+1;i++){
c_P[i]=1;
}
for(i=0;i<M;i++){
X[i].y = c_P[X[i].P];
c_P[X[i].P]=c_P[X[i].P]+1;
}
qsort(X, M, sizeof(bigint), cmp2 );
for(i=0;i<M;i++){
sixint(X[i].P);
sixint(X[i].y);
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140389/source.c"
target datalayout = "e-m:e-p270: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.bigint = type { i32, i32, i64, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 {
entry:
%Y = getelementptr inbounds %struct.bigint, ptr %p, i64 0, i32 2
%0 = load i64, ptr %Y, align 8, !tbaa !5
%Y1 = getelementptr inbounds %struct.bigint, ptr %q, i64 0, i32 2
%1 = load i64, ptr %Y1, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
%. = select i1 %cmp, i32 1, i32 -1
ret i32 %.
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 {
entry:
%0 = load i32, ptr %p, align 8, !tbaa !11
%1 = load i32, ptr %q, align 8, !tbaa !11
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sixint(i32 noundef %N) local_unnamed_addr #1 {
entry:
%rem = srem i32 %N, 10
%div = sdiv i32 %N, 10
%rem.1 = srem i32 %div, 10
%div.1 = sdiv i32 %N, 100
%rem.2 = srem i32 %div.1, 10
%div.2 = sdiv i32 %N, 1000
%rem.3 = srem i32 %div.2, 10
%div.3 = sdiv i32 %N, 10000
%rem.4 = srem i32 %div.3, 10
%div.4 = sdiv i32 %N, 100000
%rem.5.lhs.trunc = trunc i32 %div.4 to i16
%rem.519 = srem i16 %rem.5.lhs.trunc, 10
%rem.5.sext = sext i16 %rem.519 to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.5.sext)
%call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.4)
%call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.3)
%call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.2)
%call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.1)
%call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4, !tbaa !12
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca %struct.bigint, i64 %1, align 16
%3 = load i32, ptr %M, align 4, !tbaa !12
%cmp96 = icmp sgt i32 %3, 0
br i1 %cmp96, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %3 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 %struct.bigint, ptr %vla, i64 %indvars.iv
%P = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv, i32 1
%Y = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv, i32 2
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %P, ptr noundef nonnull %Y)
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 8, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %M, align 4, !tbaa !12
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %6, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 24, ptr noundef nonnull @cmp) #7
%7 = load i32, ptr %N, align 4, !tbaa !12
%add = add i32 %7, 1
%8 = zext i32 %add to i64
%vla6 = alloca i32, i64 %8, align 16
%cmp9.not98 = icmp slt i32 %7, 0
br i1 %cmp9.not98, label %for.cond17.preheader, label %for.body11.preheader
for.body11.preheader: ; preds = %for.end
%min.iters.check = icmp ult i32 %add, 8
br i1 %min.iters.check, label %for.body11.preheader117, label %vector.ph
vector.ph: ; preds = %for.body11.preheader
%n.vec = and i64 %8, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%9 = getelementptr inbounds i32, ptr %vla6, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 16, !tbaa !12
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %10, align 16, !tbaa !12
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %8
br i1 %cmp.n, label %for.cond17.preheader, label %for.body11.preheader117
for.body11.preheader117: ; preds = %for.body11.preheader, %middle.block
%indvars.iv106.ph = phi i64 [ 0, %for.body11.preheader ], [ %n.vec, %middle.block ]
br label %for.body11
for.cond17.preheader: ; preds = %for.body11, %middle.block, %for.end
%12 = load i32, ptr %M, align 4, !tbaa !12
%cmp18100 = icmp sgt i32 %12, 0
br i1 %cmp18100, label %for.body20.preheader, label %for.end41
for.body20.preheader: ; preds = %for.cond17.preheader
%wide.trip.count112 = zext i32 %12 to i64
%xtraiter = and i64 %wide.trip.count112, 1
%13 = icmp eq i32 %12, 1
br i1 %13, label %for.end41.loopexit.unr-lcssa, label %for.body20.preheader.new
for.body20.preheader.new: ; preds = %for.body20.preheader
%unroll_iter = and i64 %wide.trip.count112, 4294967294
br label %for.body20
for.body11: ; preds = %for.body11.preheader117, %for.body11
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body11 ], [ %indvars.iv106.ph, %for.body11.preheader117 ]
%arrayidx13 = getelementptr inbounds i32, ptr %vla6, i64 %indvars.iv106
store i32 1, ptr %arrayidx13, align 4, !tbaa !12
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%exitcond.not = icmp eq i64 %indvars.iv.next107, %8
br i1 %exitcond.not, label %for.cond17.preheader, label %for.body11, !llvm.loop !18
for.body20: ; preds = %for.body20, %for.body20.preheader.new
%indvars.iv109 = phi i64 [ 0, %for.body20.preheader.new ], [ %indvars.iv.next110.1, %for.body20 ]
%niter = phi i64 [ 0, %for.body20.preheader.new ], [ %niter.next.1, %for.body20 ]
%P23 = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv109, i32 1
%14 = load i32, ptr %P23, align 4, !tbaa !19
%idxprom24 = sext i32 %14 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %vla6, i64 %idxprom24
%15 = load i32, ptr %arrayidx25, align 4, !tbaa !12
%y = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv109, i32 3
store i32 %15, ptr %y, align 16, !tbaa !20
%add33 = add nsw i32 %15, 1
store i32 %add33, ptr %arrayidx25, align 4, !tbaa !12
%indvars.iv.next110 = or i64 %indvars.iv109, 1
%P23.1 = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv.next110, i32 1
%16 = load i32, ptr %P23.1, align 4, !tbaa !19
%idxprom24.1 = sext i32 %16 to i64
%arrayidx25.1 = getelementptr inbounds i32, ptr %vla6, i64 %idxprom24.1
%17 = load i32, ptr %arrayidx25.1, align 4, !tbaa !12
%y.1 = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv.next110, i32 3
store i32 %17, ptr %y.1, align 8, !tbaa !20
%add33.1 = add nsw i32 %17, 1
store i32 %add33.1, ptr %arrayidx25.1, align 4, !tbaa !12
%indvars.iv.next110.1 = add nuw nsw i64 %indvars.iv109, 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.end41.loopexit.unr-lcssa, label %for.body20, !llvm.loop !21
for.end41.loopexit.unr-lcssa: ; preds = %for.body20, %for.body20.preheader
%indvars.iv109.unr = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next110.1, %for.body20 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end41, label %for.body20.epil
for.body20.epil: ; preds = %for.end41.loopexit.unr-lcssa
%P23.epil = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv109.unr, i32 1
%18 = load i32, ptr %P23.epil, align 4, !tbaa !19
%idxprom24.epil = sext i32 %18 to i64
%arrayidx25.epil = getelementptr inbounds i32, ptr %vla6, i64 %idxprom24.epil
%19 = load i32, ptr %arrayidx25.epil, align 4, !tbaa !12
%y.epil = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv109.unr, i32 3
store i32 %19, ptr %y.epil, align 8, !tbaa !20
%add33.epil = add nsw i32 %19, 1
store i32 %add33.epil, ptr %arrayidx25.epil, align 4, !tbaa !12
br label %for.end41
for.end41: ; preds = %for.body20.epil, %for.end41.loopexit.unr-lcssa, %for.cond17.preheader
%conv42 = sext i32 %12 to i64
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv42, i64 noundef 24, ptr noundef nonnull @cmp2) #7
%20 = load i32, ptr %M, align 4, !tbaa !12
%cmp44103 = icmp sgt i32 %20, 0
br i1 %cmp44103, label %for.body46, label %for.end56
for.body46: ; preds = %for.end41, %for.body46
%indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.body46 ], [ 0, %for.end41 ]
%P49 = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv114, i32 1
%21 = load i32, ptr %P49, align 4, !tbaa !19
%rem.i = srem i32 %21, 10
%div.i = sdiv i32 %21, 10
%rem.1.i = srem i32 %div.i, 10
%div.1.i = sdiv i32 %21, 100
%rem.2.i = srem i32 %div.1.i, 10
%div.2.i = sdiv i32 %21, 1000
%rem.3.i = srem i32 %div.2.i, 10
%div.3.i = sdiv i32 %21, 10000
%rem.4.i = srem i32 %div.3.i, 10
%div.4.i = sdiv i32 %21, 100000
%rem.5.lhs.trunc.i = trunc i32 %div.4.i to i16
%rem.519.i = srem i16 %rem.5.lhs.trunc.i, 10
%rem.5.sext.i = sext i16 %rem.519.i to i32
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.5.sext.i)
%call.1.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.4.i)
%call.2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.3.i)
%call.3.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.2.i)
%call.4.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.1.i)
%call.5.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.i)
%y52 = getelementptr inbounds %struct.bigint, ptr %vla, i64 %indvars.iv114, i32 3
%22 = load i32, ptr %y52, align 8, !tbaa !20
%rem.i76 = srem i32 %22, 10
%div.i77 = sdiv i32 %22, 10
%rem.1.i78 = srem i32 %div.i77, 10
%div.1.i79 = sdiv i32 %22, 100
%rem.2.i80 = srem i32 %div.1.i79, 10
%div.2.i81 = sdiv i32 %22, 1000
%rem.3.i82 = srem i32 %div.2.i81, 10
%div.3.i83 = sdiv i32 %22, 10000
%rem.4.i84 = srem i32 %div.3.i83, 10
%div.4.i85 = sdiv i32 %22, 100000
%rem.5.lhs.trunc.i86 = trunc i32 %div.4.i85 to i16
%rem.519.i87 = srem i16 %rem.5.lhs.trunc.i86, 10
%rem.5.sext.i88 = sext i16 %rem.519.i87 to i32
%call.i89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.5.sext.i88)
%call.1.i90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.4.i84)
%call.2.i91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.3.i82)
%call.3.i92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.2.i80)
%call.4.i93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.1.i78)
%call.5.i94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.i76)
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%23 = load i32, ptr %M, align 4, !tbaa !12
%24 = sext i32 %23 to i64
%cmp44 = icmp slt i64 %indvars.iv.next115, %24
br i1 %cmp44, label %for.body46, label %for.end56, !llvm.loop !22
for.end56: ; preds = %for.body46, %for.end41
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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, !10, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !7, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !14, !17, !16}
!19 = !{!6, !7, i64 4}
!20 = !{!6, !7, i64 16}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
|
#include <stdio.h>
#define MAX 10000
int main(){
int i,j;
int n1,n2,cnt;
int num1[MAX],num2;
scanf("%d",&n1);
for(i=0;i<n1;i++){
scanf("%d",&num1[i]);
}
cnt = 0;
scanf("%d", &n2);
while(n2--){ //インクリメントを後置に変更
scanf("%d", &num2);
for(j = 0; j < n1; ++j) {
if(num1[j] == num2) {
++cnt;
break;
}
}
}
printf("%d\n", cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140431/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140431/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n1 = alloca i32, align 4
%n2 = alloca i32, align 4
%num1 = alloca [10000 x i32], align 16
%num2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n2) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %num1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n1)
%0 = load i32, ptr %n1, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %0, 0
br i1 %cmp20, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %num1, 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 %n1, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n2)
%3 = load i32, ptr %n2, align 4, !tbaa !5
%dec24 = add nsw i32 %3, -1
store i32 %dec24, ptr %n2, align 4, !tbaa !5
%tobool.not25 = icmp eq i32 %3, 0
br i1 %tobool.not25, label %while.end, label %while.body
while.body: ; preds = %for.end, %for.end13
%cnt.026 = phi i32 [ %cnt.1, %for.end13 ], [ 0, %for.end ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num2)
%4 = load i32, ptr %n1, align 4, !tbaa !5
%cmp522 = icmp sgt i32 %4, 0
br i1 %cmp522, label %for.body6.lr.ph, label %for.end13
for.body6.lr.ph: ; preds = %while.body
%5 = load i32, ptr %num2, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
br label %for.body6
for.cond4: ; preds = %for.body6
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%exitcond.not = icmp eq i64 %indvars.iv.next29, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %for.body6, !llvm.loop !11
for.body6: ; preds = %for.body6.lr.ph, %for.cond4
%indvars.iv28 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next29, %for.cond4 ]
%arrayidx8 = getelementptr inbounds [10000 x i32], ptr %num1, i64 0, i64 %indvars.iv28
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %6, %5
br i1 %cmp9, label %if.then, label %for.cond4
if.then: ; preds = %for.body6
%inc10 = add nsw i32 %cnt.026, 1
br label %for.end13
for.end13: ; preds = %for.cond4, %while.body, %if.then
%cnt.1 = phi i32 [ %inc10, %if.then ], [ %cnt.026, %while.body ], [ %cnt.026, %for.cond4 ]
%7 = load i32, ptr %n2, align 4, !tbaa !5
%dec = add nsw i32 %7, -1
store i32 %dec, ptr %n2, align 4, !tbaa !5
%tobool.not = icmp eq i32 %7, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %for.end13, %for.end
%cnt.0.lcssa = phi i32 [ 0, %for.end ], [ %cnt.1, %for.end13 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num2) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %num1) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int linear_search(int s[], int n, int t) {
for (int i = 0; i < n; i++)
if (s[i] == t)
return 1;
return 0;
}
int main(void) {
int n ,q;
int s[10000];
int t[500];
int i;
int count = 0;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &s[i]);
scanf("%d", &q);
for (i = 0; i < q; i++)
scanf("%d", &t[i]);
for (i = 0; i < q; i++) {
count += linear_search(s, n, t[i]);
}
printf("%d\n", count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140475/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140475/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @linear_search(ptr nocapture noundef readonly %s, i32 noundef %n, i32 noundef %t) local_unnamed_addr #0 {
entry:
%cmp.not4 = icmp sgt i32 %n, 0
br i1 %cmp.not4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%0 = zext i32 %n to i64
%wide.trip.count = zext i32 %n to i64
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp18 = icmp eq i32 %1, %t
br i1 %cmp18, label %cleanup, label %for.cond
for.cond: ; preds = %for.body.preheader, %for.body
%indvars.iv9 = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv9, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup.loopexit.loopexit, label %for.body, !llvm.loop !9
for.body: ; preds = %for.cond
%arrayidx = getelementptr inbounds i32, ptr %s, i64 %indvars.iv.next
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %2, %t
br i1 %cmp1, label %cleanup.loopexit.loopexit, label %for.cond, !llvm.loop !9
cleanup.loopexit.loopexit: ; preds = %for.body, %for.cond
%cmp.not.le = icmp ult i64 %indvars.iv.next, %0
%3 = zext i1 %cmp.not.le to i32
br label %cleanup
cleanup: ; preds = %for.body.preheader, %cleanup.loopexit.loopexit, %entry
%cmp.not.lcssa = phi i32 [ 0, %entry ], [ 1, %for.body.preheader ], [ %3, %cleanup.loopexit.loopexit ]
ret i32 %cmp.not.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%s = alloca [10000 x i32], align 16
%t = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp433 = icmp sgt i32 %3, 0
br i1 %cmp433, label %for.body5, label %for.end20
for.cond12.preheader: ; preds = %for.body5
%cmp1339 = icmp sgt i32 %10, 0
br i1 %cmp1339, label %for.body14.lr.ph, label %for.end20
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not4.i = icmp sgt i32 %4, 0
%5 = zext i32 %4 to i64
%6 = load i32, ptr %s, align 16
br i1 %cmp.not4.i, label %for.body14.us.preheader, label %for.end20
for.body14.us.preheader: ; preds = %for.body14.lr.ph
%wide.trip.count = zext i32 %10 to i64
br label %for.body14.us
for.body14.us: ; preds = %for.body14.us.preheader, %cleanup.loopexit.i.us
%indvars.iv52 = phi i64 [ 0, %for.body14.us.preheader ], [ %indvars.iv.next53, %cleanup.loopexit.i.us ]
%count.041.us = phi i32 [ 0, %for.body14.us.preheader ], [ %add.us, %cleanup.loopexit.i.us ]
%arrayidx16.us = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv52
%7 = load i32, ptr %arrayidx16.us, align 4, !tbaa !5
%cmp1.i35.us = icmp eq i32 %6, %7
br i1 %cmp1.i35.us, label %cleanup.loopexit.i.us, label %for.cond.i.us
for.body.i.us: ; preds = %for.cond.i.us
%arrayidx.i.us = getelementptr inbounds i32, ptr %s, i64 %indvars.iv.next.i.us
%8 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%cmp1.i.us = icmp eq i32 %8, %7
br i1 %cmp1.i.us, label %for.body.i.cleanup.loopexit.i_crit_edge.us, label %for.cond.i.us, !llvm.loop !9
for.cond.i.us: ; preds = %for.body14.us, %for.body.i.us
%indvars.iv.i36.us = phi i64 [ %indvars.iv.next.i.us, %for.body.i.us ], [ 0, %for.body14.us ]
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i36.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %5
br i1 %exitcond.not.i.us, label %cleanup.loopexit.i.us, label %for.body.i.us, !llvm.loop !9
cleanup.loopexit.i.us: ; preds = %for.cond.i.us, %for.body.i.cleanup.loopexit.i_crit_edge.us, %for.body14.us
%cmp.not.lcssa.ph.i.us = phi i1 [ %cmp.not.i.us.le43, %for.body.i.cleanup.loopexit.i_crit_edge.us ], [ true, %for.body14.us ], [ false, %for.cond.i.us ]
%9 = zext i1 %cmp.not.lcssa.ph.i.us to i32
%add.us = add nuw nsw i32 %count.041.us, %9
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
br i1 %exitcond.not, label %for.end20, label %for.body14.us, !llvm.loop !12
for.body.i.cleanup.loopexit.i_crit_edge.us: ; preds = %for.body.i.us
%cmp.not.i.us.le43 = icmp ult i64 %indvars.iv.next.i.us, %5
br label %cleanup.loopexit.i.us
for.body5: ; preds = %for.end, %for.body5
%indvars.iv49 = phi i64 [ %indvars.iv.next50, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv49
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp4 = icmp slt i64 %indvars.iv.next50, %11
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end20: ; preds = %cleanup.loopexit.i.us, %for.end, %for.body14.lr.ph, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.body14.lr.ph ], [ 0, %for.end ], [ %add.us, %cleanup.loopexit.i.us ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main()
{
int a,b,c[100000];
scanf("%d",&a);
for(int i=1;i<=a;i++){
scanf("%d",&b);
for(int j=1;j<=b;j++){
scanf("%d",&c[j]);
}
int m=0;
for(int j=1;j<b;j++){
if(c[j]>c[j+1]){
m=1;
break;
}
}
if(m==1) printf("YES\n");
else printf("NO\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14054/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14054/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not38 = icmp slt i32 %0, 1
br i1 %cmp.not38, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %if.end24, %entry
call void @llvm.lifetime.end.p0(i64 400000, 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
for.body: ; preds = %entry, %if.end24
%i.039 = phi i32 [ %inc26, %if.end24 ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp3.not36 = icmp slt i32 %1, 1
br i1 %cmp3.not36, label %for.cond8.preheader, label %for.body5
for.cond8.preheader: ; preds = %for.body5, %for.body
%.lcssa = phi i32 [ %1, %for.body ], [ %2, %for.body5 ]
%smax = call i32 @llvm.smax.i32(i32 %.lcssa, i32 1)
%wide.trip.count = zext i32 %smax to i64
br label %for.cond8
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 1, %for.body ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %c, i64 0, i64 %indvars.iv
%call6 = 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 %b, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp3.not.not, label %for.body5, label %for.cond8.preheader, !llvm.loop !9
for.cond8: ; preds = %for.cond8.preheader, %for.body11
%indvars.iv42 = phi i64 [ 1, %for.cond8.preheader ], [ %indvars.iv.next43, %for.body11 ]
%exitcond.not = icmp eq i64 %indvars.iv42, %wide.trip.count
br i1 %exitcond.not, label %if.end24, label %for.body11
for.body11: ; preds = %for.cond8
%arrayidx13 = getelementptr inbounds [100000 x i32], ptr %c, i64 0, i64 %indvars.iv42
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr %c, i64 0, i64 %indvars.iv.next43
%5 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %4, %5
br i1 %cmp16, label %if.end24, label %for.cond8, !llvm.loop !11
if.end24: ; preds = %for.cond8, %for.body11
%str.sink = phi ptr [ @str.3, %for.body11 ], [ @str, %for.cond8 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%inc26 = add nuw nsw i32 %i.039, 1
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.039, %6
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define n 10000
#define q 5000
int main(){
int S[n];
int T[q];
int U[n];
int sNum,tNum;
int i,j,k;
int c = 0;
int flag;
scanf("%d",&sNum);
for(i = 0; i < sNum; i++){
scanf("%d",&S[i]);
}
scanf("%d",&tNum);
for(i = 0; i < tNum; i++){
scanf("%d",&T[i]);
}
for(i = 0; i < sNum; i++){
for(j = 0; j < tNum; j++){
flag = 0;
if(S[i] == T[j]){
for(k = 0; k < c; k++){
if(U[k] == S[i]){
flag = 1;
break;
}
}
if(flag == 0){
U[c] = S[i];
c++;
}
}
}
}
printf("%d\n",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140583/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140583/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [10000 x i32], align 16
%T = alloca [5000 x i32], align 16
%U = alloca [10000 x i32], align 16
%sNum = alloca i32, align 4
%tNum = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 20000, ptr nonnull %T) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %U) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sNum) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tNum) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sNum)
%0 = load i32, ptr %sNum, align 4, !tbaa !5
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %sNum, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tNum)
%3 = load i32, ptr %tNum, align 4, !tbaa !5
%cmp470 = icmp sgt i32 %3, 0
br i1 %cmp470, label %for.body5, label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.body5, %for.end
%.lcssa = phi i32 [ %3, %for.end ], [ %8, %for.body5 ]
%4 = load i32, ptr %sNum, align 4, !tbaa !5
%cmp1378 = icmp sgt i32 %4, 0
%cmp1674 = icmp sgt i32 %.lcssa, 0
%or.cond = and i1 %cmp1378, %cmp1674
br i1 %or.cond, label %for.cond15.preheader.us.preheader, label %for.end49
for.cond15.preheader.us.preheader: ; preds = %for.cond12.preheader
%wide.trip.count99 = zext i32 %4 to i64
%wide.trip.count94 = zext i32 %.lcssa to i64
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.cond15.preheader.us.preheader, %for.cond15.for.inc47_crit_edge.us
%indvars.iv96 = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next97, %for.cond15.for.inc47_crit_edge.us ]
%c.080.us = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %c.2.us, %for.cond15.for.inc47_crit_edge.us ]
%arrayidx19.us = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv96
%5 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
br label %for.body17.us
for.body17.us: ; preds = %for.cond15.preheader.us, %for.inc44.us
%indvars.iv91 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next92, %for.inc44.us ]
%c.176.us = phi i32 [ %c.080.us, %for.cond15.preheader.us ], [ %c.2.us, %for.inc44.us ]
%arrayidx21.us = getelementptr inbounds [5000 x i32], ptr %T, i64 0, i64 %indvars.iv91
%6 = load i32, ptr %arrayidx21.us, align 4, !tbaa !5
%cmp22.us = icmp eq i32 %5, %6
br i1 %cmp22.us, label %for.cond23.preheader.us, label %for.inc44.us
for.cond23.us: ; preds = %for.body25.us
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
br i1 %exitcond.not, label %if.then36.us, label %for.body25.us, !llvm.loop !11
if.then36.us: ; preds = %for.cond23.us, %for.cond23.preheader.us
%idxprom39.us = sext i32 %c.176.us to i64
%arrayidx40.us = getelementptr inbounds [10000 x i32], ptr %U, i64 0, i64 %idxprom39.us
store i32 %5, ptr %arrayidx40.us, align 4, !tbaa !5
%inc41.us = add nsw i32 %c.176.us, 1
br label %for.inc44.us
for.body25.us: ; preds = %for.body25.us.preheader, %for.cond23.us
%indvars.iv88 = phi i64 [ 0, %for.body25.us.preheader ], [ %indvars.iv.next89, %for.cond23.us ]
%arrayidx27.us = getelementptr inbounds [10000 x i32], ptr %U, i64 0, i64 %indvars.iv88
%7 = load i32, ptr %arrayidx27.us, align 4, !tbaa !5
%cmp30.us = icmp eq i32 %7, %5
br i1 %cmp30.us, label %for.inc44.us, label %for.cond23.us
for.inc44.us: ; preds = %for.body25.us, %if.then36.us, %for.body17.us
%c.2.us = phi i32 [ %inc41.us, %if.then36.us ], [ %c.176.us, %for.body17.us ], [ %c.176.us, %for.body25.us ]
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
br i1 %exitcond95.not, label %for.cond15.for.inc47_crit_edge.us, label %for.body17.us, !llvm.loop !12
for.cond23.preheader.us: ; preds = %for.body17.us
%cmp24.not72.us = icmp sgt i32 %c.176.us, 0
br i1 %cmp24.not72.us, label %for.body25.us.preheader, label %if.then36.us
for.body25.us.preheader: ; preds = %for.cond23.preheader.us
%wide.trip.count = zext i32 %c.176.us to i64
br label %for.body25.us
for.cond15.for.inc47_crit_edge.us: ; preds = %for.inc44.us
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%exitcond100.not = icmp eq i64 %indvars.iv.next97, %wide.trip.count99
br i1 %exitcond100.not, label %for.end49, label %for.cond15.preheader.us, !llvm.loop !13
for.body5: ; preds = %for.end, %for.body5
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [5000 x i32], ptr %T, i64 0, i64 %indvars.iv85
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%8 = load i32, ptr %tNum, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next86, %9
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !14
for.end49: ; preds = %for.cond15.for.inc47_crit_edge.us, %for.cond12.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ %c.2.us, %for.cond15.for.inc47_crit_edge.us ]
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tNum) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sNum) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %U) #3
call void @llvm.lifetime.end.p0(i64 20000, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int serch (int A[],int n, int key){
int i = 0;
A[n] = key;
while (A[i] != key) i++;
return i != n;
}
int main(){
int i,n,q,A[10000],key,sum = 0;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if(serch(A,n,key))sum++;
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140626/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140626/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @serch(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%A = alloca [10000 x i32], align 16
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %serch.exit
%sum.022 = phi i32 [ %spec.select, %serch.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %serch.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %serch.exit, label %while.cond.i, !llvm.loop !9
serch.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %serch.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %serch.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int a[10100];
int main()
{
int t,n,i,j;
scanf("%d",&t);
while(t--)
{
j=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=1;i<n;i++)
if(a[i-1]>a[i])
{
j=1;
break;
}
if(j==1)
printf("YES\n");
else
printf("NO\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14067/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14067/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@a = dso_local global [10100 x i32] zeroinitializer, align 16
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec30 = add nsw i32 %0, -1
store i32 %dec30, ptr %t, align 4, !tbaa !5
%tobool.not31 = icmp eq i32 %0, 0
br i1 %tobool.not31, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end18
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %1, 0
br i1 %cmp26, label %for.body, label %if.end18
for.cond3.preheader: ; preds = %for.body
%cmp428 = icmp sgt i32 %2, 1
br i1 %cmp428, label %for.body5.preheader, label %if.end18
for.body5.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %2 to i64
%.pre = load i32, ptr @a, align 16, !tbaa !5
br label %for.body5
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [10100 x i32], ptr @a, 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: ; preds = %for.body5
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
br i1 %exitcond.not, label %if.end18, label %for.body5, !llvm.loop !11
for.body5: ; preds = %for.body5.preheader, %for.cond3
%4 = phi i32 [ %.pre, %for.body5.preheader ], [ %5, %for.cond3 ]
%indvars.iv34 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next35, %for.cond3 ]
%arrayidx9 = getelementptr inbounds [10100 x i32], ptr @a, i64 0, i64 %indvars.iv34
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %4, %5
br i1 %cmp10, label %if.end18, label %for.cond3
if.end18: ; preds = %for.cond3, %for.body5, %for.cond3.preheader, %while.body
%str.sink = phi ptr [ @str, %while.body ], [ @str, %for.cond3.preheader ], [ @str.3, %for.body5 ], [ @str, %for.cond3 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%6 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end18, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define N 10000
int main( void )
{
int i, j, c = 0, n, q, s[N], t;
scanf( "%d", &n );
for ( i = 0; i < n; i++ ) {
scanf( "%d", &s[i] );
}
scanf( "%d", &q );
for ( i = 0; i < q; i++ ) {
scanf( "%d", &t );
for ( j = 0; j < n; j++ ) {
if ( t == s[j] ) {
t = -1;
}
}
if ( t == -1 ) {
c++;
}
}
printf( "%d\n", c );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140712/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140712/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%s = alloca [10000 x i32], align 16
%t = alloca 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 40000, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !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
%cmp435 = icmp sgt i32 %3, 0
br i1 %cmp435, label %for.body5, label %for.end22
for.body5: ; preds = %for.end, %for.end15
%c.037 = phi i32 [ %spec.select, %for.end15 ], [ 0, %for.end ]
%i.136 = phi i32 [ %inc21, %for.end15 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%4 = load i32, ptr %n, align 4, !tbaa !5
%t.promoted = load i32, ptr %t, align 4, !tbaa !5
%cmp833 = icmp sgt i32 %4, 0
br i1 %cmp833, label %for.body9.preheader, label %for.end15
for.body9.preheader: ; preds = %for.body5
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count, 3
%5 = icmp ult i32 %4, 4
br i1 %5, label %for.end15.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body9
for.body9: ; preds = %for.inc13.3, %for.body9.preheader.new
%indvars.iv39 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next40.3, %for.inc13.3 ]
%6 = phi i32 [ %t.promoted, %for.body9.preheader.new ], [ %14, %for.inc13.3 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.inc13.3 ]
%arrayidx11 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv39
%7 = load i32, ptr %arrayidx11, align 16, !tbaa !5
%cmp12 = icmp eq i32 %6, %7
br i1 %cmp12, label %if.then, label %for.inc13
if.then: ; preds = %for.body9
store i32 -1, ptr %t, align 4, !tbaa !5
br label %for.inc13
for.inc13: ; preds = %for.body9, %if.then
%8 = phi i32 [ %6, %for.body9 ], [ -1, %if.then ]
%indvars.iv.next40 = or i64 %indvars.iv39, 1
%arrayidx11.1 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv.next40
%9 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%cmp12.1 = icmp eq i32 %8, %9
br i1 %cmp12.1, label %if.then.1, label %for.inc13.1
if.then.1: ; preds = %for.inc13
store i32 -1, ptr %t, align 4, !tbaa !5
br label %for.inc13.1
for.inc13.1: ; preds = %if.then.1, %for.inc13
%10 = phi i32 [ %8, %for.inc13 ], [ -1, %if.then.1 ]
%indvars.iv.next40.1 = or i64 %indvars.iv39, 2
%arrayidx11.2 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv.next40.1
%11 = load i32, ptr %arrayidx11.2, align 8, !tbaa !5
%cmp12.2 = icmp eq i32 %10, %11
br i1 %cmp12.2, label %if.then.2, label %for.inc13.2
if.then.2: ; preds = %for.inc13.1
store i32 -1, ptr %t, align 4, !tbaa !5
br label %for.inc13.2
for.inc13.2: ; preds = %if.then.2, %for.inc13.1
%12 = phi i32 [ %10, %for.inc13.1 ], [ -1, %if.then.2 ]
%indvars.iv.next40.2 = or i64 %indvars.iv39, 3
%arrayidx11.3 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv.next40.2
%13 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%cmp12.3 = icmp eq i32 %12, %13
br i1 %cmp12.3, label %if.then.3, label %for.inc13.3
if.then.3: ; preds = %for.inc13.2
store i32 -1, ptr %t, align 4, !tbaa !5
br label %for.inc13.3
for.inc13.3: ; preds = %if.then.3, %for.inc13.2
%14 = phi i32 [ %12, %for.inc13.2 ], [ -1, %if.then.3 ]
%indvars.iv.next40.3 = add nuw nsw i64 %indvars.iv39, 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.end15.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11
for.end15.loopexit.unr-lcssa: ; preds = %for.inc13.3, %for.body9.preheader
%.lcssa.ph = phi i32 [ undef, %for.body9.preheader ], [ %14, %for.inc13.3 ]
%indvars.iv39.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next40.3, %for.inc13.3 ]
%.unr = phi i32 [ %t.promoted, %for.body9.preheader ], [ %14, %for.inc13.3 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end15, label %for.body9.epil
for.body9.epil: ; preds = %for.end15.loopexit.unr-lcssa, %for.inc13.epil
%indvars.iv39.epil = phi i64 [ %indvars.iv.next40.epil, %for.inc13.epil ], [ %indvars.iv39.unr, %for.end15.loopexit.unr-lcssa ]
%15 = phi i32 [ %17, %for.inc13.epil ], [ %.unr, %for.end15.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.inc13.epil ], [ 0, %for.end15.loopexit.unr-lcssa ]
%arrayidx11.epil = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv39.epil
%16 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%cmp12.epil = icmp eq i32 %15, %16
br i1 %cmp12.epil, label %if.then.epil, label %for.inc13.epil
if.then.epil: ; preds = %for.body9.epil
store i32 -1, ptr %t, align 4, !tbaa !5
br label %for.inc13.epil
for.inc13.epil: ; preds = %if.then.epil, %for.body9.epil
%17 = phi i32 [ %15, %for.body9.epil ], [ -1, %if.then.epil ]
%indvars.iv.next40.epil = add nuw nsw i64 %indvars.iv39.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.end15, label %for.body9.epil, !llvm.loop !12
for.end15: ; preds = %for.end15.loopexit.unr-lcssa, %for.inc13.epil, %for.body5
%18 = phi i32 [ %t.promoted, %for.body5 ], [ %.lcssa.ph, %for.end15.loopexit.unr-lcssa ], [ %17, %for.inc13.epil ]
%cmp16 = icmp eq i32 %18, -1
%inc18 = zext i1 %cmp16 to i32
%spec.select = add nuw nsw i32 %c.037, %inc18
%inc21 = add nuw nsw i32 %i.136, 1
%19 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc21, %19
br i1 %cmp4, label %for.body5, label %for.end22, !llvm.loop !14
for.end22: ; preds = %for.end15, %for.end
%c.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %for.end15 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main () {
int n, s[10000],t[500], i, j, q;
int count = 0 ;
scanf ("%d",&n) ;
for ( i = 0 ; i < n ; i ++ ) {
scanf("%d", &s[i] ) ;
}
scanf ("%d",&q) ;
for ( i = 0 ; i < q ; i ++ ) {
scanf("%d", &t[i] ) ;
}
for ( j = 0 ; j < q ; j++) {
for ( i = 0 ; i < n ; i++) {
if ( s[i] == t[j] ) {
count++ ;
break;
}
}
}
printf("%d\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140763/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140763/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%t = alloca [500 x i32], align 16
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %0, 0
br i1 %cmp42, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp444 = icmp sgt i32 %3, 0
br i1 %cmp444, label %for.body5, label %for.end29
for.cond12.preheader: ; preds = %for.body5
%cmp1348 = icmp sgt i32 %10, 0
br i1 %cmp1348, label %for.cond15.preheader.lr.ph, label %for.end29
for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1646 = icmp sgt i32 %4, 0
br i1 %cmp1646, label %for.cond15.preheader.us.preheader, label %for.end29
for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph
%wide.trip.count65 = zext i32 %10 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count65, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us.preheader.new
for.cond15.preheader.us.preheader.new: ; preds = %for.cond15.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count65, 4294967294
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader.new
%indvars.iv62 = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%count.051.us = phi i32 [ 0, %for.cond15.preheader.us.preheader.new ], [ %count.1.us.1, %for.inc27.us.1 ]
%niter = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %niter.next.1, %for.inc27.us.1 ]
%arrayidx21.us = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv62
%6 = load i32, ptr %arrayidx21.us, align 8, !tbaa !5
br label %for.body17.us
for.cond15.us: ; preds = %for.body17.us
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
br i1 %exitcond.not, label %for.inc27.us, label %for.body17.us, !llvm.loop !11
for.body17.us: ; preds = %for.cond15.preheader.us, %for.cond15.us
%indvars.iv59 = phi i64 [ 0, %for.cond15.preheader.us ], [ %indvars.iv.next60, %for.cond15.us ]
%arrayidx19.us = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv59
%7 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%cmp22.us = icmp eq i32 %7, %6
br i1 %cmp22.us, label %if.then.us, label %for.cond15.us
if.then.us: ; preds = %for.body17.us
%inc23.us = add nsw i32 %count.051.us, 1
br label %for.inc27.us
for.inc27.us: ; preds = %for.cond15.us, %if.then.us
%count.1.us = phi i32 [ %inc23.us, %if.then.us ], [ %count.051.us, %for.cond15.us ]
%indvars.iv.next63 = or i64 %indvars.iv62, 1
%arrayidx21.us.1 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv.next63
%8 = load i32, ptr %arrayidx21.us.1, align 4, !tbaa !5
br label %for.body17.us.1
for.body17.us.1: ; preds = %for.cond15.us.1, %for.inc27.us
%indvars.iv59.1 = phi i64 [ 0, %for.inc27.us ], [ %indvars.iv.next60.1, %for.cond15.us.1 ]
%arrayidx19.us.1 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv59.1
%9 = load i32, ptr %arrayidx19.us.1, align 4, !tbaa !5
%cmp22.us.1 = icmp eq i32 %9, %8
br i1 %cmp22.us.1, label %if.then.us.1, label %for.cond15.us.1
for.cond15.us.1: ; preds = %for.body17.us.1
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next60.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc27.us.1, label %for.body17.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body17.us.1
%inc23.us.1 = add nsw i32 %count.1.us, 1
br label %for.inc27.us.1
for.inc27.us.1: ; preds = %for.cond15.us.1, %if.then.us.1
%count.1.us.1 = phi i32 [ %inc23.us.1, %if.then.us.1 ], [ %count.1.us, %for.cond15.us.1 ]
%indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end29.loopexit.unr-lcssa, label %for.cond15.preheader.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv56
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%10 = load i32, ptr %q, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp4 = icmp slt i64 %indvars.iv.next57, %11
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end29.loopexit.unr-lcssa: ; preds = %for.inc27.us.1, %for.cond15.preheader.us.preheader
%count.1.us.lcssa.ph = phi i32 [ undef, %for.cond15.preheader.us.preheader ], [ %count.1.us.1, %for.inc27.us.1 ]
%indvars.iv62.unr = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvars.iv.next63.1, %for.inc27.us.1 ]
%count.051.us.unr = phi i32 [ 0, %for.cond15.preheader.us.preheader ], [ %count.1.us.1, %for.inc27.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.cond15.preheader.us.epil
for.cond15.preheader.us.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx21.us.epil = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv62.unr
%12 = load i32, ptr %arrayidx21.us.epil, align 4, !tbaa !5
br label %for.body17.us.epil
for.body17.us.epil: ; preds = %for.cond15.us.epil, %for.cond15.preheader.us.epil
%indvars.iv59.epil = phi i64 [ 0, %for.cond15.preheader.us.epil ], [ %indvars.iv.next60.epil, %for.cond15.us.epil ]
%arrayidx19.us.epil = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv59.epil
%13 = load i32, ptr %arrayidx19.us.epil, align 4, !tbaa !5
%cmp22.us.epil = icmp eq i32 %13, %12
br i1 %cmp22.us.epil, label %if.then.us.epil, label %for.cond15.us.epil
for.cond15.us.epil: ; preds = %for.body17.us.epil
%indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next60.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end29, label %for.body17.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body17.us.epil
%inc23.us.epil = add nsw i32 %count.051.us.unr, 1
br label %for.end29
for.end29: ; preds = %for.end29.loopexit.unr-lcssa, %for.cond15.us.epil, %if.then.us.epil, %for.end, %for.cond15.preheader.lr.ph, %for.cond12.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.cond15.preheader.lr.ph ], [ 0, %for.end ], [ %count.1.us.lcssa.ph, %for.end29.loopexit.unr-lcssa ], [ %inc23.us.epil, %if.then.us.epil ], [ %count.051.us.unr, %for.cond15.us.epil ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int linarSearch(int *A, int n, int key ) {
int i = 0;
A[n] = key;
while(A[i] != key) {
i++;
}
if(i == n) return 0;
return 1;
}
int main () {
int i, n, q, S[10000], T[500], m = 0;
scanf("%d", &n);
for(i = 0; i < n; i++) scanf("%d", &S[i]);
scanf("%d", &q);
for(i = 0; i < q; i++) scanf("%d", &T[i]);
for(i = 0; i < q; i++) {
m += linarSearch(S, n, T[i]);
}
printf("%d\n", m);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140813/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140813/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @linarSearch(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%. = zext i1 %cmp3 to i32
ret i32 %.
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10000 x i32], align 16
%T = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp433 = icmp sgt i32 %3, 0
br i1 %cmp433, label %for.body5, label %for.end20
for.cond12.preheader: ; preds = %for.body5
%cmp1335 = icmp sgt i32 %6, 0
br i1 %cmp1335, label %for.body14.lr.ph, label %for.end20
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %idxprom.i
%wide.trip.count = zext i32 %6 to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %6, 1
br i1 %5, label %for.end20.loopexit.unr-lcssa, label %for.body14.lr.ph.new
for.body14.lr.ph.new: ; preds = %for.body14.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14
for.body5: ; preds = %for.end, %for.body5
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv41
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%6 = load i32, ptr %q, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next42, %7
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !12
for.body14: ; preds = %linarSearch.exit.1, %for.body14.lr.ph.new
%indvars.iv44 = phi i64 [ 0, %for.body14.lr.ph.new ], [ %indvars.iv.next45.1, %linarSearch.exit.1 ]
%m.037 = phi i32 [ 0, %for.body14.lr.ph.new ], [ %add.1, %linarSearch.exit.1 ]
%niter = phi i64 [ 0, %for.body14.lr.ph.new ], [ %niter.next.1, %linarSearch.exit.1 ]
%arrayidx16 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv44
%8 = load i32, ptr %arrayidx16, align 8, !tbaa !5
store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body14
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body14 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %9, %8
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %linarSearch.exit, label %while.cond.i, !llvm.loop !9
linarSearch.exit: ; preds = %while.cond.i
%10 = trunc i64 %indvars.iv.i to i32
%cmp3.i = icmp ne i32 %4, %10
%..i = zext i1 %cmp3.i to i32
%add = add nuw nsw i32 %m.037, %..i
%indvars.iv.next45 = or i64 %indvars.iv44, 1
%arrayidx16.1 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv.next45
%11 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.1
while.cond.i.1: ; preds = %while.cond.i.1, %linarSearch.exit
%indvars.iv.i.1 = phi i64 [ %indvars.iv.next.i.1, %while.cond.i.1 ], [ 0, %linarSearch.exit ]
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.1
%12 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp.not.i.1 = icmp eq i32 %12, %11
%indvars.iv.next.i.1 = add nuw i64 %indvars.iv.i.1, 1
br i1 %cmp.not.i.1, label %linarSearch.exit.1, label %while.cond.i.1, !llvm.loop !9
linarSearch.exit.1: ; preds = %while.cond.i.1
%13 = trunc i64 %indvars.iv.i.1 to i32
%cmp3.i.1 = icmp ne i32 %4, %13
%..i.1 = zext i1 %cmp3.i.1 to i32
%add.1 = add nuw nsw i32 %add, %..i.1
%indvars.iv.next45.1 = add nuw nsw i64 %indvars.iv44, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end20.loopexit.unr-lcssa, label %for.body14, !llvm.loop !13
for.end20.loopexit.unr-lcssa: ; preds = %linarSearch.exit.1, %for.body14.lr.ph
%add.lcssa.ph = phi i32 [ undef, %for.body14.lr.ph ], [ %add.1, %linarSearch.exit.1 ]
%indvars.iv44.unr = phi i64 [ 0, %for.body14.lr.ph ], [ %indvars.iv.next45.1, %linarSearch.exit.1 ]
%m.037.unr = phi i32 [ 0, %for.body14.lr.ph ], [ %add.1, %linarSearch.exit.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body14.epil
for.body14.epil: ; preds = %for.end20.loopexit.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv44.unr
%14 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i.epil
while.cond.i.epil: ; preds = %while.cond.i.epil, %for.body14.epil
%indvars.iv.i.epil = phi i64 [ %indvars.iv.next.i.epil, %while.cond.i.epil ], [ 0, %for.body14.epil ]
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.epil
%15 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp.not.i.epil = icmp eq i32 %15, %14
%indvars.iv.next.i.epil = add nuw i64 %indvars.iv.i.epil, 1
br i1 %cmp.not.i.epil, label %linarSearch.exit.epil, label %while.cond.i.epil, !llvm.loop !9
linarSearch.exit.epil: ; preds = %while.cond.i.epil
%16 = trunc i64 %indvars.iv.i.epil to i32
%cmp3.i.epil = icmp ne i32 %4, %16
%..i.epil = zext i1 %cmp3.i.epil to i32
%add.epil = add nuw nsw i32 %m.037.unr, %..i.epil
br label %for.end20
for.end20: ; preds = %linarSearch.exit.epil, %for.end20.loopexit.unr-lcssa, %for.end, %for.cond12.preheader
%m.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.end ], [ %add.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %add.epil, %linarSearch.exit.epil ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define Not_Found 0
#define Found 1
#define MAX 10000
#define max 500
int n;
int LinerSearch(int *,int);
int main(){
int S[MAX],T[max],q,count,i;
scanf("%d",&n);
for( i = 0; i < n; i++) scanf("%d",&S[i]);
scanf("%d",&q);
for( i = 0; i < q; i++){
scanf("%d",&T[i]);
if(LinerSearch(S,T[i]) == Found) count++;
}
printf("%d\n",count);
return 0;
}
int LinerSearch(int *A,int key){
int i = 0;
/*A[n] = &key;
while(A[i] != key){
i++;
if(i == n) return Not_Found;
}
return Found;*/
for( i = 0; i < n; i++){
if(A[i] == key) return Found;
}
return Not_Found;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140857/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140857/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [10000 x i32], align 16
%T = alloca [500 x i32], align 16
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #5
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp430 = icmp sgt i32 %3, 0
call void @llvm.assume(i1 %cmp430)
br label %for.body5
for.body5: ; preds = %for.end, %for.cond3
%indvars.iv34 = phi i64 [ 0, %for.end ], [ %indvars.iv.next35, %for.cond3 ]
%count.031 = phi i32 [ undef, %for.end ], [ %7, %for.cond3 ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv34
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %5, 0
br i1 %cmp4.i, label %for.body.preheader.i, label %for.cond3
for.body.preheader.i: ; preds = %for.body5
%wide.trip.count.i = zext i32 %5 to i64
br label %for.body.i
for.cond.i: ; preds = %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond3, label %for.body.i, !llvm.loop !11
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %6, %4
br i1 %cmp1.i, label %LinerSearch.exit, label %for.cond.i
LinerSearch.exit: ; preds = %for.body.i
%inc13 = add nsw i32 %count.031, 1
br label %for.cond3
for.cond3: ; preds = %for.cond.i, %for.body5, %LinerSearch.exit
%7 = phi i32 [ %inc13, %LinerSearch.exit ], [ %count.031, %for.body5 ], [ %count.031, %for.cond.i ]
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next35, %9
br i1 %cmp4, label %for.body5, label %for.end16, !llvm.loop !12
for.end16: ; preds = %for.cond3
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 40000, 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: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @LinerSearch(ptr nocapture noundef readonly %A, i32 noundef %key) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %1, %key
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
int i,j,k,s,numA,numB,num=0;
scanf("%d",&numA);
int retuA[numA];
for(i = 0; i < numA; i++){
scanf("%d",&retuA[i]);
}
scanf("%d",&numB);
int retuB[numB];
for(i = 0; i < numB; i++){
scanf("%d",&retuB[i]);
}
for(i = 0; i < numB; i++){
for(j = 0; j < numA; j++){
if(retuA[j]==retuB[i]){
num++;
break;
}
}
}
printf("%d\n",num);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140907/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140907/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%numA = alloca i32, align 4
%numB = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %numA) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %numB) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %numA)
%0 = load i32, ptr %numA, 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 %numA, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %3, 0
br i1 %cmp43, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %numA, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %numB)
%6 = load i32, ptr %numB, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%cmp545 = icmp sgt i32 %6, 0
br i1 %cmp545, label %for.body6, label %for.end30
for.cond13.preheader: ; preds = %for.body6
%cmp1449 = icmp sgt i32 %14, 0
br i1 %cmp1449, label %for.cond16.preheader.lr.ph, label %for.end30
for.cond16.preheader.lr.ph: ; preds = %for.cond13.preheader
%8 = load i32, ptr %numA, align 4, !tbaa !5
%cmp1747 = icmp sgt i32 %8, 0
br i1 %cmp1747, label %for.cond16.preheader.us.preheader, label %for.end30
for.cond16.preheader.us.preheader: ; preds = %for.cond16.preheader.lr.ph
%wide.trip.count66 = zext i32 %14 to i64
%wide.trip.count = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count66, 1
%9 = icmp eq i32 %14, 1
br i1 %9, label %for.end30.loopexit.unr-lcssa, label %for.cond16.preheader.us.preheader.new
for.cond16.preheader.us.preheader.new: ; preds = %for.cond16.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count66, 4294967294
br label %for.cond16.preheader.us
for.cond16.preheader.us: ; preds = %for.inc28.us.1, %for.cond16.preheader.us.preheader.new
%indvars.iv63 = phi i64 [ 0, %for.cond16.preheader.us.preheader.new ], [ %indvars.iv.next64.1, %for.inc28.us.1 ]
%num.050.us = phi i32 [ 0, %for.cond16.preheader.us.preheader.new ], [ %num.1.us.1, %for.inc28.us.1 ]
%niter = phi i64 [ 0, %for.cond16.preheader.us.preheader.new ], [ %niter.next.1, %for.inc28.us.1 ]
%arrayidx22.us = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv63
%10 = load i32, ptr %arrayidx22.us, align 8, !tbaa !5
br label %for.body18.us
for.cond16.us: ; preds = %for.body18.us
%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.inc28.us, label %for.body18.us, !llvm.loop !11
for.body18.us: ; preds = %for.cond16.preheader.us, %for.cond16.us
%indvars.iv60 = phi i64 [ 0, %for.cond16.preheader.us ], [ %indvars.iv.next61, %for.cond16.us ]
%arrayidx20.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60
%11 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5
%cmp23.us = icmp eq i32 %11, %10
br i1 %cmp23.us, label %if.then.us, label %for.cond16.us
if.then.us: ; preds = %for.body18.us
%inc24.us = add nsw i32 %num.050.us, 1
br label %for.inc28.us
for.inc28.us: ; preds = %for.cond16.us, %if.then.us
%num.1.us = phi i32 [ %inc24.us, %if.then.us ], [ %num.050.us, %for.cond16.us ]
%indvars.iv.next64 = or i64 %indvars.iv63, 1
%arrayidx22.us.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next64
%12 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5
br label %for.body18.us.1
for.body18.us.1: ; preds = %for.cond16.us.1, %for.inc28.us
%indvars.iv60.1 = phi i64 [ 0, %for.inc28.us ], [ %indvars.iv.next61.1, %for.cond16.us.1 ]
%arrayidx20.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60.1
%13 = load i32, ptr %arrayidx20.us.1, align 4, !tbaa !5
%cmp23.us.1 = icmp eq i32 %13, %12
br i1 %cmp23.us.1, label %if.then.us.1, label %for.cond16.us.1
for.cond16.us.1: ; preds = %for.body18.us.1
%indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next61.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc28.us.1, label %for.body18.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body18.us.1
%inc24.us.1 = add nsw i32 %num.1.us, 1
br label %for.inc28.us.1
for.inc28.us.1: ; preds = %for.cond16.us.1, %if.then.us.1
%num.1.us.1 = phi i32 [ %inc24.us.1, %if.then.us.1 ], [ %num.1.us, %for.cond16.us.1 ]
%indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 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.end30.loopexit.unr-lcssa, label %for.cond16.preheader.us, !llvm.loop !12
for.body6: ; preds = %for.end, %for.body6
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv57
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%14 = load i32, ptr %numB, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp5 = icmp slt i64 %indvars.iv.next58, %15
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !13
for.end30.loopexit.unr-lcssa: ; preds = %for.inc28.us.1, %for.cond16.preheader.us.preheader
%num.1.us.lcssa.ph = phi i32 [ undef, %for.cond16.preheader.us.preheader ], [ %num.1.us.1, %for.inc28.us.1 ]
%indvars.iv63.unr = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next64.1, %for.inc28.us.1 ]
%num.050.us.unr = phi i32 [ 0, %for.cond16.preheader.us.preheader ], [ %num.1.us.1, %for.inc28.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end30, label %for.cond16.preheader.us.epil
for.cond16.preheader.us.epil: ; preds = %for.end30.loopexit.unr-lcssa
%arrayidx22.us.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv63.unr
%16 = load i32, ptr %arrayidx22.us.epil, align 4, !tbaa !5
br label %for.body18.us.epil
for.body18.us.epil: ; preds = %for.cond16.us.epil, %for.cond16.preheader.us.epil
%indvars.iv60.epil = phi i64 [ 0, %for.cond16.preheader.us.epil ], [ %indvars.iv.next61.epil, %for.cond16.us.epil ]
%arrayidx20.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60.epil
%17 = load i32, ptr %arrayidx20.us.epil, align 4, !tbaa !5
%cmp23.us.epil = icmp eq i32 %17, %16
br i1 %cmp23.us.epil, label %if.then.us.epil, label %for.cond16.us.epil
for.cond16.us.epil: ; preds = %for.body18.us.epil
%indvars.iv.next61.epil = add nuw nsw i64 %indvars.iv60.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next61.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end30, label %for.body18.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body18.us.epil
%inc24.us.epil = add nsw i32 %num.050.us.unr, 1
br label %for.end30
for.end30: ; preds = %for.end30.loopexit.unr-lcssa, %for.cond16.us.epil, %if.then.us.epil, %for.end, %for.cond16.preheader.lr.ph, %for.cond13.preheader
%num.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.cond16.preheader.lr.ph ], [ 0, %for.end ], [ %num.1.us.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %inc24.us.epil, %if.then.us.epil ], [ %num.050.us.unr, %for.cond16.us.epil ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %num.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %numB) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %numA) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#define SIZE 10000
int main()
{
int s[SIZE],t;
int i,j,n,q,ans=0;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&s[i]);
scanf("%d",&q);
for(i=0;i<q;i++)
{
scanf("%d",&t);
for(j=0;j<n;j++)
{
if(t==s[j])
{
ans++;
break;
}
}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140950/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140950/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [10000 x i32], align 16
%t = alloca i32, align 4
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp432 = icmp sgt i32 %3, 0
br i1 %cmp432, label %for.body5, label %for.end19
for.body5: ; preds = %for.end, %for.inc17
%ans.034 = phi i32 [ %ans.1, %for.inc17 ], [ 0, %for.end ]
%i.133 = phi i32 [ %inc18, %for.inc17 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp830 = icmp sgt i32 %4, 0
br i1 %cmp830, label %for.body9.lr.ph, label %for.inc17
for.body9.lr.ph: ; preds = %for.body5
%5 = load i32, ptr %t, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
br label %for.body9
for.cond7: ; preds = %for.body9
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%exitcond.not = icmp eq i64 %indvars.iv.next37, %wide.trip.count
br i1 %exitcond.not, label %for.inc17, label %for.body9, !llvm.loop !11
for.body9: ; preds = %for.body9.lr.ph, %for.cond7
%indvars.iv36 = phi i64 [ 0, %for.body9.lr.ph ], [ %indvars.iv.next37, %for.cond7 ]
%arrayidx11 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv36
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %5, %6
br i1 %cmp12, label %if.then, label %for.cond7
if.then: ; preds = %for.body9
%inc13 = add nsw i32 %ans.034, 1
br label %for.inc17
for.inc17: ; preds = %for.cond7, %for.body5, %if.then
%ans.1 = phi i32 [ %inc13, %if.then ], [ %ans.034, %for.body5 ], [ %ans.034, %for.cond7 ]
%inc18 = add nuw nsw i32 %i.133, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc18, %7
br i1 %cmp4, label %for.body5, label %for.end19, !llvm.loop !12
for.end19: ; preds = %for.inc17, %for.end
%ans.0.lcssa = phi i32 [ 0, %for.end ], [ %ans.1, %for.inc17 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
//?????¢??¢?´¢
#include <stdio.h>
int Linear(int A[],int n,int key){
int i=0;
A[n]=key;
while(A[i] != key) i++;
return i != n;
}
int main(void){
int i=0,n,A[10001],key;
int q,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&A[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&key);
if(Linear(A, n, key)) sum++;
}
printf("%d\n",sum);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_140994/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_140994/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Linear(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [10001 x i32], align 16
%key = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %Linear.exit
%sum.022 = phi i32 [ %spec.select, %Linear.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %Linear.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %Linear.exit, label %while.cond.i, !llvm.loop !9
Linear.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %Linear.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %Linear.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
void sort(int n, int a[n]);
int main(){
int n,q;
int S[10000], T[500];
int count=0;
int i,j;
int si;
scanf("%d", &n );
//printf("%d\n", n);
for (i=0 ; i<n; i++ ) {
scanf("%d", &S[i] );
//printf("%d ", S[i] );
}
//printf("\n");
scanf("%d", &q );
for (i=0 ; i<q; i++ ) {
scanf("%d", &T[i] );
}
//??????S,T????????????
sort(n, S);
sort(q, T);
/*for (i=0 ; i<n; i++ ) {
printf("%d ", S[i] );
}
printf("\n");
for (i=0 ; i<q; i++ ) {
printf("%d ", T[i] );
}
printf("\n");
*/
si=0;
for(i=0; i<q; i++){
for(j=si; j<n ; j++){
//printf("S=%d T=%d",j,i);
if(S[j]==T[i]){
count++;
si=j+1;
//printf("?????´\n");
break;
}else if(S[j]>T[i]){
//printf("s<t\n");
break;
}
}
}
printf("%d\n", count );
return 0;
}
void sort(int n, int a[n]){
int i, j, tmp;
for (i = 1; i < n; i++) {
tmp = a[i];
if (a[i-1] > tmp) {
j = i;
do {
a[j] = a[j-1];
j--;
} while (j > 0 && a[j-1] > tmp);
a[j] = tmp;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141036/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141036/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10000 x i32], align 16
%T = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp81 = icmp sgt i32 %0, 0
br i1 %cmp81, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp483 = icmp sgt i32 %3, 0
br i1 %cmp483, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.body5
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv96
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%4 = load i32, ptr %q, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp4 = icmp slt i64 %indvars.iv.next97, %5
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.body5, %for.end
%.lcssa = phi i32 [ %3, %for.end ], [ %4, %for.body5 ]
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp33.i = icmp sgt i32 %6, 1
br i1 %cmp33.i, label %for.body.preheader.i, label %sort.exit
for.body.preheader.i: ; preds = %for.end11
%wide.trip.count.i = zext i32 %6 to i64
%invariant.gep.i = getelementptr i32, ptr %S, i64 -1
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%8 = load i32, ptr %gep.i, align 4, !tbaa !5
%cmp3.i = icmp sgt i32 %8, %7
br i1 %cmp3.i, label %do.body.i, label %for.inc.i
do.body.i: ; preds = %for.body.i, %land.rhs.i
%indvars.iv35.i = phi i64 [ %indvars.iv.next36.i, %land.rhs.i ], [ %indvars.iv.i, %for.body.i ]
%indvars.iv.next36.i = add nsw i64 %indvars.iv35.i, -1
%arrayidx6.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.next36.i
%9 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%arrayidx8.i = getelementptr inbounds i32, ptr %S, i64 %indvars.iv35.i
store i32 %9, ptr %arrayidx8.i, align 4, !tbaa !5
%cmp9.i = icmp sgt i64 %indvars.iv35.i, 1
br i1 %cmp9.i, label %land.rhs.i, label %do.end.i
land.rhs.i: ; preds = %do.body.i
%10 = add nuw nsw i64 %indvars.iv35.i, 4294967294
%idxprom11.i = and i64 %10, 4294967295
%arrayidx12.i = getelementptr inbounds i32, ptr %S, i64 %idxprom11.i
%11 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5
%cmp13.i = icmp sgt i32 %11, %7
br i1 %cmp13.i, label %do.body.i, label %do.end.i, !llvm.loop !12
do.end.i: ; preds = %land.rhs.i, %do.body.i
%idxprom5.lcssa.i = phi i64 [ 0, %do.body.i ], [ %indvars.iv.next36.i, %land.rhs.i ]
%arrayidx6.le.i = getelementptr inbounds i32, ptr %S, i64 %idxprom5.lcssa.i
store i32 %7, ptr %arrayidx6.le.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %do.end.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %sort.exit, label %for.body.i, !llvm.loop !13
sort.exit: ; preds = %for.inc.i, %for.end11
%cmp33.i54 = icmp sgt i32 %.lcssa, 1
br i1 %cmp33.i54, label %for.body.preheader.i55, label %sort.exit79
for.body.preheader.i55: ; preds = %sort.exit
%wide.trip.count.i56 = zext i32 %.lcssa to i64
%invariant.gep.i57 = getelementptr i32, ptr %T, i64 -1
br label %for.body.i58
for.body.i58: ; preds = %for.inc.i63, %for.body.preheader.i55
%indvars.iv.i59 = phi i64 [ 1, %for.body.preheader.i55 ], [ %indvars.iv.next.i64, %for.inc.i63 ]
%arrayidx.i60 = getelementptr inbounds i32, ptr %T, i64 %indvars.iv.i59
%12 = load i32, ptr %arrayidx.i60, align 4, !tbaa !5
%gep.i61 = getelementptr i32, ptr %invariant.gep.i57, i64 %indvars.iv.i59
%13 = load i32, ptr %gep.i61, align 4, !tbaa !5
%cmp3.i62 = icmp sgt i32 %13, %12
br i1 %cmp3.i62, label %do.body.i66, label %for.inc.i63
do.body.i66: ; preds = %for.body.i58, %land.rhs.i75
%indvars.iv35.i67 = phi i64 [ %indvars.iv.next36.i68, %land.rhs.i75 ], [ %indvars.iv.i59, %for.body.i58 ]
%indvars.iv.next36.i68 = add nsw i64 %indvars.iv35.i67, -1
%arrayidx6.i69 = getelementptr inbounds i32, ptr %T, i64 %indvars.iv.next36.i68
%14 = load i32, ptr %arrayidx6.i69, align 4, !tbaa !5
%arrayidx8.i70 = getelementptr inbounds i32, ptr %T, i64 %indvars.iv35.i67
store i32 %14, ptr %arrayidx8.i70, align 4, !tbaa !5
%cmp9.i71 = icmp sgt i64 %indvars.iv35.i67, 1
br i1 %cmp9.i71, label %land.rhs.i75, label %do.end.i72
land.rhs.i75: ; preds = %do.body.i66
%15 = add nuw nsw i64 %indvars.iv35.i67, 4294967294
%idxprom11.i76 = and i64 %15, 4294967295
%arrayidx12.i77 = getelementptr inbounds i32, ptr %T, i64 %idxprom11.i76
%16 = load i32, ptr %arrayidx12.i77, align 4, !tbaa !5
%cmp13.i78 = icmp sgt i32 %16, %12
br i1 %cmp13.i78, label %do.body.i66, label %do.end.i72, !llvm.loop !12
do.end.i72: ; preds = %land.rhs.i75, %do.body.i66
%idxprom5.lcssa.i73 = phi i64 [ 0, %do.body.i66 ], [ %indvars.iv.next36.i68, %land.rhs.i75 ]
%arrayidx6.le.i74 = getelementptr inbounds i32, ptr %T, i64 %idxprom5.lcssa.i73
store i32 %12, ptr %arrayidx6.le.i74, align 4, !tbaa !5
br label %for.inc.i63
for.inc.i63: ; preds = %do.end.i72, %for.body.i58
%indvars.iv.next.i64 = add nuw nsw i64 %indvars.iv.i59, 1
%exitcond.not.i65 = icmp eq i64 %indvars.iv.next.i64, %wide.trip.count.i56
br i1 %exitcond.not.i65, label %sort.exit79, label %for.body.i58, !llvm.loop !13
sort.exit79: ; preds = %for.inc.i63, %sort.exit
%cmp1487 = icmp sgt i32 %.lcssa, 0
br i1 %cmp1487, label %for.cond16.preheader.preheader, label %for.end37
for.cond16.preheader.preheader: ; preds = %sort.exit79
%17 = sext i32 %6 to i64
%wide.trip.count = zext i32 %.lcssa to i64
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.preheader, %for.inc35
%indvars.iv102 = phi i64 [ 0, %for.cond16.preheader.preheader ], [ %indvars.iv.next103, %for.inc35 ]
%si.091 = phi i32 [ 0, %for.cond16.preheader.preheader ], [ %si.1, %for.inc35 ]
%count.088 = phi i32 [ 0, %for.cond16.preheader.preheader ], [ %count.1, %for.inc35 ]
%cmp1785 = icmp slt i32 %si.091, %6
br i1 %cmp1785, label %for.body18.lr.ph, label %for.inc35
for.body18.lr.ph: ; preds = %for.cond16.preheader
%arrayidx22 = getelementptr inbounds [500 x i32], ptr %T, i64 0, i64 %indvars.iv102
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%19 = sext i32 %si.091 to i64
br label %for.body18
for.body18: ; preds = %if.else, %for.body18.lr.ph
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %if.else ], [ %19, %for.body18.lr.ph ]
%arrayidx20 = getelementptr inbounds [10000 x i32], ptr %S, i64 0, i64 %indvars.iv99
%20 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp23 = icmp eq i32 %20, %18
br i1 %cmp23, label %if.then, label %if.else
if.then: ; preds = %for.body18
%21 = trunc i64 %indvars.iv99 to i32
%inc24 = add nsw i32 %count.088, 1
%add = add nsw i32 %21, 1
br label %for.inc35
if.else: ; preds = %for.body18
%cmp29 = icmp sle i32 %20, %18
%indvars.iv.next100 = add nsw i64 %indvars.iv99, 1
%cmp17 = icmp slt i64 %indvars.iv.next100, %17
%or.cond = select i1 %cmp29, i1 %cmp17, i1 false
br i1 %or.cond, label %for.body18, label %for.inc35, !llvm.loop !14
for.inc35: ; preds = %if.else, %for.cond16.preheader, %if.then
%count.1 = phi i32 [ %inc24, %if.then ], [ %count.088, %for.cond16.preheader ], [ %count.088, %if.else ]
%si.1 = phi i32 [ %add, %if.then ], [ %si.091, %for.cond16.preheader ], [ %si.091, %if.else ]
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count
br i1 %exitcond.not, label %for.end37, label %for.cond16.preheader, !llvm.loop !15
for.end37: ; preds = %for.inc35, %sort.exit79
%count.0.lcssa = phi i32 [ 0, %sort.exit79 ], [ %count.1, %for.inc35 ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort(i32 noundef %n, ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%cmp33 = icmp sgt i32 %n, 1
br i1 %cmp33, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%invariant.gep = getelementptr i32, ptr %a, i64 -1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%1 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %1, %0
br i1 %cmp3, label %do.body, label %for.inc
do.body: ; preds = %for.body, %land.rhs
%indvars.iv35 = phi i64 [ %indvars.iv.next36, %land.rhs ], [ %indvars.iv, %for.body ]
%indvars.iv.next36 = add nsw i64 %indvars.iv35, -1
%arrayidx6 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next36
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv35
store i32 %2, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp sgt i64 %indvars.iv35, 1
br i1 %cmp9, label %land.rhs, label %do.end
land.rhs: ; preds = %do.body
%3 = add nuw i64 %indvars.iv35, 4294967294
%idxprom11 = and i64 %3, 4294967295
%arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %idxprom11
%4 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %4, %0
br i1 %cmp13, label %do.body, label %do.end, !llvm.loop !12
do.end: ; preds = %do.body, %land.rhs
%idxprom5.lcssa = phi i64 [ 0, %do.body ], [ %indvars.iv.next36, %land.rhs ]
%arrayidx6.le = getelementptr inbounds i32, ptr %a, i64 %idxprom5.lcssa
store i32 %0, ptr %arrayidx6.le, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %do.end
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.inc, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#define MAX (10000 + 1)
int S[MAX];
int search(int *S, int n, int key)
{
int i = 0;
S[n] = key;
while (S[i] != key) i++;
return i != n;
}
int main(int argc, char *argv[])
{
int n, q, i, key, same = 0;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &S[i]);
scanf("%d", &q);
for (i = 0; i < q; i++) {
scanf("%d", &key);
if (search(S, n, key)) same++;
}
printf("%d\n", same);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141087/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141087/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@S = dso_local global [10001 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %S, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %S, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr @S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%same.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr @S, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr @S, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %same.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%same.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %same.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int Linearsearch(int *,int,int);
int main(){
int i,j=0,n,q;
int S[10000+1],T[10000+1];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d",&T[i]);
}
for(i=0;i<q;i++){
if(Linearsearch(S,n,T[i])==1)j++;
}
printf("%d\n",j );
}
int Linearsearch(int S[],int n,int key){
int i;
for(i=0;i<n;i++){
if(S[i] == key)return 1;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141137/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141137/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%S = alloca [10001 x i32], align 16
%T = alloca [10001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %0, 0
br i1 %cmp36, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %S, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp438 = icmp sgt i32 %3, 0
br i1 %cmp438, label %for.body5, label %for.end22
for.cond12.preheader: ; preds = %for.body5
%cmp1340 = icmp sgt i32 %12, 0
br i1 %cmp1340, label %for.body14.lr.ph, label %for.end22
for.body14.lr.ph: ; preds = %for.cond12.preheader
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %4, 0
%wide.trip.count.i = zext i32 %4 to i64
br i1 %cmp4.i, label %for.body14.us.preheader, label %for.end22
for.body14.us.preheader: ; preds = %for.body14.lr.ph
%wide.trip.count = zext i32 %12 to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %12, 1
br i1 %5, label %for.end22.loopexit.unr-lcssa, label %for.body14.us.preheader.new
for.body14.us.preheader.new: ; preds = %for.body14.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14.us
for.body14.us: ; preds = %for.cond12.us.1, %for.body14.us.preheader.new
%indvars.iv51 = phi i64 [ 0, %for.body14.us.preheader.new ], [ %indvars.iv.next52.1, %for.cond12.us.1 ]
%j.042.us = phi i32 [ 0, %for.body14.us.preheader.new ], [ %11, %for.cond12.us.1 ]
%niter = phi i64 [ 0, %for.body14.us.preheader.new ], [ %niter.next.1, %for.cond12.us.1 ]
%arrayidx16.us = getelementptr inbounds [10001 x i32], ptr %T, i64 0, i64 %indvars.iv51
%6 = load i32, ptr %arrayidx16.us, align 8, !tbaa !5
br label %for.body.i.us
for.body.i.us: ; preds = %for.cond.i.us, %for.body14.us
%indvars.iv.i.us = phi i64 [ 0, %for.body14.us ], [ %indvars.iv.next.i.us, %for.cond.i.us ]
%arrayidx.i.us = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.us
%7 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%cmp1.i.us = icmp eq i32 %7, %6
br i1 %cmp1.i.us, label %Linearsearch.exit.us, label %for.cond.i.us
for.cond.i.us: ; preds = %for.body.i.us
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %for.cond12.us, label %for.body.i.us, !llvm.loop !11
Linearsearch.exit.us: ; preds = %for.body.i.us
%inc19.us = add nsw i32 %j.042.us, 1
br label %for.cond12.us
for.cond12.us: ; preds = %for.cond.i.us, %Linearsearch.exit.us
%8 = phi i32 [ %inc19.us, %Linearsearch.exit.us ], [ %j.042.us, %for.cond.i.us ]
%indvars.iv.next52 = or i64 %indvars.iv51, 1
%arrayidx16.us.1 = getelementptr inbounds [10001 x i32], ptr %T, i64 0, i64 %indvars.iv.next52
%9 = load i32, ptr %arrayidx16.us.1, align 4, !tbaa !5
br label %for.body.i.us.1
for.body.i.us.1: ; preds = %for.cond.i.us.1, %for.cond12.us
%indvars.iv.i.us.1 = phi i64 [ 0, %for.cond12.us ], [ %indvars.iv.next.i.us.1, %for.cond.i.us.1 ]
%arrayidx.i.us.1 = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.us.1
%10 = load i32, ptr %arrayidx.i.us.1, align 4, !tbaa !5
%cmp1.i.us.1 = icmp eq i32 %10, %9
br i1 %cmp1.i.us.1, label %Linearsearch.exit.us.1, label %for.cond.i.us.1
for.cond.i.us.1: ; preds = %for.body.i.us.1
%indvars.iv.next.i.us.1 = add nuw nsw i64 %indvars.iv.i.us.1, 1
%exitcond.not.i.us.1 = icmp eq i64 %indvars.iv.next.i.us.1, %wide.trip.count.i
br i1 %exitcond.not.i.us.1, label %for.cond12.us.1, label %for.body.i.us.1, !llvm.loop !11
Linearsearch.exit.us.1: ; preds = %for.body.i.us.1
%inc19.us.1 = add nsw i32 %8, 1
br label %for.cond12.us.1
for.cond12.us.1: ; preds = %for.cond.i.us.1, %Linearsearch.exit.us.1
%11 = phi i32 [ %inc19.us.1, %Linearsearch.exit.us.1 ], [ %8, %for.cond.i.us.1 ]
%indvars.iv.next52.1 = add nuw nsw i64 %indvars.iv51, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end22.loopexit.unr-lcssa, label %for.body14.us, !llvm.loop !12
for.body5: ; preds = %for.end, %for.body5
%indvars.iv48 = phi i64 [ %indvars.iv.next49, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [10001 x i32], ptr %T, i64 0, i64 %indvars.iv48
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
%12 = load i32, ptr %q, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp4 = icmp slt i64 %indvars.iv.next49, %13
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !13
for.end22.loopexit.unr-lcssa: ; preds = %for.cond12.us.1, %for.body14.us.preheader
%.lcssa.ph = phi i32 [ undef, %for.body14.us.preheader ], [ %11, %for.cond12.us.1 ]
%indvars.iv51.unr = phi i64 [ 0, %for.body14.us.preheader ], [ %indvars.iv.next52.1, %for.cond12.us.1 ]
%j.042.us.unr = phi i32 [ 0, %for.body14.us.preheader ], [ %11, %for.cond12.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end22, label %for.body14.us.epil
for.body14.us.epil: ; preds = %for.end22.loopexit.unr-lcssa
%arrayidx16.us.epil = getelementptr inbounds [10001 x i32], ptr %T, i64 0, i64 %indvars.iv51.unr
%14 = load i32, ptr %arrayidx16.us.epil, align 4, !tbaa !5
br label %for.body.i.us.epil
for.body.i.us.epil: ; preds = %for.cond.i.us.epil, %for.body14.us.epil
%indvars.iv.i.us.epil = phi i64 [ 0, %for.body14.us.epil ], [ %indvars.iv.next.i.us.epil, %for.cond.i.us.epil ]
%arrayidx.i.us.epil = getelementptr inbounds i32, ptr %S, i64 %indvars.iv.i.us.epil
%15 = load i32, ptr %arrayidx.i.us.epil, align 4, !tbaa !5
%cmp1.i.us.epil = icmp eq i32 %15, %14
br i1 %cmp1.i.us.epil, label %Linearsearch.exit.us.epil, label %for.cond.i.us.epil
for.cond.i.us.epil: ; preds = %for.body.i.us.epil
%indvars.iv.next.i.us.epil = add nuw nsw i64 %indvars.iv.i.us.epil, 1
%exitcond.not.i.us.epil = icmp eq i64 %indvars.iv.next.i.us.epil, %wide.trip.count.i
br i1 %exitcond.not.i.us.epil, label %for.end22, label %for.body.i.us.epil, !llvm.loop !11
Linearsearch.exit.us.epil: ; preds = %for.body.i.us.epil
%inc19.us.epil = add nsw i32 %j.042.us.unr, 1
br label %for.end22
for.end22: ; preds = %for.end22.loopexit.unr-lcssa, %for.cond.i.us.epil, %Linearsearch.exit.us.epil, %for.end, %for.body14.lr.ph, %for.cond12.preheader
%j.0.lcssa = phi i32 [ 0, %for.cond12.preheader ], [ 0, %for.body14.lr.ph ], [ 0, %for.end ], [ %.lcssa.ph, %for.end22.loopexit.unr-lcssa ], [ %inc19.us.epil, %Linearsearch.exit.us.epil ], [ %j.042.us.unr, %for.cond.i.us.epil ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.0.lcssa)
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @Linearsearch(ptr nocapture noundef readonly %S, i32 noundef %n, i32 noundef %key) local_unnamed_addr #3 {
entry:
%cmp4 = icmp sgt i32 %n, 0
br i1 %cmp4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %S, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %key
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(){
int n,q,i,c=0,j;
scanf("%d",&n);
int S[n];
for(i=0;i<n;i++){
scanf("%d",&S[i]);
}
scanf("%d",&q);
int T[q];
for(i=0;i<q;i++){
scanf("%d",&T[i]);
}
for(i=0;i<q;i++){
for(j=0;j<n;j++){
if(T[i]==S[j]){
c++;
break;
}
}
}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141180/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141180/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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
%cmp43 = icmp sgt i32 %3, 0
br i1 %cmp43, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%6 = load i32, ptr %q, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%cmp545 = icmp sgt i32 %6, 0
br i1 %cmp545, label %for.body6, label %for.end30
for.cond13.preheader: ; preds = %for.body6
%cmp1449 = icmp sgt i32 %14, 0
br i1 %cmp1449, label %for.cond16.preheader.lr.ph, label %for.end30
for.cond16.preheader.lr.ph: ; preds = %for.cond13.preheader
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1747 = icmp sgt i32 %8, 0
br i1 %cmp1747, label %for.cond16.preheader.us.preheader, label %for.end30
for.cond16.preheader.us.preheader: ; preds = %for.cond16.preheader.lr.ph
%wide.trip.count66 = zext i32 %14 to i64
%wide.trip.count = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count66, 1
%9 = icmp eq i32 %14, 1
br i1 %9, label %for.end30.loopexit.unr-lcssa, label %for.cond16.preheader.us.preheader.new
for.cond16.preheader.us.preheader.new: ; preds = %for.cond16.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count66, 4294967294
br label %for.cond16.preheader.us
for.cond16.preheader.us: ; preds = %for.inc28.us.1, %for.cond16.preheader.us.preheader.new
%indvars.iv63 = phi i64 [ 0, %for.cond16.preheader.us.preheader.new ], [ %indvars.iv.next64.1, %for.inc28.us.1 ]
%c.050.us = phi i32 [ 0, %for.cond16.preheader.us.preheader.new ], [ %c.1.us.1, %for.inc28.us.1 ]
%niter = phi i64 [ 0, %for.cond16.preheader.us.preheader.new ], [ %niter.next.1, %for.inc28.us.1 ]
%arrayidx20.us = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv63
%10 = load i32, ptr %arrayidx20.us, align 8, !tbaa !5
br label %for.body18.us
for.cond16.us: ; preds = %for.body18.us
%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.inc28.us, label %for.body18.us, !llvm.loop !11
for.body18.us: ; preds = %for.cond16.preheader.us, %for.cond16.us
%indvars.iv60 = phi i64 [ 0, %for.cond16.preheader.us ], [ %indvars.iv.next61, %for.cond16.us ]
%arrayidx22.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60
%11 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5
%cmp23.us = icmp eq i32 %10, %11
br i1 %cmp23.us, label %if.then.us, label %for.cond16.us
if.then.us: ; preds = %for.body18.us
%inc24.us = add nsw i32 %c.050.us, 1
br label %for.inc28.us
for.inc28.us: ; preds = %for.cond16.us, %if.then.us
%c.1.us = phi i32 [ %inc24.us, %if.then.us ], [ %c.050.us, %for.cond16.us ]
%indvars.iv.next64 = or i64 %indvars.iv63, 1
%arrayidx20.us.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next64
%12 = load i32, ptr %arrayidx20.us.1, align 4, !tbaa !5
br label %for.body18.us.1
for.body18.us.1: ; preds = %for.cond16.us.1, %for.inc28.us
%indvars.iv60.1 = phi i64 [ 0, %for.inc28.us ], [ %indvars.iv.next61.1, %for.cond16.us.1 ]
%arrayidx22.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60.1
%13 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5
%cmp23.us.1 = icmp eq i32 %12, %13
br i1 %cmp23.us.1, label %if.then.us.1, label %for.cond16.us.1
for.cond16.us.1: ; preds = %for.body18.us.1
%indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next61.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc28.us.1, label %for.body18.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body18.us.1
%inc24.us.1 = add nsw i32 %c.1.us, 1
br label %for.inc28.us.1
for.inc28.us.1: ; preds = %for.cond16.us.1, %if.then.us.1
%c.1.us.1 = phi i32 [ %inc24.us.1, %if.then.us.1 ], [ %c.1.us, %for.cond16.us.1 ]
%indvars.iv.next64.1 = add nuw nsw i64 %indvars.iv63, 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.end30.loopexit.unr-lcssa, label %for.cond16.preheader.us, !llvm.loop !12
for.body6: ; preds = %for.end, %for.body6
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv57
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%14 = load i32, ptr %q, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp5 = icmp slt i64 %indvars.iv.next58, %15
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !13
for.end30.loopexit.unr-lcssa: ; preds = %for.inc28.us.1, %for.cond16.preheader.us.preheader
%c.1.us.lcssa.ph = phi i32 [ undef, %for.cond16.preheader.us.preheader ], [ %c.1.us.1, %for.inc28.us.1 ]
%indvars.iv63.unr = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next64.1, %for.inc28.us.1 ]
%c.050.us.unr = phi i32 [ 0, %for.cond16.preheader.us.preheader ], [ %c.1.us.1, %for.inc28.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end30, label %for.cond16.preheader.us.epil
for.cond16.preheader.us.epil: ; preds = %for.end30.loopexit.unr-lcssa
%arrayidx20.us.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv63.unr
%16 = load i32, ptr %arrayidx20.us.epil, align 4, !tbaa !5
br label %for.body18.us.epil
for.body18.us.epil: ; preds = %for.cond16.us.epil, %for.cond16.preheader.us.epil
%indvars.iv60.epil = phi i64 [ 0, %for.cond16.preheader.us.epil ], [ %indvars.iv.next61.epil, %for.cond16.us.epil ]
%arrayidx22.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv60.epil
%17 = load i32, ptr %arrayidx22.us.epil, align 4, !tbaa !5
%cmp23.us.epil = icmp eq i32 %16, %17
br i1 %cmp23.us.epil, label %if.then.us.epil, label %for.cond16.us.epil
for.cond16.us.epil: ; preds = %for.body18.us.epil
%indvars.iv.next61.epil = add nuw nsw i64 %indvars.iv60.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next61.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end30, label %for.body18.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body18.us.epil
%inc24.us.epil = add nsw i32 %c.050.us.unr, 1
br label %for.end30
for.end30: ; preds = %for.end30.loopexit.unr-lcssa, %for.cond16.us.epil, %if.then.us.epil, %for.end, %for.cond16.preheader.lr.ph, %for.cond13.preheader
%c.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.cond16.preheader.lr.ph ], [ 0, %for.end ], [ %c.1.us.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %inc24.us.epil, %if.then.us.epil ], [ %c.050.us.unr, %for.cond16.us.epil ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void){
int i , j , key , s_length , t_length ;
int ans = 0;
scanf("%d",&s_length);
int S[s_length];
for(i = 0 ; i < s_length ; i++){
scanf("%d ",&S[i]);
}
scanf("%d" , &t_length);
int T[t_length];
for(i = 0 ; i < t_length ; i++){
scanf("%d" , &T[i]);
}
for(i = 0 ; i < t_length ; i++){
key = T[i];
for(j = 0 ; j < s_length ; j++){
if(key == S[j]){
ans++;
break;
}
}
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141223/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141223/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s_length = alloca i32, align 4
%t_length = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s_length) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t_length) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s_length)
%0 = load i32, ptr %s_length, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %s_length, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %3, 0
br i1 %cmp43, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %s_length, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t_length)
%6 = load i32, ptr %t_length, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca i32, i64 %7, align 16
%cmp545 = icmp sgt i32 %6, 0
br i1 %cmp545, label %for.body6, label %for.end30
for.cond13.preheader: ; preds = %for.body6
%cmp1449 = icmp sgt i32 %14, 0
br i1 %cmp1449, label %for.body15.lr.ph, label %for.end30
for.body15.lr.ph: ; preds = %for.cond13.preheader
%8 = load i32, ptr %s_length, align 4, !tbaa !5
%cmp1947 = icmp sgt i32 %8, 0
br i1 %cmp1947, label %for.body15.us.preheader, label %for.end30
for.body15.us.preheader: ; preds = %for.body15.lr.ph
%wide.trip.count65 = zext i32 %14 to i64
%wide.trip.count = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count65, 1
%9 = icmp eq i32 %14, 1
br i1 %9, label %for.end30.loopexit.unr-lcssa, label %for.body15.us.preheader.new
for.body15.us.preheader.new: ; preds = %for.body15.us.preheader
%unroll_iter = and i64 %wide.trip.count65, 4294967294
br label %for.body15.us
for.body15.us: ; preds = %for.inc28.us.1, %for.body15.us.preheader.new
%indvars.iv62 = phi i64 [ 0, %for.body15.us.preheader.new ], [ %indvars.iv.next63.1, %for.inc28.us.1 ]
%ans.050.us = phi i32 [ 0, %for.body15.us.preheader.new ], [ %ans.1.us.1, %for.inc28.us.1 ]
%niter = phi i64 [ 0, %for.body15.us.preheader.new ], [ %niter.next.1, %for.inc28.us.1 ]
%arrayidx17.us = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv62
%10 = load i32, ptr %arrayidx17.us, align 8, !tbaa !5
br label %for.body20.us
for.cond18.us: ; preds = %for.body20.us
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count
br i1 %exitcond.not, label %for.inc28.us, label %for.body20.us, !llvm.loop !11
for.body20.us: ; preds = %for.body15.us, %for.cond18.us
%indvars.iv59 = phi i64 [ 0, %for.body15.us ], [ %indvars.iv.next60, %for.cond18.us ]
%arrayidx22.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59
%11 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5
%cmp23.us = icmp eq i32 %10, %11
br i1 %cmp23.us, label %if.then.us, label %for.cond18.us
if.then.us: ; preds = %for.body20.us
%inc24.us = add nsw i32 %ans.050.us, 1
br label %for.inc28.us
for.inc28.us: ; preds = %for.cond18.us, %if.then.us
%ans.1.us = phi i32 [ %inc24.us, %if.then.us ], [ %ans.050.us, %for.cond18.us ]
%indvars.iv.next63 = or i64 %indvars.iv62, 1
%arrayidx17.us.1 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next63
%12 = load i32, ptr %arrayidx17.us.1, align 4, !tbaa !5
br label %for.body20.us.1
for.body20.us.1: ; preds = %for.cond18.us.1, %for.inc28.us
%indvars.iv59.1 = phi i64 [ 0, %for.inc28.us ], [ %indvars.iv.next60.1, %for.cond18.us.1 ]
%arrayidx22.us.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59.1
%13 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5
%cmp23.us.1 = icmp eq i32 %12, %13
br i1 %cmp23.us.1, label %if.then.us.1, label %for.cond18.us.1
for.cond18.us.1: ; preds = %for.body20.us.1
%indvars.iv.next60.1 = add nuw nsw i64 %indvars.iv59.1, 1
%exitcond.not.1 = icmp eq i64 %indvars.iv.next60.1, %wide.trip.count
br i1 %exitcond.not.1, label %for.inc28.us.1, label %for.body20.us.1, !llvm.loop !11
if.then.us.1: ; preds = %for.body20.us.1
%inc24.us.1 = add nsw i32 %ans.1.us, 1
br label %for.inc28.us.1
for.inc28.us.1: ; preds = %for.cond18.us.1, %if.then.us.1
%ans.1.us.1 = phi i32 [ %inc24.us.1, %if.then.us.1 ], [ %ans.1.us, %for.cond18.us.1 ]
%indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end30.loopexit.unr-lcssa, label %for.body15.us, !llvm.loop !12
for.body6: ; preds = %for.end, %for.body6
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv56
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%14 = load i32, ptr %t_length, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp5 = icmp slt i64 %indvars.iv.next57, %15
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !13
for.end30.loopexit.unr-lcssa: ; preds = %for.inc28.us.1, %for.body15.us.preheader
%ans.1.us.lcssa.ph = phi i32 [ undef, %for.body15.us.preheader ], [ %ans.1.us.1, %for.inc28.us.1 ]
%indvars.iv62.unr = phi i64 [ 0, %for.body15.us.preheader ], [ %indvars.iv.next63.1, %for.inc28.us.1 ]
%ans.050.us.unr = phi i32 [ 0, %for.body15.us.preheader ], [ %ans.1.us.1, %for.inc28.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end30, label %for.body15.us.epil
for.body15.us.epil: ; preds = %for.end30.loopexit.unr-lcssa
%arrayidx17.us.epil = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv62.unr
%16 = load i32, ptr %arrayidx17.us.epil, align 4, !tbaa !5
br label %for.body20.us.epil
for.body20.us.epil: ; preds = %for.cond18.us.epil, %for.body15.us.epil
%indvars.iv59.epil = phi i64 [ 0, %for.body15.us.epil ], [ %indvars.iv.next60.epil, %for.cond18.us.epil ]
%arrayidx22.us.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv59.epil
%17 = load i32, ptr %arrayidx22.us.epil, align 4, !tbaa !5
%cmp23.us.epil = icmp eq i32 %16, %17
br i1 %cmp23.us.epil, label %if.then.us.epil, label %for.cond18.us.epil
for.cond18.us.epil: ; preds = %for.body20.us.epil
%indvars.iv.next60.epil = add nuw nsw i64 %indvars.iv59.epil, 1
%exitcond.not.epil = icmp eq i64 %indvars.iv.next60.epil, %wide.trip.count
br i1 %exitcond.not.epil, label %for.end30, label %for.body20.us.epil, !llvm.loop !11
if.then.us.epil: ; preds = %for.body20.us.epil
%inc24.us.epil = add nsw i32 %ans.050.us.unr, 1
br label %for.end30
for.end30: ; preds = %for.end30.loopexit.unr-lcssa, %for.cond18.us.epil, %if.then.us.epil, %for.end, %for.body15.lr.ph, %for.cond13.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %for.body15.lr.ph ], [ 0, %for.end ], [ %ans.1.us.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %inc24.us.epil, %if.then.us.epil ], [ %ans.050.us.unr, %for.cond18.us.epil ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t_length) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s_length) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int search(int A[], int n, int key){
int i = 0;
for(i=0; i<n; i++){
if(A[i] == key) return 1;
}
return 0;
}
int main(){
int i, n, A[10000 + 1], q, key, sum;
int sea;
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%d", &A[i]);
}
scanf("%d", &q);
sum = 0;
for(i=0; i<q; i++){
scanf("%d", &key);
if(search(A, n, key)) sum++;
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141267/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141267/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(ptr nocapture noundef readonly %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%cmp4 = icmp sgt i32 %n, 0
br i1 %cmp4, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !5
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !7
%cmp1 = icmp eq i32 %0, %key
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !7
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !7
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.cond3
%i.125 = phi i32 [ %inc10, %for.cond3 ], [ 0, %for.end ]
%sum.024 = phi i32 [ %7, %for.cond3 ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !7
%5 = load i32, ptr %key, align 4, !tbaa !7
%cmp4.i = icmp sgt i32 %4, 0
br i1 %cmp4.i, label %for.body.preheader.i, label %for.cond3
for.body.preheader.i: ; preds = %for.body5
%wide.trip.count.i = zext i32 %4 to i64
br label %for.body.i
for.cond.i: ; preds = %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond3, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !7
%cmp1.i = icmp eq i32 %6, %5
br i1 %cmp1.i, label %search.exit, label %for.cond.i
search.exit: ; preds = %for.body.i
%inc8 = add nsw i32 %sum.024, 1
br label %for.cond3
for.cond3: ; preds = %for.cond.i, %for.body5, %search.exit
%7 = phi i32 [ %inc8, %search.exit ], [ %sum.024, %for.body5 ], [ %sum.024, %for.cond.i ]
%inc10 = add nuw nsw i32 %i.125, 1
%8 = load i32, ptr %q, align 4, !tbaa !7
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %for.cond3, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %7, %for.cond3 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include<stdio.h>
#include<string.h>
int main()
{
int len,a=0,d=0,i;
char string[100005];
scanf("%d",&len);
getchar();
scanf("%s",string);
for(i=0;i<len;i++)
{
if(string[i]=='A')
a++;
else
d++;
}
if(a>d)
printf("Anton\n");
else if(a==d)
printf("Friendship\n");
else
printf("Danik\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_14131/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_14131/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [6 x i8] c"Danik\00", align 1
@str.5 = private unnamed_addr constant [11 x i8] c"Friendship\00", align 1
@str.6 = private unnamed_addr constant [6 x i8] c"Anton\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%len = alloca i32, align 4
%string = alloca [100005 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %len) #5
call void @llvm.lifetime.start.p0(i64 100005, ptr nonnull %string) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %string)
%1 = load i32, ptr %len, align 4, !tbaa !9
%cmp28 = icmp sgt i32 %1, 0
br i1 %cmp28, label %for.body.preheader, label %if.end19
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body.preheader48, 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 ], [ %14, %vector.body ]
%vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi43 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi44 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%2 = getelementptr inbounds [100005 x i8], ptr %string, 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.load45 = load <4 x i8>, ptr %3, align 4, !tbaa !11
%4 = icmp eq <4 x i8> %wide.load, <i8 65, i8 65, i8 65, i8 65>
%5 = icmp eq <4 x i8> %wide.load45, <i8 65, i8 65, i8 65, i8 65>
%6 = zext <4 x i1> %4 to <4 x i32>
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = add <4 x i32> %vec.phi43, %6
%9 = add <4 x i32> %vec.phi44, %7
%10 = xor <4 x i1> %4, <i1 true, i1 true, i1 true, i1 true>
%11 = xor <4 x i1> %5, <i1 true, i1 true, i1 true, i1 true>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi42, %13
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx46 = add <4 x i32> %9, %8
%17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx46)
%bin.rdx = add <4 x i32> %15, %14
%18 = 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.preheader48
for.body.preheader48: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%d.030.ph = phi i32 [ 0, %for.body.preheader ], [ %18, %middle.block ]
%a.029.ph = phi i32 [ 0, %for.body.preheader ], [ %17, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader48, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader48 ]
%d.030 = phi i32 [ %d.1, %for.body ], [ %d.030.ph, %for.body.preheader48 ]
%a.029 = phi i32 [ %a.1, %for.body ], [ %a.029.ph, %for.body.preheader48 ]
%arrayidx = getelementptr inbounds [100005 x i8], ptr %string, i64 0, i64 %indvars.iv
%19 = load i8, ptr %arrayidx, align 1, !tbaa !11
%cmp3 = icmp eq i8 %19, 65
%inc = zext i1 %cmp3 to i32
%a.1 = add nuw nsw i32 %a.029, %inc
%not.cmp3 = xor i1 %cmp3, true
%inc5 = zext i1 %not.cmp3 to i32
%d.1 = add nuw nsw i32 %d.030, %inc5
%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
%a.1.lcssa = phi i32 [ %17, %middle.block ], [ %a.1, %for.body ]
%d.1.lcssa = phi i32 [ %18, %middle.block ], [ %d.1, %for.body ]
%cmp7 = icmp ugt i32 %a.1.lcssa, %d.1.lcssa
br i1 %cmp7, label %if.end19, label %if.else11
if.else11: ; preds = %for.end
%cmp12 = icmp eq i32 %a.1.lcssa, %d.1.lcssa
%spec.select = select i1 %cmp12, ptr @str.5, ptr @str
br label %if.end19
if.end19: ; preds = %if.else11, %entry, %for.end
%str.5.sink = phi ptr [ @str.6, %for.end ], [ @str.5, %entry ], [ %spec.select, %if.else11 ]
%puts26 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 100005, ptr nonnull %string) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %len) #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 @getc(ptr nocapture noundef) local_unnamed_addr #2
; 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 = !{!"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 = !{!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}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(int argc,char *argv[]){
int s[10000],t[500],n,q,i,j;
int count = 0;
scanf("%d",&n);
for(i = 0;i < n;i++){
scanf("%d",&s[i]);
for(j = 0;j < i;j++){
if(s[i] == s[j]){
i--;
n--;
}
}
}
scanf("%d",&q);
for(i = 0;i < q;i++){
scanf("%d",&t[i]);
for(j = 0;j < i;j++){
if(t[i] == t[j]){
i--;
q--;
}
}
}
for(i = 0;i < n;i++){
for(j = 0;j < q;j++){
if(s[i] == t[j]){
count++;
}
}
}
printf("%d\n",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141360/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141360/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [10000 x i32], align 16
%t = alloca [500 x i32], align 16
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp89 = icmp sgt i32 %0, 0
br i1 %cmp89, label %for.body, label %for.end13
for.body: ; preds = %entry, %for.inc11
%i.090 = phi i32 [ %inc12, %for.inc11 ], [ 0, %entry ]
%idxprom = sext i32 %i.090 to i64
%arrayidx = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %idxprom
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
%cmp385 = icmp sgt i32 %i.090, 0
br i1 %cmp385, label %for.body4, label %for.inc11
for.body4: ; preds = %for.body, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body ]
%i.187 = phi i32 [ %i.2, %for.inc ], [ %i.090, %for.body ]
%dec108486 = phi i32 [ %dec1083, %for.inc ], [ %n.promoted, %for.body ]
%idxprom5 = sext i32 %i.187 to i64
%arrayidx6 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %idxprom5
%1 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%arrayidx8 = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %1, %2
br i1 %cmp9, label %if.then, label %for.inc
if.then: ; preds = %for.body4
%dec = add nsw i32 %i.187, -1
%dec10 = add nsw i32 %dec108486, -1
store i32 %dec10, ptr %n, align 4, !tbaa !5
%.pre = sext i32 %dec to i64
br label %for.inc
for.inc: ; preds = %for.body4, %if.then
%.pre-phi = phi i64 [ %idxprom5, %for.body4 ], [ %.pre, %if.then ]
%dec1083 = phi i32 [ %dec108486, %for.body4 ], [ %dec10, %if.then ]
%i.2 = phi i32 [ %i.187, %for.body4 ], [ %dec, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp3 = icmp slt i64 %indvars.iv.next, %.pre-phi
br i1 %cmp3, label %for.body4, label %for.inc11, !llvm.loop !9
for.inc11: ; preds = %for.inc, %for.body
%3 = phi i32 [ %n.promoted, %for.body ], [ %dec1083, %for.inc ]
%i.1.lcssa = phi i32 [ %i.090, %for.body ], [ %i.2, %for.inc ]
%inc12 = add nsw i32 %i.1.lcssa, 1
%cmp = icmp slt i32 %inc12, %3
br i1 %cmp, label %for.body, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.inc11, %entry
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%4 = load i32, ptr %q, align 4, !tbaa !5
%cmp1698 = icmp sgt i32 %4, 0
br i1 %cmp1698, label %for.body17, label %for.cond39.preheader
for.cond39.preheader: ; preds = %for.inc36, %for.end13
%.lcssa = phi i32 [ %4, %for.end13 ], [ %21, %for.inc36 ]
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp40105 = icmp sgt i32 %5, 0
%cmp43101 = icmp sgt i32 %.lcssa, 0
%or.cond = and i1 %cmp40105, %cmp43101
br i1 %or.cond, label %for.cond42.preheader.us.preheader, label %for.end58
for.cond42.preheader.us.preheader: ; preds = %for.cond39.preheader
%wide.trip.count121 = zext i32 %5 to i64
%wide.trip.count = zext i32 %.lcssa to i64
%min.iters.check = icmp ult i32 %.lcssa, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.cond42.preheader.us
for.cond42.preheader.us: ; preds = %for.cond42.preheader.us.preheader, %for.cond42.for.inc56_crit_edge.us
%indvars.iv118 = phi i64 [ 0, %for.cond42.preheader.us.preheader ], [ %indvars.iv.next119, %for.cond42.for.inc56_crit_edge.us ]
%count.0107.us = phi i32 [ 0, %for.cond42.preheader.us.preheader ], [ %spec.select.us.lcssa, %for.cond42.for.inc56_crit_edge.us ]
%arrayidx46.us = getelementptr inbounds [10000 x i32], ptr %s, i64 0, i64 %indvars.iv118
%6 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5
br i1 %min.iters.check, label %for.body44.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond42.preheader.us
%7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %count.0107.us, i64 0
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %6, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %7, %vector.ph ], [ %14, %vector.body ]
%vec.phi127 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%8 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load128 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = icmp eq <4 x i32> %broadcast.splat, %wide.load
%11 = icmp eq <4 x i32> %broadcast.splat, %wide.load128
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi127, %13
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %15, %14
%17 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond42.for.inc56_crit_edge.us, label %for.body44.us.preheader
for.body44.us.preheader: ; preds = %for.cond42.preheader.us, %middle.block
%indvars.iv115.ph = phi i64 [ 0, %for.cond42.preheader.us ], [ %n.vec, %middle.block ]
%count.1103.us.ph = phi i32 [ %count.0107.us, %for.cond42.preheader.us ], [ %17, %middle.block ]
br label %for.body44.us
for.body44.us: ; preds = %for.body44.us.preheader, %for.body44.us
%indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.body44.us ], [ %indvars.iv115.ph, %for.body44.us.preheader ]
%count.1103.us = phi i32 [ %spec.select.us, %for.body44.us ], [ %count.1103.us.ph, %for.body44.us.preheader ]
%arrayidx48.us = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv115
%18 = load i32, ptr %arrayidx48.us, align 4, !tbaa !5
%cmp49.us = icmp eq i32 %6, %18
%inc51.us = zext i1 %cmp49.us to i32
%spec.select.us = add nsw i32 %count.1103.us, %inc51.us
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%exitcond.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count
br i1 %exitcond.not, label %for.cond42.for.inc56_crit_edge.us, label %for.body44.us, !llvm.loop !15
for.cond42.for.inc56_crit_edge.us: ; preds = %for.body44.us, %middle.block
%spec.select.us.lcssa = phi i32 [ %17, %middle.block ], [ %spec.select.us, %for.body44.us ]
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
br i1 %exitcond122.not, label %for.end58, label %for.cond42.preheader.us, !llvm.loop !16
for.body17: ; preds = %for.end13, %for.inc36
%i.399 = phi i32 [ %inc37, %for.inc36 ], [ 0, %for.end13 ]
%idxprom18 = sext i32 %i.399 to i64
%arrayidx19 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %idxprom18
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx19)
%q.promoted = load i32, ptr %q, align 4, !tbaa !5
%cmp2293 = icmp sgt i32 %i.399, 0
br i1 %cmp2293, label %for.body23, label %for.inc36
for.body23: ; preds = %for.body17, %for.inc33
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.inc33 ], [ 0, %for.body17 ]
%i.495 = phi i32 [ %i.5, %for.inc33 ], [ %i.399, %for.body17 ]
%dec319294 = phi i32 [ %dec3191, %for.inc33 ], [ %q.promoted, %for.body17 ]
%idxprom24 = sext i32 %i.495 to i64
%arrayidx25 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %idxprom24
%19 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv112
%20 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%cmp28 = icmp eq i32 %19, %20
br i1 %cmp28, label %if.then29, label %for.inc33
if.then29: ; preds = %for.body23
%dec30 = add nsw i32 %i.495, -1
%dec31 = add nsw i32 %dec319294, -1
store i32 %dec31, ptr %q, align 4, !tbaa !5
%.pre123 = sext i32 %dec30 to i64
br label %for.inc33
for.inc33: ; preds = %for.body23, %if.then29
%.pre-phi124 = phi i64 [ %idxprom24, %for.body23 ], [ %.pre123, %if.then29 ]
%dec3191 = phi i32 [ %dec319294, %for.body23 ], [ %dec31, %if.then29 ]
%i.5 = phi i32 [ %i.495, %for.body23 ], [ %dec30, %if.then29 ]
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%cmp22 = icmp slt i64 %indvars.iv.next113, %.pre-phi124
br i1 %cmp22, label %for.body23, label %for.inc36, !llvm.loop !17
for.inc36: ; preds = %for.inc33, %for.body17
%21 = phi i32 [ %q.promoted, %for.body17 ], [ %dec3191, %for.inc33 ]
%i.4.lcssa = phi i32 [ %i.399, %for.body17 ], [ %i.5, %for.inc33 ]
%inc37 = add nsw i32 %i.4.lcssa, 1
%cmp16 = icmp slt i32 %inc37, %21
br i1 %cmp16, label %for.body17, label %for.cond39.preheader, !llvm.loop !18
for.end58: ; preds = %for.cond42.for.inc56_crit_edge.us, %for.cond39.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond39.preheader ], [ %spec.select.us.lcssa, %for.cond42.for.inc56_crit_edge.us ]
%call59 = 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 %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree 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}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
int search(int A[], int n, int key) {
int i = 0; A[n] = key;
while(A[i] != key) i++;
return i != n;
}
int main(void) {
int i, n, A[10000+1], q, key, sum = 0;
scanf("%d",&n);
for(i=0; i<n; i++) scanf("%d", &A[i]);
scanf("%d",&q);
for(i=0; i<q; i++) {
scanf("%d", &key);
if(search(A, n, key)){
sum++;
}
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141454/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141454/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdlib.h>
#include<stdio.h>
int search(int a[], int n, int key)
{
int i = 0;
a[n] = key;
while (a[i] != key)
{
i++;
}
return i != n;
}
int main()
{
int a[10000 + 2], n, q, key, sum = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
scanf("%d", &q);
for (int i = 0; i < q; i++)
{
scanf("%d", &key);
if(search(a, n, key))
{
sum++;
}
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141504/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141504/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %a, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca [10002 x i32], align 16
%n = alloca i32, align 4
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 40008, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%1 = load i32, ptr %q, align 4, !tbaa !5
%cmp521 = icmp sgt i32 %1, 0
br i1 %cmp521, label %for.body7, label %for.cond.cleanup6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10002 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
for.cond.cleanup6: ; preds = %search.exit, %for.cond.cleanup
%sum.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %spec.select, %search.exit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 40008, ptr nonnull %a) #4
ret i32 0
for.body7: ; preds = %for.cond.cleanup, %search.exit
%i3.023 = phi i32 [ %inc12, %search.exit ], [ 0, %for.cond.cleanup ]
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.cond.cleanup ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body7
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body7 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc10 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc10
%inc12 = add nuw nsw i32 %i3.023, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc12, %8
br i1 %cmp5, label %for.body7, label %for.cond.cleanup6, !llvm.loop !12
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main ()
{
int N1,N2,i,j,a,A[10000],A1[100000],k=0,key;
scanf("%d",&N1);
for(i = 0;i<N1;i++)scanf("%d",&A[i]);
scanf("%d",&N2);
for(i=0;i<N2;i++)
{
scanf("%d",&A1[i]);
for(j=0;j<N1;j++)
{
if(A[j]==A1[i])
{
k++;
break;
}
}
}
printf("%d\n",k);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141591/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141591/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%N1 = alloca i32, align 4
%N2 = alloca i32, align 4
%A = alloca [10000 x i32], align 16
%A1 = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N2) #3
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A1) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N1)
%0 = load i32, ptr %N1, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N1, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N2)
%3 = load i32, ptr %N2, align 4, !tbaa !5
%cmp438 = icmp sgt i32 %3, 0
br i1 %cmp438, label %for.body5, label %for.end23
for.body5: ; preds = %for.end, %for.inc21
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.inc21 ], [ 0, %for.end ]
%k.039 = phi i32 [ %k.1, %for.inc21 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [100000 x i32], ptr %A1, i64 0, i64 %indvars.iv45
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %N1, align 4, !tbaa !5
%cmp1036 = icmp sgt i32 %4, 0
br i1 %cmp1036, label %for.body11.lr.ph, label %for.inc21
for.body11.lr.ph: ; preds = %for.body5
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
br label %for.body11
for.cond9: ; preds = %for.body11
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count
br i1 %exitcond.not, label %for.inc21, label %for.body11, !llvm.loop !11
for.body11: ; preds = %for.body11.lr.ph, %for.cond9
%indvars.iv42 = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next43, %for.cond9 ]
%arrayidx13 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv42
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp16 = icmp eq i32 %6, %5
br i1 %cmp16, label %if.then, label %for.cond9
if.then: ; preds = %for.body11
%inc17 = add nsw i32 %k.039, 1
br label %for.inc21
for.inc21: ; preds = %for.cond9, %for.body5, %if.then
%k.1 = phi i32 [ %inc17, %if.then ], [ %k.039, %for.body5 ], [ %k.039, %for.cond9 ]
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%7 = load i32, ptr %N2, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next46, %8
br i1 %cmp4, label %for.body5, label %for.end23, !llvm.loop !12
for.end23: ; preds = %for.inc21, %for.end
%k.0.lcssa = phi i32 [ 0, %for.end ], [ %k.1, %for.inc21 ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %k.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A1) #3
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int i, j, n, q, C, *S, *T;
C = 0;
scanf("%d", &n);
S = malloc( n * sizeof(int));
for( i=0; i<n; i++ ) scanf("%d", &S[i]);
scanf("%d", &q);
T = malloc( q * sizeof(int));
for( i=0; i<q; i++ )
{
scanf("%d", &T[i]);
for( j=0; j<n; j++ )
{
if( T[i] == S[j] )
{
C++;
break;
}
}
}
printf("%d\n", C);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141634/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141634/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #5
%cmp44 = icmp sgt i32 %0, 0
br i1 %cmp44, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%conv5 = sext i32 %3 to i64
%mul6 = shl nsw i64 %conv5, 2
%call7 = call noalias ptr @malloc(i64 noundef %mul6) #5
%cmp948 = icmp sgt i32 %3, 0
br i1 %cmp948, label %for.body11, label %for.end31
for.body11: ; preds = %for.end, %for.inc29
%indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.inc29 ], [ 0, %for.end ]
%C.049 = phi i32 [ %C.1, %for.inc29 ], [ 0, %for.end ]
%arrayidx13 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv55
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx13)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp1646 = icmp sgt i32 %4, 0
br i1 %cmp1646, label %for.body18.lr.ph, label %for.inc29
for.body18.lr.ph: ; preds = %for.body11
%5 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
br label %for.body18
for.cond15: ; preds = %for.body18
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%exitcond.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count
br i1 %exitcond.not, label %for.inc29, label %for.body18, !llvm.loop !11
for.body18: ; preds = %for.body18.lr.ph, %for.cond15
%indvars.iv52 = phi i64 [ 0, %for.body18.lr.ph ], [ %indvars.iv.next53, %for.cond15 ]
%arrayidx22 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv52
%6 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %5, %6
br i1 %cmp23, label %if.then, label %for.cond15
if.then: ; preds = %for.body18
%inc25 = add nsw i32 %C.049, 1
br label %for.inc29
for.inc29: ; preds = %for.cond15, %for.body11, %if.then
%C.1 = phi i32 [ %inc25, %if.then ], [ %C.049, %for.body11 ], [ %C.049, %for.cond15 ]
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%7 = load i32, ptr %q, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp9 = icmp slt i64 %indvars.iv.next56, %8
br i1 %cmp9, label %for.body11, label %for.end31, !llvm.loop !12
for.end31: ; preds = %for.inc29, %for.end
%C.0.lcssa = phi i32 [ 0, %for.end ], [ %C.1, %for.inc29 ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %C.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int LinearSearch(int);
int ori[10000],n;
int main()
{
int i,j,key[500],m,count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&ori[i]);
}
scanf("%d",&m);
for(j=0;j<m;j++){
scanf("%d",&key[j]);
count+=LinearSearch(key[j]);
}
printf("%d\n",count);
return 0;
}
int LinearSearch(int key)
{
int i;
i=0;
ori[n]=key;
while(ori[i]!=key){
i++;
if(i==n) return 0;
}
return 1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141678/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141678/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@ori = dso_local global [10000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%key = alloca [500 x i32], align 16
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %key) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %0, 0
br i1 %cmp22, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr @ori, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp424 = icmp sgt i32 %3, 0
br i1 %cmp424, label %for.body5, label %for.end14
for.body5: ; preds = %for.end, %LinearSearch.exit
%indvars.iv28 = phi i64 [ %indvars.iv.next29, %LinearSearch.exit ], [ 0, %for.end ]
%count.026 = phi i32 [ %add, %LinearSearch.exit ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [500 x i32], ptr %key, i64 0, i64 %indvars.iv28
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%5 = load i32, ptr @n, align 4, !tbaa !5
%idxprom.i = sext i32 %5 to i64
%arrayidx.i = getelementptr inbounds [10000 x i32], ptr @ori, i64 0, i64 %idxprom.i
store i32 %4, ptr %arrayidx.i, align 4, !tbaa !5
%6 = zext i32 %5 to i64
br label %while.cond.i
while.cond.i: ; preds = %while.body.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds [10000 x i32], ptr @ori, i64 0, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %7, %4
br i1 %cmp.not.i, label %LinearSearch.exit, label %while.body.i
while.body.i: ; preds = %while.cond.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%cmp3.i = icmp eq i64 %indvars.iv.next.i, %6
br i1 %cmp3.i, label %LinearSearch.exit, label %while.cond.i, !llvm.loop !11
LinearSearch.exit: ; preds = %while.cond.i, %while.body.i
%retval.0.i = phi i32 [ 0, %while.body.i ], [ 1, %while.cond.i ]
%add = add nuw nsw i32 %retval.0.i, %count.026
%indvars.iv.next29 = add nuw nsw i64 %indvars.iv28, 1
%8 = load i32, ptr %m, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next29, %9
br i1 %cmp4, label %for.body5, label %for.end14, !llvm.loop !12
for.end14: ; preds = %LinearSearch.exit, %for.end
%count.0.lcssa = phi i32 [ 0, %for.end ], [ %add, %LinearSearch.exit ]
%call15 = 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 %m) #4
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %key) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @LinearSearch(i32 noundef %key) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [10000 x i32], ptr @ori, i64 0, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
%1 = zext i32 %0 to i64
br label %while.cond
while.cond: ; preds = %while.body, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds [10000 x i32], ptr @ori, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %2, %key
br i1 %cmp.not, label %cleanup, label %while.body
while.body: ; preds = %while.cond
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp3 = icmp eq i64 %indvars.iv.next, %1
br i1 %cmp3, label %cleanup, label %while.cond, !llvm.loop !11
cleanup: ; preds = %while.cond, %while.body
%retval.0 = phi i32 [ 0, %while.body ], [ 1, %while.cond ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int sum(int A[],int a, int key)
{
int i=0;
A[a]=key;
while(A[i]!=key)i++;
return i!=a;
}
int main()
{
int a,b,A[10000+1],c,key,tum=0;
scanf("%d",&b);
for(a=0;a<b;a++)
{
scanf("%d",&A[a]);
}
scanf("%d",&c);
for(a=0;a<c;a++)
{
scanf("%d",&key);
if(sum(A,b,key))
tum++;
}
printf("%d\n",tum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141720/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141720/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @sum(ptr nocapture noundef %A, i32 noundef %a, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %a to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %a
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: 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:
%b = alloca i32, align 4
%A = alloca [10001 x i32], align 16
%c = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%3 = load i32, ptr %c, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %sum.exit
%tum.022 = phi i32 [ %spec.select, %sum.exit ], [ 0, %for.end ]
%a.121 = phi i32 [ %inc10, %sum.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %b, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %sum.exit, label %while.cond.i, !llvm.loop !9
sum.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %tum.022, %inc8
%inc10 = add nuw nsw i32 %a.121, 1
%8 = load i32, ptr %c, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %sum.exit, %for.end
%tum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %sum.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %tum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
//線形探索
int search(int A[], int n, int key){
int i=0;
A[n] = key;
while( A[i] != key ) i++;
return i != n;
}
int main(){
int i,n,A[10000+1],q,key,sum=0;
scanf("%d",&n);
for(i=0; i<n; i++) scanf("%d",&A[i]);
scanf("%d",&q);
for(i=0; i<q; i++)
{
scanf("%d", &key);
if(search(A,n,key)) sum++;
}
printf("%d\n", sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141764/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141764/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int search(int A[], int n, int key){
int i=0;
A[n] = key;
while(A[i]!=key) i++;
return i != n;
}
int main(){
int i, n, A[10000+1], q, key, sum = 0;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &A[i]);
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d", &key);
if(search(A,n,key)) sum++;
}
printf("%d\n",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_141807/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_141807/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @search(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %key) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
store i32 %key, ptr %arrayidx, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %key
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !9
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%cmp3 = icmp ne i32 %1, %n
%conv = zext i1 %cmp3 to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [10001 x i32], align 16
%q = alloca i32, align 4
%key = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !5
%cmp420 = icmp sgt i32 %3, 0
br i1 %cmp420, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %search.exit
%sum.022 = phi i32 [ %spec.select, %search.exit ], [ 0, %for.end ]
%i.121 = phi i32 [ %inc10, %search.exit ], [ 0, %for.end ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %key)
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = load i32, ptr %key, align 4, !tbaa !5
%idxprom.i = sext i32 %4 to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.body5
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond.i ], [ 0, %for.body5 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %6, %5
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br i1 %cmp.not.i, label %search.exit, label %while.cond.i, !llvm.loop !9
search.exit: ; preds = %while.cond.i
%7 = trunc i64 %indvars.iv.i to i32
%cmp3.i.not = icmp ne i32 %4, %7
%inc8 = zext i1 %cmp3.i.not to i32
%spec.select = add nuw nsw i32 %sum.022, %inc8
%inc10 = add nuw nsw i32 %i.121, 1
%8 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc10, %8
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !12
for.end11: ; preds = %search.exit, %for.end
%sum.0.lcssa = phi i32 [ 0, %for.end ], [ %spec.select, %search.exit ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.