Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
typedef unsigned u;
int main()
{
u a,n,k;
scanf("%u%u",&n,&k);
for(printf("%u",n--);n>k;printf(" %u",n--));
for(a=0;a<n;)
{
printf(" %u",++a);
if(a<n)printf(" %u",n--);
}
putchar('\n');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_22697/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_22697/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%u%u\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%u\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %u\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec = add i32 %0, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp16 = icmp ugt i32 %1, %2
br i1 %cmp16, label %for.inc, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.inc, %entry
%3 = phi i32 [ %1, %entry ], [ %5, %for.inc ]
%cmp517.not = icmp eq i32 %3, 0
br i1 %cmp517.not, label %for.end11, label %for.body6
for.inc: ; preds = %entry, %for.inc
%4 = phi i32 [ %5, %for.inc ], [ %1, %entry ]
%dec2 = add i32 %4, -1
store i32 %dec2, ptr %n, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp ugt i32 %5, %6
br i1 %cmp, label %for.inc, label %for.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.cond4.preheader, %if.end
%a.018 = phi i32 [ %inc, %if.end ], [ 0, %for.cond4.preheader ]
%inc = add nuw i32 %a.018, 1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %inc)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp8 = icmp ult i32 %inc, %7
br i1 %cmp8, label %if.then, label %if.end
if.then: ; preds = %for.body6
%dec9 = add i32 %7, -1
store i32 %dec9, ptr %n, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body6
%8 = phi i32 [ %.pre, %if.then ], [ %7, %for.body6 ]
%cmp5 = icmp ult i32 %inc, %8
br i1 %cmp5, label %for.body6, label %for.end11, !llvm.loop !11
for.end11: ; preds = %if.end, %for.cond4.preheader
%9 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %9)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
int main(void) {
int N,A,B,C,D,price;
scanf( "%d %d %d %d %d" , &N,&A,&B,&C,&D );
price=((N/A+( N%A != 0 ))*B<(N/C+( N%C != 0 ))*D)*(N/A+( N%A != 0 ))*B+((N/A+( N%A != 0 ))*B>=(N/C+( N%C != 0 ))*D)*(N/C+( N%C != 0 ))*D;
printf("%d\n" , price);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227011/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227011/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%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 %N) #3
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 %N, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %A, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%cmp = icmp ne i32 %rem, 0
%conv = zext i1 %cmp to i32
%add = add nsw i32 %div, %conv
%2 = load i32, ptr %B, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%3 = load i32, ptr %C, align 4, !tbaa !5
%div1 = sdiv i32 %0, %3
%rem2 = srem i32 %0, %3
%cmp3 = icmp ne i32 %rem2, 0
%conv4 = zext i1 %cmp3 to i32
%add5 = add nsw i32 %div1, %conv4
%4 = load i32, ptr %D, align 4, !tbaa !5
%mul6 = mul nsw i32 %add5, %4
%cmp7 = icmp slt i32 %mul, %mul6
%mul14 = select i1 %cmp7, i32 %add, i32 0
%mul15 = mul nsw i32 %mul14, %2
%mul35 = select i1 %cmp7, i32 0, i32 %add5
%mul36 = mul nsw i32 %mul35, %4
%add37 = add nsw i32 %mul15, %mul36
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add37)
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
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, a, b, c, d, ma, mb;
scanf("%d%d%d%d%d", &n, &a, &b, &c, &d);
ma = ((n-1)/a+1)*b;
mb = ((n-1)/c+1)*d;
if (ma > mb) ma = mb;
printf("%d\n", ma);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227055/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227055/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%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 %n) #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 %n, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%1 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %sub, %1
%add = add nsw i32 %div, 1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%div2 = sdiv i32 %sub, %3
%add3 = add nsw i32 %div2, 1
%4 = load i32, ptr %d, align 4, !tbaa !5
%mul4 = mul nsw i32 %add3, %4
%spec.select = call i32 @llvm.smin.i32(i32 %mul, i32 %mul4)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b,c;
scanf("%d",&a);scanf("%d",&b);
if(a>b){
c=a-b;
}
if(b>a){
c=b-a;
}
else{
c=a-b;
}
printf("%d\n",c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227105/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227105/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub4 = sub nsw i32 %1, %0
%c.0 = call i32 @llvm.abs.i32(i32 %sub4, i1 true)
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int x,y;
scanf("%d %d",&x,&y);
if(x<=y){
printf("%d\n",y-x);
}
else{
printf("%d\n",x-y);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%sub2 = sub nsw i32 %0, %1
%sub2.sink = call i32 @llvm.abs.i32(i32 %sub2, i1 true)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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.abs.i32(i32, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
long long a,b;
scanf("%lld %lld",&a,&b);
//if (abs(c-a)<=d || abs (b-a)<=d && abs (c-b)<=d)
if ((a*b)%2==0)
printf("Even");
else
printf("Odd");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227242/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227242/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%2 = and i64 %mul, 1
%cmp = icmp eq i64 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
puts(a*b%2 ? "Odd" : "Even");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227286/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227286/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%tobool.not = icmp eq i32 %2, 0
%cond = select i1 %tobool.not, ptr @.str.2, ptr @.str.1
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void) {
int a,b;
scanf("%d%d", &a, &b);
if ((a * b) % 2) {
printf("Odd\n");
}
else {
printf("Even\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227329/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227329/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%tobool.not = icmp eq i32 %2, 0
%str.str.3 = select i1 %tobool.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a %2 != 0 && b %2 != 0){
printf("Odd\n");
}
else{
printf("Even\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227372/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227372/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp.not = icmp eq i32 %1, 0
br i1 %cmp.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = and i32 %2, 1
%cmp2.not = icmp eq i32 %3, 0
br i1 %cmp2.not, label %if.else, label %if.end
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 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d",&a);
scanf("%d",&b);
c = a*b;
if (c%2)
printf("Odd");
else
printf("Even");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227415/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227415/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%tobool.not = icmp eq i32 %2, 0
%.str.2..str.1 = select i1 %tobool.not, ptr @.str.2, ptr @.str.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h> //printf()
#include <stdlib.h> //exit()
int main() {
int a, b;
if (scanf("%d %d", &a, &b) < 0) {
exit(1);
}
int product = a * b;
if (product % 2 == 0) {
printf("Even\n");
} else {
printf("Odd\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227459/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227459/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp = icmp slt i32 %call, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
call void @exit(i32 noundef 1) #6
unreachable
if.end: ; preds = %entry
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp1 = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp1, 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 %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: noreturn nounwind
declare void @exit(i32 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-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 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#include <string.h>
#include <stdio.h>
const char main_[] = {
0x48, 0x89, 0xf8,
0x48, 0x21, 0xf0,
0x48, 0x83, 0xe0, 0x01,
0xc3
};
int main(void){
int fd = open("/dev/zero", O_RDONLY);
int (*solve)(int, int) = mmap(NULL, sizeof main_, PROT_WRITE | PROT_EXEC, MAP_PRIVATE, fd, 0);
memcpy(solve, main_, sizeof main_);
int a, b;
scanf("%d%d", &a, &b);
puts(solve(a, b) ? "Odd" : "Even");
close(fd);
munmap(solve, sizeof main_);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@main_ = dso_local local_unnamed_addr constant [11 x i8] c"H\89\F8H!\F0H\83\E0\01\C3", align 1
@.str = private unnamed_addr constant [10 x i8] c"/dev/zero\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%call = tail call i32 (ptr, i32, ...) @open(ptr noundef nonnull @.str, i32 noundef 0) #7
%call1 = tail call ptr @mmap(ptr noundef null, i64 noundef 11, i32 noundef 6, i32 noundef 2, i32 noundef %call, i64 noundef 0) #7
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(11) %call1, ptr noundef nonnull align 1 dereferenceable(11) @main_, i64 11, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%call3 = call i32 %call1(i32 noundef %0, i32 noundef %1) #7
%tobool.not = icmp eq i32 %call3, 0
%cond = select i1 %tobool.not, ptr @.str.3, ptr @.str.2
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
%call5 = call i32 @close(i32 noundef %call) #7
%call6 = call i32 @munmap(ptr noundef %call1, i64 noundef 11) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #2
; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
declare i32 @close(i32 noundef) local_unnamed_addr #6
; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-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 }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d",&a);
scanf("%d",&b);
int c = a*b;
if( c%2 == 0){
printf("Even");
}else{
printf("Odd");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a % 2 == 1 && b %2 == 1){
printf("Odd");
}else{
printf("Even");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227589/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227589/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Odd\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = and i32 %0, -2147483647
%cmp = icmp eq i32 %1, 1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = and i32 %2, -2147483647
%cmp2 = icmp eq i32 %3, 1
br i1 %cmp2, 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.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a*b%2==0){
printf("Even\n");
}else{
printf("Odd\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227631/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227631/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a % 2 == 0) printf("Even");
else if(b % 2 == 0) printf("Even");
else printf("Odd");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227675/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227675/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
%2 = load i32, ptr %b, align 4
%3 = and i32 %2, 1
%cmp3 = icmp eq i32 %3, 0
%4 = select i1 %cmp, i1 true, i1 %cmp3
%.str.1.sink = select i1 %4, ptr @.str.1, ptr @.str.2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
if(a & 0x01 && b & 0x01){
printf("Odd\n");
}
else{
printf("Even\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227718/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227718/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%and = and i32 %0, 1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%and1 = and i32 %1, 1
%tobool2.not = icmp eq i32 %and1, 0
br i1 %tobool2.not, label %if.else, label %if.end
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 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a, b;
scanf("%d %d", &a, &b);
if ( ((a*b) % 2) == 0 )
printf("Even\n");
else
printf("Odd\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227769/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227769/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
int mul=a*b;
if(mul%2==0){
printf("Even");
return 0;
}
else{
printf("Odd");
return 0;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul1 = mul nsw i32 %1, %0
%2 = and i32 %mul1, 1
%cmp = icmp eq i32 %2, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void) {
int a, b;
scanf("%d%d", &a, &b);
puts(a * b % 2 == 0 ? "Even" : "Odd");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227855/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Even\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%cond = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
if (a*b%2==0)
printf("Even\n");
else
printf("Odd\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"Odd\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Even\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = and i32 %mul, 1
%cmp = icmp eq i32 %2, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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"}
|
// AOJ 1127: Building a Space Station
// 2017.9.19 bal4u@uu
// 2017.11.23
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define R 10
long long x[101], y[101], z[101], r[101];
char f[101];
char buf[100], *p;
long long dbl2int()
{
int n = 0;
while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
if (*p == '.') p++;
while (*p >= '0') n = (n<<3) + (n<<1) + (*p++ & 0xf);
return n << R;
}
long long dist(long long dx, long long dy, long long dz)
{
return (long long)sqrt((double)(dx*dx + dy*dy + dz*dz));
}
int main()
{
int i, j, n, cnt, nx;
long long ans, min, d;
while (fgets(buf, 10, stdin) && *buf != '0') {
n = atoi(buf);
memset(f, 0, n);
for (i = 0; i < n; i++) {
fgets(p=buf, 100, stdin);
x[i] = dbl2int(), p++, y[i] = dbl2int(), p++, z[i] = dbl2int(), p++, r[i] = dbl2int();
}
ans = 0, f[1] = 1, cnt = 1;
while (cnt < n) {
for (nx = -1, min = 1LL<<60, i = 0; i < n; i++) {
if (f[i] == 0) continue;
for (j = 0; j < n; j++) {
if (f[j]) continue;
d = dist(x[i]-x[j], y[i]-y[j], z[i]-z[j]) - (r[i]+r[j]);
if (nx < 0 || d < min) min = d, nx = j;
}
}
f[nx] = 1, cnt++; if (min > 0) ans += min;
}
ans = (ans+512) >> R;
printf("%lld.%03lld\n", ans/1000, ans%1000);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227941/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227941/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@p = dso_local local_unnamed_addr global ptr null, align 8
@buf = dso_local global [100 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@f = dso_local local_unnamed_addr global [101 x i8] zeroinitializer, align 16
@x = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@y = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@z = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@r = dso_local local_unnamed_addr global [101 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [13 x i8] c"%lld.%03lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i64 @dbl2int() local_unnamed_addr #0 {
entry:
%p.promoted = load ptr, ptr @p, align 8, !tbaa !5
%0 = load i8, ptr %p.promoted, align 1, !tbaa !9
%cmp30 = icmp sgt i8 %0, 47
br i1 %cmp30, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%n.032 = phi i32 [ %add4, %while.body ], [ 0, %entry ]
%incdec.ptr2931 = phi ptr [ %incdec.ptr, %while.body ], [ %p.promoted, %entry ]
%add = mul i32 %n.032, 10
%incdec.ptr = getelementptr inbounds i8, ptr %incdec.ptr2931, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5
%1 = load i8, ptr %incdec.ptr2931, align 1, !tbaa !9
%2 = and i8 %1, 15
%and = zext i8 %2 to i32
%add4 = add nsw i32 %add, %and
%3 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp = icmp sgt i8 %3, 47
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !10
while.end: ; preds = %while.body, %entry
%n.0.lcssa = phi i32 [ 0, %entry ], [ %add4, %while.body ]
%.lcssa28 = phi ptr [ %p.promoted, %entry ], [ %incdec.ptr, %while.body ]
%.lcssa = phi i8 [ %0, %entry ], [ %3, %while.body ]
%cmp6 = icmp eq i8 %.lcssa, 46
br i1 %cmp6, label %if.end, label %while.end21
if.end: ; preds = %while.end
%incdec.ptr8 = getelementptr inbounds i8, ptr %.lcssa28, i64 1
store ptr %incdec.ptr8, ptr @p, align 8, !tbaa !5
%.pre = load i8, ptr %incdec.ptr8, align 1, !tbaa !9
%cmp1137 = icmp sgt i8 %.pre, 47
br i1 %cmp1137, label %while.body13, label %while.end21
while.body13: ; preds = %if.end, %while.body13
%n.139 = phi i32 [ %add20, %while.body13 ], [ %n.0.lcssa, %if.end ]
%incdec.ptr173638 = phi ptr [ %incdec.ptr17, %while.body13 ], [ %incdec.ptr8, %if.end ]
%add16 = mul i32 %n.139, 10
%incdec.ptr17 = getelementptr inbounds i8, ptr %incdec.ptr173638, i64 1
store ptr %incdec.ptr17, ptr @p, align 8, !tbaa !5
%4 = load i8, ptr %incdec.ptr173638, align 1, !tbaa !9
%5 = and i8 %4, 15
%and19 = zext i8 %5 to i32
%add20 = add nsw i32 %add16, %and19
%6 = load i8, ptr %incdec.ptr17, align 1, !tbaa !9
%cmp11 = icmp sgt i8 %6, 47
br i1 %cmp11, label %while.body13, label %while.end21, !llvm.loop !12
while.end21: ; preds = %while.body13, %while.end, %if.end
%n.1.lcssa = phi i32 [ %n.0.lcssa, %if.end ], [ %n.0.lcssa, %while.end ], [ %add20, %while.body13 ]
%shl22 = shl i32 %n.1.lcssa, 10
%conv23 = sext i32 %shl22 to i64
ret i64 %conv23
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @dist(i64 noundef %dx, i64 noundef %dy, i64 noundef %dz) local_unnamed_addr #1 {
entry:
%mul = mul nsw i64 %dx, %dx
%mul1 = mul nsw i64 %dy, %dy
%add = add nuw nsw i64 %mul1, %mul
%mul2 = mul nsw i64 %dz, %dz
%add3 = add nuw nsw i64 %add, %mul2
%conv = sitofp i64 %add3 to double
%call = tail call double @sqrt(double noundef %conv) #8
%conv4 = fptosi double %call to i64
ret i64 %conv4
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call235 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %0)
%tobool236 = icmp ne ptr %call235, null
%1 = load i8, ptr @buf, align 16
%cmp237 = icmp ne i8 %1, 48
%2 = select i1 %tobool236, i1 %cmp237, i1 false
br i1 %2, label %while.body, label %while.end83
while.body: ; preds = %entry, %while.end
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #8
%conv.i = trunc i64 %call.i to i32
%sext = shl i64 %call.i, 32
%conv3 = ashr exact i64 %sext, 32
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @f, i8 0, i64 %conv3, i1 false)
%cmp4217 = icmp sgt i32 %conv.i, 0
br i1 %cmp4217, label %for.body.preheader, label %for.end.thread
for.end.thread: ; preds = %while.body
store i8 1, ptr getelementptr inbounds ([101 x i8], ptr @f, i64 0, i64 1), align 1, !tbaa !9
br label %while.end
for.body.preheader: ; preds = %while.body
%wide.trip.count = and i64 %call.i, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %dbl2int.exit209
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %dbl2int.exit209 ]
store ptr @buf, ptr @p, align 8, !tbaa !5
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call6 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 100, ptr noundef %3)
%p.promoted.i = load ptr, ptr @p, align 8, !tbaa !5
%4 = load i8, ptr %p.promoted.i, align 1, !tbaa !9
%cmp30.i = icmp sgt i8 %4, 47
br i1 %cmp30.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %for.body, %while.body.i
%n.032.i = phi i32 [ %add4.i, %while.body.i ], [ 0, %for.body ]
%incdec.ptr2931.i = phi ptr [ %incdec.ptr.i, %while.body.i ], [ %p.promoted.i, %for.body ]
%add.i = mul i32 %n.032.i, 10
%incdec.ptr.i = getelementptr inbounds i8, ptr %incdec.ptr2931.i, i64 1
store ptr %incdec.ptr.i, ptr @p, align 8, !tbaa !5
%5 = load i8, ptr %incdec.ptr2931.i, align 1, !tbaa !9
%6 = and i8 %5, 15
%and.i = zext i8 %6 to i32
%add4.i = add nsw i32 %add.i, %and.i
%7 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !9
%cmp.i = icmp sgt i8 %7, 47
br i1 %cmp.i, label %while.body.i, label %while.end.i, !llvm.loop !10
while.end.i: ; preds = %while.body.i, %for.body
%n.0.lcssa.i = phi i32 [ 0, %for.body ], [ %add4.i, %while.body.i ]
%.lcssa28.i = phi ptr [ %p.promoted.i, %for.body ], [ %incdec.ptr.i, %while.body.i ]
%.lcssa.i = phi i8 [ %4, %for.body ], [ %7, %while.body.i ]
%cmp6.i = icmp eq i8 %.lcssa.i, 46
br i1 %cmp6.i, label %if.end.i, label %dbl2int.exit
if.end.i: ; preds = %while.end.i
%incdec.ptr8.i = getelementptr inbounds i8, ptr %.lcssa28.i, i64 1
store ptr %incdec.ptr8.i, ptr @p, align 8, !tbaa !5
%.pre.i = load i8, ptr %incdec.ptr8.i, align 1, !tbaa !9
%cmp1137.i = icmp sgt i8 %.pre.i, 47
br i1 %cmp1137.i, label %while.body13.i, label %dbl2int.exit
while.body13.i: ; preds = %if.end.i, %while.body13.i
%n.139.i = phi i32 [ %add20.i, %while.body13.i ], [ %n.0.lcssa.i, %if.end.i ]
%incdec.ptr173638.i = phi ptr [ %incdec.ptr17.i, %while.body13.i ], [ %incdec.ptr8.i, %if.end.i ]
%add16.i = mul i32 %n.139.i, 10
%incdec.ptr17.i = getelementptr inbounds i8, ptr %incdec.ptr173638.i, i64 1
store ptr %incdec.ptr17.i, ptr @p, align 8, !tbaa !5
%8 = load i8, ptr %incdec.ptr173638.i, align 1, !tbaa !9
%9 = and i8 %8, 15
%and19.i = zext i8 %9 to i32
%add20.i = add nsw i32 %add16.i, %and19.i
%10 = load i8, ptr %incdec.ptr17.i, align 1, !tbaa !9
%cmp11.i = icmp sgt i8 %10, 47
br i1 %cmp11.i, label %while.body13.i, label %dbl2int.exit, !llvm.loop !12
dbl2int.exit: ; preds = %while.body13.i, %while.end.i, %if.end.i
%11 = phi ptr [ %incdec.ptr8.i, %if.end.i ], [ %.lcssa28.i, %while.end.i ], [ %incdec.ptr17.i, %while.body13.i ]
%n.1.lcssa.i = phi i32 [ %n.0.lcssa.i, %if.end.i ], [ %n.0.lcssa.i, %while.end.i ], [ %add20.i, %while.body13.i ]
%shl22.i = shl i32 %n.1.lcssa.i, 10
%conv23.i = sext i32 %shl22.i to i64
%arrayidx = getelementptr inbounds [101 x i64], ptr @x, i64 0, i64 %indvars.iv
store i64 %conv23.i, ptr %arrayidx, align 8, !tbaa !13
%incdec.ptr = getelementptr inbounds i8, ptr %11, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !5
%12 = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp30.i118 = icmp sgt i8 %12, 47
br i1 %cmp30.i118, label %while.body.i139, label %while.end.i119
while.body.i139: ; preds = %dbl2int.exit, %while.body.i139
%n.032.i140 = phi i32 [ %add4.i145, %while.body.i139 ], [ 0, %dbl2int.exit ]
%incdec.ptr2931.i141 = phi ptr [ %incdec.ptr.i143, %while.body.i139 ], [ %incdec.ptr, %dbl2int.exit ]
%add.i142 = mul i32 %n.032.i140, 10
%incdec.ptr.i143 = getelementptr inbounds i8, ptr %incdec.ptr2931.i141, i64 1
store ptr %incdec.ptr.i143, ptr @p, align 8, !tbaa !5
%13 = load i8, ptr %incdec.ptr2931.i141, align 1, !tbaa !9
%14 = and i8 %13, 15
%and.i144 = zext i8 %14 to i32
%add4.i145 = add nsw i32 %add.i142, %and.i144
%15 = load i8, ptr %incdec.ptr.i143, align 1, !tbaa !9
%cmp.i146 = icmp sgt i8 %15, 47
br i1 %cmp.i146, label %while.body.i139, label %while.end.i119, !llvm.loop !10
while.end.i119: ; preds = %while.body.i139, %dbl2int.exit
%16 = phi ptr [ %incdec.ptr, %dbl2int.exit ], [ %incdec.ptr.i143, %while.body.i139 ]
%n.0.lcssa.i120 = phi i32 [ 0, %dbl2int.exit ], [ %add4.i145, %while.body.i139 ]
%17 = phi ptr [ %11, %dbl2int.exit ], [ %incdec.ptr2931.i141, %while.body.i139 ]
%.lcssa.i122 = phi i8 [ %12, %dbl2int.exit ], [ %15, %while.body.i139 ]
%cmp6.i123 = icmp eq i8 %.lcssa.i122, 46
br i1 %cmp6.i123, label %if.end.i127, label %dbl2int.exit147
if.end.i127: ; preds = %while.end.i119
%incdec.ptr8.i128 = getelementptr inbounds i8, ptr %17, i64 2
store ptr %incdec.ptr8.i128, ptr @p, align 8, !tbaa !5
%.pre.i129 = load i8, ptr %incdec.ptr8.i128, align 1, !tbaa !9
%cmp1137.i130 = icmp sgt i8 %.pre.i129, 47
br i1 %cmp1137.i130, label %while.body13.i131, label %dbl2int.exit147
while.body13.i131: ; preds = %if.end.i127, %while.body13.i131
%n.139.i132 = phi i32 [ %add20.i137, %while.body13.i131 ], [ %n.0.lcssa.i120, %if.end.i127 ]
%incdec.ptr173638.i133 = phi ptr [ %incdec.ptr17.i135, %while.body13.i131 ], [ %incdec.ptr8.i128, %if.end.i127 ]
%add16.i134 = mul i32 %n.139.i132, 10
%incdec.ptr17.i135 = getelementptr inbounds i8, ptr %incdec.ptr173638.i133, i64 1
store ptr %incdec.ptr17.i135, ptr @p, align 8, !tbaa !5
%18 = load i8, ptr %incdec.ptr173638.i133, align 1, !tbaa !9
%19 = and i8 %18, 15
%and19.i136 = zext i8 %19 to i32
%add20.i137 = add nsw i32 %add16.i134, %and19.i136
%20 = load i8, ptr %incdec.ptr17.i135, align 1, !tbaa !9
%cmp11.i138 = icmp sgt i8 %20, 47
br i1 %cmp11.i138, label %while.body13.i131, label %dbl2int.exit147, !llvm.loop !12
dbl2int.exit147: ; preds = %while.body13.i131, %while.end.i119, %if.end.i127
%21 = phi ptr [ %incdec.ptr8.i128, %if.end.i127 ], [ %16, %while.end.i119 ], [ %incdec.ptr17.i135, %while.body13.i131 ]
%n.1.lcssa.i124 = phi i32 [ %n.0.lcssa.i120, %if.end.i127 ], [ %n.0.lcssa.i120, %while.end.i119 ], [ %add20.i137, %while.body13.i131 ]
%shl22.i125 = shl i32 %n.1.lcssa.i124, 10
%conv23.i126 = sext i32 %shl22.i125 to i64
%arrayidx10 = getelementptr inbounds [101 x i64], ptr @y, i64 0, i64 %indvars.iv
store i64 %conv23.i126, ptr %arrayidx10, align 8, !tbaa !13
%incdec.ptr11 = getelementptr inbounds i8, ptr %21, i64 1
store ptr %incdec.ptr11, ptr @p, align 8, !tbaa !5
%22 = load i8, ptr %incdec.ptr11, align 1, !tbaa !9
%cmp30.i149 = icmp sgt i8 %22, 47
br i1 %cmp30.i149, label %while.body.i170, label %while.end.i150
while.body.i170: ; preds = %dbl2int.exit147, %while.body.i170
%n.032.i171 = phi i32 [ %add4.i176, %while.body.i170 ], [ 0, %dbl2int.exit147 ]
%incdec.ptr2931.i172 = phi ptr [ %incdec.ptr.i174, %while.body.i170 ], [ %incdec.ptr11, %dbl2int.exit147 ]
%add.i173 = mul i32 %n.032.i171, 10
%incdec.ptr.i174 = getelementptr inbounds i8, ptr %incdec.ptr2931.i172, i64 1
store ptr %incdec.ptr.i174, ptr @p, align 8, !tbaa !5
%23 = load i8, ptr %incdec.ptr2931.i172, align 1, !tbaa !9
%24 = and i8 %23, 15
%and.i175 = zext i8 %24 to i32
%add4.i176 = add nsw i32 %add.i173, %and.i175
%25 = load i8, ptr %incdec.ptr.i174, align 1, !tbaa !9
%cmp.i177 = icmp sgt i8 %25, 47
br i1 %cmp.i177, label %while.body.i170, label %while.end.i150, !llvm.loop !10
while.end.i150: ; preds = %while.body.i170, %dbl2int.exit147
%26 = phi ptr [ %incdec.ptr11, %dbl2int.exit147 ], [ %incdec.ptr.i174, %while.body.i170 ]
%n.0.lcssa.i151 = phi i32 [ 0, %dbl2int.exit147 ], [ %add4.i176, %while.body.i170 ]
%27 = phi ptr [ %21, %dbl2int.exit147 ], [ %incdec.ptr2931.i172, %while.body.i170 ]
%.lcssa.i153 = phi i8 [ %22, %dbl2int.exit147 ], [ %25, %while.body.i170 ]
%cmp6.i154 = icmp eq i8 %.lcssa.i153, 46
br i1 %cmp6.i154, label %if.end.i158, label %dbl2int.exit178
if.end.i158: ; preds = %while.end.i150
%incdec.ptr8.i159 = getelementptr inbounds i8, ptr %27, i64 2
store ptr %incdec.ptr8.i159, ptr @p, align 8, !tbaa !5
%.pre.i160 = load i8, ptr %incdec.ptr8.i159, align 1, !tbaa !9
%cmp1137.i161 = icmp sgt i8 %.pre.i160, 47
br i1 %cmp1137.i161, label %while.body13.i162, label %dbl2int.exit178
while.body13.i162: ; preds = %if.end.i158, %while.body13.i162
%n.139.i163 = phi i32 [ %add20.i168, %while.body13.i162 ], [ %n.0.lcssa.i151, %if.end.i158 ]
%incdec.ptr173638.i164 = phi ptr [ %incdec.ptr17.i166, %while.body13.i162 ], [ %incdec.ptr8.i159, %if.end.i158 ]
%add16.i165 = mul i32 %n.139.i163, 10
%incdec.ptr17.i166 = getelementptr inbounds i8, ptr %incdec.ptr173638.i164, i64 1
store ptr %incdec.ptr17.i166, ptr @p, align 8, !tbaa !5
%28 = load i8, ptr %incdec.ptr173638.i164, align 1, !tbaa !9
%29 = and i8 %28, 15
%and19.i167 = zext i8 %29 to i32
%add20.i168 = add nsw i32 %add16.i165, %and19.i167
%30 = load i8, ptr %incdec.ptr17.i166, align 1, !tbaa !9
%cmp11.i169 = icmp sgt i8 %30, 47
br i1 %cmp11.i169, label %while.body13.i162, label %dbl2int.exit178, !llvm.loop !12
dbl2int.exit178: ; preds = %while.body13.i162, %while.end.i150, %if.end.i158
%31 = phi ptr [ %incdec.ptr8.i159, %if.end.i158 ], [ %26, %while.end.i150 ], [ %incdec.ptr17.i166, %while.body13.i162 ]
%n.1.lcssa.i155 = phi i32 [ %n.0.lcssa.i151, %if.end.i158 ], [ %n.0.lcssa.i151, %while.end.i150 ], [ %add20.i168, %while.body13.i162 ]
%shl22.i156 = shl i32 %n.1.lcssa.i155, 10
%conv23.i157 = sext i32 %shl22.i156 to i64
%arrayidx14 = getelementptr inbounds [101 x i64], ptr @z, i64 0, i64 %indvars.iv
store i64 %conv23.i157, ptr %arrayidx14, align 8, !tbaa !13
%incdec.ptr15 = getelementptr inbounds i8, ptr %31, i64 1
store ptr %incdec.ptr15, ptr @p, align 8, !tbaa !5
%32 = load i8, ptr %incdec.ptr15, align 1, !tbaa !9
%cmp30.i180 = icmp sgt i8 %32, 47
br i1 %cmp30.i180, label %while.body.i201, label %while.end.i181
while.body.i201: ; preds = %dbl2int.exit178, %while.body.i201
%n.032.i202 = phi i32 [ %add4.i207, %while.body.i201 ], [ 0, %dbl2int.exit178 ]
%incdec.ptr2931.i203 = phi ptr [ %incdec.ptr.i205, %while.body.i201 ], [ %incdec.ptr15, %dbl2int.exit178 ]
%add.i204 = mul i32 %n.032.i202, 10
%incdec.ptr.i205 = getelementptr inbounds i8, ptr %incdec.ptr2931.i203, i64 1
store ptr %incdec.ptr.i205, ptr @p, align 8, !tbaa !5
%33 = load i8, ptr %incdec.ptr2931.i203, align 1, !tbaa !9
%34 = and i8 %33, 15
%and.i206 = zext i8 %34 to i32
%add4.i207 = add nsw i32 %add.i204, %and.i206
%35 = load i8, ptr %incdec.ptr.i205, align 1, !tbaa !9
%cmp.i208 = icmp sgt i8 %35, 47
br i1 %cmp.i208, label %while.body.i201, label %while.end.i181, !llvm.loop !10
while.end.i181: ; preds = %while.body.i201, %dbl2int.exit178
%n.0.lcssa.i182 = phi i32 [ 0, %dbl2int.exit178 ], [ %add4.i207, %while.body.i201 ]
%36 = phi ptr [ %31, %dbl2int.exit178 ], [ %incdec.ptr2931.i203, %while.body.i201 ]
%.lcssa.i184 = phi i8 [ %32, %dbl2int.exit178 ], [ %35, %while.body.i201 ]
%cmp6.i185 = icmp eq i8 %.lcssa.i184, 46
br i1 %cmp6.i185, label %if.end.i189, label %dbl2int.exit209
if.end.i189: ; preds = %while.end.i181
%incdec.ptr8.i190 = getelementptr inbounds i8, ptr %36, i64 2
store ptr %incdec.ptr8.i190, ptr @p, align 8, !tbaa !5
%.pre.i191 = load i8, ptr %incdec.ptr8.i190, align 1, !tbaa !9
%cmp1137.i192 = icmp sgt i8 %.pre.i191, 47
br i1 %cmp1137.i192, label %while.body13.i193, label %dbl2int.exit209
while.body13.i193: ; preds = %if.end.i189, %while.body13.i193
%n.139.i194 = phi i32 [ %add20.i199, %while.body13.i193 ], [ %n.0.lcssa.i182, %if.end.i189 ]
%incdec.ptr173638.i195 = phi ptr [ %incdec.ptr17.i197, %while.body13.i193 ], [ %incdec.ptr8.i190, %if.end.i189 ]
%add16.i196 = mul i32 %n.139.i194, 10
%incdec.ptr17.i197 = getelementptr inbounds i8, ptr %incdec.ptr173638.i195, i64 1
store ptr %incdec.ptr17.i197, ptr @p, align 8, !tbaa !5
%37 = load i8, ptr %incdec.ptr173638.i195, align 1, !tbaa !9
%38 = and i8 %37, 15
%and19.i198 = zext i8 %38 to i32
%add20.i199 = add nsw i32 %add16.i196, %and19.i198
%39 = load i8, ptr %incdec.ptr17.i197, align 1, !tbaa !9
%cmp11.i200 = icmp sgt i8 %39, 47
br i1 %cmp11.i200, label %while.body13.i193, label %dbl2int.exit209, !llvm.loop !12
dbl2int.exit209: ; preds = %while.body13.i193, %while.end.i181, %if.end.i189
%n.1.lcssa.i186 = phi i32 [ %n.0.lcssa.i182, %if.end.i189 ], [ %n.0.lcssa.i182, %while.end.i181 ], [ %add20.i199, %while.body13.i193 ]
%shl22.i187 = shl i32 %n.1.lcssa.i186, 10
%conv23.i188 = sext i32 %shl22.i187 to i64
%arrayidx18 = getelementptr inbounds [101 x i64], ptr @r, i64 0, i64 %indvars.iv
store i64 %conv23.i188, ptr %arrayidx18, align 8, !tbaa !13
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15
for.end: ; preds = %dbl2int.exit209
store i8 1, ptr getelementptr inbounds ([101 x i8], ptr @f, i64 0, i64 1), align 1, !tbaa !9
%cmp20231 = icmp sgt i32 %conv.i, 1
br i1 %cmp20231, label %for.cond23.preheader.us.preheader, label %while.end
for.cond23.preheader.us.preheader: ; preds = %for.end
%wide.trip.count251 = and i64 %call.i, 4294967295
br label %for.cond23.preheader.us
for.cond23.preheader.us: ; preds = %for.cond23.preheader.us.preheader, %for.cond23.for.end72_crit_edge.split.us.us
%ans.0233.us = phi i64 [ %spec.select.us, %for.cond23.for.end72_crit_edge.split.us.us ], [ 0, %for.cond23.preheader.us.preheader ]
%cnt.0232.us = phi i32 [ %inc75.us, %for.cond23.for.end72_crit_edge.split.us.us ], [ 1, %for.cond23.preheader.us.preheader ]
br label %for.body26.us.us
for.body26.us.us: ; preds = %for.inc70.us.us, %for.cond23.preheader.us
%indvars.iv248 = phi i64 [ %indvars.iv.next249, %for.inc70.us.us ], [ 0, %for.cond23.preheader.us ]
%min.0226.us.us = phi i64 [ %min.3.us.us, %for.inc70.us.us ], [ 1152921504606846976, %for.cond23.preheader.us ]
%nx.0225.us.us = phi i32 [ %nx.3.us.us, %for.inc70.us.us ], [ -1, %for.cond23.preheader.us ]
%arrayidx28.us.us = getelementptr inbounds [101 x i8], ptr @f, i64 0, i64 %indvars.iv248
%40 = load i8, ptr %arrayidx28.us.us, align 1, !tbaa !9
%cmp30.us.us = icmp eq i8 %40, 0
br i1 %cmp30.us.us, label %for.inc70.us.us, label %for.cond32.preheader.us.us
for.body35.us.us: ; preds = %for.cond32.preheader.us.us, %for.inc67.us.us
%indvars.iv243 = phi i64 [ 0, %for.cond32.preheader.us.us ], [ %indvars.iv.next244, %for.inc67.us.us ]
%min.1222.us.us = phi i64 [ %min.0226.us.us, %for.cond32.preheader.us.us ], [ %min.2.us.us, %for.inc67.us.us ]
%nx.1221.us.us = phi i32 [ %nx.0225.us.us, %for.cond32.preheader.us.us ], [ %nx.2.us.us, %for.inc67.us.us ]
%arrayidx37.us.us = getelementptr inbounds [101 x i8], ptr @f, i64 0, i64 %indvars.iv243
%41 = load i8, ptr %arrayidx37.us.us, align 1, !tbaa !9
%tobool38.not.us.us = icmp eq i8 %41, 0
br i1 %tobool38.not.us.us, label %if.end40.us.us, label %for.inc67.us.us
if.end40.us.us: ; preds = %for.body35.us.us
%42 = load i64, ptr %arrayidx42.us.us, align 8, !tbaa !13
%arrayidx44.us.us = getelementptr inbounds [101 x i64], ptr @x, i64 0, i64 %indvars.iv243
%43 = load i64, ptr %arrayidx44.us.us, align 8, !tbaa !13
%sub.us.us = sub nsw i64 %42, %43
%44 = load i64, ptr %arrayidx46.us.us, align 8, !tbaa !13
%arrayidx48.us.us = getelementptr inbounds [101 x i64], ptr @y, i64 0, i64 %indvars.iv243
%45 = load i64, ptr %arrayidx48.us.us, align 8, !tbaa !13
%sub49.us.us = sub nsw i64 %44, %45
%46 = load i64, ptr %arrayidx51.us.us, align 8, !tbaa !13
%arrayidx53.us.us = getelementptr inbounds [101 x i64], ptr @z, i64 0, i64 %indvars.iv243
%47 = load i64, ptr %arrayidx53.us.us, align 8, !tbaa !13
%sub54.us.us = sub nsw i64 %46, %47
%mul.i.us.us = mul nsw i64 %sub.us.us, %sub.us.us
%mul1.i.us.us = mul nsw i64 %sub49.us.us, %sub49.us.us
%add.i210.us.us = add nuw nsw i64 %mul1.i.us.us, %mul.i.us.us
%mul2.i.us.us = mul nsw i64 %sub54.us.us, %sub54.us.us
%add3.i.us.us = add nuw nsw i64 %add.i210.us.us, %mul2.i.us.us
%conv.i211.us.us = sitofp i64 %add3.i.us.us to double
%call.i212.us.us = tail call double @sqrt(double noundef %conv.i211.us.us) #8
%conv4.i.us.us = fptosi double %call.i212.us.us to i64
%48 = load i64, ptr %arrayidx57.us.us, align 8, !tbaa !13
%arrayidx59.us.us = getelementptr inbounds [101 x i64], ptr @r, i64 0, i64 %indvars.iv243
%49 = load i64, ptr %arrayidx59.us.us, align 8, !tbaa !13
%50 = add i64 %48, %49
%sub60.us.us = sub i64 %conv4.i.us.us, %50
%cmp61.us.us = icmp slt i32 %nx.1221.us.us, 0
%cmp63.us.us = icmp slt i64 %sub60.us.us, %min.1222.us.us
%or.cond.us.us = select i1 %cmp61.us.us, i1 true, i1 %cmp63.us.us
%51 = trunc i64 %indvars.iv243 to i32
%spec.select115.us.us = select i1 %or.cond.us.us, i32 %51, i32 %nx.1221.us.us
%spec.select116.us.us = select i1 %or.cond.us.us, i64 %sub60.us.us, i64 %min.1222.us.us
br label %for.inc67.us.us
for.inc67.us.us: ; preds = %if.end40.us.us, %for.body35.us.us
%nx.2.us.us = phi i32 [ %nx.1221.us.us, %for.body35.us.us ], [ %spec.select115.us.us, %if.end40.us.us ]
%min.2.us.us = phi i64 [ %min.1222.us.us, %for.body35.us.us ], [ %spec.select116.us.us, %if.end40.us.us ]
%indvars.iv.next244 = add nuw nsw i64 %indvars.iv243, 1
%exitcond247.not = icmp eq i64 %indvars.iv.next244, %wide.trip.count251
br i1 %exitcond247.not, label %for.inc70.us.us, label %for.body35.us.us, !llvm.loop !16
for.inc70.us.us: ; preds = %for.inc67.us.us, %for.body26.us.us
%nx.3.us.us = phi i32 [ %nx.0225.us.us, %for.body26.us.us ], [ %nx.2.us.us, %for.inc67.us.us ]
%min.3.us.us = phi i64 [ %min.0226.us.us, %for.body26.us.us ], [ %min.2.us.us, %for.inc67.us.us ]
%indvars.iv.next249 = add nuw nsw i64 %indvars.iv248, 1
%exitcond252.not = icmp eq i64 %indvars.iv.next249, %wide.trip.count251
br i1 %exitcond252.not, label %for.cond23.for.end72_crit_edge.split.us.us, label %for.body26.us.us, !llvm.loop !17
for.cond32.preheader.us.us: ; preds = %for.body26.us.us
%arrayidx42.us.us = getelementptr inbounds [101 x i64], ptr @x, i64 0, i64 %indvars.iv248
%arrayidx46.us.us = getelementptr inbounds [101 x i64], ptr @y, i64 0, i64 %indvars.iv248
%arrayidx51.us.us = getelementptr inbounds [101 x i64], ptr @z, i64 0, i64 %indvars.iv248
%arrayidx57.us.us = getelementptr inbounds [101 x i64], ptr @r, i64 0, i64 %indvars.iv248
br label %for.body35.us.us
for.cond23.for.end72_crit_edge.split.us.us: ; preds = %for.inc70.us.us
%idxprom73.us = sext i32 %nx.3.us.us to i64
%arrayidx74.us = getelementptr inbounds [101 x i8], ptr @f, i64 0, i64 %idxprom73.us
store i8 1, ptr %arrayidx74.us, align 1, !tbaa !9
%inc75.us = add nuw nsw i32 %cnt.0232.us, 1
%add79.us = tail call i64 @llvm.smax.i64(i64 %min.3.us.us, i64 0)
%spec.select.us = add nuw nsw i64 %add79.us, %ans.0233.us
%exitcond253.not = icmp eq i32 %inc75.us, %conv.i
br i1 %exitcond253.not, label %while.end, label %for.cond23.preheader.us, !llvm.loop !18
while.end: ; preds = %for.cond23.for.end72_crit_edge.split.us.us, %for.end.thread, %for.end
%ans.0.lcssa = phi i64 [ 0, %for.end ], [ 0, %for.end.thread ], [ %spec.select.us, %for.cond23.for.end72_crit_edge.split.us.us ]
%add81 = add nsw i64 %ans.0.lcssa, 512
%shr = ashr i64 %add81, 10
%div = sdiv i64 %shr, 1000
%rem = srem i64 %shr, 1000
%call82 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div, i64 noundef %rem)
%52 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 10, ptr noundef %52)
%tobool = icmp ne ptr %call, null
%53 = load i8, ptr @buf, align 16
%cmp = icmp ne i8 %53, 48
%54 = select i1 %tobool, i1 %cmp, i1 false
br i1 %54, label %while.body, label %while.end83, !llvm.loop !19
while.end83: ; preds = %while.end, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
|
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<math.h>
typedef struct {
double x, y;
}POINT;
int main() {
POINT a, b, c, d;
while (~fscanf(stdin,"%lf%lf%lf%lf%lf%lf%lf%lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y, &d.x, &d.y)) {
b.x -= a.x, b.y -= a.y, d.x -= c.x, d.y -= c.y;
if (fabs(b.x*d.x + b.y*d.y) < 1e-10) fprintf(stdout, "YES\n");
else fprintf(stdout, "NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_227985/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_227985/source.c"
target datalayout = "e-m:e-p270: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.POINT = type { double, double }
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [25 x i8] c"%lf%lf%lf%lf%lf%lf%lf%lf\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [5 x i8] c"YES\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"NO\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca %struct.POINT, align 16
%b = alloca %struct.POINT, align 16
%c = alloca %struct.POINT, align 16
%d = alloca %struct.POINT, align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %d) #5
%y = getelementptr inbounds %struct.POINT, ptr %a, i64 0, i32 1
%y2 = getelementptr inbounds %struct.POINT, ptr %b, i64 0, i32 1
%y4 = getelementptr inbounds %struct.POINT, ptr %c, i64 0, i32 1
%y6 = getelementptr inbounds %struct.POINT, ptr %d, i64 0, i32 1
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call25 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %y, ptr noundef nonnull %b, ptr noundef nonnull %y2, ptr noundef nonnull %c, ptr noundef nonnull %y4, ptr noundef nonnull %d, ptr noundef nonnull %y6) #5
%tobool.not26 = icmp eq i32 %call25, -1
br i1 %tobool.not26, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%1 = load <2 x double>, ptr %a, align 16, !tbaa !9
%2 = load <2 x double>, ptr %b, align 16, !tbaa !9
%3 = fsub <2 x double> %2, %1
store <2 x double> %3, ptr %b, align 16, !tbaa !9
%4 = load <2 x double>, ptr %c, align 16, !tbaa !9
%5 = load <2 x double>, ptr %d, align 16, !tbaa !9
%6 = fsub <2 x double> %5, %4
store <2 x double> %6, ptr %d, align 16, !tbaa !9
%7 = fmul <2 x double> %3, %6
%mul22 = extractelement <2 x double> %7, i64 1
%8 = extractelement <2 x double> %3, i64 0
%9 = extractelement <2 x double> %6, i64 0
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double %mul22)
%11 = call double @llvm.fabs.f64(double %10)
%cmp = fcmp olt double %11, 1.000000e-10
%12 = load ptr, ptr @stdout, align 8, !tbaa !5
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.body
%13 = call i64 @fwrite(ptr nonnull @.str.1, i64 4, i64 1, ptr %12)
br label %if.end
if.else: ; preds = %while.body
%14 = call i64 @fwrite(ptr nonnull @.str.2, i64 3, i64 1, ptr %12)
br label %if.end
if.end: ; preds = %if.else, %if.then
%15 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %15, ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %y, ptr noundef nonnull %b, ptr noundef nonnull %y2, ptr noundef nonnull %c, ptr noundef nonnull %y4, ptr noundef nonnull %d, ptr noundef nonnull %y6) #5
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3
; Function Attrs: 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 i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
int main(void){
double xa,ya,xb,yb,xc,yc,xd,yd;
while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd)!=EOF){
if((xa-xb)*(xc-xd)+(ya-yb)*(yc-yd)==0)printf("YES\n"); else printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228027/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228027/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [32 x i8] c"%lf %lf %lf %lf %lf %lf %lf %lf\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%xa = alloca double, align 8
%ya = alloca double, align 8
%xb = alloca double, align 8
%yb = alloca double, align 8
%xc = alloca double, align 8
%yc = alloca double, align 8
%xd = alloca double, align 8
%yd = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xa) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %ya) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xb) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yb) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xc) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yc) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %xd) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %yd) #5
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %xa, ptr noundef nonnull %ya, ptr noundef nonnull %xb, ptr noundef nonnull %yb, ptr noundef nonnull %xc, ptr noundef nonnull %yc, ptr noundef nonnull %xd, ptr noundef nonnull %yd)
%cmp.not10 = icmp eq i32 %call9, -1
br i1 %cmp.not10, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load double, ptr %xa, align 8, !tbaa !5
%1 = load double, ptr %xb, align 8, !tbaa !5
%sub = fsub double %0, %1
%2 = load double, ptr %xc, align 8, !tbaa !5
%3 = load double, ptr %xd, align 8, !tbaa !5
%sub1 = fsub double %2, %3
%4 = load double, ptr %ya, align 8, !tbaa !5
%5 = load double, ptr %yb, align 8, !tbaa !5
%sub2 = fsub double %4, %5
%6 = load double, ptr %yc, align 8, !tbaa !5
%7 = load double, ptr %yd, align 8, !tbaa !5
%sub3 = fsub double %6, %7
%mul4 = fmul double %sub2, %sub3
%8 = call double @llvm.fmuladd.f64(double %sub, double %sub1, double %mul4)
%cmp5 = fcmp oeq double %8, 0.000000e+00
%str.3.str = select i1 %cmp5, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %xa, ptr noundef nonnull %ya, ptr noundef nonnull %xb, ptr noundef nonnull %yb, ptr noundef nonnull %xc, ptr noundef nonnull %yc, ptr noundef nonnull %xd, ptr noundef nonnull %yd)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yd) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xd) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yc) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xc) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %yb) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xb) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %ya) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %xa) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !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[110][110],i,j,a,b,B[10010],n,k=1;
scanf("%d%d",&a,&b);
scanf("%d",&n);
for(i=1;i<=n;i++) scanf("%d",&B[i]);
for(i=1;i<=a;i++){
if(i%2!=0){
for(j=1;j<=b;j++){
A[i][j]=k;
B[k]--;
if(B[k]==0) k++;
}
}
else{
for(j=b;j>=1;j--){
A[i][j]=k;
B[k]--;
if(B[k]==0) k++;
}
}
}
for(i=1;i<=a;i++){
for(j=1;j<b;j++){
printf("%d ",A[i][j]);
}
printf("%d\n",A[i][b]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228070/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228070/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [110 x [110 x i32]], align 16
%a = alloca i32, align 4
%b = alloca i32, align 4
%B = alloca [10010 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 48400, ptr nonnull %A) #3
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 40040, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not97 = icmp slt i32 %0, 1
br i1 %cmp.not97, label %for.cond3.preheader, label %for.body
for.cond3.preheader: ; preds = %for.body, %entry
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp4.not106 = icmp slt i32 %1, 1
br i1 %cmp4.not106, label %for.end68, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%2 = load i32, ptr %b, align 4
%.fr = freeze i32 %2
%cmp25102 = icmp sgt i32 %.fr, 0
br i1 %cmp25102, label %for.body5.us.preheader, label %for.cond50.preheader.preheader
for.body5.us.preheader: ; preds = %for.body5.lr.ph
%3 = add i32 %.fr, 1
%4 = zext i32 %.fr to i64
%5 = add nuw i32 %1, 1
%wide.trip.count154 = zext i32 %5 to i64
%wide.trip.count146 = zext i32 %3 to i64
%6 = add nsw i64 %wide.trip.count146, -1
%xtraiter = and i64 %6, 1
%7 = icmp eq i32 %3, 2
%unroll_iter = and i64 %6, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%xtraiter178 = and i64 %4, 1
%lcmp.mod179.not = icmp eq i64 %xtraiter178, 0
%indvars.iv.next149.prol = add nsw i64 %4, -1
%8 = icmp eq i32 %.fr, 1
br label %for.body5.us
for.body5.us: ; preds = %for.body5.us.preheader, %for.inc44.us
%indvars.iv151 = phi i64 [ 1, %for.body5.us.preheader ], [ %indvars.iv.next152, %for.inc44.us ]
%k.0109.us = phi i32 [ 1, %for.body5.us.preheader ], [ %k.5.us, %for.inc44.us ]
%rem.us171 = and i64 %indvars.iv151, 1
%cmp6.not.us = icmp eq i64 %rem.us171, 0
br i1 %cmp6.not.us, label %for.body26.us.preheader, label %for.body9.us.preheader
for.body9.us.preheader: ; preds = %for.body5.us
br i1 %7, label %for.inc44.us.loopexit176.unr-lcssa, label %for.body9.us
for.body26.us.preheader: ; preds = %for.body5.us
br i1 %lcmp.mod179.not, label %for.body26.us.prol.loopexit, label %for.body26.us.prol
for.body26.us.prol: ; preds = %for.body26.us.preheader
%arrayidx30.us.prol = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv151, i64 %4
store i32 %k.0109.us, ptr %arrayidx30.us.prol, align 4, !tbaa !5
%idxprom31.us.prol = sext i32 %k.0109.us to i64
%arrayidx32.us.prol = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %idxprom31.us.prol
%9 = load i32, ptr %arrayidx32.us.prol, align 4, !tbaa !5
%dec33.us.prol = add nsw i32 %9, -1
store i32 %dec33.us.prol, ptr %arrayidx32.us.prol, align 4, !tbaa !5
%cmp36.us.prol = icmp eq i32 %dec33.us.prol, 0
%inc38.us.prol = zext i1 %cmp36.us.prol to i32
%spec.select95.us.prol = add nsw i32 %k.0109.us, %inc38.us.prol
br label %for.body26.us.prol.loopexit
for.body26.us.prol.loopexit: ; preds = %for.body26.us.prol, %for.body26.us.preheader
%indvars.iv148.unr = phi i64 [ %4, %for.body26.us.preheader ], [ %indvars.iv.next149.prol, %for.body26.us.prol ]
%k.3104.us.unr = phi i32 [ %k.0109.us, %for.body26.us.preheader ], [ %spec.select95.us.prol, %for.body26.us.prol ]
%spec.select95.us.lcssa.unr = phi i32 [ undef, %for.body26.us.preheader ], [ %spec.select95.us.prol, %for.body26.us.prol ]
br i1 %8, label %for.inc44.us, label %for.body26.us
for.body9.us: ; preds = %for.body9.us.preheader, %for.body9.us
%indvars.iv143 = phi i64 [ %indvars.iv.next144.1, %for.body9.us ], [ 1, %for.body9.us.preheader ]
%k.1101.us = phi i32 [ %spec.select.us.1, %for.body9.us ], [ %k.0109.us, %for.body9.us.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body9.us ], [ 0, %for.body9.us.preheader ]
%arrayidx13.us = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv151, i64 %indvars.iv143
store i32 %k.1101.us, ptr %arrayidx13.us, align 4, !tbaa !5
%idxprom14.us = sext i32 %k.1101.us to i64
%arrayidx15.us = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %idxprom14.us
%10 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5
%dec.us = add nsw i32 %10, -1
store i32 %dec.us, ptr %arrayidx15.us, align 4, !tbaa !5
%cmp18.us = icmp eq i32 %dec.us, 0
%inc20.us = zext i1 %cmp18.us to i32
%spec.select.us = add nsw i32 %k.1101.us, %inc20.us
%indvars.iv.next144 = add nuw nsw i64 %indvars.iv143, 1
%arrayidx13.us.1 = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv151, i64 %indvars.iv.next144
store i32 %spec.select.us, ptr %arrayidx13.us.1, align 4, !tbaa !5
%idxprom14.us.1 = sext i32 %spec.select.us to i64
%arrayidx15.us.1 = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %idxprom14.us.1
%11 = load i32, ptr %arrayidx15.us.1, align 4, !tbaa !5
%dec.us.1 = add nsw i32 %11, -1
store i32 %dec.us.1, ptr %arrayidx15.us.1, align 4, !tbaa !5
%cmp18.us.1 = icmp eq i32 %dec.us.1, 0
%inc20.us.1 = zext i1 %cmp18.us.1 to i32
%spec.select.us.1 = add nsw i32 %spec.select.us, %inc20.us.1
%indvars.iv.next144.1 = add nuw nsw i64 %indvars.iv143, 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.inc44.us.loopexit176.unr-lcssa, label %for.body9.us, !llvm.loop !9
for.inc44.us.loopexit176.unr-lcssa: ; preds = %for.body9.us, %for.body9.us.preheader
%spec.select.us.lcssa.ph = phi i32 [ undef, %for.body9.us.preheader ], [ %spec.select.us.1, %for.body9.us ]
%indvars.iv143.unr = phi i64 [ 1, %for.body9.us.preheader ], [ %indvars.iv.next144.1, %for.body9.us ]
%k.1101.us.unr = phi i32 [ %k.0109.us, %for.body9.us.preheader ], [ %spec.select.us.1, %for.body9.us ]
br i1 %lcmp.mod.not, label %for.inc44.us, label %for.body9.us.epil
for.body9.us.epil: ; preds = %for.inc44.us.loopexit176.unr-lcssa
%arrayidx13.us.epil = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv151, i64 %indvars.iv143.unr
store i32 %k.1101.us.unr, ptr %arrayidx13.us.epil, align 4, !tbaa !5
%idxprom14.us.epil = sext i32 %k.1101.us.unr to i64
%arrayidx15.us.epil = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %idxprom14.us.epil
%12 = load i32, ptr %arrayidx15.us.epil, align 4, !tbaa !5
%dec.us.epil = add nsw i32 %12, -1
store i32 %dec.us.epil, ptr %arrayidx15.us.epil, align 4, !tbaa !5
%cmp18.us.epil = icmp eq i32 %dec.us.epil, 0
%inc20.us.epil = zext i1 %cmp18.us.epil to i32
%spec.select.us.epil = add nsw i32 %k.1101.us.unr, %inc20.us.epil
br label %for.inc44.us
for.inc44.us: ; preds = %for.body9.us.epil, %for.inc44.us.loopexit176.unr-lcssa, %for.body26.us.prol.loopexit, %for.body26.us
%k.5.us = phi i32 [ %spec.select95.us.lcssa.unr, %for.body26.us.prol.loopexit ], [ %spec.select95.us.1, %for.body26.us ], [ %spec.select.us.lcssa.ph, %for.inc44.us.loopexit176.unr-lcssa ], [ %spec.select.us.epil, %for.body9.us.epil ]
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%exitcond155.not = icmp eq i64 %indvars.iv.next152, %wide.trip.count154
br i1 %exitcond155.not, label %for.cond47.preheader, label %for.body5.us, !llvm.loop !11
for.body26.us: ; preds = %for.body26.us.prol.loopexit, %for.body26.us
%indvars.iv148 = phi i64 [ %indvars.iv.next149.1, %for.body26.us ], [ %indvars.iv148.unr, %for.body26.us.prol.loopexit ]
%k.3104.us = phi i32 [ %spec.select95.us.1, %for.body26.us ], [ %k.3104.us.unr, %for.body26.us.prol.loopexit ]
%arrayidx30.us = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv151, i64 %indvars.iv148
store i32 %k.3104.us, ptr %arrayidx30.us, align 4, !tbaa !5
%idxprom31.us = sext i32 %k.3104.us to i64
%arrayidx32.us = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %idxprom31.us
%13 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5
%dec33.us = add nsw i32 %13, -1
store i32 %dec33.us, ptr %arrayidx32.us, align 4, !tbaa !5
%cmp36.us = icmp eq i32 %dec33.us, 0
%inc38.us = zext i1 %cmp36.us to i32
%spec.select95.us = add nsw i32 %k.3104.us, %inc38.us
%indvars.iv.next149 = add nsw i64 %indvars.iv148, -1
%arrayidx30.us.1 = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv151, i64 %indvars.iv.next149
store i32 %spec.select95.us, ptr %arrayidx30.us.1, align 4, !tbaa !5
%idxprom31.us.1 = sext i32 %spec.select95.us to i64
%arrayidx32.us.1 = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %idxprom31.us.1
%14 = load i32, ptr %arrayidx32.us.1, align 4, !tbaa !5
%dec33.us.1 = add nsw i32 %14, -1
store i32 %dec33.us.1, ptr %arrayidx32.us.1, align 4, !tbaa !5
%cmp36.us.1 = icmp eq i32 %dec33.us.1, 0
%inc38.us.1 = zext i1 %cmp36.us.1 to i32
%spec.select95.us.1 = add nsw i32 %spec.select95.us, %inc38.us.1
%indvars.iv.next149.1 = add nsw i64 %indvars.iv148, -2
%cmp25.us.1 = icmp sgt i64 %indvars.iv148, 2
br i1 %cmp25.us.1, label %for.body26.us, label %for.inc44.us, !llvm.loop !12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [10010 x i32], ptr %B, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %16
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.cond47.preheader: ; preds = %for.inc44.us
br i1 %cmp4.not106, label %for.end68, label %for.cond50.preheader.preheader
for.cond50.preheader.preheader: ; preds = %for.body5.lr.ph, %for.cond47.preheader
br label %for.cond50.preheader
for.cond50.preheader: ; preds = %for.cond50.preheader.preheader, %for.end60
%indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.end60 ], [ 1, %for.cond50.preheader.preheader ]
%17 = load i32, ptr %b, align 4, !tbaa !5
%cmp51124 = icmp sgt i32 %17, 1
br i1 %cmp51124, label %for.body52, label %for.cond50.preheader.for.end60_crit_edge
for.cond50.preheader.for.end60_crit_edge: ; preds = %for.cond50.preheader
%.pre = sext i32 %17 to i64
br label %for.end60
for.body52: ; preds = %for.cond50.preheader, %for.body52
%indvars.iv164 = phi i64 [ %indvars.iv.next165, %for.body52 ], [ 1, %for.cond50.preheader ]
%arrayidx56 = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv167, i64 %indvars.iv164
%18 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
%indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
%19 = load i32, ptr %b, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp51 = icmp slt i64 %indvars.iv.next165, %20
br i1 %cmp51, label %for.body52, label %for.end60, !llvm.loop !14
for.end60: ; preds = %for.body52, %for.cond50.preheader.for.end60_crit_edge
%idxprom63.pre-phi = phi i64 [ %.pre, %for.cond50.preheader.for.end60_crit_edge ], [ %20, %for.body52 ]
%arrayidx64 = getelementptr inbounds [110 x [110 x i32]], ptr %A, i64 0, i64 %indvars.iv167, i64 %idxprom63.pre-phi
%21 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %21)
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%22 = load i32, ptr %a, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp48.not.not = icmp slt i64 %indvars.iv167, %23
br i1 %cmp48.not.not, label %for.cond50.preheader, label %for.end68, !llvm.loop !15
for.end68: ; preds = %for.end60, %for.cond3.preheader, %for.cond47.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 40040, ptr nonnull %B) #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
call void @llvm.lifetime.end.p0(i64 48400, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main()
{
int n,a,b=1001,c=0,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a);
if(a<b)
b=a;
if(a>c)
c=a;
}
printf("%d",c-b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228113/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228113/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%c.013 = phi i32 [ %c.1, %for.body ], [ 0, %entry ]
%b.012 = phi i32 [ %spec.select, %for.body ], [ 1001, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %1, i32 %b.012)
%c.1 = call i32 @llvm.smax.i32(i32 %1, i32 %c.013)
%inc = add nuw nsw i32 %i.014, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%3 = sub nsw i32 %c.1, %spec.select
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sub = phi i32 [ -1001, %entry ], [ %3, %for.end.loopexit ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(void){
int n;
int a[101];
int max = 0;
int min = 1000;
scanf("%d", &n);
for(int i = 0; i < n; i++){
scanf("%d", &a[i]);
if(max < a[i]){
max = a[i];
}
if(min > a[i]){
min = a[i];
}
}
printf("%d\n", max - min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228157/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228157/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 404, 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
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = sub nsw i32 %spec.select, %min.1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%sub = phi i32 [ -1000, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%min.026 = phi i32 [ %min.1, %for.body ], [ 1000, %entry ]
%max.025 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %max.025, i32 %2)
%min.1 = call i32 @llvm.smin.i32(i32 %min.026, i32 %2)
%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.cond.cleanup.loopexit, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n,a,max=0,min=1000,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a);
if(a>max)max=a;
if(min>a)min=a;
}
printf("%d",max-min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228207/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228207/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%min.013 = phi i32 [ %min.1, %for.body ], [ 1000, %entry ]
%max.012 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%1 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.012)
%min.1 = call i32 @llvm.smin.i32(i32 %min.013, i32 %1)
%inc = add nuw nsw i32 %i.014, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%3 = sub nsw i32 %spec.select, %min.1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sub = phi i32 [ -1000, %entry ], [ %3, %for.end.loopexit ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int n, i, max = 0, min = 1000;
scanf("%d\n", &n);
for (i=0; i<n; i++) {
int tmp;
scanf("%d", &tmp);
if (tmp > max)
max = tmp;
if (tmp < min)
min = tmp;
}
printf("%d\n", max - min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228250/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228250/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [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
%tmp = 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
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%min.014 = phi i32 [ %min.1, %for.body ], [ 1000, %entry ]
%max.013 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.013)
%min.1 = call i32 @llvm.smin.i32(i32 %1, i32 %min.014)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #4
%inc = add nuw nsw i32 %i.012, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%3 = sub nsw i32 %spec.select, %min.1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sub = phi i32 [ -1000, %entry ], [ %3, %for.end.loopexit ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int kosuu;
int saidai;
int saisyou;
int ie[1001];
int a; /*くりかえし*/
scanf("%d",&kosuu);
for(a = 0;a < kosuu;++a){
scanf("%d",&ie[a]);
}
saidai = 0;
saisyou = 1000;
for(a = 0;a < kosuu;++a){
if(saidai < ie[a]){
saidai = ie[a];
}
if(saisyou > ie[a]){
saisyou = ie[a];
}
}
printf("%d\n",saidai - saisyou);
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228300/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228300/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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:
%kosuu = alloca i32, align 4
%ie = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kosuu) #4
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %ie) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %kosuu)
%0 = load i32, ptr %kosuu, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %0, 0
br i1 %cmp32, label %for.body, label %for.end19
for.cond2.preheader: ; preds = %for.body
%cmp334 = icmp sgt i32 %10, 0
br i1 %cmp334, label %for.body4.preheader, label %for.end19
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %10 to i64
%min.iters.check = icmp ult i32 %10, 8
br i1 %min.iters.check, label %for.body4.preheader53, label %vector.ph
vector.ph: ; preds = %for.body4.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> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %5, %vector.body ]
%vec.phi47 = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %6, %vector.body ]
%vec.phi48 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi49 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [1001 x i32], ptr %ie, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
%wide.load50 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi48, <4 x i32> %wide.load)
%4 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi49, <4 x i32> %wide.load50)
%5 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%6 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi47, <4 x i32> %wide.load50)
%index.next = add nuw i64 %index, 8
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax51 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %3, <4 x i32> %4)
%8 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax51)
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %5, <4 x i32> %6)
%9 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end19.loopexit, label %for.body4.preheader53
for.body4.preheader53: ; preds = %for.body4.preheader, %middle.block
%indvars.iv42.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
%saisyou.036.ph = phi i32 [ 1000, %for.body4.preheader ], [ %9, %middle.block ]
%saidai.035.ph = phi i32 [ 0, %for.body4.preheader ], [ %8, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %ie, 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
%10 = load i32, ptr %kosuu, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader53, %for.body4
%indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body4 ], [ %indvars.iv42.ph, %for.body4.preheader53 ]
%saisyou.036 = phi i32 [ %saisyou.1, %for.body4 ], [ %saisyou.036.ph, %for.body4.preheader53 ]
%saidai.035 = phi i32 [ %spec.select, %for.body4 ], [ %saidai.035.ph, %for.body4.preheader53 ]
%arrayidx6 = getelementptr inbounds [1001 x i32], ptr %ie, i64 0, i64 %indvars.iv42
%12 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %saidai.035, i32 %12)
%saisyou.1 = call i32 @llvm.smin.i32(i32 %saisyou.036, i32 %12)
%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.end19.loopexit, label %for.body4, !llvm.loop !14
for.end19.loopexit: ; preds = %for.body4, %middle.block
%spec.select.lcssa = phi i32 [ %8, %middle.block ], [ %spec.select, %for.body4 ]
%saisyou.1.lcssa = phi i32 [ %9, %middle.block ], [ %saisyou.1, %for.body4 ]
%13 = sub nsw i32 %spec.select.lcssa, %saisyou.1.lcssa
br label %for.end19
for.end19: ; preds = %entry, %for.end19.loopexit, %for.cond2.preheader
%sub = phi i32 [ -1000, %for.cond2.preheader ], [ %13, %for.end19.loopexit ], [ -1000, %entry ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %ie) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kosuu) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(void){
int a;
scanf("%d", &a);
if(a < 105){
printf("0\n");
}else if(a < 135){
printf("1\n");
}else if(a < 165){
printf("2\n");
}else if(a < 189){
printf("3\n");
}else if(a < 195){
printf("4\n");
}else{
printf("5\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228351/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228351/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [2 x i8] c"5\00", align 1
@str.7 = private unnamed_addr constant [2 x i8] c"4\00", align 1
@str.8 = private unnamed_addr constant [2 x i8] c"3\00", align 1
@str.9 = private unnamed_addr constant [2 x i8] c"2\00", align 1
@str.10 = private unnamed_addr constant [2 x i8] c"1\00", align 1
@str.11 = 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:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 105
br i1 %cmp, label %if.end22, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp ult i32 %0, 135
br i1 %cmp2, label %if.end22, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = icmp ult i32 %0, 165
br i1 %cmp6, label %if.end22, label %if.else9
if.else9: ; preds = %if.else5
%cmp10 = icmp ult i32 %0, 189
br i1 %cmp10, label %if.end22, label %if.else13
if.else13: ; preds = %if.else9
%cmp14 = icmp ult i32 %0, 195
%str.7.str = select i1 %cmp14, ptr @str.7, ptr @str
br label %if.end22
if.end22: ; preds = %if.else13, %if.else9, %if.else5, %if.else, %entry
%str.10.sink = phi ptr [ @str.11, %entry ], [ @str.10, %if.else ], [ @str.9, %if.else5 ], [ @str.8, %if.else9 ], [ %str.7.str, %if.else13 ]
%puts26 = call i32 @puts(ptr nonnull dereferenceable(1) %str.10.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!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 div(int n)
{
int i,c=0;
for(i=1;i<=n/2;++i)
{
if(n%i==0)
c++;
}
c+=1;
if(c==8)
return 1;
else
return 0;
}
int main()
{
int n;
scanf("%d",&n);
if(n<105)
printf("0");
else if(n==105)
printf("1");
else
{
int i,cnt=0;
for(i=106;i<=n;++i)
{
if(i%2!=0)
{
if(div(i)==1)
cnt++;
}
}
printf("%d",cnt+1);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228395/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228395/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @div(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not11 = icmp slt i32 %n, 2
br i1 %cmp.not11, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%div1415 = lshr i32 %n, 1
%0 = icmp eq i32 %div1415, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %div1415, 2147483646
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%c.013 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%i.012 = phi i32 [ 1, %for.body.preheader.new ], [ %inc2.1, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%rem = srem i32 %n, %i.012
%cmp1 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %c.013, %inc
%inc2 = add nuw nsw i32 %i.012, 1
%rem.1 = srem i32 %n, %inc2
%cmp1.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc2.1 = add nuw nsw i32 %i.012, 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 !5
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.1, %for.body ]
%c.013.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ]
%i.012.unr = phi i32 [ 1, %for.body.preheader ], [ %inc2.1, %for.body ]
%1 = and i32 %n, 2
%lcmp.mod.not = icmp eq i32 %1, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%rem.epil = srem i32 %n, %i.012.unr
%cmp1.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp1.epil to i32
%spec.select.epil = add nuw nsw i32 %c.013.unr, %inc.epil
br label %for.end.loopexit
for.end.loopexit: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%2 = icmp eq i32 %spec.select.lcssa, 7
%3 = zext i1 %2 to i32
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%c.0.lcssa = phi i32 [ 0, %entry ], [ %3, %for.end.loopexit ]
ret i32 %c.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%cmp = icmp slt i32 %0, 105
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%putchar21 = call i32 @putchar(i32 48)
br label %if.end16
if.else: ; preds = %entry
%cmp2 = icmp eq i32 %0, 105
br i1 %cmp2, label %if.then3, label %for.body
if.then3: ; preds = %if.else
%putchar = call i32 @putchar(i32 49)
br label %if.end16
for.body: ; preds = %if.else, %for.inc
%cnt.029 = phi i32 [ %cnt.1, %for.inc ], [ 0, %if.else ]
%i.027 = phi i32 [ %inc13, %for.inc ], [ 106, %if.else ]
%1 = lshr i32 %i.027, 1
%rem = and i32 %i.027, 1
%cmp7.not = icmp eq i32 %rem, 0
br i1 %cmp7.not, label %for.inc, label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body
%2 = icmp eq i32 %1, 1
br i1 %2, label %div.exit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i32 %1, 2147483646
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%c.013.i = phi i32 [ 0, %for.body.preheader.i.new ], [ %spec.select.i.1, %for.body.i ]
%i.012.i = phi i32 [ 1, %for.body.preheader.i.new ], [ %inc2.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ]
%rem.i = urem i32 %i.027, %i.012.i
%rem.i.fr = freeze i32 %rem.i
%cmp1.i = icmp eq i32 %rem.i.fr, 0
%inc.i = zext i1 %cmp1.i to i32
%spec.select.i = add i32 %c.013.i, %inc.i
%inc2.i = add nuw nsw i32 %i.012.i, 1
%rem.i.1 = urem i32 %i.027, %inc2.i
%rem.i.fr.1 = freeze i32 %rem.i.1
%cmp1.i.1 = icmp eq i32 %rem.i.fr.1, 0
%inc.i.1 = zext i1 %cmp1.i.1 to i32
%spec.select.i.1 = add i32 %spec.select.i, %inc.i.1
%inc2.i.1 = add nuw nsw i32 %i.012.i, 2
%niter.next.1 = add nuw nsw i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %div.exit.unr-lcssa, label %for.body.i, !llvm.loop !5
div.exit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%spec.select.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %spec.select.i.1, %for.body.i ]
%c.013.i.unr = phi i32 [ 0, %for.body.preheader.i ], [ %spec.select.i.1, %for.body.i ]
%i.012.i.unr = phi i32 [ 1, %for.body.preheader.i ], [ %inc2.i.1, %for.body.i ]
%3 = and i32 %i.027, 2
%lcmp.mod.not = icmp eq i32 %3, 0
br i1 %lcmp.mod.not, label %div.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %div.exit.unr-lcssa
%rem.i.epil = urem i32 %i.027, %i.012.i.unr
%rem.i.fr.epil = freeze i32 %rem.i.epil
%cmp1.i.epil = icmp eq i32 %rem.i.fr.epil, 0
%inc.i.epil = zext i1 %cmp1.i.epil to i32
%spec.select.i.epil = add i32 %c.013.i.unr, %inc.i.epil
br label %div.exit
div.exit: ; preds = %div.exit.unr-lcssa, %for.body.i.epil
%spec.select.i.lcssa = phi i32 [ %spec.select.i.lcssa.ph, %div.exit.unr-lcssa ], [ %spec.select.i.epil, %for.body.i.epil ]
%.not = icmp eq i32 %spec.select.i.lcssa, 7
%inc = zext i1 %.not to i32
%spec.select = add nsw i32 %cnt.029, %inc
br label %for.inc
for.inc: ; preds = %div.exit, %for.body
%cnt.1 = phi i32 [ %cnt.029, %for.body ], [ %spec.select, %div.exit ]
%inc13 = add nuw i32 %i.027, 1
%exitcond.not = icmp eq i32 %i.027, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.inc
%4 = add nsw i32 %cnt.1, 1
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
br label %if.end16
if.end16: ; preds = %if.then3, %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
int main() {
int N, i, count, ans = 0, j;
scanf("%d", &N);
for (i = 105; i <= N; i += 2) {
count = 0;
for (j = 1; j <= i; j++) {
if (i % j == 0) {
count++;
}
}
if (count == 8) {
ans++;
}
}
printf("%d", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228438/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228438/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not23 = icmp slt i32 %0, 105
br i1 %cmp.not23, label %for.end11, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.body3.epil
%indvar = phi i32 [ %indvar.next, %for.body3.epil ], [ 0, %entry ]
%ans.025 = phi i32 [ %spec.select20, %for.body3.epil ], [ 0, %entry ]
%i.024 = phi i32 [ %add, %for.body3.epil ], [ 105, %entry ]
%1 = shl nuw nsw i32 %indvar, 1
%2 = add nuw i32 %1, 102
br label %for.body3
for.body3: ; preds = %for.body3, %for.cond1.preheader
%j.022 = phi i32 [ 1, %for.cond1.preheader ], [ %inc5.1, %for.body3 ]
%count.021 = phi i32 [ 0, %for.cond1.preheader ], [ %spec.select.1, %for.body3 ]
%niter = phi i32 [ 0, %for.cond1.preheader ], [ %niter.next.1, %for.body3 ]
%rem = urem i32 %i.024, %j.022
%cmp4 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp4 to i32
%spec.select = add nuw nsw i32 %count.021, %inc
%inc5 = add nuw nsw i32 %j.022, 1
%rem.1 = urem i32 %i.024, %inc5
%cmp4.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp4.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc5.1 = add nuw nsw i32 %j.022, 2
%niter.next.1 = add nuw nsw i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter, %2
br i1 %niter.ncmp.1, label %for.body3.epil, label %for.body3, !llvm.loop !9
for.body3.epil: ; preds = %for.body3
%rem.epil = urem i32 %i.024, %inc5.1
%cmp4.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp4.epil to i32
%spec.select.epil = add nuw nsw i32 %spec.select.1, %inc.epil
%cmp6 = icmp eq i32 %spec.select.epil, 8
%inc8 = zext i1 %cmp6 to i32
%spec.select20 = add nuw nsw i32 %ans.025, %inc8
%add = add nuw nsw i32 %i.024, 2
%cmp.not = icmp sgt i32 %add, %0
%indvar.next = add i32 %indvar, 1
br i1 %cmp.not, label %for.end11, label %for.cond1.preheader, !llvm.loop !11
for.end11: ; preds = %for.body3.epil, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select20, %for.body3.epil ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int N, ans;
scanf("%d", &N);
if(N < 105){
ans = 0;
} else if(N < 135){
ans = 1;
} else if(N < 165){
ans = 2;
} else if(N < 189){
ans = 3;
} else if(N < 195){
ans = 4;
} else {
ans = 5;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228481/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228481/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 105
br i1 %cmp, label %if.end16, label %if.else
if.else: ; preds = %entry
%cmp1 = icmp ult i32 %0, 135
br i1 %cmp1, label %if.end16, label %if.else3
if.else3: ; preds = %if.else
%cmp4 = icmp ult i32 %0, 165
br i1 %cmp4, label %if.end16, label %if.else6
if.else6: ; preds = %if.else3
%cmp7 = icmp ult i32 %0, 189
br i1 %cmp7, label %if.end16, label %if.else9
if.else9: ; preds = %if.else6
%cmp10 = icmp ult i32 %0, 195
%. = select i1 %cmp10, i32 4, i32 5
br label %if.end16
if.end16: ; preds = %if.else9, %if.else6, %if.else3, %if.else, %entry
%ans.0 = phi i32 [ 0, %entry ], [ 1, %if.else ], [ 2, %if.else3 ], [ 3, %if.else6 ], [ %., %if.else9 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,j,c=0;
int a[]={105,135,165,189,195};
scanf("%d",&n);
if(n<105)
{
printf("%d",c);
}
else
{
for(i=105;i<=n;i++)
{
for(j=0;j<5;j++)
{
if(i==a[j])
{
c++;
break;
}
}
}
printf("%d",c);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228524/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228524/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 105
br i1 %cmp, label %if.end13, label %for.inc9.peel
for.inc9.peel: ; preds = %entry
%exitcond.peel.not = icmp eq i32 %0, 105
br i1 %exitcond.peel.not, label %if.end13, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.inc9.peel
%1 = add i32 %0, -105
%2 = add i32 %0, -106
%xtraiter = and i32 %1, 3
%3 = icmp ult i32 %2, 3
br i1 %3, label %if.end13.loopexit.unr-lcssa, label %for.cond3.preheader.new
for.cond3.preheader.new: ; preds = %for.cond3.preheader
%unroll_iter = and i32 %1, -4
br label %for.cond3
for.cond3: ; preds = %for.inc9.3, %for.cond3.preheader.new
%c.022 = phi i32 [ 1, %for.cond3.preheader.new ], [ %c.1.3, %for.inc9.3 ]
%i.021 = phi i32 [ 106, %for.cond3.preheader.new ], [ %inc10.3, %for.inc9.3 ]
%niter = phi i32 [ 0, %for.cond3.preheader.new ], [ %niter.next.3, %for.inc9.3 ]
%inc10 = or i32 %i.021, 1
switch i32 %inc10, label %for.inc9.1 [
i32 135, label %if.then7.1
i32 165, label %if.then7.1
i32 189, label %if.then7.1
i32 195, label %if.then7.1
]
if.then7.1: ; preds = %for.cond3, %for.cond3, %for.cond3, %for.cond3
%inc.1 = add nsw i32 %c.022, 1
br label %for.inc9.1
for.inc9.1: ; preds = %if.then7.1, %for.cond3
%c.1.1 = phi i32 [ %inc.1, %if.then7.1 ], [ %c.022, %for.cond3 ]
switch i32 %i.021, label %for.inc9.3 [
i32 132, label %if.then7.3
i32 162, label %if.then7.3
i32 186, label %if.then7.3
i32 192, label %if.then7.3
]
if.then7.3: ; preds = %for.inc9.1, %for.inc9.1, %for.inc9.1, %for.inc9.1
%inc.3 = add nsw i32 %c.1.1, 1
br label %for.inc9.3
for.inc9.3: ; preds = %if.then7.3, %for.inc9.1
%c.1.3 = phi i32 [ %inc.3, %if.then7.3 ], [ %c.1.1, %for.inc9.1 ]
%inc10.3 = add nuw i32 %i.021, 4
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %if.end13.loopexit.unr-lcssa, label %for.cond3, !llvm.loop !9
if.end13.loopexit.unr-lcssa: ; preds = %for.inc9.3, %for.cond3.preheader
%c.1.lcssa.ph = phi i32 [ undef, %for.cond3.preheader ], [ %c.1.3, %for.inc9.3 ]
%c.022.unr = phi i32 [ 1, %for.cond3.preheader ], [ %c.1.3, %for.inc9.3 ]
%i.021.unr = phi i32 [ 106, %for.cond3.preheader ], [ %inc10.3, %for.inc9.3 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end13, label %for.cond3.epil
for.cond3.epil: ; preds = %if.end13.loopexit.unr-lcssa, %for.inc9.epil
%c.022.epil = phi i32 [ %c.1.epil, %for.inc9.epil ], [ %c.022.unr, %if.end13.loopexit.unr-lcssa ]
%i.021.epil = phi i32 [ %inc10.epil, %for.inc9.epil ], [ %i.021.unr, %if.end13.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.inc9.epil ], [ 0, %if.end13.loopexit.unr-lcssa ]
switch i32 %i.021.epil, label %for.inc9.epil [
i32 135, label %if.then7.epil
i32 165, label %if.then7.epil
i32 189, label %if.then7.epil
i32 195, label %if.then7.epil
]
if.then7.epil: ; preds = %for.cond3.epil, %for.cond3.epil, %for.cond3.epil, %for.cond3.epil
%inc.epil = add nsw i32 %c.022.epil, 1
br label %for.inc9.epil
for.inc9.epil: ; preds = %if.then7.epil, %for.cond3.epil
%c.1.epil = phi i32 [ %inc.epil, %if.then7.epil ], [ %c.022.epil, %for.cond3.epil ]
%inc10.epil = add nuw i32 %i.021.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %if.end13, label %for.cond3.epil, !llvm.loop !12
if.end13: ; preds = %if.end13.loopexit.unr-lcssa, %for.inc9.epil, %for.inc9.peel, %entry
%c.1.lcssa.sink = phi i32 [ 0, %entry ], [ 1, %for.inc9.peel ], [ %c.1.lcssa.ph, %if.end13.loopexit.unr-lcssa ], [ %c.1.epil, %for.inc9.epil ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %c.1.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main(){
int N;
scanf("%d",&N);
int i,j;
int ans=0;
for(i=1;i<=N;i++){
int cnt=0;
if(i%2==1){
for(j=1;j<=i;j++){
if(i%j==0){cnt++;}
}
}
if(cnt==8){ans++;}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228568/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228568/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not35 = icmp slt i32 %0, 1
br i1 %cmp.not35, label %for.end16, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%smax = call i32 @llvm.smax.i32(i32 %1, i32 2)
br label %for.body
for.body: ; preds = %for.body.preheader, %if.end9.thread
%indvar = phi i32 [ 0, %for.body.preheader ], [ %indvar.next, %if.end9.thread ]
%indvars.iv = phi i32 [ 2, %for.body.preheader ], [ %indvars.iv.next, %if.end9.thread ]
%ans.038 = phi i32 [ 0, %for.body.preheader ], [ %3, %if.end9.thread ]
%i.036 = phi i32 [ 1, %for.body.preheader ], [ %inc15, %if.end9.thread ]
%rem = and i32 %i.036, 1
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %if.end9.thread, label %for.body4.preheader
for.body4.preheader: ; preds = %for.body
%xtraiter = and i32 %i.036, 1
%2 = icmp eq i32 %indvar, 0
br i1 %2, label %if.end9.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i32 %i.036, 2147483646
br label %for.body4
for.body4: ; preds = %for.body4, %for.body4.preheader.new
%cnt.034 = phi i32 [ 0, %for.body4.preheader.new ], [ %spec.select.1, %for.body4 ]
%j.033 = phi i32 [ 1, %for.body4.preheader.new ], [ %inc8.1, %for.body4 ]
%niter = phi i32 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.body4 ]
%rem5 = urem i32 %i.036, %j.033
%cmp6 = icmp eq i32 %rem5, 0
%inc = zext i1 %cmp6 to i32
%spec.select = add i32 %cnt.034, %inc
%inc8 = add nuw nsw i32 %j.033, 1
%rem5.1 = urem i32 %i.036, %inc8
%cmp6.1 = icmp eq i32 %rem5.1, 0
%inc.1 = zext i1 %cmp6.1 to i32
%spec.select.1 = add i32 %spec.select, %inc.1
%inc8.1 = add nuw nsw i32 %j.033, 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 %if.end9.unr-lcssa, label %for.body4, !llvm.loop !9
if.end9.unr-lcssa: ; preds = %for.body4, %for.body4.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body4.preheader ], [ %spec.select.1, %for.body4 ]
%cnt.034.unr = phi i32 [ 0, %for.body4.preheader ], [ %spec.select.1, %for.body4 ]
%j.033.unr = phi i32 [ 1, %for.body4.preheader ], [ %inc8.1, %for.body4 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end9, label %for.body4.epil
for.body4.epil: ; preds = %if.end9.unr-lcssa
%rem5.epil = urem i32 %i.036, %j.033.unr
%cmp6.epil = icmp eq i32 %rem5.epil, 0
%inc.epil = zext i1 %cmp6.epil to i32
%spec.select.epil = add i32 %cnt.034.unr, %inc.epil
br label %if.end9
if.end9: ; preds = %if.end9.unr-lcssa, %for.body4.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %if.end9.unr-lcssa ], [ %spec.select.epil, %for.body4.epil ]
%cmp10 = icmp eq i32 %spec.select.lcssa, 8
%inc12 = zext i1 %cmp10 to i32
%spec.select31 = add nsw i32 %ans.038, %inc12
br label %if.end9.thread
if.end9.thread: ; preds = %if.end9, %for.body
%3 = phi i32 [ %ans.038, %for.body ], [ %spec.select31, %if.end9 ]
%inc15 = add nuw nsw i32 %i.036, 1
%indvars.iv.next = add nuw i32 %indvars.iv, 1
%exitcond40 = icmp eq i32 %indvars.iv, %smax
%indvar.next = add i32 %indvar, 1
br i1 %exitcond40, label %for.end16, label %for.body, !llvm.loop !11
for.end16: ; preds = %if.end9.thread, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %3, %if.end9.thread ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
#define MAX 200
int main(int argc, const char * argv[]) {
int N = 0;
scanf("%d", &N);
int list[MAX + 10];
int sosu[MAX];
for(int i = 0; i <= MAX; i++){
list[i] = 0;
}
int count = 0;
int index = 2;
while(1){
if(index >= sqrt(MAX)){
for(int i = index; i <= MAX; i++){
if(list[index] == 0){
sosu[count] = index;
count++;
}
}
break;
}
if(list[index] == 0){
sosu[count] = index;
count++;
for(int i = index, p = 1; i <= MAX; p++, i = index * p){
list[i] = 1;
}
}
index++;
}
int result = 0;
if(N < 105){
printf("0\n");
}else{
for(int i = 105; i <= N; i += 2){
int num[count];
for(int p = 0; p < count; p++){
num[p] = 0;
}
int n = i;
for(int p = 0; p < count;){
if(n % sosu[p] == 0){
n /= sosu[p];
num[p]++;
}else if(n == 1){
break;
}else{
p++;
}
}
int re = 1;
for(int p = 0; p < count; p++){
if(num[p] >= 1){
re *= (num[p] + 1);
}
}
if(re == 8){
result++;
}
}
printf("%d\n", result);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228618/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228618/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\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 {
for.body35.preheader:
%N = alloca i32, align 4
%list = alloca [210 x i32], align 16
%sosu = alloca [200 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7
store i32 0, ptr %N, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
call void @llvm.lifetime.start.p0(i64 840, ptr nonnull %list) #7
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %sosu) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(804) %list, i8 0, i64 804, i1 false), !tbaa !5
store i32 2, ptr %sosu, align 16, !tbaa !5
br label %for.body35
for.body9.lr.ph: ; preds = %if.end41.11, %for.body35.preheader.12
%count.3.12 = phi i32 [ %count.3.11, %if.end41.11 ], [ %inc29.12, %for.body35.preheader.12 ]
%arrayidx11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 15
%0 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %0, 0
br i1 %cmp12, label %for.body9.us.preheader, label %for.cond.cleanup8
for.body9.us.preheader: ; preds = %for.body9.lr.ph
%1 = zext i32 %count.3.12 to i64
%ind.end = add nuw nsw i64 %1, 184
%2 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %1
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %3, align 4, !tbaa !5
%offset.idx.1 = add nuw nsw i64 %1, 8
%4 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.1
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %4, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %5, align 4, !tbaa !5
%offset.idx.2 = add nuw nsw i64 %1, 16
%6 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.2
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %7, align 4, !tbaa !5
%offset.idx.3 = add nuw nsw i64 %1, 24
%8 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.3
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %9, align 4, !tbaa !5
%offset.idx.4 = add nuw nsw i64 %1, 32
%10 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %10, align 4, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %11, align 4, !tbaa !5
%offset.idx.5 = add nuw nsw i64 %1, 40
%12 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.5
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %12, align 4, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %13, align 4, !tbaa !5
%offset.idx.6 = add nuw nsw i64 %1, 48
%14 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.6
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %14, align 4, !tbaa !5
%15 = getelementptr inbounds i32, ptr %14, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %15, align 4, !tbaa !5
%offset.idx.7 = add nuw nsw i64 %1, 56
%16 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.7
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %16, align 4, !tbaa !5
%17 = getelementptr inbounds i32, ptr %16, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %17, align 4, !tbaa !5
%offset.idx.8 = add nuw nsw i64 %1, 64
%18 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.8
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %19, align 4, !tbaa !5
%offset.idx.9 = add nuw nsw i64 %1, 72
%20 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.9
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %20, align 4, !tbaa !5
%21 = getelementptr inbounds i32, ptr %20, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %21, align 4, !tbaa !5
%offset.idx.10 = add nuw nsw i64 %1, 80
%22 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.10
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %22, align 4, !tbaa !5
%23 = getelementptr inbounds i32, ptr %22, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %23, align 4, !tbaa !5
%offset.idx.11 = add nuw nsw i64 %1, 88
%24 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.11
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %24, align 4, !tbaa !5
%25 = getelementptr inbounds i32, ptr %24, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %25, align 4, !tbaa !5
%offset.idx.12 = add nuw nsw i64 %1, 96
%26 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.12
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %26, align 4, !tbaa !5
%27 = getelementptr inbounds i32, ptr %26, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %27, align 4, !tbaa !5
%offset.idx.13 = add nuw nsw i64 %1, 104
%28 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.13
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %28, align 4, !tbaa !5
%29 = getelementptr inbounds i32, ptr %28, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %29, align 4, !tbaa !5
%offset.idx.14 = add nuw nsw i64 %1, 112
%30 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.14
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %30, align 4, !tbaa !5
%31 = getelementptr inbounds i32, ptr %30, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %31, align 4, !tbaa !5
%offset.idx.15 = add nuw nsw i64 %1, 120
%32 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.15
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %32, align 4, !tbaa !5
%33 = getelementptr inbounds i32, ptr %32, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %33, align 4, !tbaa !5
%offset.idx.16 = add nuw nsw i64 %1, 128
%34 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.16
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %34, align 4, !tbaa !5
%35 = getelementptr inbounds i32, ptr %34, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %35, align 4, !tbaa !5
%offset.idx.17 = add nuw nsw i64 %1, 136
%36 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.17
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %36, align 4, !tbaa !5
%37 = getelementptr inbounds i32, ptr %36, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %37, align 4, !tbaa !5
%offset.idx.18 = add nuw nsw i64 %1, 144
%38 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.18
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %38, align 4, !tbaa !5
%39 = getelementptr inbounds i32, ptr %38, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %39, align 4, !tbaa !5
%offset.idx.19 = add nuw nsw i64 %1, 152
%40 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.19
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %40, align 4, !tbaa !5
%41 = getelementptr inbounds i32, ptr %40, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %41, align 4, !tbaa !5
%offset.idx.20 = add nuw nsw i64 %1, 160
%42 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.20
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %42, align 4, !tbaa !5
%43 = getelementptr inbounds i32, ptr %42, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %43, align 4, !tbaa !5
%offset.idx.21 = add nuw nsw i64 %1, 168
%44 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.21
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %44, align 4, !tbaa !5
%45 = getelementptr inbounds i32, ptr %44, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %45, align 4, !tbaa !5
%offset.idx.22 = add nuw nsw i64 %1, 176
%46 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %offset.idx.22
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %46, align 4, !tbaa !5
%47 = getelementptr inbounds i32, ptr %46, i64 4
store <4 x i32> <i32 15, i32 15, i32 15, i32 15>, ptr %47, align 4, !tbaa !5
%arrayidx16.us = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %ind.end
store i32 15, ptr %arrayidx16.us, align 4, !tbaa !5
%indvars.iv.next195 = add nuw nsw i64 %1, 185
%arrayidx16.us.1 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %indvars.iv.next195
store i32 15, ptr %arrayidx16.us.1, align 4, !tbaa !5
%indvars.iv.next195.1 = add i32 %count.3.12, 186
br label %for.cond.cleanup8
for.cond.cleanup8: ; preds = %for.body9.lr.ph, %for.body9.us.preheader
%count.1.lcssa = phi i32 [ %indvars.iv.next195.1, %for.body9.us.preheader ], [ %count.3.12, %for.body9.lr.ph ]
%48 = load i32, ptr %N, align 4, !tbaa !5
%cmp43 = icmp slt i32 %48, 105
br i1 %cmp43, label %if.then45, label %for.body52.lr.ph
for.body52.lr.ph: ; preds = %for.cond.cleanup8
%49 = zext i32 %count.1.lcssa to i64
%cmp55170 = icmp sgt i32 %count.1.lcssa, 0
%50 = shl nuw nsw i64 %49, 2
%min.iters.check = icmp ult i32 %count.1.lcssa, 8
%n.vec = and i64 %49, 4294967288
%cmp.n = icmp eq i64 %n.vec, %49
br label %for.body52
for.body35: ; preds = %for.body35, %for.body35.preheader
%indvars.iv188 = phi i64 [ 2, %for.body35.preheader ], [ %indvars.iv.next189.4, %for.body35 ]
%indvars.iv = phi i64 [ 1, %for.body35.preheader ], [ %indvars.iv.next.4, %for.body35 ]
%arrayidx37 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 %indvars.iv188
store i32 1, ptr %arrayidx37, align 8, !tbaa !5
%indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 2
%arrayidx37.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 %indvars.iv.next189
store i32 1, ptr %arrayidx37.1, align 8, !tbaa !5
%indvars.iv.next189.1 = add nuw nsw i64 %indvars.iv188, 4
%arrayidx37.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 %indvars.iv.next189.1
store i32 1, ptr %arrayidx37.2, align 8, !tbaa !5
%indvars.iv.next189.2 = add nuw nsw i64 %indvars.iv188, 6
%arrayidx37.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 %indvars.iv.next189.2
store i32 1, ptr %arrayidx37.3, align 8, !tbaa !5
%indvars.iv.next189.3 = add nuw nsw i64 %indvars.iv188, 8
%arrayidx37.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 %indvars.iv.next189.3
store i32 1, ptr %arrayidx37.4, align 8, !tbaa !5
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
%indvars.iv.next189.4 = add nuw nsw i64 %indvars.iv188, 10
%exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 101
br i1 %exitcond.not.4, label %if.end41, label %for.body35, !llvm.loop !9
if.end41: ; preds = %for.body35
%arrayidx23.1.phi.trans.insert = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 3
%.pre = load i32, ptr %arrayidx23.1.phi.trans.insert, align 4, !tbaa !5
%cmp24.1 = icmp eq i32 %.pre, 0
br i1 %cmp24.1, label %for.body35.preheader.1, label %if.end41.1
for.body35.preheader.1: ; preds = %if.end41
%arrayidx23.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 3
%arrayidx28.1 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 1
store i32 3, ptr %arrayidx28.1, align 4, !tbaa !5
store i32 1, ptr %arrayidx23.1, align 4, !tbaa !5
%arrayidx37.1.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 6
store i32 1, ptr %arrayidx37.1.1, align 8, !tbaa !5
%arrayidx37.1.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 9
store i32 1, ptr %arrayidx37.1.2, align 4, !tbaa !5
%arrayidx37.1.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 12
store i32 1, ptr %arrayidx37.1.3, align 16, !tbaa !5
%arrayidx37.1.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 15
store i32 1, ptr %arrayidx37.1.4, align 4, !tbaa !5
%arrayidx37.1.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 18
store i32 1, ptr %arrayidx37.1.5, align 8, !tbaa !5
%arrayidx37.1.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 21
store i32 1, ptr %arrayidx37.1.6, align 4, !tbaa !5
%arrayidx37.1.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 24
store i32 1, ptr %arrayidx37.1.7, align 16, !tbaa !5
%arrayidx37.1.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 27
store i32 1, ptr %arrayidx37.1.8, align 4, !tbaa !5
%arrayidx37.1.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 30
store i32 1, ptr %arrayidx37.1.9, align 8, !tbaa !5
%arrayidx37.1.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 33
store i32 1, ptr %arrayidx37.1.10, align 4, !tbaa !5
%arrayidx37.1.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 36
store i32 1, ptr %arrayidx37.1.11, align 16, !tbaa !5
%arrayidx37.1.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 39
store i32 1, ptr %arrayidx37.1.12, align 4, !tbaa !5
%arrayidx37.1.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 42
store i32 1, ptr %arrayidx37.1.13, align 8, !tbaa !5
%arrayidx37.1.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 45
store i32 1, ptr %arrayidx37.1.14, align 4, !tbaa !5
%arrayidx37.1.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 48
store i32 1, ptr %arrayidx37.1.15, align 16, !tbaa !5
%arrayidx37.1.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 51
store i32 1, ptr %arrayidx37.1.16, align 4, !tbaa !5
%arrayidx37.1.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 54
store i32 1, ptr %arrayidx37.1.17, align 8, !tbaa !5
%arrayidx37.1.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 57
store i32 1, ptr %arrayidx37.1.18, align 4, !tbaa !5
%arrayidx37.1.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 60
store i32 1, ptr %arrayidx37.1.19, align 16, !tbaa !5
%arrayidx37.1.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 63
store i32 1, ptr %arrayidx37.1.20, align 4, !tbaa !5
%arrayidx37.1.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 66
store i32 1, ptr %arrayidx37.1.21, align 8, !tbaa !5
%arrayidx37.1.22 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 69
store i32 1, ptr %arrayidx37.1.22, align 4, !tbaa !5
%arrayidx37.1.23 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 72
store i32 1, ptr %arrayidx37.1.23, align 16, !tbaa !5
%arrayidx37.1.24 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 75
store i32 1, ptr %arrayidx37.1.24, align 4, !tbaa !5
%arrayidx37.1.25 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 78
store i32 1, ptr %arrayidx37.1.25, align 8, !tbaa !5
%arrayidx37.1.26 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 81
store i32 1, ptr %arrayidx37.1.26, align 4, !tbaa !5
%arrayidx37.1.27 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 84
store i32 1, ptr %arrayidx37.1.27, align 16, !tbaa !5
%arrayidx37.1.28 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 87
store i32 1, ptr %arrayidx37.1.28, align 4, !tbaa !5
%arrayidx37.1.29 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 90
store i32 1, ptr %arrayidx37.1.29, align 8, !tbaa !5
%arrayidx37.1.30 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 93
store i32 1, ptr %arrayidx37.1.30, align 4, !tbaa !5
%arrayidx37.1.31 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 96
store i32 1, ptr %arrayidx37.1.31, align 16, !tbaa !5
%arrayidx37.1.32 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 99
store i32 1, ptr %arrayidx37.1.32, align 4, !tbaa !5
%arrayidx37.1.33 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 102
store i32 1, ptr %arrayidx37.1.33, align 8, !tbaa !5
%arrayidx37.1.34 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 105
store i32 1, ptr %arrayidx37.1.34, align 4, !tbaa !5
%arrayidx37.1.35 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 108
store i32 1, ptr %arrayidx37.1.35, align 16, !tbaa !5
%arrayidx37.1.36 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 111
store i32 1, ptr %arrayidx37.1.36, align 4, !tbaa !5
%arrayidx37.1.37 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 114
store i32 1, ptr %arrayidx37.1.37, align 8, !tbaa !5
%arrayidx37.1.38 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 117
store i32 1, ptr %arrayidx37.1.38, align 4, !tbaa !5
%arrayidx37.1.39 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.1.39, align 16, !tbaa !5
%arrayidx37.1.40 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 123
store i32 1, ptr %arrayidx37.1.40, align 4, !tbaa !5
%arrayidx37.1.41 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 126
store i32 1, ptr %arrayidx37.1.41, align 8, !tbaa !5
%arrayidx37.1.42 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 129
store i32 1, ptr %arrayidx37.1.42, align 4, !tbaa !5
%arrayidx37.1.43 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 132
store i32 1, ptr %arrayidx37.1.43, align 16, !tbaa !5
%arrayidx37.1.44 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 135
store i32 1, ptr %arrayidx37.1.44, align 4, !tbaa !5
%arrayidx37.1.45 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 138
store i32 1, ptr %arrayidx37.1.45, align 8, !tbaa !5
%arrayidx37.1.46 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 141
store i32 1, ptr %arrayidx37.1.46, align 4, !tbaa !5
%arrayidx37.1.47 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 144
store i32 1, ptr %arrayidx37.1.47, align 16, !tbaa !5
%arrayidx37.1.48 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 147
store i32 1, ptr %arrayidx37.1.48, align 4, !tbaa !5
%arrayidx37.1.49 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 150
store i32 1, ptr %arrayidx37.1.49, align 8, !tbaa !5
%arrayidx37.1.50 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 153
store i32 1, ptr %arrayidx37.1.50, align 4, !tbaa !5
%arrayidx37.1.51 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 156
store i32 1, ptr %arrayidx37.1.51, align 16, !tbaa !5
%arrayidx37.1.52 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 159
store i32 1, ptr %arrayidx37.1.52, align 4, !tbaa !5
%arrayidx37.1.53 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 162
store i32 1, ptr %arrayidx37.1.53, align 8, !tbaa !5
%arrayidx37.1.54 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 165
store i32 1, ptr %arrayidx37.1.54, align 4, !tbaa !5
%arrayidx37.1.55 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.1.55, align 16, !tbaa !5
%arrayidx37.1.56 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 171
store i32 1, ptr %arrayidx37.1.56, align 4, !tbaa !5
%arrayidx37.1.57 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 174
store i32 1, ptr %arrayidx37.1.57, align 8, !tbaa !5
%arrayidx37.1.58 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 177
store i32 1, ptr %arrayidx37.1.58, align 4, !tbaa !5
%arrayidx37.1.59 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.1.59, align 16, !tbaa !5
%arrayidx37.1.60 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 183
store i32 1, ptr %arrayidx37.1.60, align 4, !tbaa !5
%arrayidx37.1.61 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 186
store i32 1, ptr %arrayidx37.1.61, align 8, !tbaa !5
%arrayidx37.1.62 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 189
store i32 1, ptr %arrayidx37.1.62, align 4, !tbaa !5
%arrayidx37.1.63 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 192
store i32 1, ptr %arrayidx37.1.63, align 16, !tbaa !5
%arrayidx37.1.64 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 195
store i32 1, ptr %arrayidx37.1.64, align 4, !tbaa !5
%arrayidx37.1.65 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 198
store i32 1, ptr %arrayidx37.1.65, align 8, !tbaa !5
br label %if.end41.1
if.end41.1: ; preds = %for.body35.preheader.1, %if.end41
%count.3.1 = phi i32 [ 1, %if.end41 ], [ 2, %for.body35.preheader.1 ]
%arrayidx23.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 4
%51 = load i32, ptr %arrayidx23.2, align 16, !tbaa !5
%cmp24.2 = icmp eq i32 %51, 0
br i1 %cmp24.2, label %for.body35.preheader.2, label %if.end41.2
for.body35.preheader.2: ; preds = %if.end41.1
%idxprom27.2 = zext i32 %count.3.1 to i64
%arrayidx28.2 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.2
store i32 4, ptr %arrayidx28.2, align 4, !tbaa !5
%inc29.2 = add nuw nsw i32 %count.3.1, 1
store i32 1, ptr %arrayidx23.2, align 16, !tbaa !5
%arrayidx37.2.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 8
store i32 1, ptr %arrayidx37.2.1, align 16, !tbaa !5
%arrayidx37.2.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 12
store i32 1, ptr %arrayidx37.2.2, align 16, !tbaa !5
%arrayidx37.2.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 16
store i32 1, ptr %arrayidx37.2.3, align 16, !tbaa !5
%arrayidx37.2.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 20
store i32 1, ptr %arrayidx37.2.4, align 16, !tbaa !5
%arrayidx37.2.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 24
store i32 1, ptr %arrayidx37.2.5, align 16, !tbaa !5
%arrayidx37.2.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 28
store i32 1, ptr %arrayidx37.2.6, align 16, !tbaa !5
%arrayidx37.2.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 32
store i32 1, ptr %arrayidx37.2.7, align 16, !tbaa !5
%arrayidx37.2.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 36
store i32 1, ptr %arrayidx37.2.8, align 16, !tbaa !5
%arrayidx37.2.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 40
store i32 1, ptr %arrayidx37.2.9, align 16, !tbaa !5
%arrayidx37.2.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 44
store i32 1, ptr %arrayidx37.2.10, align 16, !tbaa !5
%arrayidx37.2.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 48
store i32 1, ptr %arrayidx37.2.11, align 16, !tbaa !5
%arrayidx37.2.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 52
store i32 1, ptr %arrayidx37.2.12, align 16, !tbaa !5
%arrayidx37.2.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 56
store i32 1, ptr %arrayidx37.2.13, align 16, !tbaa !5
%arrayidx37.2.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 60
store i32 1, ptr %arrayidx37.2.14, align 16, !tbaa !5
%arrayidx37.2.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 64
store i32 1, ptr %arrayidx37.2.15, align 16, !tbaa !5
%arrayidx37.2.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 68
store i32 1, ptr %arrayidx37.2.16, align 16, !tbaa !5
%arrayidx37.2.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 72
store i32 1, ptr %arrayidx37.2.17, align 16, !tbaa !5
%arrayidx37.2.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 76
store i32 1, ptr %arrayidx37.2.18, align 16, !tbaa !5
%arrayidx37.2.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 80
store i32 1, ptr %arrayidx37.2.19, align 16, !tbaa !5
%arrayidx37.2.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 84
store i32 1, ptr %arrayidx37.2.20, align 16, !tbaa !5
%arrayidx37.2.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 88
store i32 1, ptr %arrayidx37.2.21, align 16, !tbaa !5
%arrayidx37.2.22 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 92
store i32 1, ptr %arrayidx37.2.22, align 16, !tbaa !5
%arrayidx37.2.23 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 96
store i32 1, ptr %arrayidx37.2.23, align 16, !tbaa !5
%arrayidx37.2.24 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 100
store i32 1, ptr %arrayidx37.2.24, align 16, !tbaa !5
%arrayidx37.2.25 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 104
store i32 1, ptr %arrayidx37.2.25, align 16, !tbaa !5
%arrayidx37.2.26 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 108
store i32 1, ptr %arrayidx37.2.26, align 16, !tbaa !5
%arrayidx37.2.27 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 112
store i32 1, ptr %arrayidx37.2.27, align 16, !tbaa !5
%arrayidx37.2.28 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 116
store i32 1, ptr %arrayidx37.2.28, align 16, !tbaa !5
%arrayidx37.2.29 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.2.29, align 16, !tbaa !5
%arrayidx37.2.30 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 124
store i32 1, ptr %arrayidx37.2.30, align 16, !tbaa !5
%arrayidx37.2.31 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 128
store i32 1, ptr %arrayidx37.2.31, align 16, !tbaa !5
%arrayidx37.2.32 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 132
store i32 1, ptr %arrayidx37.2.32, align 16, !tbaa !5
%arrayidx37.2.33 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 136
store i32 1, ptr %arrayidx37.2.33, align 16, !tbaa !5
%arrayidx37.2.34 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 140
store i32 1, ptr %arrayidx37.2.34, align 16, !tbaa !5
%arrayidx37.2.35 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 144
store i32 1, ptr %arrayidx37.2.35, align 16, !tbaa !5
%arrayidx37.2.36 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 148
store i32 1, ptr %arrayidx37.2.36, align 16, !tbaa !5
%arrayidx37.2.37 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 152
store i32 1, ptr %arrayidx37.2.37, align 16, !tbaa !5
%arrayidx37.2.38 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 156
store i32 1, ptr %arrayidx37.2.38, align 16, !tbaa !5
%arrayidx37.2.39 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 160
store i32 1, ptr %arrayidx37.2.39, align 16, !tbaa !5
%arrayidx37.2.40 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 164
store i32 1, ptr %arrayidx37.2.40, align 16, !tbaa !5
%arrayidx37.2.41 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.2.41, align 16, !tbaa !5
%arrayidx37.2.42 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 172
store i32 1, ptr %arrayidx37.2.42, align 16, !tbaa !5
%arrayidx37.2.43 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 176
store i32 1, ptr %arrayidx37.2.43, align 16, !tbaa !5
%arrayidx37.2.44 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.2.44, align 16, !tbaa !5
%arrayidx37.2.45 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 184
store i32 1, ptr %arrayidx37.2.45, align 16, !tbaa !5
%arrayidx37.2.46 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 188
store i32 1, ptr %arrayidx37.2.46, align 16, !tbaa !5
%arrayidx37.2.47 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 192
store i32 1, ptr %arrayidx37.2.47, align 16, !tbaa !5
%arrayidx37.2.48 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 196
store i32 1, ptr %arrayidx37.2.48, align 16, !tbaa !5
%arrayidx37.2.49 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 200
store i32 1, ptr %arrayidx37.2.49, align 16, !tbaa !5
br label %if.end41.2
if.end41.2: ; preds = %for.body35.preheader.2, %if.end41.1
%count.3.2 = phi i32 [ %count.3.1, %if.end41.1 ], [ %inc29.2, %for.body35.preheader.2 ]
%arrayidx23.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 5
%52 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5
%cmp24.3 = icmp eq i32 %52, 0
br i1 %cmp24.3, label %for.body35.preheader.3, label %if.end41.3
for.body35.preheader.3: ; preds = %if.end41.2
%idxprom27.3 = zext i32 %count.3.2 to i64
%arrayidx28.3 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.3
store i32 5, ptr %arrayidx28.3, align 4, !tbaa !5
%inc29.3 = add nuw nsw i32 %count.3.2, 1
store i32 1, ptr %arrayidx23.3, align 4, !tbaa !5
%arrayidx37.3.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 10
store i32 1, ptr %arrayidx37.3.1, align 8, !tbaa !5
%arrayidx37.3.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 15
store i32 1, ptr %arrayidx37.3.2, align 4, !tbaa !5
%arrayidx37.3.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 20
store i32 1, ptr %arrayidx37.3.3, align 16, !tbaa !5
%arrayidx37.3.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 25
store i32 1, ptr %arrayidx37.3.4, align 4, !tbaa !5
%arrayidx37.3.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 30
store i32 1, ptr %arrayidx37.3.5, align 8, !tbaa !5
%arrayidx37.3.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 35
store i32 1, ptr %arrayidx37.3.6, align 4, !tbaa !5
%arrayidx37.3.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 40
store i32 1, ptr %arrayidx37.3.7, align 16, !tbaa !5
%arrayidx37.3.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 45
store i32 1, ptr %arrayidx37.3.8, align 4, !tbaa !5
%arrayidx37.3.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 50
store i32 1, ptr %arrayidx37.3.9, align 8, !tbaa !5
%arrayidx37.3.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 55
store i32 1, ptr %arrayidx37.3.10, align 4, !tbaa !5
%arrayidx37.3.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 60
store i32 1, ptr %arrayidx37.3.11, align 16, !tbaa !5
%arrayidx37.3.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 65
store i32 1, ptr %arrayidx37.3.12, align 4, !tbaa !5
%arrayidx37.3.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 70
store i32 1, ptr %arrayidx37.3.13, align 8, !tbaa !5
%arrayidx37.3.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 75
store i32 1, ptr %arrayidx37.3.14, align 4, !tbaa !5
%arrayidx37.3.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 80
store i32 1, ptr %arrayidx37.3.15, align 16, !tbaa !5
%arrayidx37.3.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 85
store i32 1, ptr %arrayidx37.3.16, align 4, !tbaa !5
%arrayidx37.3.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 90
store i32 1, ptr %arrayidx37.3.17, align 8, !tbaa !5
%arrayidx37.3.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 95
store i32 1, ptr %arrayidx37.3.18, align 4, !tbaa !5
%arrayidx37.3.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 100
store i32 1, ptr %arrayidx37.3.19, align 16, !tbaa !5
%arrayidx37.3.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 105
store i32 1, ptr %arrayidx37.3.20, align 4, !tbaa !5
%arrayidx37.3.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 110
store i32 1, ptr %arrayidx37.3.21, align 8, !tbaa !5
%arrayidx37.3.22 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 115
store i32 1, ptr %arrayidx37.3.22, align 4, !tbaa !5
%arrayidx37.3.23 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.3.23, align 16, !tbaa !5
%arrayidx37.3.24 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 125
store i32 1, ptr %arrayidx37.3.24, align 4, !tbaa !5
%arrayidx37.3.25 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 130
store i32 1, ptr %arrayidx37.3.25, align 8, !tbaa !5
%arrayidx37.3.26 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 135
store i32 1, ptr %arrayidx37.3.26, align 4, !tbaa !5
%arrayidx37.3.27 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 140
store i32 1, ptr %arrayidx37.3.27, align 16, !tbaa !5
%arrayidx37.3.28 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 145
store i32 1, ptr %arrayidx37.3.28, align 4, !tbaa !5
%arrayidx37.3.29 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 150
store i32 1, ptr %arrayidx37.3.29, align 8, !tbaa !5
%arrayidx37.3.30 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 155
store i32 1, ptr %arrayidx37.3.30, align 4, !tbaa !5
%arrayidx37.3.31 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 160
store i32 1, ptr %arrayidx37.3.31, align 16, !tbaa !5
%arrayidx37.3.32 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 165
store i32 1, ptr %arrayidx37.3.32, align 4, !tbaa !5
%arrayidx37.3.33 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 170
store i32 1, ptr %arrayidx37.3.33, align 8, !tbaa !5
%arrayidx37.3.34 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 175
store i32 1, ptr %arrayidx37.3.34, align 4, !tbaa !5
%arrayidx37.3.35 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.3.35, align 16, !tbaa !5
%arrayidx37.3.36 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 185
store i32 1, ptr %arrayidx37.3.36, align 4, !tbaa !5
%arrayidx37.3.37 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 190
store i32 1, ptr %arrayidx37.3.37, align 8, !tbaa !5
%arrayidx37.3.38 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 195
store i32 1, ptr %arrayidx37.3.38, align 4, !tbaa !5
%arrayidx37.3.39 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 200
store i32 1, ptr %arrayidx37.3.39, align 16, !tbaa !5
br label %if.end41.3
if.end41.3: ; preds = %for.body35.preheader.3, %if.end41.2
%count.3.3 = phi i32 [ %count.3.2, %if.end41.2 ], [ %inc29.3, %for.body35.preheader.3 ]
%arrayidx23.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 6
%53 = load i32, ptr %arrayidx23.4, align 8, !tbaa !5
%cmp24.4 = icmp eq i32 %53, 0
br i1 %cmp24.4, label %for.body35.preheader.4, label %if.end41.4
for.body35.preheader.4: ; preds = %if.end41.3
%idxprom27.4 = zext i32 %count.3.3 to i64
%arrayidx28.4 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.4
store i32 6, ptr %arrayidx28.4, align 4, !tbaa !5
%inc29.4 = add nuw nsw i32 %count.3.3, 1
store i32 1, ptr %arrayidx23.4, align 8, !tbaa !5
%arrayidx37.4.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 12
store i32 1, ptr %arrayidx37.4.1, align 16, !tbaa !5
%arrayidx37.4.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 18
store i32 1, ptr %arrayidx37.4.2, align 8, !tbaa !5
%arrayidx37.4.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 24
store i32 1, ptr %arrayidx37.4.3, align 16, !tbaa !5
%arrayidx37.4.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 30
store i32 1, ptr %arrayidx37.4.4, align 8, !tbaa !5
%arrayidx37.4.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 36
store i32 1, ptr %arrayidx37.4.5, align 16, !tbaa !5
%arrayidx37.4.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 42
store i32 1, ptr %arrayidx37.4.6, align 8, !tbaa !5
%arrayidx37.4.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 48
store i32 1, ptr %arrayidx37.4.7, align 16, !tbaa !5
%arrayidx37.4.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 54
store i32 1, ptr %arrayidx37.4.8, align 8, !tbaa !5
%arrayidx37.4.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 60
store i32 1, ptr %arrayidx37.4.9, align 16, !tbaa !5
%arrayidx37.4.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 66
store i32 1, ptr %arrayidx37.4.10, align 8, !tbaa !5
%arrayidx37.4.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 72
store i32 1, ptr %arrayidx37.4.11, align 16, !tbaa !5
%arrayidx37.4.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 78
store i32 1, ptr %arrayidx37.4.12, align 8, !tbaa !5
%arrayidx37.4.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 84
store i32 1, ptr %arrayidx37.4.13, align 16, !tbaa !5
%arrayidx37.4.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 90
store i32 1, ptr %arrayidx37.4.14, align 8, !tbaa !5
%arrayidx37.4.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 96
store i32 1, ptr %arrayidx37.4.15, align 16, !tbaa !5
%arrayidx37.4.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 102
store i32 1, ptr %arrayidx37.4.16, align 8, !tbaa !5
%arrayidx37.4.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 108
store i32 1, ptr %arrayidx37.4.17, align 16, !tbaa !5
%arrayidx37.4.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 114
store i32 1, ptr %arrayidx37.4.18, align 8, !tbaa !5
%arrayidx37.4.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.4.19, align 16, !tbaa !5
%arrayidx37.4.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 126
store i32 1, ptr %arrayidx37.4.20, align 8, !tbaa !5
%arrayidx37.4.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 132
store i32 1, ptr %arrayidx37.4.21, align 16, !tbaa !5
%arrayidx37.4.22 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 138
store i32 1, ptr %arrayidx37.4.22, align 8, !tbaa !5
%arrayidx37.4.23 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 144
store i32 1, ptr %arrayidx37.4.23, align 16, !tbaa !5
%arrayidx37.4.24 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 150
store i32 1, ptr %arrayidx37.4.24, align 8, !tbaa !5
%arrayidx37.4.25 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 156
store i32 1, ptr %arrayidx37.4.25, align 16, !tbaa !5
%arrayidx37.4.26 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 162
store i32 1, ptr %arrayidx37.4.26, align 8, !tbaa !5
%arrayidx37.4.27 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.4.27, align 16, !tbaa !5
%arrayidx37.4.28 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 174
store i32 1, ptr %arrayidx37.4.28, align 8, !tbaa !5
%arrayidx37.4.29 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.4.29, align 16, !tbaa !5
%arrayidx37.4.30 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 186
store i32 1, ptr %arrayidx37.4.30, align 8, !tbaa !5
%arrayidx37.4.31 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 192
store i32 1, ptr %arrayidx37.4.31, align 16, !tbaa !5
%arrayidx37.4.32 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 198
store i32 1, ptr %arrayidx37.4.32, align 8, !tbaa !5
br label %if.end41.4
if.end41.4: ; preds = %for.body35.preheader.4, %if.end41.3
%count.3.4 = phi i32 [ %count.3.3, %if.end41.3 ], [ %inc29.4, %for.body35.preheader.4 ]
%arrayidx23.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 7
%54 = load i32, ptr %arrayidx23.5, align 4, !tbaa !5
%cmp24.5 = icmp eq i32 %54, 0
br i1 %cmp24.5, label %for.body35.preheader.5, label %if.end41.5
for.body35.preheader.5: ; preds = %if.end41.4
%idxprom27.5 = zext i32 %count.3.4 to i64
%arrayidx28.5 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.5
store i32 7, ptr %arrayidx28.5, align 4, !tbaa !5
%inc29.5 = add nuw nsw i32 %count.3.4, 1
store i32 1, ptr %arrayidx23.5, align 4, !tbaa !5
%arrayidx37.5.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 14
store i32 1, ptr %arrayidx37.5.1, align 8, !tbaa !5
%arrayidx37.5.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 21
store i32 1, ptr %arrayidx37.5.2, align 4, !tbaa !5
%arrayidx37.5.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 28
store i32 1, ptr %arrayidx37.5.3, align 16, !tbaa !5
%arrayidx37.5.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 35
store i32 1, ptr %arrayidx37.5.4, align 4, !tbaa !5
%arrayidx37.5.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 42
store i32 1, ptr %arrayidx37.5.5, align 8, !tbaa !5
%arrayidx37.5.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 49
store i32 1, ptr %arrayidx37.5.6, align 4, !tbaa !5
%arrayidx37.5.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 56
store i32 1, ptr %arrayidx37.5.7, align 16, !tbaa !5
%arrayidx37.5.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 63
store i32 1, ptr %arrayidx37.5.8, align 4, !tbaa !5
%arrayidx37.5.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 70
store i32 1, ptr %arrayidx37.5.9, align 8, !tbaa !5
%arrayidx37.5.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 77
store i32 1, ptr %arrayidx37.5.10, align 4, !tbaa !5
%arrayidx37.5.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 84
store i32 1, ptr %arrayidx37.5.11, align 16, !tbaa !5
%arrayidx37.5.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 91
store i32 1, ptr %arrayidx37.5.12, align 4, !tbaa !5
%arrayidx37.5.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 98
store i32 1, ptr %arrayidx37.5.13, align 8, !tbaa !5
%arrayidx37.5.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 105
store i32 1, ptr %arrayidx37.5.14, align 4, !tbaa !5
%arrayidx37.5.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 112
store i32 1, ptr %arrayidx37.5.15, align 16, !tbaa !5
%arrayidx37.5.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 119
store i32 1, ptr %arrayidx37.5.16, align 4, !tbaa !5
%arrayidx37.5.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 126
store i32 1, ptr %arrayidx37.5.17, align 8, !tbaa !5
%arrayidx37.5.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 133
store i32 1, ptr %arrayidx37.5.18, align 4, !tbaa !5
%arrayidx37.5.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 140
store i32 1, ptr %arrayidx37.5.19, align 16, !tbaa !5
%arrayidx37.5.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 147
store i32 1, ptr %arrayidx37.5.20, align 4, !tbaa !5
%arrayidx37.5.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 154
store i32 1, ptr %arrayidx37.5.21, align 8, !tbaa !5
%arrayidx37.5.22 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 161
store i32 1, ptr %arrayidx37.5.22, align 4, !tbaa !5
%arrayidx37.5.23 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.5.23, align 16, !tbaa !5
%arrayidx37.5.24 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 175
store i32 1, ptr %arrayidx37.5.24, align 4, !tbaa !5
%arrayidx37.5.25 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 182
store i32 1, ptr %arrayidx37.5.25, align 8, !tbaa !5
%arrayidx37.5.26 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 189
store i32 1, ptr %arrayidx37.5.26, align 4, !tbaa !5
%arrayidx37.5.27 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 196
store i32 1, ptr %arrayidx37.5.27, align 16, !tbaa !5
br label %if.end41.5
if.end41.5: ; preds = %for.body35.preheader.5, %if.end41.4
%count.3.5 = phi i32 [ %count.3.4, %if.end41.4 ], [ %inc29.5, %for.body35.preheader.5 ]
%arrayidx23.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 8
%55 = load i32, ptr %arrayidx23.6, align 16, !tbaa !5
%cmp24.6 = icmp eq i32 %55, 0
br i1 %cmp24.6, label %for.body35.preheader.6, label %if.end41.6
for.body35.preheader.6: ; preds = %if.end41.5
%idxprom27.6 = zext i32 %count.3.5 to i64
%arrayidx28.6 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.6
store i32 8, ptr %arrayidx28.6, align 4, !tbaa !5
%inc29.6 = add nuw nsw i32 %count.3.5, 1
store i32 1, ptr %arrayidx23.6, align 16, !tbaa !5
%arrayidx37.6.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 16
store i32 1, ptr %arrayidx37.6.1, align 16, !tbaa !5
%arrayidx37.6.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 24
store i32 1, ptr %arrayidx37.6.2, align 16, !tbaa !5
%arrayidx37.6.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 32
store i32 1, ptr %arrayidx37.6.3, align 16, !tbaa !5
%arrayidx37.6.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 40
store i32 1, ptr %arrayidx37.6.4, align 16, !tbaa !5
%arrayidx37.6.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 48
store i32 1, ptr %arrayidx37.6.5, align 16, !tbaa !5
%arrayidx37.6.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 56
store i32 1, ptr %arrayidx37.6.6, align 16, !tbaa !5
%arrayidx37.6.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 64
store i32 1, ptr %arrayidx37.6.7, align 16, !tbaa !5
%arrayidx37.6.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 72
store i32 1, ptr %arrayidx37.6.8, align 16, !tbaa !5
%arrayidx37.6.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 80
store i32 1, ptr %arrayidx37.6.9, align 16, !tbaa !5
%arrayidx37.6.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 88
store i32 1, ptr %arrayidx37.6.10, align 16, !tbaa !5
%arrayidx37.6.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 96
store i32 1, ptr %arrayidx37.6.11, align 16, !tbaa !5
%arrayidx37.6.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 104
store i32 1, ptr %arrayidx37.6.12, align 16, !tbaa !5
%arrayidx37.6.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 112
store i32 1, ptr %arrayidx37.6.13, align 16, !tbaa !5
%arrayidx37.6.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.6.14, align 16, !tbaa !5
%arrayidx37.6.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 128
store i32 1, ptr %arrayidx37.6.15, align 16, !tbaa !5
%arrayidx37.6.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 136
store i32 1, ptr %arrayidx37.6.16, align 16, !tbaa !5
%arrayidx37.6.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 144
store i32 1, ptr %arrayidx37.6.17, align 16, !tbaa !5
%arrayidx37.6.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 152
store i32 1, ptr %arrayidx37.6.18, align 16, !tbaa !5
%arrayidx37.6.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 160
store i32 1, ptr %arrayidx37.6.19, align 16, !tbaa !5
%arrayidx37.6.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.6.20, align 16, !tbaa !5
%arrayidx37.6.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 176
store i32 1, ptr %arrayidx37.6.21, align 16, !tbaa !5
%arrayidx37.6.22 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 184
store i32 1, ptr %arrayidx37.6.22, align 16, !tbaa !5
%arrayidx37.6.23 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 192
store i32 1, ptr %arrayidx37.6.23, align 16, !tbaa !5
%arrayidx37.6.24 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 200
store i32 1, ptr %arrayidx37.6.24, align 16, !tbaa !5
br label %if.end41.6
if.end41.6: ; preds = %for.body35.preheader.6, %if.end41.5
%count.3.6 = phi i32 [ %count.3.5, %if.end41.5 ], [ %inc29.6, %for.body35.preheader.6 ]
%arrayidx23.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 9
%56 = load i32, ptr %arrayidx23.7, align 4, !tbaa !5
%cmp24.7 = icmp eq i32 %56, 0
br i1 %cmp24.7, label %for.body35.preheader.7, label %if.end41.7
for.body35.preheader.7: ; preds = %if.end41.6
%idxprom27.7 = zext i32 %count.3.6 to i64
%arrayidx28.7 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.7
store i32 9, ptr %arrayidx28.7, align 4, !tbaa !5
%inc29.7 = add nuw nsw i32 %count.3.6, 1
store i32 1, ptr %arrayidx23.7, align 4, !tbaa !5
%arrayidx37.7.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 18
store i32 1, ptr %arrayidx37.7.1, align 8, !tbaa !5
%arrayidx37.7.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 27
store i32 1, ptr %arrayidx37.7.2, align 4, !tbaa !5
%arrayidx37.7.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 36
store i32 1, ptr %arrayidx37.7.3, align 16, !tbaa !5
%arrayidx37.7.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 45
store i32 1, ptr %arrayidx37.7.4, align 4, !tbaa !5
%arrayidx37.7.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 54
store i32 1, ptr %arrayidx37.7.5, align 8, !tbaa !5
%arrayidx37.7.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 63
store i32 1, ptr %arrayidx37.7.6, align 4, !tbaa !5
%arrayidx37.7.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 72
store i32 1, ptr %arrayidx37.7.7, align 16, !tbaa !5
%arrayidx37.7.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 81
store i32 1, ptr %arrayidx37.7.8, align 4, !tbaa !5
%arrayidx37.7.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 90
store i32 1, ptr %arrayidx37.7.9, align 8, !tbaa !5
%arrayidx37.7.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 99
store i32 1, ptr %arrayidx37.7.10, align 4, !tbaa !5
%arrayidx37.7.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 108
store i32 1, ptr %arrayidx37.7.11, align 16, !tbaa !5
%arrayidx37.7.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 117
store i32 1, ptr %arrayidx37.7.12, align 4, !tbaa !5
%arrayidx37.7.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 126
store i32 1, ptr %arrayidx37.7.13, align 8, !tbaa !5
%arrayidx37.7.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 135
store i32 1, ptr %arrayidx37.7.14, align 4, !tbaa !5
%arrayidx37.7.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 144
store i32 1, ptr %arrayidx37.7.15, align 16, !tbaa !5
%arrayidx37.7.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 153
store i32 1, ptr %arrayidx37.7.16, align 4, !tbaa !5
%arrayidx37.7.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 162
store i32 1, ptr %arrayidx37.7.17, align 8, !tbaa !5
%arrayidx37.7.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 171
store i32 1, ptr %arrayidx37.7.18, align 4, !tbaa !5
%arrayidx37.7.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.7.19, align 16, !tbaa !5
%arrayidx37.7.20 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 189
store i32 1, ptr %arrayidx37.7.20, align 4, !tbaa !5
%arrayidx37.7.21 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 198
store i32 1, ptr %arrayidx37.7.21, align 8, !tbaa !5
br label %if.end41.7
if.end41.7: ; preds = %for.body35.preheader.7, %if.end41.6
%count.3.7 = phi i32 [ %count.3.6, %if.end41.6 ], [ %inc29.7, %for.body35.preheader.7 ]
%arrayidx23.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 10
%57 = load i32, ptr %arrayidx23.8, align 8, !tbaa !5
%cmp24.8 = icmp eq i32 %57, 0
br i1 %cmp24.8, label %for.body35.preheader.8, label %if.end41.8
for.body35.preheader.8: ; preds = %if.end41.7
%idxprom27.8 = zext i32 %count.3.7 to i64
%arrayidx28.8 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.8
store i32 10, ptr %arrayidx28.8, align 4, !tbaa !5
%inc29.8 = add nuw nsw i32 %count.3.7, 1
store i32 1, ptr %arrayidx23.8, align 8, !tbaa !5
%arrayidx37.8.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 20
store i32 1, ptr %arrayidx37.8.1, align 16, !tbaa !5
%arrayidx37.8.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 30
store i32 1, ptr %arrayidx37.8.2, align 8, !tbaa !5
%arrayidx37.8.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 40
store i32 1, ptr %arrayidx37.8.3, align 16, !tbaa !5
%arrayidx37.8.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 50
store i32 1, ptr %arrayidx37.8.4, align 8, !tbaa !5
%arrayidx37.8.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 60
store i32 1, ptr %arrayidx37.8.5, align 16, !tbaa !5
%arrayidx37.8.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 70
store i32 1, ptr %arrayidx37.8.6, align 8, !tbaa !5
%arrayidx37.8.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 80
store i32 1, ptr %arrayidx37.8.7, align 16, !tbaa !5
%arrayidx37.8.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 90
store i32 1, ptr %arrayidx37.8.8, align 8, !tbaa !5
%arrayidx37.8.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 100
store i32 1, ptr %arrayidx37.8.9, align 16, !tbaa !5
%arrayidx37.8.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 110
store i32 1, ptr %arrayidx37.8.10, align 8, !tbaa !5
%arrayidx37.8.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.8.11, align 16, !tbaa !5
%arrayidx37.8.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 130
store i32 1, ptr %arrayidx37.8.12, align 8, !tbaa !5
%arrayidx37.8.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 140
store i32 1, ptr %arrayidx37.8.13, align 16, !tbaa !5
%arrayidx37.8.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 150
store i32 1, ptr %arrayidx37.8.14, align 8, !tbaa !5
%arrayidx37.8.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 160
store i32 1, ptr %arrayidx37.8.15, align 16, !tbaa !5
%arrayidx37.8.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 170
store i32 1, ptr %arrayidx37.8.16, align 8, !tbaa !5
%arrayidx37.8.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.8.17, align 16, !tbaa !5
%arrayidx37.8.18 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 190
store i32 1, ptr %arrayidx37.8.18, align 8, !tbaa !5
%arrayidx37.8.19 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 200
store i32 1, ptr %arrayidx37.8.19, align 16, !tbaa !5
br label %if.end41.8
if.end41.8: ; preds = %for.body35.preheader.8, %if.end41.7
%count.3.8 = phi i32 [ %count.3.7, %if.end41.7 ], [ %inc29.8, %for.body35.preheader.8 ]
%arrayidx23.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 11
%58 = load i32, ptr %arrayidx23.9, align 4, !tbaa !5
%cmp24.9 = icmp eq i32 %58, 0
br i1 %cmp24.9, label %for.body35.preheader.9, label %if.end41.9
for.body35.preheader.9: ; preds = %if.end41.8
%idxprom27.9 = zext i32 %count.3.8 to i64
%arrayidx28.9 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.9
store i32 11, ptr %arrayidx28.9, align 4, !tbaa !5
%inc29.9 = add nuw nsw i32 %count.3.8, 1
store i32 1, ptr %arrayidx23.9, align 4, !tbaa !5
%arrayidx37.9.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 22
store i32 1, ptr %arrayidx37.9.1, align 8, !tbaa !5
%arrayidx37.9.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 33
store i32 1, ptr %arrayidx37.9.2, align 4, !tbaa !5
%arrayidx37.9.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 44
store i32 1, ptr %arrayidx37.9.3, align 16, !tbaa !5
%arrayidx37.9.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 55
store i32 1, ptr %arrayidx37.9.4, align 4, !tbaa !5
%arrayidx37.9.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 66
store i32 1, ptr %arrayidx37.9.5, align 8, !tbaa !5
%arrayidx37.9.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 77
store i32 1, ptr %arrayidx37.9.6, align 4, !tbaa !5
%arrayidx37.9.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 88
store i32 1, ptr %arrayidx37.9.7, align 16, !tbaa !5
%arrayidx37.9.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 99
store i32 1, ptr %arrayidx37.9.8, align 4, !tbaa !5
%arrayidx37.9.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 110
store i32 1, ptr %arrayidx37.9.9, align 8, !tbaa !5
%arrayidx37.9.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 121
store i32 1, ptr %arrayidx37.9.10, align 4, !tbaa !5
%arrayidx37.9.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 132
store i32 1, ptr %arrayidx37.9.11, align 16, !tbaa !5
%arrayidx37.9.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 143
store i32 1, ptr %arrayidx37.9.12, align 4, !tbaa !5
%arrayidx37.9.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 154
store i32 1, ptr %arrayidx37.9.13, align 8, !tbaa !5
%arrayidx37.9.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 165
store i32 1, ptr %arrayidx37.9.14, align 4, !tbaa !5
%arrayidx37.9.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 176
store i32 1, ptr %arrayidx37.9.15, align 16, !tbaa !5
%arrayidx37.9.16 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 187
store i32 1, ptr %arrayidx37.9.16, align 4, !tbaa !5
%arrayidx37.9.17 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 198
store i32 1, ptr %arrayidx37.9.17, align 8, !tbaa !5
br label %if.end41.9
if.end41.9: ; preds = %for.body35.preheader.9, %if.end41.8
%count.3.9 = phi i32 [ %count.3.8, %if.end41.8 ], [ %inc29.9, %for.body35.preheader.9 ]
%arrayidx23.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 12
%59 = load i32, ptr %arrayidx23.10, align 16, !tbaa !5
%cmp24.10 = icmp eq i32 %59, 0
br i1 %cmp24.10, label %for.body35.preheader.10, label %if.end41.10
for.body35.preheader.10: ; preds = %if.end41.9
%idxprom27.10 = zext i32 %count.3.9 to i64
%arrayidx28.10 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.10
store i32 12, ptr %arrayidx28.10, align 4, !tbaa !5
%inc29.10 = add nuw nsw i32 %count.3.9, 1
store i32 1, ptr %arrayidx23.10, align 16, !tbaa !5
%arrayidx37.10.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 24
store i32 1, ptr %arrayidx37.10.1, align 16, !tbaa !5
%arrayidx37.10.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 36
store i32 1, ptr %arrayidx37.10.2, align 16, !tbaa !5
%arrayidx37.10.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 48
store i32 1, ptr %arrayidx37.10.3, align 16, !tbaa !5
%arrayidx37.10.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 60
store i32 1, ptr %arrayidx37.10.4, align 16, !tbaa !5
%arrayidx37.10.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 72
store i32 1, ptr %arrayidx37.10.5, align 16, !tbaa !5
%arrayidx37.10.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 84
store i32 1, ptr %arrayidx37.10.6, align 16, !tbaa !5
%arrayidx37.10.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 96
store i32 1, ptr %arrayidx37.10.7, align 16, !tbaa !5
%arrayidx37.10.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 108
store i32 1, ptr %arrayidx37.10.8, align 16, !tbaa !5
%arrayidx37.10.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 120
store i32 1, ptr %arrayidx37.10.9, align 16, !tbaa !5
%arrayidx37.10.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 132
store i32 1, ptr %arrayidx37.10.10, align 16, !tbaa !5
%arrayidx37.10.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 144
store i32 1, ptr %arrayidx37.10.11, align 16, !tbaa !5
%arrayidx37.10.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 156
store i32 1, ptr %arrayidx37.10.12, align 16, !tbaa !5
%arrayidx37.10.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.10.13, align 16, !tbaa !5
%arrayidx37.10.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 180
store i32 1, ptr %arrayidx37.10.14, align 16, !tbaa !5
%arrayidx37.10.15 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 192
store i32 1, ptr %arrayidx37.10.15, align 16, !tbaa !5
br label %if.end41.10
if.end41.10: ; preds = %for.body35.preheader.10, %if.end41.9
%count.3.10 = phi i32 [ %count.3.9, %if.end41.9 ], [ %inc29.10, %for.body35.preheader.10 ]
%arrayidx23.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 13
%60 = load i32, ptr %arrayidx23.11, align 4, !tbaa !5
%cmp24.11 = icmp eq i32 %60, 0
br i1 %cmp24.11, label %for.body35.preheader.11, label %if.end41.11
for.body35.preheader.11: ; preds = %if.end41.10
%idxprom27.11 = zext i32 %count.3.10 to i64
%arrayidx28.11 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.11
store i32 13, ptr %arrayidx28.11, align 4, !tbaa !5
%inc29.11 = add nuw nsw i32 %count.3.10, 1
store i32 1, ptr %arrayidx23.11, align 4, !tbaa !5
%arrayidx37.11.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 26
store i32 1, ptr %arrayidx37.11.1, align 8, !tbaa !5
%arrayidx37.11.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 39
store i32 1, ptr %arrayidx37.11.2, align 4, !tbaa !5
%arrayidx37.11.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 52
store i32 1, ptr %arrayidx37.11.3, align 16, !tbaa !5
%arrayidx37.11.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 65
store i32 1, ptr %arrayidx37.11.4, align 4, !tbaa !5
%arrayidx37.11.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 78
store i32 1, ptr %arrayidx37.11.5, align 8, !tbaa !5
%arrayidx37.11.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 91
store i32 1, ptr %arrayidx37.11.6, align 4, !tbaa !5
%arrayidx37.11.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 104
store i32 1, ptr %arrayidx37.11.7, align 16, !tbaa !5
%arrayidx37.11.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 117
store i32 1, ptr %arrayidx37.11.8, align 4, !tbaa !5
%arrayidx37.11.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 130
store i32 1, ptr %arrayidx37.11.9, align 8, !tbaa !5
%arrayidx37.11.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 143
store i32 1, ptr %arrayidx37.11.10, align 4, !tbaa !5
%arrayidx37.11.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 156
store i32 1, ptr %arrayidx37.11.11, align 16, !tbaa !5
%arrayidx37.11.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 169
store i32 1, ptr %arrayidx37.11.12, align 4, !tbaa !5
%arrayidx37.11.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 182
store i32 1, ptr %arrayidx37.11.13, align 8, !tbaa !5
%arrayidx37.11.14 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 195
store i32 1, ptr %arrayidx37.11.14, align 4, !tbaa !5
br label %if.end41.11
if.end41.11: ; preds = %for.body35.preheader.11, %if.end41.10
%count.3.11 = phi i32 [ %count.3.10, %if.end41.10 ], [ %inc29.11, %for.body35.preheader.11 ]
%arrayidx23.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 14
%61 = load i32, ptr %arrayidx23.12, align 8, !tbaa !5
%cmp24.12 = icmp eq i32 %61, 0
br i1 %cmp24.12, label %for.body35.preheader.12, label %for.body9.lr.ph
for.body35.preheader.12: ; preds = %if.end41.11
%idxprom27.12 = zext i32 %count.3.11 to i64
%arrayidx28.12 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom27.12
store i32 14, ptr %arrayidx28.12, align 4, !tbaa !5
%inc29.12 = add nuw nsw i32 %count.3.11, 1
store i32 1, ptr %arrayidx23.12, align 8, !tbaa !5
%arrayidx37.12.1 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 28
store i32 1, ptr %arrayidx37.12.1, align 16, !tbaa !5
%arrayidx37.12.2 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 42
store i32 1, ptr %arrayidx37.12.2, align 8, !tbaa !5
%arrayidx37.12.3 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 56
store i32 1, ptr %arrayidx37.12.3, align 16, !tbaa !5
%arrayidx37.12.4 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 70
store i32 1, ptr %arrayidx37.12.4, align 8, !tbaa !5
%arrayidx37.12.5 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 84
store i32 1, ptr %arrayidx37.12.5, align 16, !tbaa !5
%arrayidx37.12.6 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 98
store i32 1, ptr %arrayidx37.12.6, align 8, !tbaa !5
%arrayidx37.12.7 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 112
store i32 1, ptr %arrayidx37.12.7, align 16, !tbaa !5
%arrayidx37.12.8 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 126
store i32 1, ptr %arrayidx37.12.8, align 8, !tbaa !5
%arrayidx37.12.9 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 140
store i32 1, ptr %arrayidx37.12.9, align 16, !tbaa !5
%arrayidx37.12.10 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 154
store i32 1, ptr %arrayidx37.12.10, align 8, !tbaa !5
%arrayidx37.12.11 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 168
store i32 1, ptr %arrayidx37.12.11, align 16, !tbaa !5
%arrayidx37.12.12 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 182
store i32 1, ptr %arrayidx37.12.12, align 8, !tbaa !5
%arrayidx37.12.13 = getelementptr inbounds [210 x i32], ptr %list, i64 0, i64 196
store i32 1, ptr %arrayidx37.12.13, align 16, !tbaa !5
br label %for.body9.lr.ph
if.then45: ; preds = %for.cond.cleanup8
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end118
for.cond.cleanup51: ; preds = %for.cond.cleanup93
%call117 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select)
br label %if.end118
for.body52: ; preds = %for.body52.lr.ph, %for.cond.cleanup93
%i47.0181 = phi i32 [ 105, %for.body52.lr.ph ], [ %add114, %for.cond.cleanup93 ]
%result.0180 = phi i32 [ 0, %for.body52.lr.ph ], [ %spec.select, %for.cond.cleanup93 ]
%62 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %49, align 16
br i1 %cmp55170, label %for.body69.preheader, label %for.cond.cleanup93
for.body69.preheader: ; preds = %for.body52
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %50, i1 false), !tbaa !5
br label %for.body69
for.body69: ; preds = %for.body69.preheader, %if.end87
%p64.0174 = phi i32 [ %p64.1, %if.end87 ], [ 0, %for.body69.preheader ]
%n.0173 = phi i32 [ %n.1, %if.end87 ], [ %i47.0181, %for.body69.preheader ]
%idxprom70 = sext i32 %p64.0174 to i64
%arrayidx71 = getelementptr inbounds [200 x i32], ptr %sosu, i64 0, i64 %idxprom70
%63 = load i32, ptr %arrayidx71, align 4, !tbaa !5
%rem = srem i32 %n.0173, %63
%div = sdiv i32 %n.0173, %63
%cmp72 = icmp eq i32 %rem, 0
br i1 %cmp72, label %if.then74, label %if.else80
if.then74: ; preds = %for.body69
%arrayidx78 = getelementptr inbounds i32, ptr %vla, i64 %idxprom70
%64 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%inc79 = add nsw i32 %64, 1
store i32 %inc79, ptr %arrayidx78, align 4, !tbaa !5
br label %if.end87
if.else80: ; preds = %for.body69
%cmp81 = icmp eq i32 %n.0173, 1
br i1 %cmp81, label %cleanup, label %if.else84
if.else84: ; preds = %if.else80
%inc85 = add nsw i32 %p64.0174, 1
br label %if.end87
if.end87: ; preds = %if.else84, %if.then74
%n.1 = phi i32 [ %div, %if.then74 ], [ %n.0173, %if.else84 ]
%p64.1 = phi i32 [ %p64.0174, %if.then74 ], [ %inc85, %if.else84 ]
%cmp66 = icmp slt i32 %p64.1, %count.1.lcssa
br i1 %cmp66, label %for.body69, label %cleanup, !llvm.loop !11
cleanup: ; preds = %if.end87, %if.else80
br i1 %cmp55170, label %for.body94.preheader, label %for.cond.cleanup93
for.body94.preheader: ; preds = %cleanup
br i1 %min.iters.check, label %for.body94.preheader215, label %vector.body210
vector.body210: ; preds = %for.body94.preheader, %vector.body210
%index211 = phi i64 [ %index.next214, %vector.body210 ], [ 0, %for.body94.preheader ]
%vec.phi = phi <4 x i32> [ %73, %vector.body210 ], [ <i32 1, i32 1, i32 1, i32 1>, %for.body94.preheader ]
%vec.phi212 = phi <4 x i32> [ %74, %vector.body210 ], [ <i32 1, i32 1, i32 1, i32 1>, %for.body94.preheader ]
%65 = getelementptr inbounds i32, ptr %vla, i64 %index211
%wide.load = load <4 x i32>, ptr %65, align 16, !tbaa !5
%66 = getelementptr inbounds i32, ptr %65, i64 4
%wide.load213 = load <4 x i32>, ptr %66, align 16, !tbaa !5
%67 = add nuw nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%68 = add nuw nsw <4 x i32> %wide.load213, <i32 1, i32 1, i32 1, i32 1>
%69 = icmp slt <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1>
%70 = icmp slt <4 x i32> %wide.load213, <i32 1, i32 1, i32 1, i32 1>
%71 = select <4 x i1> %69, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %67
%72 = select <4 x i1> %70, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> %68
%73 = mul <4 x i32> %71, %vec.phi
%74 = mul <4 x i32> %72, %vec.phi212
%index.next214 = add nuw i64 %index211, 8
%75 = icmp eq i64 %index.next214, %n.vec
br i1 %75, label %middle.block206, label %vector.body210, !llvm.loop !12
middle.block206: ; preds = %vector.body210
%bin.rdx = mul <4 x i32> %74, %73
%76 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond.cleanup93, label %for.body94.preheader215
for.body94.preheader215: ; preds = %for.body94.preheader, %middle.block206
%indvars.iv201.ph = phi i64 [ 0, %for.body94.preheader ], [ %n.vec, %middle.block206 ]
%re.0176.ph = phi i32 [ 1, %for.body94.preheader ], [ %76, %middle.block206 ]
br label %for.body94
for.cond.cleanup93: ; preds = %for.body94, %middle.block206, %for.body52, %cleanup
%re.0.lcssa = phi i32 [ 1, %cleanup ], [ 1, %for.body52 ], [ %76, %middle.block206 ], [ %re.1, %for.body94 ]
%cmp108 = icmp eq i32 %re.0.lcssa, 8
%inc111 = zext i1 %cmp108 to i32
%spec.select = add nuw nsw i32 %result.0180, %inc111
call void @llvm.stackrestore.p0(ptr %62)
%add114 = add nuw nsw i32 %i47.0181, 2
%77 = load i32, ptr %N, align 4, !tbaa !5
%cmp49.not = icmp sgt i32 %add114, %77
br i1 %cmp49.not, label %for.cond.cleanup51, label %for.body52, !llvm.loop !15
for.body94: ; preds = %for.body94.preheader215, %for.body94
%indvars.iv201 = phi i64 [ %indvars.iv.next202, %for.body94 ], [ %indvars.iv201.ph, %for.body94.preheader215 ]
%re.0176 = phi i32 [ %re.1, %for.body94 ], [ %re.0176.ph, %for.body94.preheader215 ]
%arrayidx96 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv201
%78 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%add = add nuw nsw i32 %78, 1
%cmp97.inv = icmp slt i32 %78, 1
%mul102 = select i1 %cmp97.inv, i32 1, i32 %add
%re.1 = mul nsw i32 %mul102, %re.0176
%indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1
%exitcond204.not = icmp eq i64 %indvars.iv.next202, %49
br i1 %exitcond204.not, label %for.cond.cleanup93, label %for.body94, !llvm.loop !16
if.end118: ; preds = %for.cond.cleanup51, %if.then45
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %sosu) #7
call void @llvm.lifetime.end.p0(i64 840, ptr nonnull %list) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; 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.mul.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, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int i,n,m;
char s[51],t[51];
scanf("%s%s",s,t);
n=strlen(s);
m=strlen(t);
for(i=0;i<m;i++)
printf("%c%c",s[i],t[i]);
if(n-m==1)printf("%c\n",s[n-1]);
else printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228661/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228661/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%c%c\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [51 x i8], align 16
%t = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call3 to i32
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6
%conv6 = trunc i64 %call5 to i32
%cmp26 = icmp sgt i32 %conv6, 0
br i1 %cmp26, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call5, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv8 = sext i8 %0 to i32
%arrayidx10 = getelementptr inbounds [51 x i8], ptr %t, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%conv11 = sext i8 %1 to i32
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv8, i32 noundef %conv11)
%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 !8
for.end: ; preds = %for.body, %entry
%sub = sub nsw i32 %conv, %conv6
%cmp13 = icmp eq i32 %sub, 1
br i1 %cmp13, label %if.then, label %if.else
if.then: ; preds = %for.end
%sub15 = shl i64 %call3, 32
%sext = add i64 %sub15, -4294967296
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds [51 x i8], ptr %s, i64 0, i64 %idxprom16
%2 = load i8, ptr %arrayidx17, align 1, !tbaa !5
%conv18 = sext i8 %2 to i32
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv18)
br label %if.end
if.else: ; preds = %for.end
%putchar = call i32 @putchar(i32 10)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#define pai 3.1415926535
int main(void) {
char O[51], E[51];
scanf("%s %s", O, E);
char S[101];
int count = 0;
for (int i = 0;i<strlen(O);i++) {
S[count] = O[i];
count+=2;
}
count = 1;
for (int i = 0; i < strlen(E); i ++) {
S[count] = E[i];
count+=2;
}
S[strlen(O) + strlen(E)] = '\0';
printf("%s\n", S);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228704/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228704/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%O = alloca [51 x i8], align 16
%E = alloca [51 x i8], align 16
%S = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %O) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %E) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %O, ptr noundef nonnull %E)
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %S) #5
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %O) #6
%cmp39.not = icmp eq i64 %call3, 0
br i1 %cmp39.not, label %for.cond8.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call3, 3
%0 = icmp ult i64 %call3, 4
br i1 %0, label %for.cond8.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %call3, -4
br label %for.body
for.cond8.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv48.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next49.3, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond8.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond8.preheader.loopexit.unr-lcssa, %for.body.epil
%indvars.iv48.epil = phi i64 [ %indvars.iv.next49.epil, %for.body.epil ], [ %indvars.iv48.unr, %for.cond8.preheader.loopexit.unr-lcssa ]
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.cond8.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond8.preheader.loopexit.unr-lcssa ]
%arrayidx.epil = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv.epil
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%arrayidx6.epil = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv48.epil
store i8 %1, ptr %arrayidx6.epil, align 2, !tbaa !5
%indvars.iv.next49.epil = add nuw i64 %indvars.iv48.epil, 2
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond8.preheader, label %for.body.epil, !llvm.loop !8
for.cond8.preheader: ; preds = %for.cond8.preheader.loopexit.unr-lcssa, %for.body.epil, %entry
%call11 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %E) #6
%cmp1243.not = icmp eq i64 %call11, 0
br i1 %cmp1243.not, label %for.cond.cleanup14, label %for.body15.preheader
for.body15.preheader: ; preds = %for.cond8.preheader
%xtraiter61 = and i64 %call11, 3
%2 = icmp ult i64 %call11, 4
br i1 %2, label %for.cond.cleanup14.loopexit.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter64 = and i64 %call11, -4
br label %for.body15
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv48 = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next49.3, %for.body ]
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv48
store i8 %3, ptr %arrayidx6, align 8, !tbaa !5
%indvars.iv.next49 = or i64 %indvars.iv48, 2
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%arrayidx6.1 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next49
store i8 %4, ptr %arrayidx6.1, align 2, !tbaa !5
%indvars.iv.next49.1 = or i64 %indvars.iv48, 4
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv.next.1
%5 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%arrayidx6.2 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next49.1
store i8 %5, ptr %arrayidx6.2, align 4, !tbaa !5
%indvars.iv.next49.2 = or i64 %indvars.iv48, 6
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [51 x i8], ptr %O, i64 0, i64 %indvars.iv.next.2
%6 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%arrayidx6.3 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next49.2
store i8 %6, ptr %arrayidx6.3, align 2, !tbaa !5
%indvars.iv.next49.3 = add nuw i64 %indvars.iv48, 8
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond8.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !10
for.cond.cleanup14.loopexit.unr-lcssa: ; preds = %for.body15, %for.body15.preheader
%indvars.iv55.unr = phi i64 [ 1, %for.body15.preheader ], [ %indvars.iv.next56.3, %for.body15 ]
%indvars.iv53.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next54.3, %for.body15 ]
%lcmp.mod63.not = icmp eq i64 %xtraiter61, 0
br i1 %lcmp.mod63.not, label %for.cond.cleanup14, label %for.body15.epil
for.body15.epil: ; preds = %for.cond.cleanup14.loopexit.unr-lcssa, %for.body15.epil
%indvars.iv55.epil = phi i64 [ %indvars.iv.next56.epil, %for.body15.epil ], [ %indvars.iv55.unr, %for.cond.cleanup14.loopexit.unr-lcssa ]
%indvars.iv53.epil = phi i64 [ %indvars.iv.next54.epil, %for.body15.epil ], [ %indvars.iv53.unr, %for.cond.cleanup14.loopexit.unr-lcssa ]
%epil.iter62 = phi i64 [ %epil.iter62.next, %for.body15.epil ], [ 0, %for.cond.cleanup14.loopexit.unr-lcssa ]
%arrayidx17.epil = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv53.epil
%7 = load i8, ptr %arrayidx17.epil, align 1, !tbaa !5
%arrayidx19.epil = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv55.epil
store i8 %7, ptr %arrayidx19.epil, align 1, !tbaa !5
%indvars.iv.next56.epil = add nuw i64 %indvars.iv55.epil, 2
%indvars.iv.next54.epil = add nuw nsw i64 %indvars.iv53.epil, 1
%epil.iter62.next = add i64 %epil.iter62, 1
%epil.iter62.cmp.not = icmp eq i64 %epil.iter62.next, %xtraiter61
br i1 %epil.iter62.cmp.not, label %for.cond.cleanup14, label %for.body15.epil, !llvm.loop !12
for.cond.cleanup14: ; preds = %for.cond.cleanup14.loopexit.unr-lcssa, %for.body15.epil, %for.cond8.preheader
%add28 = add i64 %call11, %call3
%arrayidx29 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %add28
store i8 0, ptr %arrayidx29, align 1, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %S)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %E) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %O) #5
ret i32 0
for.body15: ; preds = %for.body15, %for.body15.preheader.new
%indvars.iv55 = phi i64 [ 1, %for.body15.preheader.new ], [ %indvars.iv.next56.3, %for.body15 ]
%indvars.iv53 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next54.3, %for.body15 ]
%niter65 = phi i64 [ 0, %for.body15.preheader.new ], [ %niter65.next.3, %for.body15 ]
%arrayidx17 = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv53
%8 = load i8, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv55
store i8 %8, ptr %arrayidx19, align 1, !tbaa !5
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 2
%indvars.iv.next54 = or i64 %indvars.iv53, 1
%arrayidx17.1 = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv.next54
%9 = load i8, ptr %arrayidx17.1, align 1, !tbaa !5
%arrayidx19.1 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next56
store i8 %9, ptr %arrayidx19.1, align 1, !tbaa !5
%indvars.iv.next56.1 = add nuw nsw i64 %indvars.iv55, 4
%indvars.iv.next54.1 = or i64 %indvars.iv53, 2
%arrayidx17.2 = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv.next54.1
%10 = load i8, ptr %arrayidx17.2, align 2, !tbaa !5
%arrayidx19.2 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next56.1
store i8 %10, ptr %arrayidx19.2, align 1, !tbaa !5
%indvars.iv.next56.2 = add nuw nsw i64 %indvars.iv55, 6
%indvars.iv.next54.2 = or i64 %indvars.iv53, 3
%arrayidx17.3 = getelementptr inbounds [51 x i8], ptr %E, i64 0, i64 %indvars.iv.next54.2
%11 = load i8, ptr %arrayidx17.3, align 1, !tbaa !5
%arrayidx19.3 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv.next56.2
store i8 %11, ptr %arrayidx19.3, align 1, !tbaa !5
%indvars.iv.next56.3 = add nuw i64 %indvars.iv55, 8
%indvars.iv.next54.3 = add nuw nsw i64 %indvars.iv53, 4
%niter65.next.3 = add i64 %niter65, 4
%niter65.ncmp.3 = icmp eq i64 %niter65.next.3, %unroll_iter64
br i1 %niter65.ncmp.3, label %for.cond.cleanup14.loopexit.unr-lcssa, label %for.body15, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.unroll.disable"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
#include <string.h>
int
main(int argc, char *argv[])
{
char s1[51];
char s2[51];
scanf("%s",s1);
scanf("%s",s2);
for(int i=0;i<strlen(s1)-1;i++){
printf("%c%c",s1[i],s2[i]);
}
if(strlen(s1)==strlen(s2)){
printf("%c%c",s1[strlen(s1)-1],s2[strlen(s2)-1]);
}
else{
printf("%c",s1[strlen(s1)-1]);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228748/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228748/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%c%c\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:
%s1 = alloca [51 x i8], align 16
%s2 = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %s1) #5
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %s2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s2)
%call439 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s1) #6
%cmp41.not = icmp eq i64 %call439, 1
br i1 %cmp41.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%call4.lcssa = phi i64 [ 1, %entry ], [ %call4, %for.body ]
%sub.lcssa = phi i64 [ 0, %entry ], [ %sub, %for.body ]
%call14 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s2) #6
%cmp15 = icmp eq i64 %call4.lcssa, %call14
%arrayidx20 = getelementptr inbounds [51 x i8], ptr %s1, i64 0, i64 %sub.lcssa
%0 = load i8, ptr %arrayidx20, align 1, !tbaa !5
%conv21 = sext i8 %0 to i32
br i1 %cmp15, label %if.then, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [51 x i8], ptr %s1, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv6 = sext i8 %1 to i32
%arrayidx8 = getelementptr inbounds [51 x i8], ptr %s2, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%conv9 = sext i8 %2 to i32
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv6, i32 noundef %conv9)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s1) #6
%sub = add i64 %call4, -1
%cmp = icmp ugt i64 %sub, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8
if.then: ; preds = %for.cond.cleanup
%sub24 = add i64 %call4.lcssa, -1
%arrayidx25 = getelementptr inbounds [51 x i8], ptr %s2, i64 0, i64 %sub24
%3 = load i8, ptr %arrayidx25, align 1, !tbaa !5
%conv26 = sext i8 %3 to i32
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv21, i32 noundef %conv26)
br label %if.end
if.else: ; preds = %for.cond.cleanup
%putchar = call i32 @putchar(i32 %conv21)
br label %if.end
if.end: ; preds = %if.else, %if.then
%putchar38 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %s2) #5
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %s1) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main() {
char a[102];
char b[102];
int c;
scanf("%s", a);
fflush(stdin);
scanf("%s", b);
fflush(stdin);
c = strlen(a);
for (int i = 0;i < c;i++) {
if (b[i] == NULL) {
printf("%c", a[i]);
}
else {
printf("%c%c", a[i], b[i]);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [5 x i8] c"%c%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [102 x i8], align 16
%b = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call1 = call i32 @fflush(ptr noundef %0)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call4 = call i32 @fflush(ptr noundef %1)
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%conv = trunc i64 %call6 to i32
%cmp27 = icmp sgt i32 %conv, 0
br i1 %cmp27, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call6, 4294967295
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %a) #5
ret i32 0
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [102 x i8], ptr %b, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp9 = icmp eq i8 %2, 0
%arrayidx12 = getelementptr inbounds [102 x i8], ptr %a, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx12, align 1, !tbaa !9
%conv13 = sext i8 %3 to i32
br i1 %cmp9, label %if.then, label %if.else
if.then: ; preds = %for.body
%putchar = call i32 @putchar(i32 %conv13)
br label %for.inc
if.else: ; preds = %for.body
%conv20 = sext i8 %2 to i32
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv13, i32 noundef %conv20)
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = !{!"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"}
|
#include <stdio.h>
#include <stdlib.h>
/* char dummyA[100],dummyB[100];
int inputA(char sp[],int MS){
int stc = 0;
while(stc < MS+1){ //50文字以内でループ
scanf("%c",&sp[stc]); //一文字ずつスキャン
if(sp[stc]>='a' && sp[stc]<='z'){ //小文字アルファベット以外はループを抜ける
if(sp[stc] == '\n' || stc == 50){ //改行が来たらNULLに置き換え
if(stc == 0) break; //そもそも何も入力してなかったらループ抜ける
sp[stc] = '\0';
return stc;
}else {stc++;}
}else {break;}
}
// scanf("%s",dummyA);
//rewind(stdin);
//exit(0);
return 50;
}
int inputB(char sp[],int MS,int limit){
int stc = 0;
limit++;
while(stc < MS+1 && stc < limit){
scanf("%c",&sp[stc]);
if(sp[stc] == '\n'){
if(stc != limit-2 && stc != limit-1 || stc == 50) break;
sp[stc] = '\0';
return 0;
}
else {stc++;}
}
//scanf("%s",dummyB);
//rewind(stdin);
//exit(0);
return -1;
}
int main(void){
char a[51],b[51];
int a1 = 0;
int b1 = 0;
int MS = 50;
int inputANum = inputA(a,MS);
inputB(b,MS,inputANum);
for(int i = 0; i < 50; i++){
if(a[a1] == '\0' || a[a1] == '\n' || b[b1] == '\n') {
printf("\n");
exit(0);
}
printf("%c%c",a[a1],b[b1]);
a1++;
b1++;
//break;
}
}*/
int main(void){
char a[100],b[100];
char dummy;
int a1 = 0;
int b1 = 0;
scanf("%s",a);
scanf("%c",&dummy);
scanf("%s",b);
/*for(int i = 0; i < 50; i++){
if(b[b1] == '\n') {
printf("\n");
//break;
exit(0);
}
printf("%c%c",a[a1],b[b1]);
a1++;
b1++;
}
printf("\n");
return 0;
}*/
char AB[200];
for(int i = 0; i<50; i++){
AB[2*i] = a[i];
AB[2*i + 1] = b[i];
}
printf("%s\n",AB);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228834/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228834/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\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
%dummy = alloca i8, align 1
%AB = alloca [200 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 1, ptr nonnull %dummy) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %dummy)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %AB) #4
%wide.load = load <8 x i8>, ptr %a, align 16, !tbaa !5
%wide.load22 = load <8 x i8>, ptr %b, align 16, !tbaa !5
%interleaved.vec = shufflevector <8 x i8> %wide.load, <8 x i8> %wide.load22, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec, ptr %AB, align 16, !tbaa !5
%0 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 8
%wide.load.1 = load <8 x i8>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 8
%wide.load22.1 = load <8 x i8>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 16
%interleaved.vec.1 = shufflevector <8 x i8> %wide.load.1, <8 x i8> %wide.load22.1, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec.1, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 16
%wide.load.2 = load <8 x i8>, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 16
%wide.load22.2 = load <8 x i8>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 32
%interleaved.vec.2 = shufflevector <8 x i8> %wide.load.2, <8 x i8> %wide.load22.2, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec.2, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 24
%wide.load.3 = load <8 x i8>, ptr %6, align 8, !tbaa !5
%7 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 24
%wide.load22.3 = load <8 x i8>, ptr %7, align 8, !tbaa !5
%8 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 48
%interleaved.vec.3 = shufflevector <8 x i8> %wide.load.3, <8 x i8> %wide.load22.3, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec.3, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 32
%wide.load.4 = load <8 x i8>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 32
%wide.load22.4 = load <8 x i8>, ptr %10, align 16, !tbaa !5
%11 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 64
%interleaved.vec.4 = shufflevector <8 x i8> %wide.load.4, <8 x i8> %wide.load22.4, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec.4, ptr %11, align 16, !tbaa !5
%12 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 40
%wide.load.5 = load <8 x i8>, ptr %12, align 8, !tbaa !5
%13 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 40
%wide.load22.5 = load <8 x i8>, ptr %13, align 8, !tbaa !5
%14 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 80
%interleaved.vec.5 = shufflevector <8 x i8> %wide.load.5, <8 x i8> %wide.load22.5, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec.5, ptr %14, align 16, !tbaa !5
%arrayidx = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 48
%15 = load i8, ptr %arrayidx, align 16, !tbaa !5
%arrayidx5 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 96
store i8 %15, ptr %arrayidx5, align 16, !tbaa !5
%arrayidx7 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 48
%16 = load i8, ptr %arrayidx7, align 16, !tbaa !5
%arrayidx10 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 97
store i8 %16, ptr %arrayidx10, align 1, !tbaa !5
%arrayidx.1 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 49
%17 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%arrayidx5.1 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 98
store i8 %17, ptr %arrayidx5.1, align 2, !tbaa !5
%arrayidx7.1 = getelementptr inbounds [100 x i8], ptr %b, i64 0, i64 49
%18 = load i8, ptr %arrayidx7.1, align 1, !tbaa !5
%arrayidx10.1 = getelementptr inbounds [200 x i8], ptr %AB, i64 0, i64 99
store i8 %18, ptr %arrayidx10.1, align 1, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %AB)
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %AB) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %dummy) #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"}
|
#include <stdio.h>
#include <string.h>
char O[55];
char E[55];
char ans[110];
int main() {
scanf("%s", O);
scanf("%s", E);
int i;
int len1 = strlen(O);
int len2 = strlen(E);
int cnt1 = 0;
int cnt2 = 0;
for (i = 0;; i+=2) {
if (cnt1 >= len1 && cnt2 >= len2) { break; }
if (cnt1 < len1) {
ans[i] = O[cnt1];
cnt1++;
}
if (cnt2 < len2) {
ans[i + 1] = E[cnt2];
cnt2++;
}
}
printf("%s\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228892/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228892/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
@O = dso_local global [55 x i8] zeroinitializer, align 16
@E = dso_local global [55 x i8] zeroinitializer, align 16
@ans = dso_local global [110 x i8] zeroinitializer, align 16
; 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 @O)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @E)
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @O) #4
%conv = trunc i64 %call2 to i32
%call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @E) #4
%conv4 = trunc i64 %call3 to i32
%cmp.not35 = icmp sgt i32 %conv, 0
%cmp6.not36 = icmp sgt i32 %conv4, 0
%or.cond37 = select i1 %cmp.not35, i1 true, i1 %cmp6.not36
br i1 %or.cond37, label %if.end, label %for.end
if.end: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%cmp6.not42 = phi i1 [ %cmp6.not, %for.inc ], [ %cmp6.not36, %entry ]
%cmp.not41 = phi i1 [ %cmp.not, %for.inc ], [ %cmp.not35, %entry ]
%cnt2.040 = phi i32 [ %cnt2.1, %for.inc ], [ 0, %entry ]
%cnt1.039 = phi i32 [ %cnt1.1, %for.inc ], [ 0, %entry ]
br i1 %cmp.not41, label %if.then10, label %if.end13
if.then10: ; preds = %if.end
%idxprom = sext i32 %cnt1.039 to i64
%arrayidx = getelementptr inbounds [55 x i8], ptr @O, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx12 = getelementptr inbounds [110 x i8], ptr @ans, i64 0, i64 %indvars.iv
store i8 %0, ptr %arrayidx12, align 2, !tbaa !5
%inc = add nsw i32 %cnt1.039, 1
br label %if.end13
if.end13: ; preds = %if.then10, %if.end
%cnt1.1 = phi i32 [ %inc, %if.then10 ], [ %cnt1.039, %if.end ]
br i1 %cmp6.not42, label %if.then16, label %for.inc
if.then16: ; preds = %if.end13
%idxprom17 = sext i32 %cnt2.040 to i64
%arrayidx18 = getelementptr inbounds [55 x i8], ptr @E, i64 0, i64 %idxprom17
%1 = load i8, ptr %arrayidx18, align 1, !tbaa !5
%2 = or i64 %indvars.iv, 1
%arrayidx20 = getelementptr inbounds [110 x i8], ptr @ans, i64 0, i64 %2
store i8 %1, ptr %arrayidx20, align 1, !tbaa !5
%inc21 = add nsw i32 %cnt2.040, 1
br label %for.inc
for.inc: ; preds = %if.end13, %if.then16
%cnt2.1 = phi i32 [ %inc21, %if.then16 ], [ %cnt2.040, %if.end13 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 2
%cmp.not = icmp slt i32 %cnt1.1, %conv
%cmp6.not = icmp slt i32 %cnt2.1, %conv4
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp6.not
br i1 %or.cond, label %if.end, label %for.end
for.end: ; preds = %for.inc, %entry
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @ans)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a;
char s[10];
scanf("%d %s",&a,&s);
if(a<3200)
{
printf("red\n");
}
else
{
printf("%s\n",s);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228935/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228935/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.s = select i1 %cmp, ptr @str, ptr %s
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.s)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #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>
#include<string.h>
#include<stdlib.h>
int main(){
int a;
char s[15];
scanf("%d", &a);
scanf("%s", s);
if(a >= 3200) printf("%s\n", s);
else printf("red\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_228979/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_228979/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %s) #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 a;
char s[11];
scanf("%d\n", &a);
scanf("%s", s);
if (a <3200)
printf("red");
else
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229020/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229020/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a;
char s[11];
scanf("%d",&a);
scanf("%s",s);
if(a >= 3200){
printf("%s",s);
}else{
printf("red");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229064/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229064/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
int main(void){
int a;
char s[9999];
scanf("%d %s", &a, s);
if(a>=3200){
printf("%s", s);
return 0;
}
printf("red");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229114/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [9999 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 9999, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %cleanup
if.end: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
cleanup: ; preds = %if.end, %if.then
call void @llvm.lifetime.end.p0(i64 9999, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a;
char str[11];
scanf("%d",&a);
scanf("%10s",str);
if (a>=3200) {
printf("%s\n",str);
}else{
printf("%s\n","red");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229165/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229165/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"%10s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%str = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%str..str.3 = select i1 %cmp, ptr %str, ptr @.str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str..str.3)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %str) #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>
#include<stdlib.h>
#define MAX 11
int main(){
int a;
char boja[MAX];
scanf("%d%s", &a, boja);
if(a<3200)
printf("red\n");
else
printf("%s\n", boja);
exit(EXIT_SUCCESS);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229208/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229208/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: noreturn nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%boja = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %boja) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %boja)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.boja = select i1 %cmp, ptr @str, ptr %boja
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.boja)
call void @exit(i32 noundef 0) #6
unreachable
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-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 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int a;
char s[10];
scanf("%d",&a);
scanf("%s",s);
if(a>=3200)
{
printf("%s\n",s);;
}
else
{
printf("red\n");;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229251/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229251/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
%s.str = select i1 %cmp, ptr %s, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s.str)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #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 a;
char s[100];
scanf("%d",&a);
scanf("%s",s);
if(a>=3200) printf("%s",s);
else printf("red");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229295/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229295/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 3199
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
br label %if.end
if.else: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
char s[10];
scanf("%d", &a);
scanf("%s", s);
if(a < 3200) printf("red\n");
else printf("%s\n", s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229338/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229338/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"red\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 3200
%str.s = select i1 %cmp, ptr @str, ptr %s
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.s)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #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"}
|
#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#include <assert.h>
#include <stdio.h>
typedef long long int lld;
void table(int prev[], int new[]) {
for (int i = 0; i <= 9; i++) {
if (prev == NULL) {
new[i] = 1;
} else {
new[i] = 0;
for (int j = -1; j <= 1; j++) {
if (i + j < 0 || i + j > 9) {
continue;
}
new[i] += prev[i + j];
}
}
}
}
int main() {
int k;
assert(scanf("%d", &k) == 1);
int cnt[20][10], last;
lld tmp = k - 1;
for (int i = 0; i < 20; i++) {
table(i > 0 ? cnt[i - 1] : NULL, cnt[i]);
for (int j = 1; j <= 9; j++) {
if (tmp >= cnt[i][j]) {
tmp -= cnt[i][j];
} else {
last = j;
printf("%d", last);
for (int l = i - 1; l >= 0; l--) {
for (int m = -1; m <= 1; m++) {
if (last + m < 0 || last + m > 9) {
continue;
}
if (tmp >= cnt[l][last + m]) {
tmp -= cnt[l][last + m];
} else {
last = last + m;
printf("%d", last);
break;
}
}
}
goto exit;
}
}
}
exit:
puts("");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229389/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [21 x i8] c"scanf(\22%d\22, &k) == 1\00", align 1
@.str.2 = private unnamed_addr constant [63 x i8] c"/data/TheStack_IR/OJ_Samples/Collated/C/Source_229389/source.c\00", align 1
@__PRETTY_FUNCTION__.main = private unnamed_addr constant [11 x i8] c"int main()\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @table(ptr noundef readonly %prev, ptr nocapture noundef writeonly %new) local_unnamed_addr #0 {
entry:
%cmp1 = icmp eq ptr %prev, null
br i1 %cmp1, label %for.body.us.preheader, label %for.inc.2.9
for.body.us.preheader: ; preds = %entry
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %new, align 4, !tbaa !5
%arrayidx.us.4 = getelementptr inbounds i32, ptr %new, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %arrayidx.us.4, align 4, !tbaa !5
%arrayidx.us.8 = getelementptr inbounds i32, ptr %new, i64 8
store i32 1, ptr %arrayidx.us.8, align 4, !tbaa !5
%arrayidx.us.9 = getelementptr inbounds i32, ptr %new, i64 9
store i32 1, ptr %arrayidx.us.9, align 4, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc.2.9, %for.body.us.preheader
ret void
for.inc.2.9: ; preds = %entry
store i32 0, ptr %new, align 4, !tbaa !5
%0 = load i32, ptr %prev, align 4, !tbaa !5
store i32 %0, ptr %new, align 4, !tbaa !5
%arrayidx14.2 = getelementptr inbounds i32, ptr %prev, i64 1
%1 = load i32, ptr %arrayidx14.2, align 4, !tbaa !5
%add17.2 = add nsw i32 %0, %1
store i32 %add17.2, ptr %new, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds i32, ptr %new, i64 1
store i32 0, ptr %arrayidx3.1, align 4, !tbaa !5
%2 = load i32, ptr %prev, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3.1, align 4, !tbaa !5
%arrayidx14.1.1 = getelementptr inbounds i32, ptr %prev, i64 1
%3 = load i32, ptr %arrayidx14.1.1, align 4, !tbaa !5
%add17.1.1 = add nsw i32 %2, %3
store i32 %add17.1.1, ptr %arrayidx3.1, align 4, !tbaa !5
%arrayidx14.2.1 = getelementptr inbounds i32, ptr %prev, i64 2
%4 = load i32, ptr %arrayidx14.2.1, align 4, !tbaa !5
%add17.2.1 = add nsw i32 %add17.1.1, %4
store i32 %add17.2.1, ptr %arrayidx3.1, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds i32, ptr %new, i64 2
store i32 0, ptr %arrayidx3.2, align 4, !tbaa !5
%arrayidx14.246 = getelementptr inbounds i32, ptr %prev, i64 1
%5 = load i32, ptr %arrayidx14.246, align 4, !tbaa !5
store i32 %5, ptr %arrayidx3.2, align 4, !tbaa !5
%arrayidx14.1.2 = getelementptr inbounds i32, ptr %prev, i64 2
%6 = load i32, ptr %arrayidx14.1.2, align 4, !tbaa !5
%add17.1.2 = add nsw i32 %5, %6
store i32 %add17.1.2, ptr %arrayidx3.2, align 4, !tbaa !5
%arrayidx14.2.2 = getelementptr inbounds i32, ptr %prev, i64 3
%7 = load i32, ptr %arrayidx14.2.2, align 4, !tbaa !5
%add17.2.2 = add nsw i32 %add17.1.2, %7
store i32 %add17.2.2, ptr %arrayidx3.2, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds i32, ptr %new, i64 3
store i32 0, ptr %arrayidx3.3, align 4, !tbaa !5
%arrayidx14.3 = getelementptr inbounds i32, ptr %prev, i64 2
%8 = load i32, ptr %arrayidx14.3, align 4, !tbaa !5
store i32 %8, ptr %arrayidx3.3, align 4, !tbaa !5
%arrayidx14.1.3 = getelementptr inbounds i32, ptr %prev, i64 3
%9 = load i32, ptr %arrayidx14.1.3, align 4, !tbaa !5
%add17.1.3 = add nsw i32 %8, %9
store i32 %add17.1.3, ptr %arrayidx3.3, align 4, !tbaa !5
%arrayidx14.2.3 = getelementptr inbounds i32, ptr %prev, i64 4
%10 = load i32, ptr %arrayidx14.2.3, align 4, !tbaa !5
%add17.2.3 = add nsw i32 %add17.1.3, %10
store i32 %add17.2.3, ptr %arrayidx3.3, align 4, !tbaa !5
%arrayidx3.4 = getelementptr inbounds i32, ptr %new, i64 4
store i32 0, ptr %arrayidx3.4, align 4, !tbaa !5
%arrayidx14.4 = getelementptr inbounds i32, ptr %prev, i64 3
%11 = load i32, ptr %arrayidx14.4, align 4, !tbaa !5
store i32 %11, ptr %arrayidx3.4, align 4, !tbaa !5
%arrayidx14.1.4 = getelementptr inbounds i32, ptr %prev, i64 4
%12 = load i32, ptr %arrayidx14.1.4, align 4, !tbaa !5
%add17.1.4 = add nsw i32 %11, %12
store i32 %add17.1.4, ptr %arrayidx3.4, align 4, !tbaa !5
%arrayidx14.2.4 = getelementptr inbounds i32, ptr %prev, i64 5
%13 = load i32, ptr %arrayidx14.2.4, align 4, !tbaa !5
%add17.2.4 = add nsw i32 %add17.1.4, %13
store i32 %add17.2.4, ptr %arrayidx3.4, align 4, !tbaa !5
%arrayidx3.5 = getelementptr inbounds i32, ptr %new, i64 5
store i32 0, ptr %arrayidx3.5, align 4, !tbaa !5
%arrayidx14.5 = getelementptr inbounds i32, ptr %prev, i64 4
%14 = load i32, ptr %arrayidx14.5, align 4, !tbaa !5
store i32 %14, ptr %arrayidx3.5, align 4, !tbaa !5
%arrayidx14.1.5 = getelementptr inbounds i32, ptr %prev, i64 5
%15 = load i32, ptr %arrayidx14.1.5, align 4, !tbaa !5
%add17.1.5 = add nsw i32 %14, %15
store i32 %add17.1.5, ptr %arrayidx3.5, align 4, !tbaa !5
%arrayidx14.2.5 = getelementptr inbounds i32, ptr %prev, i64 6
%16 = load i32, ptr %arrayidx14.2.5, align 4, !tbaa !5
%add17.2.5 = add nsw i32 %add17.1.5, %16
store i32 %add17.2.5, ptr %arrayidx3.5, align 4, !tbaa !5
%arrayidx3.6 = getelementptr inbounds i32, ptr %new, i64 6
store i32 0, ptr %arrayidx3.6, align 4, !tbaa !5
%arrayidx14.6 = getelementptr inbounds i32, ptr %prev, i64 5
%17 = load i32, ptr %arrayidx14.6, align 4, !tbaa !5
store i32 %17, ptr %arrayidx3.6, align 4, !tbaa !5
%arrayidx14.1.6 = getelementptr inbounds i32, ptr %prev, i64 6
%18 = load i32, ptr %arrayidx14.1.6, align 4, !tbaa !5
%add17.1.6 = add nsw i32 %17, %18
store i32 %add17.1.6, ptr %arrayidx3.6, align 4, !tbaa !5
%arrayidx14.2.6 = getelementptr inbounds i32, ptr %prev, i64 7
%19 = load i32, ptr %arrayidx14.2.6, align 4, !tbaa !5
%add17.2.6 = add nsw i32 %add17.1.6, %19
store i32 %add17.2.6, ptr %arrayidx3.6, align 4, !tbaa !5
%arrayidx3.7 = getelementptr inbounds i32, ptr %new, i64 7
store i32 0, ptr %arrayidx3.7, align 4, !tbaa !5
%arrayidx14.7 = getelementptr inbounds i32, ptr %prev, i64 6
%20 = load i32, ptr %arrayidx14.7, align 4, !tbaa !5
store i32 %20, ptr %arrayidx3.7, align 4, !tbaa !5
%arrayidx14.1.7 = getelementptr inbounds i32, ptr %prev, i64 7
%21 = load i32, ptr %arrayidx14.1.7, align 4, !tbaa !5
%add17.1.7 = add nsw i32 %20, %21
store i32 %add17.1.7, ptr %arrayidx3.7, align 4, !tbaa !5
%arrayidx14.2.7 = getelementptr inbounds i32, ptr %prev, i64 8
%22 = load i32, ptr %arrayidx14.2.7, align 4, !tbaa !5
%add17.2.7 = add nsw i32 %add17.1.7, %22
store i32 %add17.2.7, ptr %arrayidx3.7, align 4, !tbaa !5
%arrayidx3.8 = getelementptr inbounds i32, ptr %new, i64 8
store i32 0, ptr %arrayidx3.8, align 4, !tbaa !5
%arrayidx14.8 = getelementptr inbounds i32, ptr %prev, i64 7
%23 = load i32, ptr %arrayidx14.8, align 4, !tbaa !5
store i32 %23, ptr %arrayidx3.8, align 4, !tbaa !5
%arrayidx14.1.8 = getelementptr inbounds i32, ptr %prev, i64 8
%24 = load i32, ptr %arrayidx14.1.8, align 4, !tbaa !5
%add17.1.8 = add nsw i32 %23, %24
store i32 %add17.1.8, ptr %arrayidx3.8, align 4, !tbaa !5
%arrayidx14.2.8 = getelementptr inbounds i32, ptr %prev, i64 9
%25 = load i32, ptr %arrayidx14.2.8, align 4, !tbaa !5
%add17.2.8 = add nsw i32 %add17.1.8, %25
store i32 %add17.2.8, ptr %arrayidx3.8, align 4, !tbaa !5
%arrayidx3.9 = getelementptr inbounds i32, ptr %new, i64 9
store i32 0, ptr %arrayidx3.9, align 4, !tbaa !5
%arrayidx14.9 = getelementptr inbounds i32, ptr %prev, i64 8
%26 = load i32, ptr %arrayidx14.9, align 4, !tbaa !5
store i32 %26, ptr %arrayidx3.9, align 4, !tbaa !5
%arrayidx14.1.9 = getelementptr inbounds i32, ptr %prev, i64 9
%27 = load i32, ptr %arrayidx14.1.9, align 4, !tbaa !5
%add17.1.9 = add nsw i32 %26, %27
store i32 %add17.1.9, ptr %arrayidx3.9, align 4, !tbaa !5
br label %for.cond.cleanup
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 i32 @main() local_unnamed_addr #2 {
entry:
%k = alloca i32, align 4
%cnt = alloca [20 x [10 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%cmp = icmp eq i32 %call, 1
br i1 %cmp, label %if.end, label %if.else
if.else: ; preds = %entry
call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 25, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
unreachable
if.end: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %cnt) #6
%0 = load i32, ptr %k, align 4, !tbaa !5
call void @table(ptr noundef null, ptr noundef nonnull %cnt)
%arrayidx17.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 1
%1 = load i32, ptr %arrayidx17.peel, align 4, !tbaa !5
%cmp19.not.peel.not = icmp sgt i32 %0, %1
br i1 %cmp19.not.peel.not, label %if.then21.peel, label %if.else28.thread
if.then21.peel: ; preds = %if.end
%sub = add nsw i32 %0, -1
%conv = sext i32 %sub to i64
%conv18.peel = sext i32 %1 to i64
%sub27.peel = sub nsw i64 %conv, %conv18.peel
%arrayidx17.1.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 2
%2 = load i32, ptr %arrayidx17.1.peel, align 8, !tbaa !5
%conv18.1.peel = sext i32 %2 to i64
%cmp19.not.1.peel = icmp slt i64 %sub27.peel, %conv18.1.peel
br i1 %cmp19.not.1.peel, label %if.else28.thread, label %if.then21.1.peel
if.then21.1.peel: ; preds = %if.then21.peel
%sub27.1.peel = sub nsw i64 %sub27.peel, %conv18.1.peel
%arrayidx17.2.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 3
%3 = load i32, ptr %arrayidx17.2.peel, align 4, !tbaa !5
%conv18.2.peel = sext i32 %3 to i64
%cmp19.not.2.peel = icmp slt i64 %sub27.1.peel, %conv18.2.peel
br i1 %cmp19.not.2.peel, label %if.else28.thread, label %if.then21.2.peel
if.then21.2.peel: ; preds = %if.then21.1.peel
%sub27.2.peel = sub nsw i64 %sub27.1.peel, %conv18.2.peel
%arrayidx17.3.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 4
%4 = load i32, ptr %arrayidx17.3.peel, align 16, !tbaa !5
%conv18.3.peel = sext i32 %4 to i64
%cmp19.not.3.peel = icmp slt i64 %sub27.2.peel, %conv18.3.peel
br i1 %cmp19.not.3.peel, label %if.else28.thread, label %if.then21.3.peel
if.then21.3.peel: ; preds = %if.then21.2.peel
%sub27.3.peel = sub nsw i64 %sub27.2.peel, %conv18.3.peel
%arrayidx17.4.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 5
%5 = load i32, ptr %arrayidx17.4.peel, align 4, !tbaa !5
%conv18.4.peel = sext i32 %5 to i64
%cmp19.not.4.peel = icmp slt i64 %sub27.3.peel, %conv18.4.peel
br i1 %cmp19.not.4.peel, label %if.else28.thread, label %if.then21.4.peel
if.then21.4.peel: ; preds = %if.then21.3.peel
%sub27.4.peel = sub nsw i64 %sub27.3.peel, %conv18.4.peel
%arrayidx17.5.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 6
%6 = load i32, ptr %arrayidx17.5.peel, align 8, !tbaa !5
%conv18.5.peel = sext i32 %6 to i64
%cmp19.not.5.peel = icmp slt i64 %sub27.4.peel, %conv18.5.peel
br i1 %cmp19.not.5.peel, label %if.else28.thread, label %if.then21.5.peel
if.then21.5.peel: ; preds = %if.then21.4.peel
%sub27.5.peel = sub nsw i64 %sub27.4.peel, %conv18.5.peel
%arrayidx17.6.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 7
%7 = load i32, ptr %arrayidx17.6.peel, align 4, !tbaa !5
%conv18.6.peel = sext i32 %7 to i64
%cmp19.not.6.peel = icmp slt i64 %sub27.5.peel, %conv18.6.peel
br i1 %cmp19.not.6.peel, label %if.else28.thread, label %if.then21.6.peel
if.then21.6.peel: ; preds = %if.then21.5.peel
%sub27.6.peel = sub nsw i64 %sub27.5.peel, %conv18.6.peel
%arrayidx17.7.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 8
%8 = load i32, ptr %arrayidx17.7.peel, align 16, !tbaa !5
%conv18.7.peel = sext i32 %8 to i64
%cmp19.not.7.peel = icmp slt i64 %sub27.6.peel, %conv18.7.peel
br i1 %cmp19.not.7.peel, label %if.else28.thread, label %if.then21.7.peel
if.then21.7.peel: ; preds = %if.then21.6.peel
%sub27.7.peel = sub nsw i64 %sub27.6.peel, %conv18.7.peel
%arrayidx17.8.peel = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 0, i64 9
%9 = load i32, ptr %arrayidx17.8.peel, align 4, !tbaa !5
%conv18.8.peel = sext i32 %9 to i64
%cmp19.not.8.peel = icmp slt i64 %sub27.7.peel, %conv18.8.peel
br i1 %cmp19.not.8.peel, label %if.else28.thread, label %for.body.peel.next
for.body.peel.next: ; preds = %if.then21.7.peel
%sub27.8.peel = sub nsw i64 %sub27.7.peel, %conv18.8.peel
br label %for.body
for.body: ; preds = %for.body.peel.next, %if.then21.8
%indvars.iv = phi i64 [ 1, %for.body.peel.next ], [ %indvars.iv.next, %if.then21.8 ]
%tmp.0126 = phi i64 [ %sub27.8.peel, %for.body.peel.next ], [ %sub27.8, %if.then21.8 ]
%10 = add nsw i64 %indvars.iv, -1
%arrayidx = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %10
%arrayidx7 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv
call void @table(ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx7)
%arrayidx17 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 1
%11 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%conv18 = sext i32 %11 to i64
%cmp19.not = icmp slt i64 %tmp.0126, %conv18
br i1 %cmp19.not, label %if.else28, label %if.then21
if.then21: ; preds = %for.body
%sub27 = sub nsw i64 %tmp.0126, %conv18
%arrayidx17.1 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 2
%12 = load i32, ptr %arrayidx17.1, align 8, !tbaa !5
%conv18.1 = sext i32 %12 to i64
%cmp19.not.1 = icmp slt i64 %sub27, %conv18.1
br i1 %cmp19.not.1, label %if.else28, label %if.then21.1
if.then21.1: ; preds = %if.then21
%sub27.1 = sub nsw i64 %sub27, %conv18.1
%arrayidx17.2 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 3
%13 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5
%conv18.2 = sext i32 %13 to i64
%cmp19.not.2 = icmp slt i64 %sub27.1, %conv18.2
br i1 %cmp19.not.2, label %if.else28, label %if.then21.2
if.then21.2: ; preds = %if.then21.1
%sub27.2 = sub nsw i64 %sub27.1, %conv18.2
%arrayidx17.3 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 4
%14 = load i32, ptr %arrayidx17.3, align 8, !tbaa !5
%conv18.3 = sext i32 %14 to i64
%cmp19.not.3 = icmp slt i64 %sub27.2, %conv18.3
br i1 %cmp19.not.3, label %if.else28, label %if.then21.3
if.then21.3: ; preds = %if.then21.2
%sub27.3 = sub nsw i64 %sub27.2, %conv18.3
%arrayidx17.4 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 5
%15 = load i32, ptr %arrayidx17.4, align 4, !tbaa !5
%conv18.4 = sext i32 %15 to i64
%cmp19.not.4 = icmp slt i64 %sub27.3, %conv18.4
br i1 %cmp19.not.4, label %if.else28, label %if.then21.4
if.then21.4: ; preds = %if.then21.3
%sub27.4 = sub nsw i64 %sub27.3, %conv18.4
%arrayidx17.5 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 6
%16 = load i32, ptr %arrayidx17.5, align 8, !tbaa !5
%conv18.5 = sext i32 %16 to i64
%cmp19.not.5 = icmp slt i64 %sub27.4, %conv18.5
br i1 %cmp19.not.5, label %if.else28, label %if.then21.5
if.then21.5: ; preds = %if.then21.4
%sub27.5 = sub nsw i64 %sub27.4, %conv18.5
%arrayidx17.6 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 7
%17 = load i32, ptr %arrayidx17.6, align 4, !tbaa !5
%conv18.6 = sext i32 %17 to i64
%cmp19.not.6 = icmp slt i64 %sub27.5, %conv18.6
br i1 %cmp19.not.6, label %if.else28, label %if.then21.6
if.then21.6: ; preds = %if.then21.5
%sub27.6 = sub nsw i64 %sub27.5, %conv18.6
%arrayidx17.7 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 8
%18 = load i32, ptr %arrayidx17.7, align 8, !tbaa !5
%conv18.7 = sext i32 %18 to i64
%cmp19.not.7 = icmp slt i64 %sub27.6, %conv18.7
br i1 %cmp19.not.7, label %if.else28, label %if.then21.7
if.then21.7: ; preds = %if.then21.6
%sub27.7 = sub nsw i64 %sub27.6, %conv18.7
%arrayidx17.8 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv, i64 9
%19 = load i32, ptr %arrayidx17.8, align 4, !tbaa !5
%conv18.8 = sext i32 %19 to i64
%cmp19.not.8 = icmp slt i64 %sub27.7, %conv18.8
br i1 %cmp19.not.8, label %if.else28, label %if.then21.8
if.then21.8: ; preds = %if.then21.7
%sub27.8 = sub nsw i64 %sub27.7, %conv18.8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 20
br i1 %exitcond.not, label %cleanup78, label %for.body, !llvm.loop !9
if.else28.thread: ; preds = %if.end, %if.then21.peel, %if.then21.1.peel, %if.then21.2.peel, %if.then21.3.peel, %if.then21.4.peel, %if.then21.5.peel, %if.then21.6.peel, %if.then21.7.peel
%j.0119.lcssa.wide.ph143 = phi i32 [ 9, %if.then21.7.peel ], [ 8, %if.then21.6.peel ], [ 7, %if.then21.5.peel ], [ 6, %if.then21.4.peel ], [ 5, %if.then21.3.peel ], [ 4, %if.then21.2.peel ], [ 3, %if.then21.1.peel ], [ 2, %if.then21.peel ], [ 1, %if.end ]
%call29149 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %j.0119.lcssa.wide.ph143)
br label %cleanup78
if.else28: ; preds = %if.then21.7, %if.then21.6, %if.then21.5, %if.then21.4, %if.then21.3, %if.then21.2, %if.then21.1, %if.then21, %for.body
%j.0119.lcssa.wide.ph = phi i32 [ 9, %if.then21.7 ], [ 8, %if.then21.6 ], [ 7, %if.then21.5 ], [ 6, %if.then21.4 ], [ 5, %if.then21.3 ], [ 4, %if.then21.2 ], [ 3, %if.then21.1 ], [ 2, %if.then21 ], [ 1, %for.body ]
%tmp.1118.lcssa.ph = phi i64 [ %sub27.7, %if.then21.7 ], [ %sub27.6, %if.then21.6 ], [ %sub27.5, %if.then21.5 ], [ %sub27.4, %if.then21.4 ], [ %sub27.3, %if.then21.3 ], [ %sub27.2, %if.then21.2 ], [ %sub27.1, %if.then21.1 ], [ %sub27, %if.then21 ], [ %tmp.0126, %for.body ]
%20 = and i64 %indvars.iv, 4294967295
%21 = icmp eq i64 %20, 0
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %j.0119.lcssa.wide.ph)
br i1 %21, label %cleanup78, label %for.cond36.preheader.preheader
for.cond36.preheader.preheader: ; preds = %if.else28
%22 = and i64 %10, 4294967295
br label %for.cond36.preheader
for.cond36.preheader: ; preds = %for.cond36.preheader.preheader, %cleanup
%indvars.iv140 = phi i64 [ %indvars.iv.next141, %cleanup ], [ %22, %for.cond36.preheader.preheader ]
%tmp.2124 = phi i64 [ %tmp.3117, %cleanup ], [ %tmp.1118.lcssa.ph, %for.cond36.preheader.preheader ]
%last.0123 = phi i32 [ %last.1, %cleanup ], [ %j.0119.lcssa.wide.ph, %for.cond36.preheader.preheader ]
%add = add nsw i32 %last.0123, -1
%or.cond = icmp ugt i32 %add, 9
br i1 %or.cond, label %for.inc, label %if.end47
if.end47: ; preds = %for.cond36.preheader
%idxprom51 = zext i32 %add to i64
%arrayidx52 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv140, i64 %idxprom51
%23 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%conv53 = sext i32 %23 to i64
%cmp54.not = icmp slt i64 %tmp.2124, %conv53
br i1 %cmp54.not, label %if.else64, label %if.then56
if.then56: ; preds = %if.end47
%sub63 = sub nsw i64 %tmp.2124, %conv53
br label %for.inc
if.else64: ; preds = %if.end47.2, %if.end47.1, %if.end47
%tmp.3120.lcssa = phi i64 [ %tmp.2124, %if.end47 ], [ %tmp.4, %if.end47.1 ], [ %tmp.4.1, %if.end47.2 ]
%add.lcssa = phi i32 [ %add, %if.end47 ], [ %last.0123, %if.end47.1 ], [ %add.2, %if.end47.2 ]
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add.lcssa)
br label %cleanup
for.inc: ; preds = %for.cond36.preheader, %if.then56
%tmp.4 = phi i64 [ %tmp.2124, %for.cond36.preheader ], [ %sub63, %if.then56 ]
%or.cond.1 = icmp ugt i32 %last.0123, 9
br i1 %or.cond.1, label %for.inc.1, label %if.end47.1
if.end47.1: ; preds = %for.inc
%idxprom51.1 = zext i32 %last.0123 to i64
%arrayidx52.1 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv140, i64 %idxprom51.1
%24 = load i32, ptr %arrayidx52.1, align 4, !tbaa !5
%conv53.1 = sext i32 %24 to i64
%cmp54.not.1 = icmp slt i64 %tmp.4, %conv53.1
br i1 %cmp54.not.1, label %if.else64, label %if.then56.1
if.then56.1: ; preds = %if.end47.1
%sub63.1 = sub nsw i64 %tmp.4, %conv53.1
br label %for.inc.1
for.inc.1: ; preds = %if.then56.1, %for.inc
%tmp.4.1 = phi i64 [ %tmp.4, %for.inc ], [ %sub63.1, %if.then56.1 ]
%add.2 = add nsw i32 %last.0123, 1
%or.cond.2 = icmp ugt i32 %add.2, 9
br i1 %or.cond.2, label %cleanup, label %if.end47.2
if.end47.2: ; preds = %for.inc.1
%idxprom51.2 = zext i32 %add.2 to i64
%arrayidx52.2 = getelementptr inbounds [20 x [10 x i32]], ptr %cnt, i64 0, i64 %indvars.iv140, i64 %idxprom51.2
%25 = load i32, ptr %arrayidx52.2, align 4, !tbaa !5
%conv53.2 = sext i32 %25 to i64
%cmp54.not.2 = icmp slt i64 %tmp.4.1, %conv53.2
br i1 %cmp54.not.2, label %if.else64, label %if.then56.2
if.then56.2: ; preds = %if.end47.2
%sub63.2 = sub nsw i64 %tmp.4.1, %conv53.2
br label %cleanup
cleanup: ; preds = %for.inc.1, %if.then56.2, %if.else64
%tmp.3117 = phi i64 [ %tmp.3120.lcssa, %if.else64 ], [ %tmp.4.1, %for.inc.1 ], [ %sub63.2, %if.then56.2 ]
%last.1 = phi i32 [ %add.lcssa, %if.else64 ], [ %last.0123, %for.inc.1 ], [ %last.0123, %if.then56.2 ]
%indvars.iv.next141 = add nsw i64 %indvars.iv140, -1
%26 = trunc i64 %indvars.iv140 to i32
%cmp32 = icmp sgt i32 %26, 0
br i1 %cmp32, label %for.cond36.preheader, label %cleanup78, !llvm.loop !12
cleanup78: ; preds = %if.then21.8, %cleanup, %if.else28.thread, %if.else28
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %cnt) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = { noreturn nounwind "no-trapping-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 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#include<math.h>
#define loop(i, l, r) for(i=l; i<r; i++)/*Instead of function, (for).*/
#define rep(i,r) for(i=0; i<r; i++)
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) < (b) ? (a) : (b))
typedef long long int lli;
/*Return Combination ,(nCr)*/
int combi(int n, int r)
{
if(r==0 || r==n) return 1;
else return combi(n-1,r) + combi(n-1,r-1);
}
/*Return gcd(a, b)*/
int gcd(int a, int b){
if(b == 0) return a;
else return gcd(b, a % b);
}
//qsort���Ɏg��compare��,(long long int, int, double�^)
int compare_lli(const void *a, const void *b)
{
return *(lli*)a - *(lli*)b;
}
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
int compare_double(const void *a, const void *b)
{
return *(double*)a - *(double*)b;
}
/*qsort(data, 10, sizeof(int_lli_double), compare_int);*/
/*qsort(�z��, �v�f��, sizeof(�z��̌^), compare_�z��̌^);*/
int chek(int *tmp1, int *tmp2, int n){
int i;
for(i=0; i<n; i++){
if(tmp1[i] != tmp2[i]){
return 1;
}
}
return 0;
}//2�̔z��v���邩�̔���_(return��v��0,�s��v���P)
int Abs(int a){
if(a>=0) return a;
else return -1*a;
}
int main(void)
{
int k;
int head=1, tail=10;
scanf("%d", &k);
lli x, queue[100005];
for(int i=0; i<10; i++)
queue[i]=i;
while(tail <= k){
x = queue[head++];
if(x % 10 != 0)
queue[tail++] = x*10+x%10-1;
queue[tail++] = x*10+x%10;
if(x%10 != 9)
queue[tail++] = x*10+x%10+1;
}
printf("%lld", queue[k]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229439/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229439/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @combi(i32 noundef %n, i32 noundef %r) local_unnamed_addr #0 {
entry:
%cmp10 = icmp eq i32 %r, 0
%cmp111 = icmp eq i32 %r, %n
%or.cond12 = or i1 %cmp10, %cmp111
br i1 %or.cond12, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%r.tr15 = phi i32 [ %sub3, %if.else ], [ %r, %entry ]
%n.tr14 = phi i32 [ %sub, %if.else ], [ %n, %entry ]
%accumulator.tr13 = phi i32 [ %add, %if.else ], [ 0, %entry ]
%sub = add nsw i32 %n.tr14, -1
%call = tail call i32 @combi(i32 noundef %sub, i32 noundef %r.tr15)
%sub3 = add nsw i32 %r.tr15, -1
%add = add nsw i32 %call, %accumulator.tr13
%cmp = icmp eq i32 %sub3, 0
%cmp1 = icmp eq i32 %r.tr15, %n.tr14
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %return.loopexit, label %if.else
return.loopexit: ; preds = %if.else
%0 = add nsw i32 %add, 1
br label %return
return: ; preds = %return.loopexit, %entry
%accumulator.tr.lcssa = phi i32 [ 1, %entry ], [ %0, %return.loopexit ]
ret i32 %accumulator.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ]
ret i32 %a.tr.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_lli(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
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 @compare_double(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !11
%1 = load double, ptr %b, align 8, !tbaa !11
%sub = fsub double %0, %1
%conv = fptosi double %sub to i32
ret i32 %conv
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @chek(ptr nocapture noundef readonly %tmp1, ptr nocapture noundef readonly %tmp2, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, 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 !13
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 %tmp1, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !9
%arrayidx2 = getelementptr inbounds i32, ptr %tmp2, i64 %indvars.iv
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !9
%cmp3.not = icmp eq i32 %0, %1
br i1 %cmp3.not, label %for.cond, label %cleanup
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) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @Abs(i32 noundef %a) local_unnamed_addr #5 {
entry:
%retval.0 = tail call i32 @llvm.abs.i32(i32 %a, i1 true)
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%k = alloca i32, align 4
%queue = alloca [100005 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
call void @llvm.lifetime.start.p0(i64 800040, ptr nonnull %queue) #9
store i64 0, ptr %queue, align 16, !tbaa !5
%arrayidx.1 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 1
store i64 1, ptr %arrayidx.1, align 8, !tbaa !5
%arrayidx.2 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 2
store i64 2, ptr %arrayidx.2, align 16, !tbaa !5
%arrayidx.3 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 3
store i64 3, ptr %arrayidx.3, align 8, !tbaa !5
%arrayidx.4 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 4
store i64 4, ptr %arrayidx.4, align 16, !tbaa !5
%arrayidx.5 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 5
store i64 5, ptr %arrayidx.5, align 8, !tbaa !5
%arrayidx.6 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 6
store i64 6, ptr %arrayidx.6, align 16, !tbaa !5
%arrayidx.7 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 7
store i64 7, ptr %arrayidx.7, align 8, !tbaa !5
%arrayidx.8 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 8
store i64 8, ptr %arrayidx.8, align 16, !tbaa !5
%arrayidx.9 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 9
store i64 9, ptr %arrayidx.9, align 8, !tbaa !5
%0 = load i32, ptr %k, align 4, !tbaa !9
%cmp1.not57 = icmp slt i32 %0, 10
br i1 %cmp1.not57, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end29
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end29 ], [ 1, %entry ]
%tail.058 = phi i32 [ %tail.2, %if.end29 ], [ 10, %entry ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx5 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 %indvars.iv
%1 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%rem = srem i64 %1, 10
%cmp6.not = icmp eq i64 %rem, 0
%mul1247 = mul nsw i64 %1, 10
br i1 %cmp6.not, label %if.end.thread, label %if.end
if.end.thread: ; preds = %while.body
%inc1549 = add nsw i32 %tail.058, 1
%idxprom1650 = sext i32 %tail.058 to i64
%arrayidx1751 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 %idxprom1650
store i64 %mul1247, ptr %arrayidx1751, align 8, !tbaa !5
br label %if.then21
if.end: ; preds = %while.body
%add = add nsw i64 %rem, -1
%sub = add i64 %add, %mul1247
%inc9 = add nsw i32 %tail.058, 1
%idxprom10 = sext i32 %tail.058 to i64
%arrayidx11 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 %idxprom10
store i64 %sub, ptr %arrayidx11, align 8, !tbaa !5
%add14 = add nsw i64 %mul1247, %rem
%inc15 = add nsw i32 %tail.058, 2
%idxprom16 = sext i32 %inc9 to i64
%arrayidx17 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 %idxprom16
store i64 %add14, ptr %arrayidx17, align 8, !tbaa !5
%cmp19.not = icmp eq i64 %rem, 9
br i1 %cmp19.not, label %if.end29, label %if.then21
if.then21: ; preds = %if.end.thread, %if.end
%inc1555 = phi i32 [ %inc1549, %if.end.thread ], [ %inc15, %if.end ]
%add1454 = phi i64 [ %mul1247, %if.end.thread ], [ %add14, %if.end ]
%tail.153 = phi i32 [ %tail.058, %if.end.thread ], [ %inc9, %if.end ]
%add25 = add nsw i64 %add1454, 1
%inc26 = add nsw i32 %tail.153, 2
%idxprom27 = sext i32 %inc1555 to i64
%arrayidx28 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 %idxprom27
store i64 %add25, ptr %arrayidx28, align 8, !tbaa !5
br label %if.end29
if.end29: ; preds = %if.then21, %if.end
%tail.2 = phi i32 [ %inc26, %if.then21 ], [ %inc15, %if.end ]
%cmp1.not = icmp sgt i32 %tail.2, %0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end29, %entry
%idxprom30 = sext i32 %0 to i64
%arrayidx31 = getelementptr inbounds [100005 x i64], ptr %queue, i64 0, i64 %idxprom30
%2 = load i64, ptr %arrayidx31, align 8, !tbaa !5
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %2)
call void @llvm.lifetime.end.p0(i64 800040, ptr nonnull %queue) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
|
#include <stdio.h>
int main(void)
{
int m, n;
int x;
int i;
int cnt;
while (1){
scanf("%d %d", &m, &n);
if (m == 0){
break;
}
cnt = 0;
for (i = m; i <= n; i++){
x = i;
while (x % 2 == 0){
x /= 2;
}
while (x % 3 == 0){
x /= 3;
}
while (x % 5 == 0){
x /= 5;
}
if (x == 1){
cnt++;
}
}
printf("%d\n", cnt);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp47 = icmp eq i32 %0, 0
br i1 %cmp47, label %while.end22, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %5, %for.end ], [ %0, %entry ]
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp1.not42 = icmp sgt i32 %1, %2
br i1 %cmp1.not42, label %for.end, label %while.cond2.preheader
while.cond2.preheader: ; preds = %for.cond.preheader, %while.end16
%cnt.044 = phi i32 [ %spec.select, %while.end16 ], [ 0, %for.cond.preheader ]
%i.043 = phi i32 [ %inc20, %while.end16 ], [ %1, %for.cond.preheader ]
%3 = and i32 %i.043, 1
%cmp332 = icmp eq i32 %3, 0
br i1 %cmp332, label %while.body4, label %while.cond5.preheader
while.cond5.preheader: ; preds = %while.body4, %while.cond2.preheader
%x.0.lcssa = phi i32 [ %i.043, %while.cond2.preheader ], [ %div, %while.body4 ]
%rem634 = srem i32 %x.0.lcssa, 3
%cmp735 = icmp eq i32 %rem634, 0
br i1 %cmp735, label %while.body8, label %while.cond11.preheader
while.body4: ; preds = %while.cond2.preheader, %while.body4
%x.033 = phi i32 [ %div, %while.body4 ], [ %i.043, %while.cond2.preheader ]
%div = sdiv i32 %x.033, 2
%4 = and i32 %div, 1
%cmp3 = icmp eq i32 %4, 0
br i1 %cmp3, label %while.body4, label %while.cond5.preheader, !llvm.loop !9
while.cond11.preheader: ; preds = %while.body8, %while.cond5.preheader
%x.1.lcssa = phi i32 [ %x.0.lcssa, %while.cond5.preheader ], [ %div9, %while.body8 ]
%rem1238 = srem i32 %x.1.lcssa, 5
%cmp1339 = icmp eq i32 %rem1238, 0
br i1 %cmp1339, label %while.body14, label %while.end16
while.body8: ; preds = %while.cond5.preheader, %while.body8
%x.136 = phi i32 [ %div9, %while.body8 ], [ %x.0.lcssa, %while.cond5.preheader ]
%div9 = sdiv i32 %x.136, 3
%rem6 = srem i32 %div9, 3
%cmp7 = icmp eq i32 %rem6, 0
br i1 %cmp7, label %while.body8, label %while.cond11.preheader, !llvm.loop !11
while.body14: ; preds = %while.cond11.preheader, %while.body14
%x.240 = phi i32 [ %div15, %while.body14 ], [ %x.1.lcssa, %while.cond11.preheader ]
%div15 = sdiv i32 %x.240, 5
%rem12 = srem i32 %div15, 5
%cmp13 = icmp eq i32 %rem12, 0
br i1 %cmp13, label %while.body14, label %while.end16, !llvm.loop !12
while.end16: ; preds = %while.body14, %while.cond11.preheader
%x.2.lcssa = phi i32 [ %x.1.lcssa, %while.cond11.preheader ], [ %div15, %while.body14 ]
%cmp17 = icmp eq i32 %x.2.lcssa, 1
%inc = zext i1 %cmp17 to i32
%spec.select = add nuw nsw i32 %cnt.044, %inc
%inc20 = add i32 %i.043, 1
%exitcond.not = icmp eq i32 %i.043, %2
br i1 %exitcond.not, label %for.end, label %while.cond2.preheader, !llvm.loop !13
for.end: ; preds = %while.end16, %for.cond.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %spec.select, %while.end16 ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n)
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %5, 0
br i1 %cmp, label %while.end22, label %for.cond.preheader
while.end22: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
int prime(int x){
int t = 1;
for(int i = 2; i <= (int)sqrt(x); i++){
if(x % i == 0){
t = 0;
break;
}
}
if(x == 1){
t = 0;
}else if(x == 2){
t = 1;
}
return t;
}
int main(void){
int Q;
scanf("%d", &Q);
int c[100001];
c[0] = 0, c[1] = 0;
for(int i = 2; i <= 100000; i++){
if(prime(i) == 1 && prime((i+1) / 2) == 1 && i % 2 == 1){
c[i] = c[i-1] + 1;
}else{
c[i] = c[i-1];
}
}
int l[Q], r[Q];
for(int i = 0; i < Q; i++){
scanf("%d%d", &l[i], &r[i]);
}
for(int i = 0; i < Q; i++){
printf("%d\n", c[r[i]] - c[l[i]-1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229525/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229525/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local i32 @prime(i32 noundef %x) local_unnamed_addr #0 {
entry:
%conv = sitofp i32 %x to double
%call19 = tail call double @sqrt(double noundef %conv) #6
%conv120 = fptosi double %call19 to i32
%cmp.not21 = icmp slt i32 %conv120, 2
br i1 %cmp.not21, label %cleanup, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.022, 1
%call = tail call double @sqrt(double noundef %conv) #6
%conv1 = fptosi double %call to i32
%cmp.not.not = icmp slt i32 %i.022, %conv1
br i1 %cmp.not.not, label %for.body, label %cleanup, !llvm.loop !5
for.body: ; preds = %entry, %for.cond
%i.022 = phi i32 [ %inc, %for.cond ], [ 2, %entry ]
%rem = srem i32 %x, %i.022
%cmp3 = icmp eq i32 %rem, 0
br i1 %cmp3, label %cleanup, label %for.cond
cleanup: ; preds = %for.cond, %for.body, %entry
%t.0 = phi i32 [ 1, %entry ], [ 0, %for.body ], [ 1, %for.cond ]
switch i32 %x, label %if.end12.fold.split [
i32 1, label %if.end12
i32 2, label %if.then10
]
if.then10: ; preds = %cleanup
br label %if.end12
if.end12.fold.split: ; preds = %cleanup
br label %if.end12
if.end12: ; preds = %cleanup, %if.end12.fold.split, %if.then10
%t.1 = phi i32 [ 1, %if.then10 ], [ 0, %cleanup ], [ %t.0, %if.end12.fold.split ]
ret i32 %t.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2
; Function Attrs: 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 #3 {
entry:
%Q = alloca i32, align 4
%c = alloca [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Q)
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %c) #6
store i32 0, ptr %c, align 16, !tbaa !7
%arrayidx1 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 1
store i32 0, ptr %arrayidx1, align 4, !tbaa !7
br label %for.body
for.cond.cleanup: ; preds = %for.inc
%0 = load i32, ptr %Q, align 4, !tbaa !7
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %Q, align 4, !tbaa !7
%4 = zext i32 %3 to i64
%vla17 = alloca i32, i64 %4, align 16
%cmp2096 = icmp sgt i32 %3, 0
br i1 %cmp2096, label %for.body22, label %for.cond.cleanup34
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next.pre-phi, %for.inc ]
%5 = trunc i64 %indvars.iv to i32
%conv.i = sitofp i32 %5 to double
%call19.i = call double @sqrt(double noundef %conv.i) #6
%conv120.i = fptosi double %call19.i to i32
%cmp.not21.i = icmp slt i32 %conv120.i, 2
br i1 %cmp.not21.i, label %cleanup.i, label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %i.022.i, 1
%call.i = call double @sqrt(double noundef %conv.i) #6
%conv1.i = fptosi double %call.i to i32
%cmp.not.not.i = icmp slt i32 %i.022.i, %conv1.i
br i1 %cmp.not.not.i, label %for.body.i, label %cleanup.i, !llvm.loop !5
for.body.i: ; preds = %for.body, %for.cond.i
%i.022.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.body ]
%rem.i = urem i32 %5, %i.022.i
%cmp3.i = icmp eq i32 %rem.i, 0
br i1 %cmp3.i, label %cleanup.i, label %for.cond.i
cleanup.i: ; preds = %for.body.i, %for.cond.i, %for.body
%cmp3.not = phi i1 [ false, %for.body ], [ %cmp3.i, %for.cond.i ], [ %cmp3.i, %for.body.i ]
switch i32 %5, label %prime.exit [
i32 1, label %if.else
i32 2, label %land.lhs.true
]
prime.exit: ; preds = %cleanup.i
br i1 %cmp3.not, label %if.else, label %land.lhs.true
land.lhs.true: ; preds = %cleanup.i, %prime.exit
%6 = add nuw nsw i64 %indvars.iv, 1
%7 = trunc i64 %6 to i32
%div64 = lshr i32 %7, 1
%conv.i65 = sitofp i32 %div64 to double
%call19.i66 = call double @sqrt(double noundef %conv.i65) #6
%conv120.i67 = fptosi double %call19.i66 to i32
%cmp.not21.i68 = icmp slt i32 %conv120.i67, 2
br i1 %cmp.not21.i68, label %cleanup.i78, label %for.body.i69
for.cond.i73: ; preds = %for.body.i69
%inc.i74 = add nuw nsw i32 %i.022.i70, 1
%call.i75 = call double @sqrt(double noundef %conv.i65) #6
%conv1.i76 = fptosi double %call.i75 to i32
%cmp.not.not.i77 = icmp slt i32 %i.022.i70, %conv1.i76
br i1 %cmp.not.not.i77, label %for.body.i69, label %cleanup.i78, !llvm.loop !5
for.body.i69: ; preds = %land.lhs.true, %for.cond.i73
%i.022.i70 = phi i32 [ %inc.i74, %for.cond.i73 ], [ 2, %land.lhs.true ]
%rem.i71 = urem i32 %div64, %i.022.i70
%cmp3.i72 = icmp eq i32 %rem.i71, 0
br i1 %cmp3.i72, label %cleanup.i78, label %for.cond.i73
cleanup.i78: ; preds = %for.body.i69, %for.cond.i73, %land.lhs.true
%t.0.i79 = phi i32 [ 1, %land.lhs.true ], [ 1, %for.cond.i73 ], [ 0, %for.body.i69 ]
switch i32 %div64, label %if.end12.fold.split.i82 [
i32 1, label %if.else
i32 2, label %prime.exit83
]
if.end12.fold.split.i82: ; preds = %cleanup.i78
br label %prime.exit83
prime.exit83: ; preds = %cleanup.i78, %if.end12.fold.split.i82
%t.1.i81 = phi i32 [ %t.0.i79, %if.end12.fold.split.i82 ], [ 1, %cleanup.i78 ]
%cmp5.not = icmp eq i32 %t.1.i81, 0
%rem = and i32 %5, 1
%cmp7.not = icmp eq i32 %rem, 0
%or.cond = or i1 %cmp7.not, %cmp5.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %prime.exit83
%8 = add nsw i64 %indvars.iv, -1
%arrayidx8 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %8
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !7
%add9 = add nsw i32 %9, 1
%arrayidx11 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %indvars.iv
store i32 %add9, ptr %arrayidx11, align 4, !tbaa !7
br label %for.inc
if.else: ; preds = %cleanup.i78, %cleanup.i, %prime.exit83, %prime.exit
%10 = add nsw i64 %indvars.iv, -1
%arrayidx14 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %10
%11 = load i32, ptr %arrayidx14, align 4, !tbaa !7
%arrayidx16 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %indvars.iv
store i32 %11, ptr %arrayidx16, align 4, !tbaa !7
%.pre = add nuw nsw i64 %indvars.iv, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.else
%indvars.iv.next.pre-phi = phi i64 [ %6, %if.then ], [ %.pre, %if.else ]
%exitcond.not = icmp eq i64 %indvars.iv.next.pre-phi, 100001
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11
for.cond32.preheader: ; preds = %for.body22
%12 = icmp sgt i32 %13, 0
br i1 %12, label %for.body35, label %for.cond.cleanup34
for.body22: ; preds = %for.cond.cleanup, %for.body22
%indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.body22 ], [ 0, %for.cond.cleanup ]
%arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv104
%arrayidx26 = getelementptr inbounds i32, ptr %vla17, i64 %indvars.iv104
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx24, ptr noundef nonnull %arrayidx26)
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%13 = load i32, ptr %Q, align 4, !tbaa !7
%14 = sext i32 %13 to i64
%cmp20 = icmp slt i64 %indvars.iv.next105, %14
br i1 %cmp20, label %for.body22, label %for.cond32.preheader, !llvm.loop !12
for.cond.cleanup34: ; preds = %for.body35, %for.cond.cleanup, %for.cond32.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #6
ret i32 0
for.body35: ; preds = %for.cond32.preheader, %for.body35
%indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.body35 ], [ 0, %for.cond32.preheader ]
%arrayidx37 = getelementptr inbounds i32, ptr %vla17, i64 %indvars.iv107
%15 = load i32, ptr %arrayidx37, align 4, !tbaa !7
%idxprom38 = sext i32 %15 to i64
%arrayidx39 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %idxprom38
%16 = load i32, ptr %arrayidx39, align 4, !tbaa !7
%arrayidx41 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv107
%17 = load i32, ptr %arrayidx41, align 4, !tbaa !7
%sub42 = add nsw i32 %17, -1
%idxprom43 = sext i32 %sub42 to i64
%arrayidx44 = getelementptr inbounds [100001 x i32], ptr %c, i64 0, i64 %idxprom43
%18 = load i32, ptr %arrayidx44, align 4, !tbaa !7
%sub45 = sub nsw i32 %16, %18
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub45)
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%19 = load i32, ptr %Q, align 4, !tbaa !7
%20 = sext i32 %19 to i64
%cmp33 = icmp slt i64 %indvars.iv.next108, %20
br i1 %cmp33, label %for.body35, label %for.cond.cleanup34, !llvm.loop !13
}
; 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: 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
attributes #0 = { nofree nounwind memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}
|
#include <stdio.h>
#include <math.h>
#define NUM 100000
int prime[NUM + 1];
int counts[NUM + 1];
void init_prime() {
int i, j;
int sq_num = (int)sqrt((double)NUM);
for (i = 0; i < NUM; i++) {
prime[i] = i % 2;
}
prime[0] = prime[1] = 0;
prime[2] = 1;
for (i = 3; i < sq_num; i++) {
if (prime[i] == 0) {
continue;
}
for (j = i; i * j <= NUM; j += 2) {
prime[i * j] = 0;
}
}
}
void init_counts() {
int i;
counts[0] = counts[1] = 0;
for (i = 2; i <= NUM; i++) {
counts[i] = counts[i - 1];
if (prime[i] && prime[(i + 1) / 2]) {
counts[i]++;
}
}
}
void solv(int q) {
int i, l, r;
for (i = 0; i < q; i++) {
scanf("%d %d", &l, &r);
printf("%d\n", counts[r] - counts[l - 1]);
}
}
int main(int argc, char **argv) {
int q;
init_prime();
init_counts();
while (scanf("%d", &q) != EOF) {
solv(q);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229569/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229569/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@prime = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@counts = dso_local local_unnamed_addr global [100001 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init_prime() local_unnamed_addr #0 {
entry:
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %entry ], [ %vec.ind.next.1, %vector.body ]
%0 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%2 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %index
store <4 x i32> %0, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> %1, ptr %3, align 16, !tbaa !5
%index.next = or i64 %index, 8
%4 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%5 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%6 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %index.next
store <4 x i32> %4, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %5, ptr %7, align 16, !tbaa !5
%index.next.1 = add nuw nsw i64 %index, 16
%vec.ind.next.1 = add <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16>
%8 = icmp eq i64 %index.next.1, 100000
br i1 %8, label %for.end, label %vector.body, !llvm.loop !9
for.end: ; preds = %vector.body
store i32 0, ptr getelementptr inbounds ([100001 x i32], ptr @prime, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr @prime, align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([100001 x i32], ptr @prime, i64 0, i64 2), align 8, !tbaa !5
br label %for.body5
for.body5: ; preds = %for.end, %for.inc19
%indvars.iv56 = phi i64 [ 7, %for.end ], [ %indvars.iv.next57, %for.inc19 ]
%indvars.iv49 = phi i64 [ 3, %for.end ], [ %indvars.iv.next50, %for.inc19 ]
%indvars.iv45 = phi i64 [ 6, %for.end ], [ %indvars.iv.next46, %for.inc19 ]
%indvars.iv43 = phi i32 [ 9, %for.end ], [ %indvars.iv.next44, %for.inc19 ]
%indvars61 = trunc i64 %indvars.iv49 to i32
%arrayidx7 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %indvars.iv49
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp ne i32 %9, 0
%mul34 = mul nsw i32 %indvars61, %indvars61
%cmp1135 = icmp ult i32 %mul34, 100001
%or.cond = select i1 %cmp8, i1 %cmp1135, i1 false
br i1 %or.cond, label %for.body13.preheader, label %for.inc19
for.body13.preheader: ; preds = %for.body5
%10 = zext i32 %indvars.iv43 to i64
br label %for.body13
for.body13: ; preds = %for.body13.preheader, %for.body13
%indvars.iv47 = phi i64 [ %10, %for.body13.preheader ], [ %indvars.iv.next48, %for.body13 ]
%arrayidx16 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %indvars.iv47
store i32 0, ptr %arrayidx16, align 4, !tbaa !5
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, %indvars.iv45
%indvars = trunc i64 %indvars.iv.next48 to i32
%cmp11 = icmp ult i32 %indvars, 100001
br i1 %cmp11, label %for.body13, label %for.inc19, !llvm.loop !13
for.inc19: ; preds = %for.body13, %for.body5
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 2
%11 = trunc i64 %indvars.iv56 to i32
%indvars.iv.next44 = add i32 %indvars.iv43, %11
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 2
%exitcond62.not = icmp eq i64 %indvars.iv.next50, 316
br i1 %exitcond62.not, label %for.end21, label %for.body5, !llvm.loop !14
for.end21: ; preds = %for.inc19
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(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init_counts() local_unnamed_addr #0 {
entry:
store i32 0, ptr getelementptr inbounds ([100001 x i32], ptr @counts, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr @counts, align 16, !tbaa !5
br label %for.body
for.body: ; preds = %entry, %for.inc
%0 = phi i32 [ 0, %entry ], [ %3, %for.inc ]
%indvars.iv = phi i64 [ 2, %entry ], [ %.pre, %for.inc ]
%arrayidx2 = getelementptr inbounds [100001 x i32], ptr @counts, i64 0, i64 %indvars.iv
store i32 %0, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx4 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
%.pre = add nuw nsw i64 %indvars.iv, 1
br i1 %tobool.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%div17 = lshr i64 %.pre, 1
%idxprom5 = and i64 %div17, 2147483647
%arrayidx6 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %idxprom5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%tobool7.not = icmp eq i32 %2, 0
br i1 %tobool7.not, label %for.inc, label %if.then
if.then: ; preds = %land.lhs.true
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then
%3 = phi i32 [ %0, %land.lhs.true ], [ %inc, %if.then ], [ %0, %for.body ]
%exitcond.not = icmp eq i64 %.pre, 100001
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !15
for.end: ; preds = %for.inc
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @solv(i32 noundef %q) local_unnamed_addr #2 {
entry:
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%cmp6 = icmp sgt i32 %q, 0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100001 x i32], ptr @counts, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %l, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%idxprom1 = sext i32 %sub to i64
%arrayidx2 = getelementptr inbounds [100001 x i32], ptr @counts, i64 0, i64 %idxprom1
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%sub3 = sub nsw i32 %1, %3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub3)
%inc = add nuw nsw i32 %i.07, 1
%exitcond.not = icmp eq i32 %inc, %q
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !16
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
ret void
}
; 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 nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
entry:
%l.i = alloca i32, align 4
%r.i = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %entry ], [ %vec.ind.next.1, %vector.body ]
%0 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%1 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%2 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %index
store <4 x i32> %0, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> %1, ptr %3, align 16, !tbaa !5
%index.next = or i64 %index, 8
%4 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%5 = and <4 x i32> %vec.ind, <i32 1, i32 1, i32 1, i32 1>
%6 = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %index.next
store <4 x i32> %4, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %5, ptr %7, align 16, !tbaa !5
%index.next.1 = add nuw nsw i64 %index, 16
%vec.ind.next.1 = add <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16>
%8 = icmp eq i64 %index.next.1, 100000
br i1 %8, label %for.end.i, label %vector.body, !llvm.loop !17
for.end.i: ; preds = %vector.body
store i32 0, ptr getelementptr inbounds ([100001 x i32], ptr @prime, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr @prime, align 16, !tbaa !5
store i32 1, ptr getelementptr inbounds ([100001 x i32], ptr @prime, i64 0, i64 2), align 8, !tbaa !5
br label %for.body5.i
for.body5.i: ; preds = %for.inc19.i, %for.end.i
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc19.i ], [ 7, %for.end.i ]
%indvars.iv49.i = phi i64 [ %indvars.iv.next50.i, %for.inc19.i ], [ 3, %for.end.i ]
%indvars.iv45.i = phi i64 [ %indvars.iv.next46.i, %for.inc19.i ], [ 6, %for.end.i ]
%indvars.iv43.i = phi i32 [ %indvars.iv.next44.i, %for.inc19.i ], [ 9, %for.end.i ]
%indvars61.i = trunc i64 %indvars.iv49.i to i32
%arrayidx7.i = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %indvars.iv49.i
%9 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%cmp8.i = icmp ne i32 %9, 0
%mul34.i = mul nsw i32 %indvars61.i, %indvars61.i
%cmp1135.i = icmp ult i32 %mul34.i, 100001
%or.cond.i = select i1 %cmp8.i, i1 %cmp1135.i, i1 false
br i1 %or.cond.i, label %for.body13.preheader.i, label %for.inc19.i
for.body13.preheader.i: ; preds = %for.body5.i
%10 = zext i32 %indvars.iv43.i to i64
br label %for.body13.i
for.body13.i: ; preds = %for.body13.i, %for.body13.preheader.i
%indvars.iv47.i = phi i64 [ %10, %for.body13.preheader.i ], [ %indvars.iv.next48.i, %for.body13.i ]
%arrayidx16.i = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %indvars.iv47.i
store i32 0, ptr %arrayidx16.i, align 4, !tbaa !5
%indvars.iv.next48.i = add nuw nsw i64 %indvars.iv47.i, %indvars.iv45.i
%indvars.i = trunc i64 %indvars.iv.next48.i to i32
%cmp11.i = icmp ult i32 %indvars.i, 100001
br i1 %cmp11.i, label %for.body13.i, label %for.inc19.i, !llvm.loop !13
for.inc19.i: ; preds = %for.body13.i, %for.body5.i
%indvars.iv.next50.i = add nuw nsw i64 %indvars.iv49.i, 1
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
%11 = trunc i64 %indvars.iv to i32
%indvars.iv.next44.i = add i32 %indvars.iv43.i, %11
%indvars.iv.next46.i = add nuw nsw i64 %indvars.iv45.i, 2
%exitcond62.not.i = icmp eq i64 %indvars.iv.next50.i, 316
br i1 %exitcond62.not.i, label %init_prime.exit, label %for.body5.i, !llvm.loop !14
init_prime.exit: ; preds = %for.inc19.i
store i32 0, ptr getelementptr inbounds ([100001 x i32], ptr @counts, i64 0, i64 1), align 4, !tbaa !5
store i32 0, ptr @counts, align 16, !tbaa !5
br label %for.body.i1
for.body.i1: ; preds = %for.inc.i, %init_prime.exit
%12 = phi i32 [ 0, %init_prime.exit ], [ %15, %for.inc.i ]
%indvars.iv.i2 = phi i64 [ 2, %init_prime.exit ], [ %.pre.i, %for.inc.i ]
%arrayidx2.i = getelementptr inbounds [100001 x i32], ptr @counts, i64 0, i64 %indvars.iv.i2
store i32 %12, ptr %arrayidx2.i, align 4, !tbaa !5
%arrayidx4.i = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %indvars.iv.i2
%13 = load i32, ptr %arrayidx4.i, align 4, !tbaa !5
%tobool.not.i = icmp eq i32 %13, 0
%.pre.i = add nuw nsw i64 %indvars.iv.i2, 1
br i1 %tobool.not.i, label %for.inc.i, label %land.lhs.true.i
land.lhs.true.i: ; preds = %for.body.i1
%div17.i = lshr i64 %.pre.i, 1
%idxprom5.i = and i64 %div17.i, 2147483647
%arrayidx6.i = getelementptr inbounds [100001 x i32], ptr @prime, i64 0, i64 %idxprom5.i
%14 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
%tobool7.not.i = icmp eq i32 %14, 0
br i1 %tobool7.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %land.lhs.true.i
%inc.i = add nsw i32 %12, 1
store i32 %inc.i, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %land.lhs.true.i, %for.body.i1
%15 = phi i32 [ %12, %land.lhs.true.i ], [ %inc.i, %if.then.i ], [ %12, %for.body.i1 ]
%exitcond.not.i3 = icmp eq i64 %.pre.i, 100001
br i1 %exitcond.not.i3, label %while.cond.preheader, label %for.body.i1, !llvm.loop !15
while.cond.preheader: ; preds = %for.inc.i
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %q)
%cmp.not12 = icmp eq i32 %call11, -1
br i1 %cmp.not12, label %while.end, label %while.body
while.body: ; preds = %while.cond.preheader, %solv.exit
%16 = load i32, ptr %q, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l.i) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r.i) #4
%cmp6.i = icmp sgt i32 %16, 0
br i1 %cmp6.i, label %for.body.i6, label %solv.exit
for.body.i6: ; preds = %while.body, %for.body.i6
%i.07.i = phi i32 [ %inc.i9, %for.body.i6 ], [ 0, %while.body ]
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l.i, ptr noundef nonnull %r.i)
%17 = load i32, ptr %r.i, align 4, !tbaa !5
%idxprom.i = sext i32 %17 to i64
%arrayidx.i7 = getelementptr inbounds [100001 x i32], ptr @counts, i64 0, i64 %idxprom.i
%18 = load i32, ptr %arrayidx.i7, align 4, !tbaa !5
%19 = load i32, ptr %l.i, align 4, !tbaa !5
%sub.i = add nsw i32 %19, -1
%idxprom1.i = sext i32 %sub.i to i64
%arrayidx2.i8 = getelementptr inbounds [100001 x i32], ptr @counts, i64 0, i64 %idxprom1.i
%20 = load i32, ptr %arrayidx2.i8, align 4, !tbaa !5
%sub3.i = sub nsw i32 %18, %20
%call4.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub3.i)
%inc.i9 = add nuw nsw i32 %i.07.i, 1
%exitcond.not.i10 = icmp eq i32 %inc.i9, %16
br i1 %exitcond.not.i10, label %solv.exit, label %for.body.i6, !llvm.loop !16
solv.exit: ; preds = %for.body.i6, %while.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r.i) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l.i) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %q)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !18
while.end: ; preds = %solv.exit, %while.cond.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
ret i32 0
}
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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, !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}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11, !12}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int Q, i, j, maxr;
scanf("%d", &Q);
int *l = (int *)malloc(sizeof(int) * Q);
int *r = (int *)malloc(sizeof(int) * Q);
for(i = 0, maxr = 0; i < Q; i++){
scanf("%d%d", &l[i], &r[i]);
if(r[i] > maxr){
maxr = r[i];
}
}
int *is_prime = (int *)malloc(sizeof(int) * (maxr + 1));
int *is_like_2017 = (int *)malloc(sizeof(int) * (maxr + 1));
for(i = 0; i <= maxr; i++){
is_prime[i] = 1;
is_like_2017[i] = 0;
}
is_prime[0] = 0;
is_prime[1] = 0;
for(i = 2; i <= maxr; i++){
if(is_prime[i] == 1){
for(j = 2; i * j <= maxr; j++){
is_prime[i * j] = 0;
}
}
}
for(i = 3; i <= maxr; i++){
if(is_prime[i] == 1 && is_prime[(i + 1) / 2] == 1){
is_like_2017[i] = 1;
}
is_like_2017[i] += is_like_2017[i - 1];
}
for(i = 0; i < Q; i++){
printf("%d\n", is_like_2017[r[i]] - is_like_2017[l[i] - 1]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229611/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229611/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Q)
%0 = load i32, ptr %Q, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%call4 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp151 = icmp sgt i32 %0, 0
br i1 %cmp151, label %for.body, label %for.body25.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%maxr.0152 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%arrayidx7 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef %arrayidx7)
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %maxr.0152)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %Q, 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.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%4 = icmp sgt i32 %2, 0
br label %for.body25.preheader
for.body25.preheader: ; preds = %entry, %for.end.loopexit
%cmp85165 = phi i1 [ false, %entry ], [ %4, %for.end.loopexit ]
%maxr.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.end.loopexit ]
%add = add nuw i32 %maxr.0.lcssa, 1
%conv15 = sext i32 %add to i64
%mul16 = shl nsw i64 %conv15, 2
%call17 = call noalias ptr @malloc(i64 noundef %mul16) #7
%call21 = call noalias ptr @malloc(i64 noundef %mul16) #7
%5 = zext i32 %add to i64
%6 = shl nuw nsw i64 %5, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call21, i8 0, i64 %6, i1 false), !tbaa !5
%min.iters.check = icmp ult i32 %maxr.0.lcssa, 7
br i1 %min.iters.check, label %for.body25.preheader194, label %vector.ph
vector.ph: ; preds = %for.body25.preheader
%n.vec = and i64 %5, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%7 = getelementptr inbounds i32, ptr %call17, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %5
br i1 %cmp.n, label %for.end32, label %for.body25.preheader194
for.body25.preheader194: ; preds = %for.body25.preheader, %middle.block
%indvars.iv168.ph = phi i64 [ 0, %for.body25.preheader ], [ %n.vec, %middle.block ]
br label %for.body25
for.body25: ; preds = %for.body25.preheader194, %for.body25
%indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.body25 ], [ %indvars.iv168.ph, %for.body25.preheader194 ]
%arrayidx27 = getelementptr inbounds i32, ptr %call17, i64 %indvars.iv168
store i32 1, ptr %arrayidx27, align 4, !tbaa !5
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%exitcond.not = icmp eq i64 %indvars.iv.next169, %5
br i1 %exitcond.not, label %for.end32, label %for.body25, !llvm.loop !14
for.end32: ; preds = %for.body25, %middle.block
store i32 0, ptr %call17, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds i32, ptr %call17, i64 1
store i32 0, ptr %arrayidx34, align 4, !tbaa !5
%cmp36.not160 = icmp slt i32 %maxr.0.lcssa, 2
br i1 %cmp36.not160, label %for.cond84.preheader, label %for.body38.preheader
for.body38.preheader: ; preds = %for.end32
%wide.trip.count179 = zext i32 %add to i64
br label %for.body38
for.cond59.preheader: ; preds = %for.inc56
%cmp60.not163 = icmp slt i32 %maxr.0.lcssa, 3
br i1 %cmp60.not163, label %for.cond84.preheader, label %for.body62.preheader
for.body62.preheader: ; preds = %for.cond59.preheader
%wide.trip.count187 = zext i32 %add to i64
%invariant.gep = getelementptr i32, ptr %call21, i64 -1
br label %for.body62
for.body38: ; preds = %for.body38.preheader, %for.inc56
%indvars.iv174 = phi i64 [ 2, %for.body38.preheader ], [ %indvars.iv.next175, %for.inc56 ]
%arrayidx40 = getelementptr inbounds i32, ptr %call17, i64 %indvars.iv174
%10 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%cmp41 = icmp ne i32 %10, 1
%indvars.iv174.tr = trunc i64 %indvars.iv174 to i32
%11 = shl i32 %indvars.iv174.tr, 1
%cmp46.not157 = icmp sgt i32 %11, %maxr.0.lcssa
%or.cond = or i1 %cmp41, %cmp46.not157
br i1 %or.cond, label %for.inc56, label %for.body48.preheader
for.body48.preheader: ; preds = %for.body38
%12 = trunc i64 %indvars.iv174 to i32
br label %for.body48
for.body48: ; preds = %for.body48.preheader, %for.body48
%indvars.iv171 = phi i64 [ 2, %for.body48.preheader ], [ %indvars.iv.next172, %for.body48 ]
%mul45159 = phi i32 [ %11, %for.body48.preheader ], [ %mul45, %for.body48 ]
%idxprom50 = zext i32 %mul45159 to i64
%arrayidx51 = getelementptr inbounds i32, ptr %call17, i64 %idxprom50
store i32 0, ptr %arrayidx51, align 4, !tbaa !5
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%indvars = trunc i64 %indvars.iv.next172 to i32
%mul45 = mul nsw i32 %indvars, %12
%cmp46.not = icmp sgt i32 %mul45, %maxr.0.lcssa
br i1 %cmp46.not, label %for.inc56, label %for.body48, !llvm.loop !15
for.inc56: ; preds = %for.body48, %for.body38
%indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
%exitcond180.not = icmp eq i64 %indvars.iv.next175, %wide.trip.count179
br i1 %exitcond180.not, label %for.cond59.preheader, label %for.body38, !llvm.loop !16
for.cond84.preheader: ; preds = %if.end75, %for.end32, %for.cond59.preheader
br i1 %cmp85165, label %for.body87, label %for.end101
for.body62: ; preds = %for.body62.preheader, %if.end75
%indvars.iv181 = phi i64 [ 3, %for.body62.preheader ], [ %14, %if.end75 ]
%arrayidx64 = getelementptr inbounds i32, ptr %call17, i64 %indvars.iv181
%13 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%cmp65 = icmp eq i32 %13, 1
%14 = add nuw nsw i64 %indvars.iv181, 1
br i1 %cmp65, label %land.lhs.true, label %if.end75
land.lhs.true: ; preds = %for.body62
%div150 = lshr i64 %14, 1
%idxprom68 = and i64 %div150, 2147483647
%arrayidx69 = getelementptr inbounds i32, ptr %call17, i64 %idxprom68
%15 = load i32, ptr %arrayidx69, align 4, !tbaa !5
%cmp70 = icmp eq i32 %15, 1
br i1 %cmp70, label %if.then72, label %if.end75
if.then72: ; preds = %land.lhs.true
%arrayidx74 = getelementptr inbounds i32, ptr %call21, i64 %indvars.iv181
store i32 1, ptr %arrayidx74, align 4, !tbaa !5
br label %if.end75
if.end75: ; preds = %for.body62, %if.then72, %land.lhs.true
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv181
%16 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx79 = getelementptr inbounds i32, ptr %call21, i64 %indvars.iv181
%17 = load i32, ptr %arrayidx79, align 4, !tbaa !5
%add80 = add nsw i32 %17, %16
store i32 %add80, ptr %arrayidx79, align 4, !tbaa !5
%exitcond188.not = icmp eq i64 %14, %wide.trip.count187
br i1 %exitcond188.not, label %for.cond84.preheader, label %for.body62, !llvm.loop !17
for.body87: ; preds = %for.cond84.preheader, %for.body87
%indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.body87 ], [ 0, %for.cond84.preheader ]
%arrayidx89 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv189
%18 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%idxprom90 = sext i32 %18 to i64
%arrayidx91 = getelementptr inbounds i32, ptr %call21, i64 %idxprom90
%19 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%arrayidx93 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv189
%20 = load i32, ptr %arrayidx93, align 4, !tbaa !5
%sub94 = add nsw i32 %20, -1
%idxprom95 = sext i32 %sub94 to i64
%arrayidx96 = getelementptr inbounds i32, ptr %call21, i64 %idxprom95
%21 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%sub97 = sub nsw i32 %19, %21
%call98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub97)
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%22 = load i32, ptr %Q, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp85 = icmp slt i64 %indvars.iv.next190, %23
br i1 %cmp85, label %for.body87, label %for.end101, !llvm.loop !18
for.end101: ; preds = %for.body87, %for.cond84.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree 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) #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !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}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include<stdio.h>
int main(void){
int i,j,n,m,max=0,f,sum;
int a[1000];
while(1){
scanf("%d %d",&n,&m);
if(n==0&&m==0) break;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++){
for(j=i+1;j<n;j++){
sum=a[i]+a[j];
if(sum<=m&&sum>max){
max=sum;
f=1;
}
}
}
if(f==1){
printf("%d\n",max);
max=0;
f=0;
}else{
printf("NONE\n");
max=0;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229655/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229655/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@str = private unnamed_addr constant [5 x i8] c"NONE\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 [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4
%call57 = 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
%cmp58 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp159 = icmp eq i32 %1, 0
%or.cond60 = select i1 %cmp58, i1 %cmp159, i1 false
br i1 %or.cond60, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end30
%2 = phi i32 [ %9, %if.end30 ], [ %0, %entry ]
%f.061 = phi i32 [ %f.4, %if.end30 ], [ undef, %entry ]
%cmp243 = icmp sgt i32 %2, 0
br i1 %cmp243, label %for.body, label %if.else
for.cond4.preheader: ; preds = %for.body
%cmp551 = icmp sgt i32 %5, 1
br i1 %cmp551, label %for.body6.lr.ph, label %for.end25
for.body6.lr.ph: ; preds = %for.cond4.preheader
%sub = add nsw i32 %5, -1
%3 = load i32, ptr %m, align 4
%4 = zext i32 %5 to i64
%wide.trip.count72 = zext i32 %sub to i64
%wide.trip.count = zext i32 %5 to i64
br label %for.body6
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp2, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.cond4.loopexit: ; preds = %for.body9, %for.body6
%max.2.lcssa = phi i32 [ %max.152, %for.body6 ], [ %max.3, %for.body9 ]
%f.2.lcssa = phi i32 [ %f.153, %for.body6 ], [ %f.3, %for.body9 ]
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
br i1 %exitcond73.not, label %for.end25, label %for.body6, !llvm.loop !11
for.body6: ; preds = %for.body6.lr.ph, %for.cond4.loopexit
%indvars.iv69 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next70, %for.cond4.loopexit ]
%indvars.iv64 = phi i64 [ 1, %for.body6.lr.ph ], [ %indvars.iv.next65, %for.cond4.loopexit ]
%f.153 = phi i32 [ %f.061, %for.body6.lr.ph ], [ %f.2.lcssa, %for.cond4.loopexit ]
%max.152 = phi i32 [ 0, %for.body6.lr.ph ], [ %max.2.lcssa, %for.cond4.loopexit ]
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%cmp845 = icmp ult i64 %indvars.iv.next70, %4
br i1 %cmp845, label %for.body9.lr.ph, label %for.cond4.loopexit
for.body9.lr.ph: ; preds = %for.body6
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv69
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !5
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.body9
%indvars.iv66 = phi i64 [ %indvars.iv64, %for.body9.lr.ph ], [ %indvars.iv.next67, %for.body9 ]
%f.248 = phi i32 [ %f.153, %for.body9.lr.ph ], [ %f.3, %for.body9 ]
%max.247 = phi i32 [ %max.152, %for.body9.lr.ph ], [ %max.3, %for.body9 ]
%arrayidx13 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv66
%8 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%add14 = add nsw i32 %8, %7
%cmp15.not = icmp sle i32 %add14, %3
%cmp17 = icmp sgt i32 %add14, %max.247
%or.cond42 = select i1 %cmp15.not, i1 %cmp17, i1 false
%max.3 = select i1 %or.cond42, i32 %add14, i32 %max.247
%f.3 = select i1 %or.cond42, i32 1, i32 %f.248
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count
br i1 %exitcond.not, label %for.cond4.loopexit, label %for.body9, !llvm.loop !12
for.end25: ; preds = %for.cond4.loopexit, %for.cond4.preheader
%max.1.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ %max.2.lcssa, %for.cond4.loopexit ]
%f.1.lcssa = phi i32 [ %f.061, %for.cond4.preheader ], [ %f.2.lcssa, %for.cond4.loopexit ]
%cmp26 = icmp eq i32 %f.1.lcssa, 1
br i1 %cmp26, label %if.then27, label %if.else
if.then27: ; preds = %for.end25
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.1.lcssa)
br label %if.end30
if.else: ; preds = %for.cond.preheader, %for.end25
%f.1.lcssa79 = phi i32 [ %f.1.lcssa, %for.end25 ], [ %f.061, %for.cond.preheader ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end30
if.end30: ; preds = %if.else, %if.then27
%f.4 = phi i32 [ 0, %if.then27 ], [ %f.1.lcssa79, %if.else ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end30, %entry
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define N 50000
int main(){
int n,m,i,j,k,ans[N];
for(i=0; i<N; i++)
ans[i]=-1;
while(1){
scanf("%d",&n);scanf("%d",&m);
if(n==0 && m==0)
break;
else{
int item[n],temp,max=0;
for(i=0;i<n;i++)
scanf("%d",&item[i]);
for(i=0;i<n-1;i++){
for(j=i+1;j<n; j++){
temp = item[i]+item[j];
if(temp<=m && temp>max)
max = temp;
}
}
ans[k]=max;
k++;
}
}
for(i=0;i<N;i++){
if(ans[i]>0)
printf("%d\n",ans[i]);
else if(ans[i]==0)
printf("NONE\n");
else
break;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229699/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229699/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [5 x i8] c"NONE\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
%ans = alloca [50000 x i32], 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 200000, ptr nonnull %ans) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200000) %ans, i8 -1, i64 200000, i1 false), !tbaa !5
%call92 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call193 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp294 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp395 = icmp eq i32 %1, 0
%or.cond96 = select i1 %cmp294, i1 %cmp395, i1 false
br i1 %or.cond96, label %for.body40.preheader, label %if.else
if.else: ; preds = %entry, %for.end33
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.end33 ], [ 0, %entry ]
%2 = phi i32 [ %12, %for.end33 ], [ %0, %entry ]
%3 = zext i32 %2 to i64
%4 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %3, align 16
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp582 = icmp sgt i32 %5, 0
br i1 %cmp582, label %for.body6, label %for.end33
for.cond13.preheader: ; preds = %for.body6
%cmp1488 = icmp sgt i32 %8, 1
br i1 %cmp1488, label %for.body15.lr.ph, label %for.end33
for.body15.lr.ph: ; preds = %for.cond13.preheader
%sub = add nsw i32 %8, -1
%6 = load i32, ptr %m, align 4
%7 = zext i32 %8 to i64
%wide.trip.count110 = zext i32 %sub to i64
%wide.trip.count = zext i32 %8 to i64
br label %for.body15
for.body6: ; preds = %if.else, %for.body6
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ 0, %if.else ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp5 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp5, label %for.body6, label %for.cond13.preheader, !llvm.loop !9
for.cond13.loopexit: ; preds = %for.body18, %for.body15
%max.1.lcssa = phi i32 [ %max.090, %for.body15 ], [ %max.2, %for.body18 ]
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond111.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count110
br i1 %exitcond111.not, label %for.end33, label %for.body15, !llvm.loop !11
for.body15: ; preds = %for.body15.lr.ph, %for.cond13.loopexit
%indvars.iv107 = phi i64 [ 0, %for.body15.lr.ph ], [ %indvars.iv.next108, %for.cond13.loopexit ]
%indvars.iv102 = phi i64 [ 1, %for.body15.lr.ph ], [ %indvars.iv.next103, %for.cond13.loopexit ]
%max.090 = phi i32 [ 0, %for.body15.lr.ph ], [ %max.1.lcssa, %for.cond13.loopexit ]
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%cmp1784 = icmp ult i64 %indvars.iv.next108, %7
br i1 %cmp1784, label %for.body18.lr.ph, label %for.cond13.loopexit
for.body18.lr.ph: ; preds = %for.body15
%arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv107
%10 = load i32, ptr %arrayidx20, align 4, !tbaa !5
br label %for.body18
for.body18: ; preds = %for.body18.lr.ph, %for.body18
%indvars.iv104 = phi i64 [ %indvars.iv102, %for.body18.lr.ph ], [ %indvars.iv.next105, %for.body18 ]
%max.186 = phi i32 [ %max.090, %for.body18.lr.ph ], [ %max.2, %for.body18 ]
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv104
%11 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%add23 = add nsw i32 %11, %10
%cmp24.not = icmp sle i32 %add23, %6
%cmp26 = icmp sgt i32 %add23, %max.186
%or.cond80 = select i1 %cmp24.not, i1 %cmp26, i1 false
%max.2 = select i1 %or.cond80, i32 %add23, i32 %max.186
%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.cond13.loopexit, label %for.body18, !llvm.loop !12
for.end33: ; preds = %for.cond13.loopexit, %if.else, %for.cond13.preheader
%max.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %if.else ], [ %max.1.lcssa, %for.cond13.loopexit ]
%arrayidx35 = getelementptr inbounds [50000 x i32], ptr %ans, i64 0, i64 %indvars.iv112
store i32 %max.0.lcssa, ptr %arrayidx35, align 4, !tbaa !5
%indvars.iv.next113 = add i64 %indvars.iv112, 1
call void @llvm.stackrestore.p0(ptr %4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%12 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp eq i32 %12, 0
%13 = load i32, ptr %m, align 4
%cmp3 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %for.body40.preheader, label %if.else
for.body40.preheader: ; preds = %for.end33, %entry
br label %for.body40
for.body40: ; preds = %for.body40.preheader, %for.inc57
%indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc57 ], [ 0, %for.body40.preheader ]
%arrayidx42 = getelementptr inbounds [50000 x i32], ptr %ans, i64 0, i64 %indvars.iv114
%14 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %14, 0
br i1 %cmp43, label %if.then44, label %if.else48
if.then44: ; preds = %for.body40
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
br label %for.inc57
if.else48: ; preds = %for.body40
%cmp51 = icmp eq i32 %14, 0
br i1 %cmp51, label %if.then52, label %for.end59
if.then52: ; preds = %if.else48
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc57
for.inc57: ; preds = %if.then44, %if.then52
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%exitcond117.not = icmp eq i64 %indvars.iv.next115, 50000
br i1 %exitcond117.not, label %for.end59, label %for.body40, !llvm.loop !13
for.end59: ; preds = %if.else48, %for.inc57
call void @llvm.lifetime.end.p0(i64 200000, ptr nonnull %ans) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int n,i,x;
scanf("%d",&n);
for(i=1;i<=n;i++){
x=i;
if(x%3==0){
printf(" %d",x);
}
else{
while(x){
if(x%10==3){
printf(" %d",i);
break;
}
x=x/10;
}
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229741/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229741/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not17 = icmp slt i32 %0, 1
br i1 %cmp.not17, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.018 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.018, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %while.body
while.body: ; preds = %for.body, %if.end
%x.016 = phi i32 [ %div, %if.end ], [ %i.018, %for.body ]
%rem3 = srem i32 %x.016, 10
%div = sdiv i32 %x.016, 10
%cmp4 = icmp eq i32 %rem3, 3
br i1 %cmp4, label %for.inc.sink.split, label %if.end
if.end: ; preds = %while.body
%x.016.off = add i32 %x.016, 9
%tobool.not = icmp ult i32 %x.016.off, 19
br i1 %tobool.not, label %for.inc, label %while.body, !llvm.loop !9
for.inc.sink.split: ; preds = %while.body, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.018)
br label %for.inc
for.inc: ; preds = %if.end, %for.inc.sink.split
%inc = add nuw nsw i32 %i.018, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.018, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
void call(int n)
{
int i, x;
for(i = 3; i <= n; i++){
if(i % 3 == 0){
printf(" %d", i);
}else{
x = i;
do{
if(x % 10 == 3){
printf(" %d", i);
break;
}
x /= 10;
}while(x);
}
}
printf("\n");
}
int main(void)
{
int n;
scanf("%d", &n);
call(n);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229828/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229828/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @call(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not15 = icmp slt i32 %n, 3
br i1 %cmp.not15, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.016 = phi i32 [ %inc, %for.inc ], [ 3, %entry ]
%rem = urem i32 %i.016, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %do.body
do.body: ; preds = %for.body, %if.end
%x.0 = phi i32 [ %div, %if.end ], [ %i.016, %for.body ]
%rem2 = srem i32 %x.0, 10
%div = sdiv i32 %x.0, 10
%cmp3 = icmp eq i32 %rem2, 3
br i1 %cmp3, label %for.inc.sink.split, label %if.end
if.end: ; preds = %do.body
%x.0.off = add i32 %x.0, 9
%tobool.not = icmp ult i32 %x.0.off, 19
br i1 %tobool.not, label %for.inc, label %do.body, !llvm.loop !5
for.inc.sink.split: ; preds = %do.body, %for.body
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.016)
br label %for.inc
for.inc: ; preds = %if.end, %for.inc.sink.split
%inc = add nuw i32 %i.016, 1
%exitcond.not = icmp eq i32 %i.016, %n
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !7
for.end: ; preds = %for.inc, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !8
%cmp.not15.i = icmp slt i32 %0, 3
br i1 %cmp.not15.i, label %call.exit, label %for.body.i
for.body.i: ; preds = %entry, %for.inc.i
%i.016.i = phi i32 [ %inc.i, %for.inc.i ], [ 3, %entry ]
%rem.i = urem i32 %i.016.i, 3
%cmp1.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.i, label %for.inc.sink.split.i, label %do.body.i
do.body.i: ; preds = %for.body.i, %if.end.i
%x.0.i = phi i32 [ %div.i, %if.end.i ], [ %i.016.i, %for.body.i ]
%rem2.i = srem i32 %x.0.i, 10
%div.i = sdiv i32 %x.0.i, 10
%cmp3.i = icmp eq i32 %rem2.i, 3
br i1 %cmp3.i, label %for.inc.sink.split.i, label %if.end.i
if.end.i: ; preds = %do.body.i
%x.0.off.i = add i32 %x.0.i, 9
%tobool.not.i = icmp ult i32 %x.0.off.i, 19
br i1 %tobool.not.i, label %for.inc.i, label %do.body.i, !llvm.loop !5
for.inc.sink.split.i: ; preds = %do.body.i, %for.body.i
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.016.i)
br label %for.inc.i
for.inc.i: ; preds = %if.end.i, %for.inc.sink.split.i
%inc.i = add nuw i32 %i.016.i, 1
%exitcond.not.i = icmp eq i32 %i.016.i, %0
br i1 %exitcond.not.i, label %call.exit, label %for.body.i, !llvm.loop !7
call.exit: ; preds = %for.inc.i, %entry
%putchar.i = call i32 @putchar(i32 10)
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 #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int i, x, n;
scanf("%d",&n);
for(i = 1; i <= n; i++){
if(i % 3 == 0){
printf(" %d",i);
}
else{
for(x = i; x >= 1; x /= 10){
if(x % 10 == 3){
printf(" %d",i);
break;
}
}
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229871/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229871/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not22 = icmp slt i32 %0, 1
br i1 %cmp.not22, label %for.end12, label %for.body
for.body: ; preds = %entry, %for.inc11
%i.023 = phi i32 [ %inc, %for.inc11 ], [ 1, %entry ]
%rem = urem i32 %i.023, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc11.sink.split, label %for.body5
for.body5: ; preds = %for.body, %for.inc
%x.021 = phi i32 [ %div, %for.inc ], [ %i.023, %for.body ]
%rem6 = urem i32 %x.021, 10
%div = udiv i32 %x.021, 10
%cmp7 = icmp eq i32 %rem6, 3
br i1 %cmp7, label %for.inc11.sink.split, label %for.inc
for.inc: ; preds = %for.body5
%cmp4.not = icmp ult i32 %x.021, 10
br i1 %cmp4.not, label %for.inc11, label %for.body5, !llvm.loop !9
for.inc11.sink.split: ; preds = %for.body5, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.023)
br label %for.inc11
for.inc11: ; preds = %for.inc, %for.inc11.sink.split
%inc = add nuw nsw i32 %i.023, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.023, %1
br i1 %cmp.not.not, label %for.body, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.inc11, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int n, i, c;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
if (i % 3 == 0) printf(" %d", i);
else {
c = i;
while (c % 10 != 3 && c) {
c /= 10;
}
if (c) printf(" %d", i);
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229914/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229914/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.022 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.022, 3
%cmp1 = icmp eq i32 %rem, 0
%rem318.urem = urem i32 %i.022, 10
%cmp419.not = icmp eq i32 %rem318.urem, 3
%or.cond = or i1 %cmp1, %cmp419.not
br i1 %or.cond, label %for.inc.sink.split, label %while.body
while.body: ; preds = %for.body, %while.body
%c.020 = phi i32 [ %div, %while.body ], [ %i.022, %for.body ]
%div = sdiv i32 %c.020, 10
%rem3 = srem i32 %div, 10
%cmp4 = icmp ne i32 %rem3, 3
%1 = add nsw i32 %c.020, -10
%tobool = icmp ult i32 %1, -19
%2 = and i1 %tobool, %cmp4
br i1 %2, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body
br i1 %tobool, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %while.end, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.022)
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %while.end
%inc = add nuw nsw i32 %i.022, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.022, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int n,l=1,x;
for(scanf("%d",&n);l<=n;l++){
x=l;
if(x%3==0)printf(" %d",l);
else {
for(;x;x/=10) {
if(x%10==3){
printf(" %d",l);
break;
}
}
}
}
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_229958/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_229958/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %for.end11, label %for.body
for.body: ; preds = %entry, %for.inc10
%l.022 = phi i32 [ %inc, %for.inc10 ], [ 1, %entry ]
%rem = urem i32 %l.022, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc10.sink.split, label %for.body4
for.body4: ; preds = %for.body, %for.inc
%x.020 = phi i32 [ %div, %for.inc ], [ %l.022, %for.body ]
%rem5 = srem i32 %x.020, 10
%div = sdiv i32 %x.020, 10
%cmp6 = icmp eq i32 %rem5, 3
br i1 %cmp6, label %for.inc10.sink.split, label %for.inc
for.inc: ; preds = %for.body4
%x.020.off = add i32 %x.020, 9
%tobool.not = icmp ult i32 %x.020.off, 19
br i1 %tobool.not, label %for.inc10, label %for.body4, !llvm.loop !9
for.inc10.sink.split: ; preds = %for.body4, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %l.022)
br label %for.inc10
for.inc10: ; preds = %for.inc, %for.inc10.sink.split
%inc = add nuw nsw i32 %l.022, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %l.022, %1
br i1 %cmp.not.not, label %for.body, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.inc10, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
int compare(const void*a,const void*b){
return (*(int*)a-*(int*)b);
}
int main(){
int n,x,y;
scanf("%d%d%d",&n,&x,&y);
int ar[n];
for(int i=0;i<n;i++)
scanf("%d",ar+i);
qsort((void*)ar,n,sizeof(int),compare);int i;
for( i=0;i<n;i++){
if(ar[i]>x)
break;
}
if(y>=x){
if(i%2==0)
printf("%d\n",i/2);
else
printf("%d\n",i/2+1);
}
else
printf("%d\n",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2300/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2300/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %y)
%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
%cmp35 = icmp sgt i32 %3, 0
br i1 %cmp35, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre47 = sext i32 %3 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre47, %entry.for.cond.cleanup_crit_edge ], [ %6, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #6
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp437 = icmp sgt i32 %4, 0
%.pre = load i32, ptr %x, align 4, !tbaa !5
br i1 %cmp437, label %for.body6.lr.ph, label %for.end11
for.body6.lr.ph: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %4 to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %vla, 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
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.body6: ; preds = %for.body6.lr.ph, %for.inc9
%indvars.iv44 = phi i64 [ 0, %for.body6.lr.ph ], [ %indvars.iv.next45, %for.inc9 ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv44
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %7, %.pre
br i1 %cmp7, label %for.end11.loopexit.split.loop.exit, label %for.inc9
for.inc9: ; preds = %for.body6
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count
br i1 %exitcond.not, label %for.end11, label %for.body6, !llvm.loop !11
for.end11.loopexit.split.loop.exit: ; preds = %for.body6
%8 = trunc i64 %indvars.iv44 to i32
br label %for.end11
for.end11: ; preds = %for.inc9, %for.end11.loopexit.split.loop.exit, %for.cond.cleanup
%i2.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ %8, %for.end11.loopexit.split.loop.exit ], [ %4, %for.inc9 ]
%9 = load i32, ptr %y, align 4, !tbaa !5
%cmp12.not = icmp slt i32 %9, %.pre
%rem = and i32 %i2.0.lcssa, 1
%div33 = lshr i32 %i2.0.lcssa, 1
%spec.select = add nuw i32 %div33, %rem
%div33.sink = select i1 %cmp12.not, i32 %4, i32 %spec.select
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div33.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
#include <string.h>
int main()
{
int t;
scanf("%d",&t);
int x[10005],y[10005];
for(int i=0;i<t;i++)
{
int sum=0;
scanf("%d%d",&x[i],&y[i]);
if(x[i]==y[i])
sum=x[i]+y[i];
else if(x[i]-y[i]==1||x[i]-y[i]==-1)
sum=x[i]+y[i];
else if(x[i]==0&&y[i]==0)
sum=0;
else if(y[i]==0&&x[i]!=0)
sum=x[i]+x[i]-1;
else if(x[i]==0&&y[i]!=0)
sum=y[i]+y[i]-1;
else
{
if(x[i]>y[i])
sum=x[i]*2-1;
else
sum=2*y[i]-1;
}
printf("%d\n",sum);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23005/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23005/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [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
%x = alloca [10005 x i32], align 16
%y = alloca [10005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
call void @llvm.lifetime.start.p0(i64 40020, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 40020, ptr nonnull %y) #3
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp122 = icmp sgt i32 %0, 0
br i1 %cmp122, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end87, %entry
call void @llvm.lifetime.end.p0(i64 40020, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 40020, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
for.body: ; preds = %entry, %if.end87
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end87 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10005 x i32], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [10005 x i32], ptr %y, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp8 = icmp eq i32 %1, %2
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = shl nsw i32 %1, 1
br label %if.end87
if.else: ; preds = %for.body
%sub = sub nsw i32 %1, %2
switch i32 %sub, label %if.else30 [
i32 1, label %if.then24
i32 -1, label %if.then24
]
if.then24: ; preds = %if.else, %if.else
%add29 = add nsw i32 %2, %1
br label %if.end87
if.else30: ; preds = %if.else
%cmp33 = icmp eq i32 %1, 0
%3 = or i32 %2, %1
%or.cond = icmp eq i32 %3, 0
br i1 %or.cond, label %if.end87, label %if.else38
if.else38: ; preds = %if.else30
%cmp36 = icmp eq i32 %2, 0
br i1 %cmp36, label %land.lhs.true42, label %if.else53
land.lhs.true42: ; preds = %if.else38
br i1 %cmp33, label %if.else68, label %if.then46
if.then46: ; preds = %land.lhs.true42
%add51 = shl nsw i32 %1, 1
%sub52 = add nsw i32 %add51, -1
br label %if.end87
if.else53: ; preds = %if.else38
br i1 %cmp33, label %if.then61, label %if.else68
if.then61: ; preds = %if.else53
%add66 = shl nsw i32 %2, 1
%sub67 = add nsw i32 %add66, -1
br label %if.end87
if.else68: ; preds = %land.lhs.true42, %if.else53
%cmp73 = icmp sgt i32 %1, %2
br i1 %cmp73, label %if.then74, label %if.else78
if.then74: ; preds = %if.else68
%mul = shl nsw i32 %1, 1
%sub77 = add nsw i32 %mul, -1
br label %if.end87
if.else78: ; preds = %if.else68
%mul81 = shl nsw i32 %2, 1
%sub82 = add nsw i32 %mul81, -1
br label %if.end87
if.end87: ; preds = %if.else30, %if.then24, %if.then46, %if.then74, %if.else78, %if.then61, %if.then
%sum.0 = phi i32 [ %add, %if.then ], [ %add29, %if.then24 ], [ %sub52, %if.then46 ], [ %sub67, %if.then61 ], [ %sub77, %if.then74 ], [ %sub82, %if.else78 ], [ 0, %if.else30 ]
%call88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %t, 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.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 t;
scanf("%d",&t);
for(int i=1;i<=t;i++)
{
int x,y;
scanf("%d %d",&x,&y);
int sum=0,max;
if(x>=y)
max=x;
else
max=y;
sum=max+max-1;
if(x==y)
sum+=1;
printf("%d\n",sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23010/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23010/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%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
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not12 = icmp slt i32 %0, 1
br i1 %cmp.not12, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.013 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %y, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %1, i32 %2)
%add = shl nsw i32 %., 1
%cmp3 = icmp ne i32 %1, %2
%sub = sext i1 %cmp3 to i32
%sum.0 = add nsw i32 %add, %sub
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
%inc = add nuw nsw i32 %i.013, 1
%3 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.013, %3
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int N,i,t;
scanf("%d",&N);
for(i=3;i<=N;i++){
if(i%3==0){
printf(" %d", i);
}else {
t=i;
while(t>0){
if(t%10==3){
printf(" %d", i);
break;
}else{
t /= 10;
}
}
}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230150/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230150/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not19 = icmp slt i32 %0, 3
br i1 %cmp.not19, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.020 = phi i32 [ %inc, %for.inc ], [ 3, %entry ]
%rem = urem i32 %i.020, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %while.body
while.body: ; preds = %for.body, %if.else8
%t.018 = phi i32 [ %div, %if.else8 ], [ %i.020, %for.body ]
%rem4 = urem i32 %t.018, 10
%div = udiv i32 %t.018, 10
%cmp5 = icmp eq i32 %rem4, 3
br i1 %cmp5, label %for.inc.sink.split, label %if.else8
if.else8: ; preds = %while.body
%cmp3.not = icmp ult i32 %t.018, 10
br i1 %cmp3.not, label %for.inc, label %while.body, !llvm.loop !9
for.inc.sink.split: ; preds = %while.body, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.020)
br label %for.inc
for.inc: ; preds = %if.else8, %for.inc.sink.split
%inc = add nuw nsw i32 %i.020, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.020, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int divisible(int num){
if(num<3)
return 0;
else if(num%10==3)
return 1;
else
divisible(num/10);
}
int main(){
char line[100];
int num;
int i;
int n;
fgets(line, sizeof(line), stdin);
sscanf(line, "%d", &num);
for(i=3; i<=num; ++i){
if(i%3==0)
printf(" %d",i);
else
if(divisible(i))
printf(" %d", i);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230194/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230194/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @divisible(i32 noundef %num) local_unnamed_addr #0 {
entry:
%cmp8 = icmp slt i32 %num, 3
br i1 %cmp8, label %if.end4, label %if.else.preheader
if.else.preheader: ; preds = %entry
%rem.peel = urem i32 %num, 10
%cmp1.peel = icmp eq i32 %rem.peel, 3
br i1 %cmp1.peel, label %if.end4, label %if.else3.peel
if.else3.peel: ; preds = %if.else.preheader
%cmp.peel = icmp ult i32 %num, 30
br i1 %cmp.peel, label %if.end4, label %if.else
if.else: ; preds = %if.else3.peel, %if.else3
%num.tr9.in = phi i32 [ %num.tr9, %if.else3 ], [ %num, %if.else3.peel ]
%num.tr9 = udiv i32 %num.tr9.in, 10
%rem = urem i32 %num.tr9, 10
%cmp1 = icmp eq i32 %rem, 3
br i1 %cmp1, label %if.end4, label %if.else3
if.else3: ; preds = %if.else
%cmp = icmp ult i32 %num.tr9.in, 300
br i1 %cmp, label %if.end4, label %if.else, !llvm.loop !5
if.end4: ; preds = %if.else3, %if.else, %if.else.preheader, %if.else3.peel, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %if.else.preheader ], [ 0, %if.else3.peel ], [ 0, %if.else3 ], [ 1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%line = alloca [100 x i8], align 16
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %line) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !7
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 100, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %num) #5
%1 = load i32, ptr %num, align 4, !tbaa !11
%cmp.not17 = icmp slt i32 %1, 3
br i1 %cmp.not17, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.018 = phi i32 [ %inc, %for.inc ], [ 3, %entry ]
%rem = urem i32 %i.018, 3
%cmp3 = icmp eq i32 %rem, 0
%rem.peel.i = urem i32 %i.018, 10
%cmp1.peel.i = icmp eq i32 %rem.peel.i, 3
%or.cond = or i1 %cmp3, %cmp1.peel.i
br i1 %or.cond, label %for.inc.sink.split, label %if.else3.peel.i
if.else3.peel.i: ; preds = %for.body
%cmp.peel.i = icmp ult i32 %i.018, 30
br i1 %cmp.peel.i, label %for.inc, label %if.else.i
if.else.i: ; preds = %if.else3.peel.i, %if.else3.i
%num.tr9.in.i = phi i32 [ %num.tr9.i, %if.else3.i ], [ %i.018, %if.else3.peel.i ]
%num.tr9.i = udiv i32 %num.tr9.in.i, 10
%rem.i = urem i32 %num.tr9.i, 10
%cmp1.i = icmp eq i32 %rem.i, 3
br i1 %cmp1.i, label %for.inc.sink.split, label %if.else3.i
if.else3.i: ; preds = %if.else.i
%cmp.i = icmp ult i32 %num.tr9.in.i, 300
br i1 %cmp.i, label %for.inc, label %if.else.i, !llvm.loop !5
for.inc.sink.split: ; preds = %if.else.i, %for.body
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.018)
br label %for.inc
for.inc: ; preds = %if.else3.i, %for.inc.sink.split, %if.else3.peel.i
%inc = add nuw nsw i32 %i.018, 1
%2 = load i32, ptr %num, align 4, !tbaa !11
%cmp.not.not = icmp slt i32 %i.018, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %line) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.peeled.count", i32 1}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !9, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int n,i=1,x;
int end_flag = 0;
void checkNum();
void endCheckNum(){
if(++i <= n){
checkNum();
}
end_flag = 1;
}
void include3(){
if(end_flag) return;
if(x % 10 == 3){
printf(" %d",i);
endCheckNum();
}
x /= 10;
if( x ) include3();
endCheckNum();
}
void checkNum(){
if(end_flag) return;
x = i;
if(x % 3 == 0){
printf(" %d",i);
endCheckNum();
}
include3();
}
int main(){
scanf("%d",&n);
checkNum();
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230244/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230244/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@i = dso_local local_unnamed_addr global i32 1, align 4
@end_flag = dso_local local_unnamed_addr global i32 0, align 4
@n = dso_local global i32 0, align 4
@x = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @endCheckNum() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @i, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %0, %1
%2 = load i32, ptr @end_flag, align 4
%tobool.not.i = icmp eq i32 %2, 0
%or.cond = select i1 %cmp.not.not, i1 %tobool.not.i, i1 false
br i1 %or.cond, label %if.end.i, label %if.end
if.end.i: ; preds = %entry
store i32 %inc, ptr @x, align 4, !tbaa !5
%rem.i = srem i32 %inc, 3
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.then1.i, label %if.end2.i
if.then1.i: ; preds = %if.end.i
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %inc)
tail call void @endCheckNum()
br label %if.end2.i
if.end2.i: ; preds = %if.then1.i, %if.end.i
tail call void @include3()
br label %if.end
if.end: ; preds = %if.end2.i, %entry
store i32 1, ptr @end_flag, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @include3() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @end_flag, align 4, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %if.end, label %return
if.end: ; preds = %entry
%1 = load i32, ptr @x, align 4, !tbaa !5
%rem = srem i32 %1, 10
%cmp = icmp eq i32 %rem, 3
br i1 %cmp, label %if.then1, label %if.end2
if.then1: ; preds = %if.end
%2 = load i32, ptr @i, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
tail call void @endCheckNum()
%.pre = load i32, ptr @x, align 4, !tbaa !5
br label %if.end2
if.end2: ; preds = %if.then1, %if.end
%3 = phi i32 [ %.pre, %if.then1 ], [ %1, %if.end ]
%div = sdiv i32 %3, 10
store i32 %div, ptr @x, align 4, !tbaa !5
%.off = add i32 %3, 9
%tobool3.not = icmp ult i32 %.off, 19
br i1 %tobool3.not, label %if.end5, label %if.then4
if.then4: ; preds = %if.end2
tail call void @include3()
br label %if.end5
if.end5: ; preds = %if.then4, %if.end2
tail call void @endCheckNum()
br label %return
return: ; preds = %entry, %if.end5
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 void @checkNum() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @end_flag, align 4, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %if.end, label %return
if.end: ; preds = %entry
%1 = load i32, ptr @i, align 4, !tbaa !5
store i32 %1, ptr @x, align 4, !tbaa !5
%rem = srem i32 %1, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.then1, label %if.end2
if.then1: ; preds = %if.end
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
tail call void @endCheckNum()
br label %if.end2
if.end2: ; preds = %if.then1, %if.end
tail call void @include3()
br label %return
return: ; preds = %entry, %if.end2
ret void
}
; 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.1, ptr noundef nonnull @n)
%0 = load i32, ptr @end_flag, align 4, !tbaa !5
%tobool.not.i = icmp eq i32 %0, 0
br i1 %tobool.not.i, label %if.end.i, label %checkNum.exit
if.end.i: ; preds = %entry
%1 = load i32, ptr @i, align 4, !tbaa !5
store i32 %1, ptr @x, align 4, !tbaa !5
%rem.i = srem i32 %1, 3
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.then1.i, label %if.end2.i
if.then1.i: ; preds = %if.end.i
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
tail call void @endCheckNum()
br label %if.end2.i
if.end2.i: ; preds = %if.then1.i, %if.end.i
tail call void @include3()
br label %checkNum.exit
checkNum.exit: ; preds = %entry, %if.end2.i
%putchar = tail call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,x,i;
scanf("%d", &n);
for(i=1; i <= n; i++){
if( i % 3 == 0){
printf(" %d", i);
}
else{
x=i;
while(1){
if( x % 10 == 3 ){
printf(" %d", i);
break;
}
x/=10;
if(x==0) break;
}
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230288/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230288/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not19 = icmp slt i32 %0, 1
br i1 %cmp.not19, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.020 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.020, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %while.cond
while.cond: ; preds = %for.body, %if.end
%x.0 = phi i32 [ %div, %if.end ], [ %i.020, %for.body ]
%rem3 = srem i32 %x.0, 10
%div = sdiv i32 %x.0, 10
%cmp4 = icmp eq i32 %rem3, 3
br i1 %cmp4, label %for.inc.sink.split, label %if.end
if.end: ; preds = %while.cond
%x.0.off = add i32 %x.0, 9
%cmp7 = icmp ult i32 %x.0.off, 19
br i1 %cmp7, label %for.inc, label %while.cond
for.inc.sink.split: ; preds = %while.cond, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.020)
br label %for.inc
for.inc: ; preds = %if.end, %for.inc.sink.split
%inc = add nuw nsw i32 %i.020, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.020, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int n,x;
scanf("%d",&n);
for(int i=3;i<=n;i++){
x=i;
if(x!=0&&x%3==0){
printf(" %d",i);
}else{
while(x!=0){
if(x%10==3){
printf(" %d",i);
break;
}else{
x/=10;
}
}
}
}
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230330/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230330/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not21 = icmp slt i32 %0, 3
br i1 %cmp.not21, label %for.cond.cleanup, label %land.lhs.true
for.cond.cleanup: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
land.lhs.true: ; preds = %entry, %for.inc
%i.022 = phi i32 [ %inc, %for.inc ], [ 3, %entry ]
%rem = urem i32 %i.022, 3
%cmp2 = icmp eq i32 %rem, 0
br i1 %cmp2, label %for.inc.sink.split, label %while.body
while.body: ; preds = %land.lhs.true, %if.else9
%x.020 = phi i32 [ %div, %if.else9 ], [ %i.022, %land.lhs.true ]
%rem5 = srem i32 %x.020, 10
%div = sdiv i32 %x.020, 10
%cmp6 = icmp eq i32 %rem5, 3
br i1 %cmp6, label %for.inc.sink.split, label %if.else9
if.else9: ; preds = %while.body
%x.020.off = add i32 %x.020, 9
%cmp4.not = icmp ult i32 %x.020.off, 19
br i1 %cmp4.not, label %for.inc, label %while.body, !llvm.loop !9
for.inc.sink.split: ; preds = %while.body, %land.lhs.true
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.022)
br label %for.inc
for.inc: ; preds = %if.else9, %for.inc.sink.split
%inc = add nuw nsw i32 %i.022, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.022, %1
br i1 %cmp.not.not, label %land.lhs.true, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
void call (int n);
int main (void) {
int n;
scanf ("%d", &n);
call(n);
return 0;
}
void call (int n) {
for (int i=1; i<=n; i++) {
int x = i;
if (x%3==0) printf(" %d", i);
else {
for (;;) {
if (x%10==3) {
printf (" %d", i);
break;
}
x /= 10;
if (x==0) break;
}
}
}
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230389/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not20.i = icmp slt i32 %0, 1
br i1 %cmp.not20.i, label %call.exit, label %for.body.i
for.body.i: ; preds = %entry, %if.end10.i
%i.021.i = phi i32 [ %inc.i, %if.end10.i ], [ 1, %entry ]
%rem.i = urem i32 %i.021.i, 3
%cmp1.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.i, label %if.end10.sink.split.i, label %for.cond2.i
for.cond2.i: ; preds = %for.body.i, %if.end.i
%x.0.i = phi i32 [ %div.i, %if.end.i ], [ %i.021.i, %for.body.i ]
%rem3.i = srem i32 %x.0.i, 10
%div.i = sdiv i32 %x.0.i, 10
%cmp4.i = icmp eq i32 %rem3.i, 3
br i1 %cmp4.i, label %if.end10.sink.split.i, label %if.end.i
if.end.i: ; preds = %for.cond2.i
%x.0.off.i = add i32 %x.0.i, 9
%cmp7.i = icmp ult i32 %x.0.off.i, 19
br i1 %cmp7.i, label %if.end10.i, label %for.cond2.i
if.end10.sink.split.i: ; preds = %for.cond2.i, %for.body.i
%call6.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.021.i)
br label %if.end10.i
if.end10.i: ; preds = %if.end.i, %if.end10.sink.split.i
%inc.i = add nuw i32 %i.021.i, 1
%exitcond.not.i = icmp eq i32 %i.021.i, %0
br i1 %exitcond.not.i, label %call.exit, label %for.body.i, !llvm.loop !9
call.exit: ; preds = %if.end10.i, %entry
%putchar.i = call i32 @putchar(i32 10)
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 uwtable
define dso_local void @call(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not20 = icmp slt i32 %n, 1
br i1 %cmp.not20, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %if.end10, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
for.body: ; preds = %entry, %if.end10
%i.021 = phi i32 [ %inc, %if.end10 ], [ 1, %entry ]
%rem = urem i32 %i.021, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.end10.sink.split, label %for.cond2
for.cond2: ; preds = %for.body, %if.end
%x.0 = phi i32 [ %div, %if.end ], [ %i.021, %for.body ]
%rem3 = srem i32 %x.0, 10
%div = sdiv i32 %x.0, 10
%cmp4 = icmp eq i32 %rem3, 3
br i1 %cmp4, label %if.end10.sink.split, label %if.end
if.end: ; preds = %for.cond2
%x.0.off = add i32 %x.0, 9
%cmp7 = icmp ult i32 %x.0.off, 19
br i1 %cmp7, label %if.end10, label %for.cond2
if.end10.sink.split: ; preds = %for.cond2, %for.body
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.021)
br label %if.end10
if.end10: ; preds = %if.end, %if.end10.sink.split
%inc = add nuw i32 %i.021, 1
%exitcond.not = icmp eq i32 %i.021, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; 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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
int main (void)
{
int input1;
int i,x;
scanf("%d",&input1);
for(i = 3 ; i <= input1 ; i++)
{
if(i % 3 == 0)
{
printf(" %d",i);
}
else
{
x = i;
do
{
if(x % 10 == 3)
{
printf(" %d",i);
break;
}
else
{
x /= 10;
}
}while(x);
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input1 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input1) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input1)
%0 = load i32, ptr %input1, align 4, !tbaa !5
%cmp.not17 = icmp slt i32 %0, 3
br i1 %cmp.not17, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.018 = phi i32 [ %inc, %for.inc ], [ 3, %entry ]
%rem = urem i32 %i.018, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %do.body
do.body: ; preds = %for.body, %if.else7
%x.0 = phi i32 [ %div, %if.else7 ], [ %i.018, %for.body ]
%rem3 = srem i32 %x.0, 10
%div = sdiv i32 %x.0, 10
%cmp4 = icmp eq i32 %rem3, 3
br i1 %cmp4, label %for.inc.sink.split, label %if.else7
if.else7: ; preds = %do.body
%x.0.off = add i32 %x.0, 9
%tobool.not = icmp ult i32 %x.0.off, 19
br i1 %tobool.not, label %for.inc, label %do.body, !llvm.loop !9
for.inc.sink.split: ; preds = %do.body, %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.018)
br label %for.inc
for.inc: ; preds = %if.else7, %for.inc.sink.split
%inc = add nuw nsw i32 %i.018, 1
%1 = load i32, ptr %input1, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.018, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 i, x, n;
scanf("%d", &n);
i = 1;
while(i <= n){
x = i;
if(x % 3 == 0){
printf(" %d", i);
}
else{
while(x != 0){
if(x % 10 == 3){
printf(" %d", i);
break;
}
x /= 10;
}
}
i++;
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230532/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230532/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not21 = icmp slt i32 %0, 1
br i1 %cmp.not21, label %while.end11, label %while.body
while.body: ; preds = %entry, %if.end10
%i.022 = phi i32 [ %inc, %if.end10 ], [ 1, %entry ]
%rem = urem i32 %i.022, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.end10.sink.split, label %while.body5
while.body5: ; preds = %while.body, %if.end
%x.020 = phi i32 [ %div, %if.end ], [ %i.022, %while.body ]
%rem6 = srem i32 %x.020, 10
%div = sdiv i32 %x.020, 10
%cmp7 = icmp eq i32 %rem6, 3
br i1 %cmp7, label %if.end10.sink.split, label %if.end
if.end: ; preds = %while.body5
%x.020.off = add i32 %x.020, 9
%cmp4.not = icmp ult i32 %x.020.off, 19
br i1 %cmp4.not, label %if.end10, label %while.body5, !llvm.loop !9
if.end10.sink.split: ; preds = %while.body5, %while.body
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.022)
br label %if.end10
if.end10: ; preds = %if.end, %if.end10.sink.split
%inc = add nuw nsw i32 %i.022, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.022, %1
br i1 %cmp.not.not, label %while.body, label %while.end11, !llvm.loop !11
while.end11: ; preds = %if.end10, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int n,i,j;
scanf("%d",&n);
for(i=1;i<n+1;i++){
if(i%3==0){
printf(" %d",i);
continue;
}
else{
j=i;
while(j>0){
if(j%10==3){
printf(" %d",i);
break;
}
j=j/10;
}
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230583/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230583/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
; 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
%cmp.not18 = icmp slt i32 %0, 1
br i1 %cmp.not18, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.019 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%rem = urem i32 %i.019, 3
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %for.inc.sink.split, label %while.body
while.body: ; preds = %for.body, %if.end
%j.017 = phi i32 [ %div, %if.end ], [ %i.019, %for.body ]
%rem4 = urem i32 %j.017, 10
%div = udiv i32 %j.017, 10
%cmp5 = icmp eq i32 %rem4, 3
br i1 %cmp5, label %for.inc.sink.split, label %if.end
if.end: ; preds = %while.body
%cmp3.not = icmp ult i32 %j.017, 10
br i1 %cmp3.not, label %for.inc, label %while.body, !llvm.loop !9
for.inc.sink.split: ; preds = %while.body, %for.body
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.019)
br label %for.inc
for.inc: ; preds = %if.end, %for.inc.sink.split
%inc = add nuw nsw i32 %i.019, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.019, %1
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d%d",&a,&b);
if(b%a==0) printf("%d",a+b);
else printf("%d",b-a);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230626/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230626/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %1
%sub.sink.p = select i1 %cmp, i32 %1, i32 %2
%sub.sink = add i32 %0, %sub.sink.p
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int n, i, j, count = 0;
scanf("%d", &n);
char **a, **b;
a = (char **)malloc(sizeof(char *)*n);
b = (char **)malloc(sizeof(char *)*n);
for (i = 0; i < n; i++)
{
a[i] = (char *)malloc(5 * sizeof(char));
b[i] = (char *)malloc(5 * sizeof(char));
}
for (i = 0; i < n; i++)
{
scanf("%s", a[i]);
}
for (i = 0; i < n; i++)
{
scanf("%s", b[i]);
}
for (i = 0; i < n; i++)
{
for (j = 0; j < n; j++)
{
if (strcmp(a[i],b[j])== 0)
{
a[i] = "\0";
b[j] = "\0";
break;
}
}
}
for (i = 0; i < n; i++)
{
if (a[i] != "\0")
{
for (j = 0; j < n; j++)
{
if (b[j] != "\0")
{
if (strlen(a[i]) == strlen(b[j]))
{
count++;
a[i] = "\0";
b[j] = "\0";
break;
}
}
}
}
}
printf("%d", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23067/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23067/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] zeroinitializer, 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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #6
%call4 = call noalias ptr @malloc(i64 noundef %mul) #6
%cmp136 = icmp sgt i32 %0, 0
br i1 %cmp136, label %for.body.preheader, label %for.end95
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond10.preheader: ; preds = %for.body
br i1 %cmp136, label %for.body13, label %for.end95
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%call6 = call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #6
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call6, ptr %arrayidx, align 8, !tbaa !9
%call7 = call noalias dereferenceable_or_null(5) ptr @malloc(i64 noundef 5) #6
%arrayidx9 = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv
store ptr %call7, ptr %arrayidx9, align 8, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond10.preheader, label %for.body, !llvm.loop !11
for.cond20.preheader: ; preds = %for.body13
%cmp21140 = icmp sgt i32 %2, 0
br i1 %cmp21140, label %for.body23, label %for.end95
for.body13: ; preds = %for.cond10.preheader, %for.body13
%indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.body13 ], [ 0, %for.cond10.preheader ]
%arrayidx15 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv158
%1 = load ptr, ptr %arrayidx15, align 8, !tbaa !9
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %1)
%indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp11 = icmp slt i64 %indvars.iv.next159, %3
br i1 %cmp11, label %for.body13, label %for.cond20.preheader, !llvm.loop !13
for.cond30.preheader: ; preds = %for.body23
%cmp31144 = icmp sgt i32 %7, 0
br i1 %cmp31144, label %for.cond34.preheader.us.preheader, label %for.end95
for.cond34.preheader.us.preheader: ; preds = %for.cond30.preheader
%wide.trip.count172 = zext i32 %7 to i64
br label %for.cond34.preheader.us
for.cond34.preheader.us: ; preds = %for.cond34.preheader.us.preheader, %for.inc52.us
%indvars.iv169 = phi i64 [ 0, %for.cond34.preheader.us.preheader ], [ %indvars.iv.next170, %for.inc52.us ]
%arrayidx39.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv169
%4 = load ptr, ptr %arrayidx39.us, align 8, !tbaa !9
br label %for.body37.us
for.cond34.us: ; preds = %for.body37.us
%indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1
%exitcond168.not = icmp eq i64 %indvars.iv.next165, %wide.trip.count172
br i1 %exitcond168.not, label %for.inc52.us, label %for.body37.us, !llvm.loop !14
for.body37.us: ; preds = %for.cond34.preheader.us, %for.cond34.us
%indvars.iv164 = phi i64 [ 0, %for.cond34.preheader.us ], [ %indvars.iv.next165, %for.cond34.us ]
%arrayidx41.us = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv164
%5 = load ptr, ptr %arrayidx41.us, align 8, !tbaa !9
%call42.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %5) #7
%cmp43.us = icmp eq i32 %call42.us, 0
br i1 %cmp43.us, label %if.then.us, label %for.cond34.us
if.then.us: ; preds = %for.body37.us
%arrayidx41.us.le = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv164
store ptr @.str.2, ptr %arrayidx39.us, align 8, !tbaa !9
store ptr @.str.2, ptr %arrayidx41.us.le, align 8, !tbaa !9
br label %for.inc52.us
for.inc52.us: ; preds = %for.cond34.us, %if.then.us
%indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
%exitcond173.not = icmp eq i64 %indvars.iv.next170, %wide.trip.count172
br i1 %exitcond173.not, label %for.cond55.preheader, label %for.cond34.preheader.us, !llvm.loop !15
for.body23: ; preds = %for.cond20.preheader, %for.body23
%indvars.iv161 = phi i64 [ %indvars.iv.next162, %for.body23 ], [ 0, %for.cond20.preheader ]
%arrayidx25 = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv161
%6 = load ptr, ptr %arrayidx25, align 8, !tbaa !9
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %6)
%indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp21 = icmp slt i64 %indvars.iv.next162, %8
br i1 %cmp21, label %for.body23, label %for.cond30.preheader, !llvm.loop !16
for.cond55.preheader: ; preds = %for.inc52.us
br i1 %cmp31144, label %for.body58.us.preheader, label %for.end95
for.body58.us.preheader: ; preds = %for.cond55.preheader
%wide.trip.count182 = zext i32 %7 to i64
br label %for.body58.us
for.body58.us: ; preds = %for.body58.us.preheader, %for.inc93.us
%indvars.iv179 = phi i64 [ 0, %for.body58.us.preheader ], [ %indvars.iv.next180, %for.inc93.us ]
%count.0150.us = phi i32 [ 0, %for.body58.us.preheader ], [ %count.1.us, %for.inc93.us ]
%arrayidx60.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv179
%9 = load ptr, ptr %arrayidx60.us, align 8, !tbaa !9
%cmp61.not.us = icmp eq ptr %9, @.str.2
br i1 %cmp61.not.us, label %for.inc93.us, label %for.body67.us
for.body67.us: ; preds = %for.body58.us, %for.inc89.us
%indvars.iv174 = phi i64 [ %indvars.iv.next175, %for.inc89.us ], [ 0, %for.body58.us ]
%arrayidx69.us = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv174
%10 = load ptr, ptr %arrayidx69.us, align 8, !tbaa !9
%cmp70.not.us = icmp eq ptr %10, @.str.2
br i1 %cmp70.not.us, label %for.inc89.us, label %if.then72.us
if.then72.us: ; preds = %for.body67.us
%call75.us = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %9) #7
%call78.us = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %10) #7
%cmp79.us = icmp eq i64 %call75.us, %call78.us
br i1 %cmp79.us, label %if.then81.us, label %for.inc89.us
if.then81.us: ; preds = %if.then72.us
%arrayidx69.us.le = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv174
%inc82.us = add nsw i32 %count.0150.us, 1
store ptr @.str.2, ptr %arrayidx60.us, align 8, !tbaa !9
store ptr @.str.2, ptr %arrayidx69.us.le, align 8, !tbaa !9
br label %for.inc93.us
for.inc89.us: ; preds = %if.then72.us, %for.body67.us
%indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
%exitcond178.not = icmp eq i64 %indvars.iv.next175, %wide.trip.count182
br i1 %exitcond178.not, label %for.inc93.us, label %for.body67.us, !llvm.loop !17
for.inc93.us: ; preds = %for.inc89.us, %if.then81.us, %for.body58.us
%count.1.us = phi i32 [ %inc82.us, %if.then81.us ], [ %count.0150.us, %for.body58.us ], [ %count.0150.us, %for.inc89.us ]
%indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1
%exitcond183.not = icmp eq i64 %indvars.iv.next180, %wide.trip.count182
br i1 %exitcond183.not, label %for.end95, label %for.body58.us, !llvm.loop !18
for.end95: ; preds = %for.inc93.us, %for.cond30.preheader, %entry, %for.cond10.preheader, %for.cond20.preheader, %for.cond55.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond55.preheader ], [ 0, %for.cond20.preheader ], [ 0, %for.cond10.preheader ], [ 0, %entry ], [ 0, %for.cond30.preheader ], [ %count.1.us, %for.inc93.us ]
%call96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %count.0.lcssa)
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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
|
#include<stdio.h>
int main()
{
int a,b,dev;
scanf("%d%d",&a,&b);
if(b%a==0)
printf("%d\n",a+b);
else
printf("%d\n",b-a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230712/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230712/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %1
%sub.sink.p = select i1 %cmp, i32 %1, i32 %2
%sub.sink = add i32 %0, %sub.sink.p
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b);
if(b%a == 0)
printf("%d\n", a+b);
else
printf("%d\n", b-a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230756/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230756/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %1
%sub.sink.p = select i1 %cmp, i32 %1, i32 %2
%sub.sink = add i32 %0, %sub.sink.p
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a, b, c, d;
scanf("%d%d", &a, &b);
c = a + b;
d = b - a;
if (b % a == 0){
printf("%d", c);
}
else
printf("%d", d);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230806/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230806/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem = srem i32 %1, %0
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %0
%sub.sink.p = select i1 %cmp, i32 %0, i32 %2
%sub.sink = add i32 %1, %sub.sink.p
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
# include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(b%a==0) printf("%d\n",a+b);
else printf("%d\n",b-a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230857/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230857/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %1
%sub.sink.p = select i1 %cmp, i32 %1, i32 %2
%sub.sink = add i32 %0, %sub.sink.p
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int gy(int a,int b)
{
if(b==0) return a;
else return gy(b,a%b);
}
int gb(int a,int b)
{
return a/gy(a,b)*b;
}
int main()
{
int a,b,c,d,ch,k,p,q,kk;
while(scanf("%d%d%d%d",&a,&b,&c,&d)!=EOF)
{
if(1.0*a/b>=1.0*c/d)
{
k=gb(b,d);
a=a*k/b;
c=c*k/d;
b=d=k;
p=a-c;
q=a;
kk=gy(p,q);
p=p/kk;
q=q/kk;
printf("%d/%d\n",p,q);
continue;
}
else if(1.0*a/b<1.0*c/d)
{
k=gb(a,c);
b=b*k/a;
d=d*k/c;
a=c=k;
p=b-d;
q=b;
kk=gy(p,q);
p=p/kk;
q=q/kk;
printf("%d/%d\n",p,q);
continue;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23090/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d/%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gy(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gb(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4.i = icmp eq i32 %b, 0
br i1 %cmp4.i, label %gy.exit, label %if.else.i
if.else.i: ; preds = %entry, %if.else.i
%b.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %b, %entry ]
%a.tr5.i = phi i32 [ %b.tr6.i, %if.else.i ], [ %a, %entry ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gy.exit, label %if.else.i
gy.exit: ; preds = %if.else.i, %entry
%a.tr.lcssa.i = phi i32 [ %a, %entry ], [ %b.tr6.i, %if.else.i ]
%div = sdiv i32 %a, %a.tr.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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
%call75 = 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)
%cmp.not76 = icmp eq i32 %call75, -1
br i1 %cmp.not76, label %while.end, label %while.body
while.body: ; preds = %entry, %while.cond.backedge
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%4 = insertelement <2 x i32> poison, i32 %0, i64 0
%5 = insertelement <2 x i32> %4, i32 %2, i64 1
%6 = sitofp <2 x i32> %5 to <2 x double>
%7 = insertelement <2 x i32> poison, i32 %1, i64 0
%8 = insertelement <2 x i32> %7, i32 %3, i64 1
%9 = sitofp <2 x i32> %8 to <2 x double>
%10 = fdiv <2 x double> %6, %9
%11 = extractelement <2 x double> %10, i64 0
%12 = extractelement <2 x double> %10, i64 1
%cmp6 = fcmp ult double %11, %12
br i1 %cmp6, label %if.else, label %if.then
if.then: ; preds = %while.body
%cmp4.i.i = icmp eq i32 %3, 0
br i1 %cmp4.i.i, label %gb.exit, label %if.else.i.i
if.else.i.i: ; preds = %if.then, %if.else.i.i
%b.tr6.i.i = phi i32 [ %rem.i.i, %if.else.i.i ], [ %3, %if.then ]
%a.tr5.i.i = phi i32 [ %b.tr6.i.i, %if.else.i.i ], [ %1, %if.then ]
%rem.i.i = srem i32 %a.tr5.i.i, %b.tr6.i.i
%cmp.i.i = icmp eq i32 %rem.i.i, 0
br i1 %cmp.i.i, label %gb.exit, label %if.else.i.i
gb.exit: ; preds = %if.else.i.i, %if.then
%a.tr.lcssa.i.i = phi i32 [ %1, %if.then ], [ %b.tr6.i.i, %if.else.i.i ]
%div.i = sdiv i32 %1, %a.tr.lcssa.i.i
%mul.i = mul nsw i32 %div.i, %3
%mul9 = mul nsw i32 %mul.i, %0
%div10 = sdiv i32 %mul9, %1
store i32 %div10, ptr %a, align 4, !tbaa !5
%mul11 = mul nsw i32 %mul.i, %2
%div12 = sdiv i32 %mul11, %3
store i32 %div12, ptr %c, align 4, !tbaa !5
store i32 %mul.i, ptr %d, align 4, !tbaa !5
store i32 %mul.i, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %div10, %div12
%cmp4.i = icmp eq i32 %div10, 0
br i1 %cmp4.i, label %gy.exit, label %if.else.i
if.else.i: ; preds = %gb.exit, %if.else.i
%b.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %div10, %gb.exit ]
%a.tr5.i = phi i32 [ %b.tr6.i, %if.else.i ], [ %sub, %gb.exit ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gy.exit, label %if.else.i
gy.exit: ; preds = %if.else.i, %gb.exit
%a.tr.lcssa.i = phi i32 [ %sub, %gb.exit ], [ %b.tr6.i, %if.else.i ]
%div14 = sdiv i32 %sub, %a.tr.lcssa.i
%div15 = sdiv i32 %div10, %a.tr.lcssa.i
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div14, i32 noundef %div15)
br label %while.cond.backedge
while.cond.backedge: ; preds = %gy.exit, %gy.exit74, %if.else
%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)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
if.else: ; preds = %while.body
%cmp25 = fcmp olt double %11, %12
br i1 %cmp25, label %if.then27, label %while.cond.backedge
if.then27: ; preds = %if.else
%cmp4.i.i57 = icmp eq i32 %2, 0
br i1 %cmp4.i.i57, label %gb.exit66, label %if.else.i.i58
if.else.i.i58: ; preds = %if.then27, %if.else.i.i58
%b.tr6.i.i59 = phi i32 [ %rem.i.i61, %if.else.i.i58 ], [ %2, %if.then27 ]
%a.tr5.i.i60 = phi i32 [ %b.tr6.i.i59, %if.else.i.i58 ], [ %0, %if.then27 ]
%rem.i.i61 = srem i32 %a.tr5.i.i60, %b.tr6.i.i59
%cmp.i.i62 = icmp eq i32 %rem.i.i61, 0
br i1 %cmp.i.i62, label %gb.exit66, label %if.else.i.i58
gb.exit66: ; preds = %if.else.i.i58, %if.then27
%a.tr.lcssa.i.i63 = phi i32 [ %0, %if.then27 ], [ %b.tr6.i.i59, %if.else.i.i58 ]
%div.i64 = sdiv i32 %0, %a.tr.lcssa.i.i63
%mul.i65 = mul nsw i32 %div.i64, %2
%mul29 = mul nsw i32 %mul.i65, %1
%div30 = sdiv i32 %mul29, %0
store i32 %div30, ptr %b, align 4, !tbaa !5
%mul31 = mul nsw i32 %mul.i65, %3
%div32 = sdiv i32 %mul31, %2
store i32 %div32, ptr %d, align 4, !tbaa !5
store i32 %mul.i65, ptr %c, align 4, !tbaa !5
store i32 %mul.i65, ptr %a, align 4, !tbaa !5
%sub33 = sub nsw i32 %div30, %div32
%cmp4.i67 = icmp eq i32 %div30, 0
br i1 %cmp4.i67, label %gy.exit74, label %if.else.i68
if.else.i68: ; preds = %gb.exit66, %if.else.i68
%b.tr6.i69 = phi i32 [ %rem.i71, %if.else.i68 ], [ %div30, %gb.exit66 ]
%a.tr5.i70 = phi i32 [ %b.tr6.i69, %if.else.i68 ], [ %sub33, %gb.exit66 ]
%rem.i71 = srem i32 %a.tr5.i70, %b.tr6.i69
%cmp.i72 = icmp eq i32 %rem.i71, 0
br i1 %cmp.i72, label %gy.exit74, label %if.else.i68
gy.exit74: ; preds = %if.else.i68, %gb.exit66
%a.tr.lcssa.i73 = phi i32 [ %sub33, %gb.exit66 ], [ %b.tr6.i69, %if.else.i68 ]
%div35 = sdiv i32 %sub33, %a.tr.lcssa.i73
%div36 = sdiv i32 %div30, %a.tr.lcssa.i73
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div35, i32 noundef %div36)
br label %while.cond.backedge
while.end: ; preds = %while.cond.backedge, %entry
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(b % a == 0){
printf("%d\n",a+b);
}else{
printf("%d\n",b-a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230943/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230943/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %1
%sub.sink.p = select i1 %cmp, i32 %1, i32 %2
%sub.sink = add i32 %0, %sub.sink.p
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, ans;
scanf("%d %d", &a, &b);
if(b%a == 0) ans = a + b;
else ans = b - a;
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_230987/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_230987/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%2 = sub i32 0, %1
%ans.0.p = select i1 %cmp, i32 %1, i32 %2
%ans.0 = add i32 %ans.0.p, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
if(b%a==0)printf("%d\n",a+b);
if(b%a!=0)printf("%d\n",b-a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231029/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231029/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.end, label %if.then4
if.end: ; preds = %entry
%add = add nsw i32 %1, %0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%.pre = load i32, ptr %b, align 4, !tbaa !5
%.pre7 = load i32, ptr %a, align 4, !tbaa !5
%.pre8 = srem i32 %.pre, %.pre7
%2 = icmp eq i32 %.pre8, 0
br i1 %2, label %if.end6, label %if.then4
if.then4: ; preds = %entry, %if.end
%3 = phi i32 [ %.pre, %if.end ], [ %0, %entry ]
%4 = phi i32 [ %.pre7, %if.end ], [ %1, %entry ]
%sub = sub nsw i32 %3, %4
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define MOD 1000000007
typedef long long int ll;
ll PMRS(ll N, ll P, ll M){
if (P == 0){
return 1;
}else if (P % 2 == 0){
ll t = PMRS(N, P/2, M);
return t * t % M;
}else{
return N * PMRS(N, P - 1, M) % M;
}
}
ll inv_Felmat(ll a, ll M){
return PMRS(a, M - 2, M);
}
ll perm(ll n, ll k, ll M){
if (k == 1) return n;
return perm(n, k - 1, M) * (n - k + 1) % M;
}
ll comb(ll n, ll k, ll M){
ll x = perm(n, k, M);
ll y = perm(k, k, M);
return x * inv_Felmat(y, M);
}
int main(){
ll n, a, b, ans;
scanf("%lld%lld%lld", &n, &a, &b);
ans = (PMRS(2, n, MOD) - 1) % MOD;
ans = (ans - comb(n, a, MOD)) % MOD;
ans = (ans - comb(n, b, MOD)) % MOD;
while (ans < 0) ans += MOD;
printf("%lld", ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231087/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231087/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @PMRS(i64 noundef %N, i64 noundef %P, i64 noundef %M) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i64 %P, 0
br i1 %cmp, label %common.ret, label %if.else
if.else: ; preds = %entry
%0 = and i64 %P, 1
%cmp1 = icmp eq i64 %0, 0
br i1 %cmp1, label %if.then2, label %if.else4
common.ret.sink.split: ; preds = %if.then2, %if.else4
%mul6.sink = phi i64 [ %mul6, %if.else4 ], [ %mul, %if.then2 ]
%rem7 = srem i64 %mul6.sink, %M
br label %common.ret
common.ret: ; preds = %common.ret.sink.split, %entry
%common.ret.op = phi i64 [ 1, %entry ], [ %rem7, %common.ret.sink.split ]
ret i64 %common.ret.op
if.then2: ; preds = %if.else
%div = sdiv i64 %P, 2
%call = tail call i64 @PMRS(i64 noundef %N, i64 noundef %div, i64 noundef %M)
%mul = mul nsw i64 %call, %call
br label %common.ret.sink.split
if.else4: ; preds = %if.else
%sub = add nsw i64 %P, -1
%call5 = tail call i64 @PMRS(i64 noundef %N, i64 noundef %sub, i64 noundef %M)
%mul6 = mul nsw i64 %call5, %N
br label %common.ret.sink.split
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @inv_Felmat(i64 noundef %a, i64 noundef %M) local_unnamed_addr #0 {
entry:
%sub = add nsw i64 %M, -2
%call = tail call i64 @PMRS(i64 noundef %a, i64 noundef %sub, i64 noundef %M)
ret i64 %call
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @perm(i64 noundef %n, i64 noundef %k, i64 noundef %M) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i64 %k, 1
br i1 %cmp, label %common.ret7, label %if.end
common.ret7: ; preds = %entry, %if.end
%common.ret7.op = phi i64 [ %rem, %if.end ], [ %n, %entry ]
ret i64 %common.ret7.op
if.end: ; preds = %entry
%sub = add nsw i64 %k, -1
%call = tail call i64 @perm(i64 noundef %n, i64 noundef %sub, i64 noundef %M)
%sub1 = add i64 %n, 1
%add = sub i64 %sub1, %k
%mul = mul nsw i64 %call, %add
%rem = srem i64 %mul, %M
br label %common.ret7
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @comb(i64 noundef %n, i64 noundef %k, i64 noundef %M) local_unnamed_addr #0 {
entry:
%call = tail call i64 @perm(i64 noundef %n, i64 noundef %k, i64 noundef %M)
%call1 = tail call i64 @perm(i64 noundef %k, i64 noundef %k, i64 noundef %M)
%sub.i = add nsw i64 %M, -2
%call.i = tail call i64 @PMRS(i64 noundef %call1, i64 noundef %sub.i, i64 noundef %M)
%mul = mul nsw i64 %call.i, %call
ret i64 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i64, ptr %n, align 8, !tbaa !5
%call1 = call i64 @PMRS(i64 noundef 2, i64 noundef %0, i64 noundef 1000000007)
%sub = add nsw i64 %call1, -1
%rem = srem i64 %sub, 1000000007
%1 = load i64, ptr %a, align 8, !tbaa !5
%call.i = call i64 @perm(i64 noundef %0, i64 noundef %1, i64 noundef 1000000007)
%call1.i = call i64 @perm(i64 noundef %1, i64 noundef %1, i64 noundef 1000000007)
%call.i.i = call i64 @PMRS(i64 noundef %call1.i, i64 noundef 1000000005, i64 noundef 1000000007)
%mul.i = mul nsw i64 %call.i.i, %call.i
%sub3 = sub nsw i64 %rem, %mul.i
%rem4 = srem i64 %sub3, 1000000007
%2 = load i64, ptr %b, align 8, !tbaa !5
%call.i13 = call i64 @perm(i64 noundef %0, i64 noundef %2, i64 noundef 1000000007)
%call1.i14 = call i64 @perm(i64 noundef %2, i64 noundef %2, i64 noundef 1000000007)
%call.i.i15 = call i64 @PMRS(i64 noundef %call1.i14, i64 noundef 1000000005, i64 noundef 1000000007)
%mul.i16 = mul nsw i64 %call.i.i15, %call.i13
%sub6 = sub nsw i64 %rem4, %mul.i16
%rem7 = srem i64 %sub6, 1000000007
%smax = call i64 @llvm.smax.i64(i64 %rem7, i64 0)
%rem7.lobit = lshr i64 %rem7, 63
%3 = add nsw i64 %rem7, %rem7.lobit
%4 = sub nsw i64 %smax, %3
%5 = udiv i64 %4, 1000000007
%6 = add nuw nsw i64 %rem7.lobit, %5
%7 = mul i64 %6, 1000000007
%8 = add i64 %rem7, %7
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %8)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!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>
#define mod 1000000007
#define Maxn 10005
#define Maxd 105
char s[Maxn];
int dp[Maxn][Maxd][2],p,d,len;
int dfs(int idx,int z,int t)
{
if (idx==len) return !z;
int *res=&dp[idx][z][t];
if (~*res) return *res;*res=0;
int x=s[idx]-'0',r=(t?x:9);
for (int i=0;i<=r;i++)
*res=(*res+dfs(idx+1,(z+i)%d,t&&i==r))%mod;
return *res;
}
int main()
{
memset(dp,-1,sizeof(dp));
scanf("%s\n%d",s,&d);len=strlen(s);
printf("%d\n",(dfs(0,0,1)-1+mod)%mod);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231151/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231151/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@len = dso_local local_unnamed_addr global i32 0, align 4
@dp = dso_local local_unnamed_addr global [10005 x [105 x [2 x i32]]] zeroinitializer, align 16
@s = dso_local global [10005 x i8] zeroinitializer, align 16
@d = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [6 x i8] c"%s\0A%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@p = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %idx, i32 noundef %z, i32 noundef %t) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @len, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %idx
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%tobool.not = icmp eq i32 %z, 0
%lnot.ext = zext i1 %tobool.not to i32
br label %return
if.end: ; preds = %entry
%idxprom = sext i32 %idx to i64
%idxprom1 = sext i32 %z to i64
%idxprom3 = sext i32 %t to i64
%arrayidx4 = getelementptr inbounds [10005 x [105 x [2 x i32]]], ptr @dp, i64 0, i64 %idxprom, i64 %idxprom1, i64 %idxprom3
%1 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%tobool5.not = icmp eq i32 %1, -1
br i1 %tobool5.not, label %if.end7, label %return
if.end7: ; preds = %if.end
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
%arrayidx9 = getelementptr inbounds [10005 x i8], ptr @s, i64 0, i64 %idxprom
%2 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%conv = sext i8 %2 to i32
%sub = add nsw i32 %conv, -48
%tobool10 = icmp ne i32 %t, 0
%cond = select i1 %tobool10, i32 %sub, i32 9
%cmp11.not35 = icmp slt i32 %cond, 0
br i1 %cmp11.not35, label %return, label %for.body.lr.ph
for.body.lr.ph: ; preds = %if.end7
%add = add nsw i32 %idx, 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%3 = phi i32 [ 0, %for.body.lr.ph ], [ %rem18, %for.body ]
%i.036 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%add13 = add nsw i32 %i.036, %z
%4 = load i32, ptr @d, align 4, !tbaa !5
%rem = srem i32 %add13, %4
%cmp15 = icmp eq i32 %i.036, %cond
%5 = and i1 %tobool10, %cmp15
%land.ext = zext i1 %5 to i32
%call = tail call i32 @dfs(i32 noundef %add, i32 noundef %rem, i32 noundef %land.ext)
%add17 = add nsw i32 %call, %3
%rem18 = srem i32 %add17, 1000000007
store i32 %rem18, ptr %arrayidx4, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.036, 1
%exitcond.not = icmp eq i32 %i.036, %cond
br i1 %exitcond.not, label %return, label %for.body, !llvm.loop !10
return: ; preds = %for.body, %if.end7, %if.end, %if.then
%retval.1 = phi i32 [ %lnot.ext, %if.then ], [ %1, %if.end ], [ 0, %if.end7 ], [ %rem18, %for.body ]
ret i32 %retval.1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8404200) @dp, i8 -1, i64 8404200, i1 false)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s, ptr noundef nonnull @d)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #5
%conv = trunc i64 %call1 to i32
store i32 %conv, ptr @len, align 4, !tbaa !5
%call2 = tail call i32 @dfs(i32 noundef 0, i32 noundef 0, i32 noundef 1)
%add = add nsw i32 %call2, 1000000006
%rem = srem i32 %add, 1000000007
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem)
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree 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 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define int long long
#define iin(x) scanf("%d", &x)
#define lin(x) scanf("%lld", &x)
#define fin(x) scanf("%lf", &x)
#define iout(x) printf("%d", x)
#define lout(x) printf("%lld", x)
#define fout(x) printf("%.10f", x)
#define _ putchar(' ')
#define endl puts("")
#define reps(i, x, n) for(i = (x); i < (n); i++)
#define rep(i, n) reps(i, 0, n)
int L[500001], R[500001];
int merge(int A[], int left, int mid, int right) {
int res = 0;
int n1 = mid - left;
int n2 = right - mid;
int i, j, k;
rep(i, n1) L[i] = A[left+i];
rep(i, n2) R[i] = A[mid+i];
L[n1] = 2000000000;
R[n2] = 2000000000;
i = 0, j = 0;
reps(k, left, right) {
if(L[i] <= R[j]) {
A[k] = L[i];
i++;
} else {
A[k] = R[j];
j++;
res += n1 - i;
}
}
return res;
}
int mergeSort(int A[], int left, int right) {
int a = 0, b = 0, c = 0;
if(left + 1 < right) {
int mid = (left + right) / 2;
a = mergeSort(A, left, mid);
b = mergeSort(A, mid, right);
c = merge(A, left, mid, right);
}
return a+b+c;
}
int A[500001];
signed main() {
int n; lin(n);
int i;
rep(i, n) lin(A[i]);
lout(mergeSort(A, 0, n)),endl;
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231201/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231201/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@L = dso_local local_unnamed_addr global [500001 x i64] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [500001 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@A = dso_local global [500001 x i64] zeroinitializer, align 16
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @merge(ptr nocapture noundef %A, i64 noundef %left, i64 noundef %mid, i64 noundef %right) local_unnamed_addr #0 {
entry:
%A73 = ptrtoint ptr %A to i64
%sub = sub nsw i64 %mid, %left
%sub1 = sub i64 %right, %mid
%invariant.gep = getelementptr i64, ptr %A, i64 %left
%cmp60 = icmp sgt i64 %sub, 0
br i1 %cmp60, label %for.body.preheader, label %for.cond3.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %sub, 10
br i1 %min.iters.check, label %for.body.preheader91, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%0 = shl i64 %left, 3
%1 = add i64 %0, %A73
%2 = sub i64 ptrtoint (ptr @L to i64), %1
%diff.check = icmp ult i64 %2, 32
br i1 %diff.check, label %for.body.preheader91, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %sub, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%3 = getelementptr i64, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %3, align 8, !tbaa !5
%4 = getelementptr i64, ptr %3, i64 2
%wide.load74 = load <2 x i64>, ptr %4, align 8, !tbaa !5
%5 = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %index
store <2 x i64> %wide.load, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i64, ptr %5, i64 2
store <2 x i64> %wide.load74, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %sub, %n.vec
br i1 %cmp.n, label %for.cond3.preheader, label %for.body.preheader91
for.body.preheader91: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%i.061.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond3.preheader: ; preds = %for.body, %middle.block, %entry
%invariant.gep62 = getelementptr i64, ptr %A, i64 %mid
%cmp464 = icmp sgt i64 %sub1, 0
br i1 %cmp464, label %for.body5.preheader, label %for.end11
for.body5.preheader: ; preds = %for.cond3.preheader
%min.iters.check79 = icmp ult i64 %sub1, 10
br i1 %min.iters.check79, label %for.body5.preheader90, label %vector.memcheck75
vector.memcheck75: ; preds = %for.body5.preheader
%8 = shl i64 %mid, 3
%9 = add i64 %8, %A73
%10 = sub i64 ptrtoint (ptr @R to i64), %9
%diff.check76 = icmp ult i64 %10, 32
br i1 %diff.check76, label %for.body5.preheader90, label %vector.ph80
vector.ph80: ; preds = %vector.memcheck75
%n.vec82 = and i64 %sub1, -4
br label %vector.body85
vector.body85: ; preds = %vector.body85, %vector.ph80
%index86 = phi i64 [ 0, %vector.ph80 ], [ %index.next89, %vector.body85 ]
%11 = getelementptr i64, ptr %invariant.gep62, i64 %index86
%wide.load87 = load <2 x i64>, ptr %11, align 8, !tbaa !5
%12 = getelementptr i64, ptr %11, i64 2
%wide.load88 = load <2 x i64>, ptr %12, align 8, !tbaa !5
%13 = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %index86
store <2 x i64> %wide.load87, ptr %13, align 16, !tbaa !5
%14 = getelementptr inbounds i64, ptr %13, i64 2
store <2 x i64> %wide.load88, ptr %14, align 16, !tbaa !5
%index.next89 = add nuw i64 %index86, 4
%15 = icmp eq i64 %index.next89, %n.vec82
br i1 %15, label %middle.block77, label %vector.body85, !llvm.loop !13
middle.block77: ; preds = %vector.body85
%cmp.n84 = icmp eq i64 %sub1, %n.vec82
br i1 %cmp.n84, label %for.end11, label %for.body5.preheader90
for.body5.preheader90: ; preds = %vector.memcheck75, %for.body5.preheader, %middle.block77
%i.165.ph = phi i64 [ 0, %vector.memcheck75 ], [ 0, %for.body5.preheader ], [ %n.vec82, %middle.block77 ]
br label %for.body5
for.body: ; preds = %for.body.preheader91, %for.body
%i.061 = phi i64 [ %inc, %for.body ], [ %i.061.ph, %for.body.preheader91 ]
%gep = getelementptr i64, ptr %invariant.gep, i64 %i.061
%16 = load i64, ptr %gep, align 8, !tbaa !5
%arrayidx2 = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %i.061
store i64 %16, ptr %arrayidx2, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.061, 1
%exitcond.not = icmp eq i64 %inc, %sub
br i1 %exitcond.not, label %for.cond3.preheader, label %for.body, !llvm.loop !14
for.body5: ; preds = %for.body5.preheader90, %for.body5
%i.165 = phi i64 [ %inc10, %for.body5 ], [ %i.165.ph, %for.body5.preheader90 ]
%gep63 = getelementptr i64, ptr %invariant.gep62, i64 %i.165
%17 = load i64, ptr %gep63, align 8, !tbaa !5
%arrayidx8 = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %i.165
store i64 %17, ptr %arrayidx8, align 8, !tbaa !5
%inc10 = add nuw nsw i64 %i.165, 1
%exitcond71.not = icmp eq i64 %inc10, %sub1
br i1 %exitcond71.not, label %for.end11, label %for.body5, !llvm.loop !15
for.end11: ; preds = %for.body5, %middle.block77, %for.cond3.preheader
%arrayidx12 = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %sub
store i64 2000000000, ptr %arrayidx12, align 8, !tbaa !5
%arrayidx13 = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %sub1
store i64 2000000000, ptr %arrayidx13, align 8, !tbaa !5
%cmp1566 = icmp slt i64 %left, %right
br i1 %cmp1566, label %for.body16, label %for.end30
for.body16: ; preds = %for.end11, %for.inc28
%k.070 = phi i64 [ %inc29, %for.inc28 ], [ %left, %for.end11 ]
%j.069 = phi i64 [ %j.1, %for.inc28 ], [ 0, %for.end11 ]
%i.268 = phi i64 [ %i.3, %for.inc28 ], [ 0, %for.end11 ]
%res.067 = phi i64 [ %res.1, %for.inc28 ], [ 0, %for.end11 ]
%arrayidx17 = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %i.268
%18 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%arrayidx18 = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %j.069
%19 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%cmp19.not = icmp sgt i64 %18, %19
br i1 %cmp19.not, label %if.else, label %if.then
if.then: ; preds = %for.body16
%inc22 = add nsw i64 %i.268, 1
br label %for.inc28
if.else: ; preds = %for.body16
%inc25 = add nsw i64 %j.069, 1
%sub26 = add i64 %res.067, %sub
%add27 = sub i64 %sub26, %i.268
br label %for.inc28
for.inc28: ; preds = %if.then, %if.else
%.sink = phi i64 [ %19, %if.else ], [ %18, %if.then ]
%res.1 = phi i64 [ %add27, %if.else ], [ %res.067, %if.then ]
%i.3 = phi i64 [ %i.268, %if.else ], [ %inc22, %if.then ]
%j.1 = phi i64 [ %inc25, %if.else ], [ %j.069, %if.then ]
%20 = getelementptr inbounds i64, ptr %A, i64 %k.070
store i64 %.sink, ptr %20, align 8
%inc29 = add nsw i64 %k.070, 1
%exitcond72.not = icmp eq i64 %inc29, %right
br i1 %exitcond72.not, label %for.end30, label %for.body16, !llvm.loop !16
for.end30: ; preds = %for.inc28, %for.end11
%res.0.lcssa = phi i64 [ 0, %for.end11 ], [ %res.1, %for.inc28 ]
ret i64 %res.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @mergeSort(ptr noundef %A, i64 noundef %left, i64 noundef %right) local_unnamed_addr #2 {
entry:
%A16 = ptrtoint ptr %A to i64
%add = add nsw i64 %left, 1
%cmp = icmp slt i64 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i64 %right, %left
%div = sdiv i64 %add1, 2
%call = tail call i64 @mergeSort(ptr noundef %A, i64 noundef %left, i64 noundef %div)
%call2 = tail call i64 @mergeSort(ptr noundef %A, i64 noundef %div, i64 noundef %right)
%sub.i = sub nsw i64 %div, %left
%sub1.i = sub i64 %right, %div
%invariant.gep.i = getelementptr i64, ptr %A, i64 %left
%cmp60.i = icmp sgt i64 %sub.i, 0
br i1 %cmp60.i, label %for.body.i.preheader, label %for.cond3.preheader.i
for.body.i.preheader: ; preds = %if.then
%min.iters.check = icmp ult i64 %sub.i, 10
br i1 %min.iters.check, label %for.body.i.preheader34, label %vector.memcheck
vector.memcheck: ; preds = %for.body.i.preheader
%0 = shl i64 %left, 3
%1 = add i64 %0, %A16
%2 = sub i64 ptrtoint (ptr @L to i64), %1
%diff.check = icmp ult i64 %2, 32
br i1 %diff.check, label %for.body.i.preheader34, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %sub.i, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%3 = getelementptr i64, ptr %invariant.gep.i, i64 %index
%wide.load = load <2 x i64>, ptr %3, align 8, !tbaa !5
%4 = getelementptr i64, ptr %3, i64 2
%wide.load17 = load <2 x i64>, ptr %4, align 8, !tbaa !5
%5 = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %index
store <2 x i64> %wide.load, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i64, ptr %5, i64 2
store <2 x i64> %wide.load17, ptr %6, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%7 = icmp eq i64 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %sub.i, %n.vec
br i1 %cmp.n, label %for.cond3.preheader.i, label %for.body.i.preheader34
for.body.i.preheader34: ; preds = %vector.memcheck, %for.body.i.preheader, %middle.block
%i.061.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.i.preheader ], [ %n.vec, %middle.block ]
br label %for.body.i
for.cond3.preheader.i: ; preds = %for.body.i, %middle.block, %if.then
%invariant.gep62.i = getelementptr i64, ptr %A, i64 %div
%cmp464.i = icmp sgt i64 %sub1.i, 0
br i1 %cmp464.i, label %for.body5.i.preheader, label %for.end11.i
for.body5.i.preheader: ; preds = %for.cond3.preheader.i
%min.iters.check22 = icmp ult i64 %sub1.i, 10
br i1 %min.iters.check22, label %for.body5.i.preheader33, label %vector.memcheck18
vector.memcheck18: ; preds = %for.body5.i.preheader
%8 = shl i64 %div, 3
%9 = add i64 %8, %A16
%10 = sub i64 ptrtoint (ptr @R to i64), %9
%diff.check19 = icmp ult i64 %10, 32
br i1 %diff.check19, label %for.body5.i.preheader33, label %vector.ph23
vector.ph23: ; preds = %vector.memcheck18
%n.vec25 = and i64 %sub1.i, -4
br label %vector.body28
vector.body28: ; preds = %vector.body28, %vector.ph23
%index29 = phi i64 [ 0, %vector.ph23 ], [ %index.next32, %vector.body28 ]
%11 = getelementptr i64, ptr %invariant.gep62.i, i64 %index29
%wide.load30 = load <2 x i64>, ptr %11, align 8, !tbaa !5
%12 = getelementptr i64, ptr %11, i64 2
%wide.load31 = load <2 x i64>, ptr %12, align 8, !tbaa !5
%13 = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %index29
store <2 x i64> %wide.load30, ptr %13, align 16, !tbaa !5
%14 = getelementptr inbounds i64, ptr %13, i64 2
store <2 x i64> %wide.load31, ptr %14, align 16, !tbaa !5
%index.next32 = add nuw i64 %index29, 4
%15 = icmp eq i64 %index.next32, %n.vec25
br i1 %15, label %middle.block20, label %vector.body28, !llvm.loop !18
middle.block20: ; preds = %vector.body28
%cmp.n27 = icmp eq i64 %sub1.i, %n.vec25
br i1 %cmp.n27, label %for.end11.i, label %for.body5.i.preheader33
for.body5.i.preheader33: ; preds = %vector.memcheck18, %for.body5.i.preheader, %middle.block20
%i.165.i.ph = phi i64 [ 0, %vector.memcheck18 ], [ 0, %for.body5.i.preheader ], [ %n.vec25, %middle.block20 ]
br label %for.body5.i
for.body.i: ; preds = %for.body.i.preheader34, %for.body.i
%i.061.i = phi i64 [ %inc.i, %for.body.i ], [ %i.061.i.ph, %for.body.i.preheader34 ]
%gep.i = getelementptr i64, ptr %invariant.gep.i, i64 %i.061.i
%16 = load i64, ptr %gep.i, align 8, !tbaa !5
%arrayidx2.i = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %i.061.i
store i64 %16, ptr %arrayidx2.i, align 8, !tbaa !5
%inc.i = add nuw nsw i64 %i.061.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %sub.i
br i1 %exitcond.not.i, label %for.cond3.preheader.i, label %for.body.i, !llvm.loop !19
for.body5.i: ; preds = %for.body5.i.preheader33, %for.body5.i
%i.165.i = phi i64 [ %inc10.i, %for.body5.i ], [ %i.165.i.ph, %for.body5.i.preheader33 ]
%gep63.i = getelementptr i64, ptr %invariant.gep62.i, i64 %i.165.i
%17 = load i64, ptr %gep63.i, align 8, !tbaa !5
%arrayidx8.i = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %i.165.i
store i64 %17, ptr %arrayidx8.i, align 8, !tbaa !5
%inc10.i = add nuw nsw i64 %i.165.i, 1
%exitcond71.not.i = icmp eq i64 %inc10.i, %sub1.i
br i1 %exitcond71.not.i, label %for.end11.i, label %for.body5.i, !llvm.loop !20
for.end11.i: ; preds = %for.body5.i, %middle.block20, %for.cond3.preheader.i
%arrayidx12.i = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %sub.i
store i64 2000000000, ptr %arrayidx12.i, align 8, !tbaa !5
%arrayidx13.i = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %sub1.i
store i64 2000000000, ptr %arrayidx13.i, align 8, !tbaa !5
br label %for.body16.i
for.body16.i: ; preds = %for.end11.i, %for.inc28.i
%k.070.i = phi i64 [ %inc29.i, %for.inc28.i ], [ %left, %for.end11.i ]
%j.069.i = phi i64 [ %j.1.i, %for.inc28.i ], [ 0, %for.end11.i ]
%i.268.i = phi i64 [ %i.3.i, %for.inc28.i ], [ 0, %for.end11.i ]
%res.067.i = phi i64 [ %res.1.i, %for.inc28.i ], [ 0, %for.end11.i ]
%arrayidx17.i = getelementptr inbounds [500001 x i64], ptr @L, i64 0, i64 %i.268.i
%18 = load i64, ptr %arrayidx17.i, align 8, !tbaa !5
%arrayidx18.i = getelementptr inbounds [500001 x i64], ptr @R, i64 0, i64 %j.069.i
%19 = load i64, ptr %arrayidx18.i, align 8, !tbaa !5
%cmp19.not.i = icmp sgt i64 %18, %19
br i1 %cmp19.not.i, label %if.else.i, label %if.then.i
if.then.i: ; preds = %for.body16.i
%inc22.i = add nsw i64 %i.268.i, 1
br label %for.inc28.i
if.else.i: ; preds = %for.body16.i
%inc25.i = add nsw i64 %j.069.i, 1
%sub26.i = sub i64 %sub.i, %i.268.i
%add27.i = add i64 %sub26.i, %res.067.i
br label %for.inc28.i
for.inc28.i: ; preds = %if.else.i, %if.then.i
%.sink.i = phi i64 [ %19, %if.else.i ], [ %18, %if.then.i ]
%res.1.i = phi i64 [ %add27.i, %if.else.i ], [ %res.067.i, %if.then.i ]
%i.3.i = phi i64 [ %i.268.i, %if.else.i ], [ %inc22.i, %if.then.i ]
%j.1.i = phi i64 [ %inc25.i, %if.else.i ], [ %j.069.i, %if.then.i ]
%20 = getelementptr inbounds i64, ptr %A, i64 %k.070.i
store i64 %.sink.i, ptr %20, align 8
%inc29.i = add nsw i64 %k.070.i, 1
%exitcond72.not.i = icmp eq i64 %inc29.i, %right
br i1 %exitcond72.not.i, label %merge.exit, label %for.body16.i, !llvm.loop !16
merge.exit: ; preds = %for.inc28.i
%21 = add nsw i64 %call2, %call
%22 = add nsw i64 %21, %res.1.i
br label %if.end
if.end: ; preds = %merge.exit, %entry
%add5 = phi i64 [ %22, %merge.exit ], [ 0, %entry ]
ret i64 %add5
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp7 = icmp sgt i64 %0, 0
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.08 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [500001 x i64], ptr @A, i64 0, i64 %i.08
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.08, 1
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21
for.end: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %0, %entry ], [ %1, %for.body ]
%call2 = call i64 @mergeSort(ptr noundef nonnull @A, i64 noundef 0, i64 noundef %.lcssa)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %call2)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"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, !11, !12}
!14 = distinct !{!14, !10, !11}
!15 = distinct !{!15, !10, !11}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !11, !12}
!18 = distinct !{!18, !10, !11, !12}
!19 = distinct !{!19, !10, !11}
!20 = distinct !{!20, !10, !11}
!21 = distinct !{!21, !10}
|
#include <stdio.h>
#include <limits.h>
long inversions = 0;
void merge(int A[], int left, int mid, int right) {
int n1, n2, i, j, k;
n1 = mid - left;
n2 = right - mid;
int L[n1+1], R[n2+1];
for (i = 0; i < n1; i++) {
L[i] = A[left + i];
}
for (i = 0; i < n2; i++) {
R[i] = A[mid + i];
}
L[n1] = R[n2] = INT_MAX;
i = 0, j = 0;
for (k = left; k < right; k++) {
if (L[i] <= R[j])
A[k] = L[i++];
else {
A[k] = R[j++];
//if (i != n1 && j != n2)
inversions += n1 - i;
}
}
}
void mergeSort(int A[], int left, int right) {
if (left + 1 < right) {
int mid = (left + right)/2;
mergeSort(A, left, mid);
mergeSort(A, mid, right);
merge(A, left, mid, right);
}
}
int main() {
int n, i;
scanf("%d", &n);
int arr[n+5];
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
mergeSort(arr, 0, n);
printf("%ld\n", inversions);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231245/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231245/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@inversions = dso_local local_unnamed_addr global i64 0, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%sub = sub nsw i32 %mid, %left
%sub1 = sub nsw i32 %right, %mid
%add = add nsw i32 %sub, 1
%0 = zext i32 %add to i64
%vla = alloca i32, i64 %0, align 16
%add2 = add nsw i32 %sub1, 1
%1 = zext i32 %add2 to i64
%vla3 = alloca i32, i64 %1, align 16
%cmp73 = icmp sgt i32 %sub, 0
br i1 %cmp73, label %for.body.preheader, label %for.cond7.preheader
for.body.preheader: ; preds = %entry
%2 = sext i32 %left to i64
%3 = shl nsw i64 %2, 2
%scevgep = getelementptr i8, ptr %A, i64 %3
%4 = xor i32 %left, -1
%5 = add i32 %4, %mid
%6 = zext i32 %5 to i64
%7 = shl nuw nsw i64 %6, 2
%8 = add nuw nsw i64 %7, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i64 %8, i1 false), !tbaa !5
br label %for.cond7.preheader
for.cond7.preheader: ; preds = %for.body.preheader, %entry
%cmp875 = icmp sgt i32 %sub1, 0
br i1 %cmp875, label %for.body9.preheader, label %for.end17
for.body9.preheader: ; preds = %for.cond7.preheader
%9 = sext i32 %mid to i64
%10 = shl nsw i64 %9, 2
%scevgep86 = getelementptr i8, ptr %A, i64 %10
%11 = xor i32 %mid, -1
%12 = add i32 %11, %right
%13 = zext i32 %12 to i64
%14 = shl nuw nsw i64 %13, 2
%15 = add nuw nsw i64 %14, 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla3, ptr noundef nonnull align 4 dereferenceable(1) %scevgep86, i64 %15, i1 false), !tbaa !5
br label %for.end17
for.end17: ; preds = %for.body9.preheader, %for.cond7.preheader
%idxprom18 = sext i32 %sub1 to i64
%arrayidx19 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom18
store i32 2147483647, ptr %arrayidx19, align 4, !tbaa !5
%idxprom20 = sext i32 %sub to i64
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %idxprom20
store i32 2147483647, ptr %arrayidx21, align 4, !tbaa !5
%cmp2379 = icmp slt i32 %left, %right
br i1 %cmp2379, label %for.body24.preheader, label %for.end44
for.body24.preheader: ; preds = %for.end17
%inversions.promoted = load i64, ptr @inversions, align 8, !tbaa !9
%16 = sext i32 %left to i64
%wide.trip.count = sext i32 %right to i64
br label %for.body24
for.body24: ; preds = %for.body24.preheader, %for.inc42
%indvars.iv = phi i64 [ %16, %for.body24.preheader ], [ %indvars.iv.next, %for.inc42 ]
%i.283 = phi i32 [ 0, %for.body24.preheader ], [ %i.3, %for.inc42 ]
%j.082 = phi i32 [ 0, %for.body24.preheader ], [ %j.1, %for.inc42 ]
%add417880 = phi i64 [ %inversions.promoted, %for.body24.preheader ], [ %add4177, %for.inc42 ]
%idxprom25 = sext i32 %i.283 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %vla, i64 %idxprom25
%17 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%idxprom27 = sext i32 %j.082 to i64
%arrayidx28 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom27
%18 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%cmp29.not = icmp sgt i32 %17, %18
br i1 %cmp29.not, label %if.else, label %if.then
if.then: ; preds = %for.body24
%inc30 = add nsw i32 %i.283, 1
br label %for.inc42
if.else: ; preds = %for.body24
%inc35 = add nsw i32 %j.082, 1
%sub40 = sub nsw i32 %sub, %i.283
%conv = sext i32 %sub40 to i64
%add41 = add nsw i64 %add417880, %conv
store i64 %add41, ptr @inversions, align 8, !tbaa !9
br label %for.inc42
for.inc42: ; preds = %if.then, %if.else
%.sink = phi i32 [ %18, %if.else ], [ %17, %if.then ]
%add4177 = phi i64 [ %add41, %if.else ], [ %add417880, %if.then ]
%j.1 = phi i32 [ %inc35, %if.else ], [ %j.082, %if.then ]
%i.3 = phi i32 [ %i.283, %if.else ], [ %inc30, %if.then ]
%19 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
store i32 %.sink, ptr %19, align 4
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end44, label %for.body24, !llvm.loop !11
for.end44: ; preds = %for.inc42, %for.end17
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
declare ptr @llvm.stacksave.p0() #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %common.ret12
common.ret12: ; preds = %entry, %if.then
ret void
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
tail call void @merge(ptr noundef %A, i32 noundef %left, i32 noundef %div, i32 noundef %right)
br label %common.ret12
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 5
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %3, 0
br i1 %cmp5, 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 !13
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ]
call void @mergeSort(ptr noundef nonnull %vla, i32 noundef 0, i32 noundef %.lcssa)
%6 = load i64, ptr @inversions, align 8, !tbaa !9
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %6)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5
attributes #0 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
#define MAX 200000
#define INF (1<<30)
int L[MAX], R[MAX];
long long merge(int* A, int l, int mid, int r){
int n1,n2,i,j,k;
long long cnt=0;
n1=mid-l; n2=r-mid;
for(i=0;i<n1;i++){
L[i]=A[l+i];
}
for(int i=0;i<n2;i++){
R[i]=A[mid+i];
}
L[n1]=R[n2]=INF;
i=j=0;
for(k=l;k<r;k++){
if(L[i]<=R[j]){
A[k]=L[i++];
}else{
cnt+=n1-i;
A[k]=R[j++];
}
}
return cnt;
}
long long MergeSort(int* A, int l, int r){
int mid;
long long cnt=0;
if(r-l>1){
mid=(l+r)/2;
cnt+=MergeSort(A,l,mid);
cnt+=MergeSort(A,mid,r);
cnt+=merge(A,l,mid,r);
}
return cnt;
}
int main(){
int i,n,A[MAX];
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
long long cnt=MergeSort(A,0,n);
//for(i=0;i<n;i++){
// if(i)printf(" ");
// printf("%d",A[i]);
//}
printf("%lli\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231289/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231289/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@L = dso_local local_unnamed_addr global [200000 x i32] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [200000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lli\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @merge(ptr nocapture noundef %A, i32 noundef %l, i32 noundef %mid, i32 noundef %r) local_unnamed_addr #0 {
entry:
%A93 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %l
%sub1 = sub i32 %r, %mid
%cmp69 = icmp sgt i32 %sub, 0
br i1 %cmp69, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %l to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 12
br i1 %min.iters.check, label %for.body.preheader111, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A93
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader111, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%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 ]
%4 = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load94 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load94, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond5.preheader, label %for.body.preheader111
for.body.preheader111: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader111, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader111 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader111 ]
%gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i32, ptr %gep.prol, align 4, !tbaa !5
%arrayidx3.prol = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.prol
store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !13
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader111
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader111 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader, label %for.body
for.cond5.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp671 = icmp sgt i32 %sub1, 0
br i1 %cmp671, label %for.body7.preheader, label %for.cond.cleanup
for.body7.preheader: ; preds = %for.cond5.preheader
%13 = sext i32 %mid to i64
%wide.trip.count84 = zext i32 %sub1 to i64
%invariant.gep91 = getelementptr i32, ptr %A, i64 %13
%min.iters.check99 = icmp ult i32 %sub1, 12
br i1 %min.iters.check99, label %for.body7.preheader110, label %vector.memcheck95
vector.memcheck95: ; preds = %for.body7.preheader
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A93
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check96 = icmp ult i64 %16, 32
br i1 %diff.check96, label %for.body7.preheader110, label %vector.ph100
vector.ph100: ; preds = %vector.memcheck95
%n.vec102 = and i64 %wide.trip.count84, 4294967288
br label %vector.body105
vector.body105: ; preds = %vector.body105, %vector.ph100
%index106 = phi i64 [ 0, %vector.ph100 ], [ %index.next109, %vector.body105 ]
%17 = getelementptr i32, ptr %invariant.gep91, i64 %index106
%wide.load107 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load108 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %index106
store <4 x i32> %wide.load107, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load108, ptr %20, align 16, !tbaa !5
%index.next109 = add nuw i64 %index106, 8
%21 = icmp eq i64 %index.next109, %n.vec102
br i1 %21, label %middle.block97, label %vector.body105, !llvm.loop !15
middle.block97: ; preds = %vector.body105
%cmp.n104 = icmp eq i64 %n.vec102, %wide.trip.count84
br i1 %cmp.n104, label %for.cond.cleanup, label %for.body7.preheader110
for.body7.preheader110: ; preds = %vector.memcheck95, %for.body7.preheader, %middle.block97
%indvars.iv80.ph = phi i64 [ 0, %vector.memcheck95 ], [ 0, %for.body7.preheader ], [ %n.vec102, %middle.block97 ]
%22 = xor i64 %indvars.iv80.ph, -1
%23 = add nsw i64 %22, %wide.trip.count84
%xtraiter112 = and i64 %wide.trip.count84, 3
%lcmp.mod113.not = icmp eq i64 %xtraiter112, 0
br i1 %lcmp.mod113.not, label %for.body7.prol.loopexit, label %for.body7.prol
for.body7.prol: ; preds = %for.body7.preheader110, %for.body7.prol
%indvars.iv80.prol = phi i64 [ %indvars.iv.next81.prol, %for.body7.prol ], [ %indvars.iv80.ph, %for.body7.preheader110 ]
%prol.iter114 = phi i64 [ %prol.iter114.next, %for.body7.prol ], [ 0, %for.body7.preheader110 ]
%gep92.prol = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv80.prol
%24 = load i32, ptr %gep92.prol, align 4, !tbaa !5
%arrayidx12.prol = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv80.prol
store i32 %24, ptr %arrayidx12.prol, align 4, !tbaa !5
%indvars.iv.next81.prol = add nuw nsw i64 %indvars.iv80.prol, 1
%prol.iter114.next = add i64 %prol.iter114, 1
%prol.iter114.cmp.not = icmp eq i64 %prol.iter114.next, %xtraiter112
br i1 %prol.iter114.cmp.not, label %for.body7.prol.loopexit, label %for.body7.prol, !llvm.loop !16
for.body7.prol.loopexit: ; preds = %for.body7.prol, %for.body7.preheader110
%indvars.iv80.unr = phi i64 [ %indvars.iv80.ph, %for.body7.preheader110 ], [ %indvars.iv.next81.prol, %for.body7.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup, label %for.body7
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%26 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv
store i32 %26, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i32, ptr %gep.1, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.next
store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i32, ptr %gep.2, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.1
store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i32, ptr %gep.3, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.2
store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond5.preheader, label %for.body, !llvm.loop !17
for.cond.cleanup: ; preds = %for.body7.prol.loopexit, %for.body7, %middle.block97, %for.cond5.preheader
%idxprom16 = sext i32 %sub1 to i64
%arrayidx17 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %idxprom16
store i32 1073741824, ptr %arrayidx17, align 4, !tbaa !5
%idxprom18 = sext i32 %sub to i64
%arrayidx19 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %idxprom18
store i32 1073741824, ptr %arrayidx19, align 4, !tbaa !5
%cmp2173 = icmp slt i32 %l, %r
br i1 %cmp2173, label %for.body22.preheader, label %for.end42
for.body22.preheader: ; preds = %for.cond.cleanup
%30 = sext i32 %l to i64
%wide.trip.count89 = sext i32 %r to i64
br label %for.body22
for.body7: ; preds = %for.body7.prol.loopexit, %for.body7
%indvars.iv80 = phi i64 [ %indvars.iv.next81.3, %for.body7 ], [ %indvars.iv80.unr, %for.body7.prol.loopexit ]
%gep92 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv80
%31 = load i32, ptr %gep92, align 4, !tbaa !5
%arrayidx12 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv80
store i32 %31, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%gep92.1 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv.next81
%32 = load i32, ptr %gep92.1, align 4, !tbaa !5
%arrayidx12.1 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv.next81
store i32 %32, ptr %arrayidx12.1, align 4, !tbaa !5
%indvars.iv.next81.1 = add nuw nsw i64 %indvars.iv80, 2
%gep92.2 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv.next81.1
%33 = load i32, ptr %gep92.2, align 4, !tbaa !5
%arrayidx12.2 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.1
store i32 %33, ptr %arrayidx12.2, align 4, !tbaa !5
%indvars.iv.next81.2 = add nuw nsw i64 %indvars.iv80, 3
%gep92.3 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv.next81.2
%34 = load i32, ptr %gep92.3, align 4, !tbaa !5
%arrayidx12.3 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.2
store i32 %34, ptr %arrayidx12.3, align 4, !tbaa !5
%indvars.iv.next81.3 = add nuw nsw i64 %indvars.iv80, 4
%exitcond85.not.3 = icmp eq i64 %indvars.iv.next81.3, %wide.trip.count84
br i1 %exitcond85.not.3, label %for.cond.cleanup, label %for.body7, !llvm.loop !18
for.body22: ; preds = %for.body22.preheader, %for.inc40
%indvars.iv86 = phi i64 [ %30, %for.body22.preheader ], [ %indvars.iv.next87, %for.inc40 ]
%cnt.077 = phi i64 [ 0, %for.body22.preheader ], [ %cnt.1, %for.inc40 ]
%j.075 = phi i32 [ 0, %for.body22.preheader ], [ %j.1, %for.inc40 ]
%i.174 = phi i32 [ 0, %for.body22.preheader ], [ %i.2, %for.inc40 ]
%idxprom23 = sext i32 %i.174 to i64
%arrayidx24 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %idxprom23
%35 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%idxprom25 = sext i32 %j.075 to i64
%arrayidx26 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %idxprom25
%36 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp sgt i32 %35, %36
br i1 %cmp27.not, label %if.else, label %if.then
if.then: ; preds = %for.body22
%inc28 = add nsw i32 %i.174, 1
br label %for.inc40
if.else: ; preds = %for.body22
%sub33 = sub nsw i32 %sub, %i.174
%conv = sext i32 %sub33 to i64
%add34 = add nsw i64 %cnt.077, %conv
%inc35 = add nsw i32 %j.075, 1
br label %for.inc40
for.inc40: ; preds = %if.then, %if.else
%.sink = phi i32 [ %36, %if.else ], [ %35, %if.then ]
%i.2 = phi i32 [ %i.174, %if.else ], [ %inc28, %if.then ]
%j.1 = phi i32 [ %inc35, %if.else ], [ %j.075, %if.then ]
%cnt.1 = phi i64 [ %add34, %if.else ], [ %cnt.077, %if.then ]
%37 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv86
store i32 %.sink, ptr %37, align 4
%indvars.iv.next87 = add nsw i64 %indvars.iv86, 1
%exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89
br i1 %exitcond90.not, label %for.end42, label %for.body22, !llvm.loop !19
for.end42: ; preds = %for.inc40, %for.cond.cleanup
%cnt.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %cnt.1, %for.inc40 ]
ret i64 %cnt.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @MergeSort(ptr noundef %A, i32 noundef %l, i32 noundef %r) local_unnamed_addr #2 {
entry:
%A19 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %r, %l
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add = add nsw i32 %r, %l
%div = sdiv i32 %add, 2
%call = tail call i64 @MergeSort(ptr noundef %A, i32 noundef %l, i32 noundef %div)
%call2 = tail call i64 @MergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %r)
%add3 = add nsw i64 %call2, %call
%sub.i = sub nsw i32 %div, %l
%sub1.i = sub i32 %r, %div
%cmp69.i = icmp sgt i32 %sub.i, 0
br i1 %cmp69.i, label %for.body.preheader.i, label %for.cond5.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %l to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 12
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A19
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr i32, ptr %invariant.gep.i, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load20 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load20, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !20
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond5.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5
%arrayidx3.i.prol = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.i.prol
store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !21
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond5.preheader.i, label %for.body.i
for.cond5.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp671.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp671.i, label %for.body7.preheader.i, label %for.cond.cleanup.i
for.body7.preheader.i: ; preds = %for.cond5.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count84.i = zext i32 %sub1.i to i64
%invariant.gep91.i = getelementptr i32, ptr %A, i64 %13
%min.iters.check25 = icmp ult i32 %sub1.i, 12
br i1 %min.iters.check25, label %for.body7.i.preheader, label %vector.memcheck21
vector.memcheck21: ; preds = %for.body7.preheader.i
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A19
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check22 = icmp ult i64 %16, 32
br i1 %diff.check22, label %for.body7.i.preheader, label %vector.ph26
vector.ph26: ; preds = %vector.memcheck21
%n.vec28 = and i64 %wide.trip.count84.i, 4294967288
br label %vector.body31
vector.body31: ; preds = %vector.body31, %vector.ph26
%index32 = phi i64 [ 0, %vector.ph26 ], [ %index.next35, %vector.body31 ]
%17 = getelementptr i32, ptr %invariant.gep91.i, i64 %index32
%wide.load33 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load34 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %index32
store <4 x i32> %wide.load33, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load34, ptr %20, align 16, !tbaa !5
%index.next35 = add nuw i64 %index32, 8
%21 = icmp eq i64 %index.next35, %n.vec28
br i1 %21, label %middle.block23, label %vector.body31, !llvm.loop !22
middle.block23: ; preds = %vector.body31
%cmp.n30 = icmp eq i64 %n.vec28, %wide.trip.count84.i
br i1 %cmp.n30, label %for.cond.cleanup.i, label %for.body7.i.preheader
for.body7.i.preheader: ; preds = %vector.memcheck21, %for.body7.preheader.i, %middle.block23
%indvars.iv80.i.ph = phi i64 [ 0, %vector.memcheck21 ], [ 0, %for.body7.preheader.i ], [ %n.vec28, %middle.block23 ]
%22 = xor i64 %indvars.iv80.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count84.i
%xtraiter36 = and i64 %wide.trip.count84.i, 3
%lcmp.mod37.not = icmp eq i64 %xtraiter36, 0
br i1 %lcmp.mod37.not, label %for.body7.i.prol.loopexit, label %for.body7.i.prol
for.body7.i.prol: ; preds = %for.body7.i.preheader, %for.body7.i.prol
%indvars.iv80.i.prol = phi i64 [ %indvars.iv.next81.i.prol, %for.body7.i.prol ], [ %indvars.iv80.i.ph, %for.body7.i.preheader ]
%prol.iter38 = phi i64 [ %prol.iter38.next, %for.body7.i.prol ], [ 0, %for.body7.i.preheader ]
%gep92.i.prol = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv80.i.prol
%24 = load i32, ptr %gep92.i.prol, align 4, !tbaa !5
%arrayidx12.i.prol = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv80.i.prol
store i32 %24, ptr %arrayidx12.i.prol, align 4, !tbaa !5
%indvars.iv.next81.i.prol = add nuw nsw i64 %indvars.iv80.i.prol, 1
%prol.iter38.next = add i64 %prol.iter38, 1
%prol.iter38.cmp.not = icmp eq i64 %prol.iter38.next, %xtraiter36
br i1 %prol.iter38.cmp.not, label %for.body7.i.prol.loopexit, label %for.body7.i.prol, !llvm.loop !23
for.body7.i.prol.loopexit: ; preds = %for.body7.i.prol, %for.body7.i.preheader
%indvars.iv80.i.unr = phi i64 [ %indvars.iv80.i.ph, %for.body7.i.preheader ], [ %indvars.iv.next81.i.prol, %for.body7.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.cond.cleanup.i, label %for.body7.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.i
store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i32, ptr %gep.i.1, align 4, !tbaa !5
%arrayidx3.i.1 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i
store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i32, ptr %gep.i.2, align 4, !tbaa !5
%arrayidx3.i.2 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.1
store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i32, ptr %gep.i.3, align 4, !tbaa !5
%arrayidx3.i.3 = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.2
store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond5.preheader.i, label %for.body.i, !llvm.loop !24
for.cond.cleanup.i: ; preds = %for.body7.i.prol.loopexit, %for.body7.i, %middle.block23, %for.cond5.preheader.i
%idxprom16.i = sext i32 %sub1.i to i64
%arrayidx17.i = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %idxprom16.i
store i32 1073741824, ptr %arrayidx17.i, align 4, !tbaa !5
%idxprom18.i = sext i32 %sub.i to i64
%arrayidx19.i = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %idxprom18.i
store i32 1073741824, ptr %arrayidx19.i, align 4, !tbaa !5
%cmp2173.i = icmp slt i32 %l, %r
br i1 %cmp2173.i, label %for.body22.preheader.i, label %merge.exit
for.body22.preheader.i: ; preds = %for.cond.cleanup.i
%30 = sext i32 %l to i64
%wide.trip.count89.i = sext i32 %r to i64
br label %for.body22.i
for.body7.i: ; preds = %for.body7.i.prol.loopexit, %for.body7.i
%indvars.iv80.i = phi i64 [ %indvars.iv.next81.i.3, %for.body7.i ], [ %indvars.iv80.i.unr, %for.body7.i.prol.loopexit ]
%gep92.i = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv80.i
%31 = load i32, ptr %gep92.i, align 4, !tbaa !5
%arrayidx12.i = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv80.i
store i32 %31, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next81.i = add nuw nsw i64 %indvars.iv80.i, 1
%gep92.i.1 = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i
%32 = load i32, ptr %gep92.i.1, align 4, !tbaa !5
%arrayidx12.i.1 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.i
store i32 %32, ptr %arrayidx12.i.1, align 4, !tbaa !5
%indvars.iv.next81.i.1 = add nuw nsw i64 %indvars.iv80.i, 2
%gep92.i.2 = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i.1
%33 = load i32, ptr %gep92.i.2, align 4, !tbaa !5
%arrayidx12.i.2 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.i.1
store i32 %33, ptr %arrayidx12.i.2, align 4, !tbaa !5
%indvars.iv.next81.i.2 = add nuw nsw i64 %indvars.iv80.i, 3
%gep92.i.3 = getelementptr i32, ptr %invariant.gep91.i, i64 %indvars.iv.next81.i.2
%34 = load i32, ptr %gep92.i.3, align 4, !tbaa !5
%arrayidx12.i.3 = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %indvars.iv.next81.i.2
store i32 %34, ptr %arrayidx12.i.3, align 4, !tbaa !5
%indvars.iv.next81.i.3 = add nuw nsw i64 %indvars.iv80.i, 4
%exitcond85.not.i.3 = icmp eq i64 %indvars.iv.next81.i.3, %wide.trip.count84.i
br i1 %exitcond85.not.i.3, label %for.cond.cleanup.i, label %for.body7.i, !llvm.loop !25
for.body22.i: ; preds = %for.inc40.i, %for.body22.preheader.i
%indvars.iv86.i = phi i64 [ %30, %for.body22.preheader.i ], [ %indvars.iv.next87.i, %for.inc40.i ]
%cnt.077.i = phi i64 [ 0, %for.body22.preheader.i ], [ %cnt.1.i, %for.inc40.i ]
%j.075.i = phi i32 [ 0, %for.body22.preheader.i ], [ %j.1.i, %for.inc40.i ]
%i.174.i = phi i32 [ 0, %for.body22.preheader.i ], [ %i.2.i, %for.inc40.i ]
%idxprom23.i = sext i32 %i.174.i to i64
%arrayidx24.i = getelementptr inbounds [200000 x i32], ptr @L, i64 0, i64 %idxprom23.i
%35 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%idxprom25.i = sext i32 %j.075.i to i64
%arrayidx26.i = getelementptr inbounds [200000 x i32], ptr @R, i64 0, i64 %idxprom25.i
%36 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%cmp27.not.i = icmp sgt i32 %35, %36
br i1 %cmp27.not.i, label %if.else.i, label %if.then.i
if.then.i: ; preds = %for.body22.i
%inc28.i = add nsw i32 %i.174.i, 1
br label %for.inc40.i
if.else.i: ; preds = %for.body22.i
%sub33.i = sub nsw i32 %sub.i, %i.174.i
%conv.i = sext i32 %sub33.i to i64
%add34.i = add nsw i64 %cnt.077.i, %conv.i
%inc35.i = add nsw i32 %j.075.i, 1
br label %for.inc40.i
for.inc40.i: ; preds = %if.else.i, %if.then.i
%.sink.i = phi i32 [ %36, %if.else.i ], [ %35, %if.then.i ]
%i.2.i = phi i32 [ %i.174.i, %if.else.i ], [ %inc28.i, %if.then.i ]
%j.1.i = phi i32 [ %inc35.i, %if.else.i ], [ %j.075.i, %if.then.i ]
%cnt.1.i = phi i64 [ %add34.i, %if.else.i ], [ %cnt.077.i, %if.then.i ]
%37 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv86.i
store i32 %.sink.i, ptr %37, align 4
%indvars.iv.next87.i = add nsw i64 %indvars.iv86.i, 1
%exitcond90.not.i = icmp eq i64 %indvars.iv.next87.i, %wide.trip.count89.i
br i1 %exitcond90.not.i, label %merge.exit, label %for.body22.i, !llvm.loop !19
merge.exit: ; preds = %for.inc40.i, %for.cond.cleanup.i
%cnt.0.lcssa.i = phi i64 [ 0, %for.cond.cleanup.i ], [ %cnt.1.i, %for.inc40.i ]
%add5 = add nsw i64 %add3, %cnt.0.lcssa.i
br label %if.end
if.end: ; preds = %merge.exit, %entry
%cnt.0 = phi i64 [ %add5, %merge.exit ], [ 0, %entry ]
ret i64 %cnt.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%A = alloca [200000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 800000, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, 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 [200000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %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 !26
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
%call2 = call i64 @MergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %call2)
call void @llvm.lifetime.end.p0(i64 800000, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10, !11}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !11, !12}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !10, !11, !12}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !10, !11}
!25 = distinct !{!25, !10, !11}
!26 = distinct !{!26, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 500000
#define INF 1000000000
int L[N], R[N];
long long count = 0;
void merge(int A[], int left, int mid, int right)
{
int n1, n2, i, j, k;
n1 = mid - left;
n2 = right - mid;
for(i = 0; i < n1; i++) L[i] = A[left + i];
for(i = 0; i < n2; i++) R[i] = A[mid + i];
L[n1] = INF;
R[n2] = INF;
i = 0;
j = 0;
for(k = left; k < right; k++){
if(L[i] <= R[j]){
A[k] = L[i];
i++;
}
else{
A[k] = R[j];
j++;
count += n1 - i;
}
}
}
void mergeSort(int A[], int left, int right)
{
int mid;
if(left + 1 < right){
mid = (left + right) / 2;
mergeSort(A, left, mid);
mergeSort(A, mid, right);
merge(A, left, mid, right);
}
}
int main(void)
{
int i, n, A[N];
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d", &A[i]);
}
mergeSort(A, 0, n);
printf("%lld\n", count); //%lldとすることでlong long int型の数値をprint文で表示
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231331/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231331/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i64 0, align 8
@L = dso_local local_unnamed_addr global [500000 x i32] zeroinitializer, align 16
@R = dso_local local_unnamed_addr global [500000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @merge(ptr nocapture noundef %A, i32 noundef %left, i32 noundef %mid, i32 noundef %right) local_unnamed_addr #0 {
entry:
%A96 = ptrtoint ptr %A to i64
%sub = sub nsw i32 %mid, %left
%sub1 = sub i32 %right, %mid
%cmp70 = icmp sgt i32 %sub, 0
br i1 %cmp70, label %for.body.preheader, label %for.cond4.preheader
for.body.preheader: ; preds = %entry
%0 = sext i32 %left to i64
%wide.trip.count = zext i32 %sub to i64
%invariant.gep = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub, 12
br i1 %min.iters.check, label %for.body.preheader114, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A96
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.preheader114, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%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 ]
%4 = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load97 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load97, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond4.preheader, label %for.body.preheader114
for.body.preheader114: ; preds = %vector.memcheck, %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.ph, -1
%10 = add nsw i64 %9, %wide.trip.count
%xtraiter = and i64 %wide.trip.count, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader114, %for.body.prol
%indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader114 ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader114 ]
%gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.prol
%11 = load i32, ptr %gep.prol, align 4, !tbaa !5
%arrayidx3.prol = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.prol
store i32 %11, ptr %arrayidx3.prol, align 4, !tbaa !5
%indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !13
for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader114
%indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader114 ], [ %indvars.iv.next.prol, %for.body.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader, label %for.body
for.cond4.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %entry
%cmp572 = icmp sgt i32 %sub1, 0
br i1 %cmp572, label %for.body6.preheader, label %for.end14
for.body6.preheader: ; preds = %for.cond4.preheader
%13 = sext i32 %mid to i64
%wide.trip.count87 = zext i32 %sub1 to i64
%invariant.gep94 = getelementptr i32, ptr %A, i64 %13
%min.iters.check102 = icmp ult i32 %sub1, 12
br i1 %min.iters.check102, label %for.body6.preheader113, label %vector.memcheck98
vector.memcheck98: ; preds = %for.body6.preheader
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A96
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check99 = icmp ult i64 %16, 32
br i1 %diff.check99, label %for.body6.preheader113, label %vector.ph103
vector.ph103: ; preds = %vector.memcheck98
%n.vec105 = and i64 %wide.trip.count87, 4294967288
br label %vector.body108
vector.body108: ; preds = %vector.body108, %vector.ph103
%index109 = phi i64 [ 0, %vector.ph103 ], [ %index.next112, %vector.body108 ]
%17 = getelementptr i32, ptr %invariant.gep94, i64 %index109
%wide.load110 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load111 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %index109
store <4 x i32> %wide.load110, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load111, ptr %20, align 16, !tbaa !5
%index.next112 = add nuw i64 %index109, 8
%21 = icmp eq i64 %index.next112, %n.vec105
br i1 %21, label %middle.block100, label %vector.body108, !llvm.loop !15
middle.block100: ; preds = %vector.body108
%cmp.n107 = icmp eq i64 %n.vec105, %wide.trip.count87
br i1 %cmp.n107, label %for.end14, label %for.body6.preheader113
for.body6.preheader113: ; preds = %vector.memcheck98, %for.body6.preheader, %middle.block100
%indvars.iv83.ph = phi i64 [ 0, %vector.memcheck98 ], [ 0, %for.body6.preheader ], [ %n.vec105, %middle.block100 ]
%22 = xor i64 %indvars.iv83.ph, -1
%23 = add nsw i64 %22, %wide.trip.count87
%xtraiter115 = and i64 %wide.trip.count87, 3
%lcmp.mod116.not = icmp eq i64 %xtraiter115, 0
br i1 %lcmp.mod116.not, label %for.body6.prol.loopexit, label %for.body6.prol
for.body6.prol: ; preds = %for.body6.preheader113, %for.body6.prol
%indvars.iv83.prol = phi i64 [ %indvars.iv.next84.prol, %for.body6.prol ], [ %indvars.iv83.ph, %for.body6.preheader113 ]
%prol.iter117 = phi i64 [ %prol.iter117.next, %for.body6.prol ], [ 0, %for.body6.preheader113 ]
%gep95.prol = getelementptr i32, ptr %invariant.gep94, i64 %indvars.iv83.prol
%24 = load i32, ptr %gep95.prol, align 4, !tbaa !5
%arrayidx11.prol = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv83.prol
store i32 %24, ptr %arrayidx11.prol, align 4, !tbaa !5
%indvars.iv.next84.prol = add nuw nsw i64 %indvars.iv83.prol, 1
%prol.iter117.next = add i64 %prol.iter117, 1
%prol.iter117.cmp.not = icmp eq i64 %prol.iter117.next, %xtraiter115
br i1 %prol.iter117.cmp.not, label %for.body6.prol.loopexit, label %for.body6.prol, !llvm.loop !16
for.body6.prol.loopexit: ; preds = %for.body6.prol, %for.body6.preheader113
%indvars.iv83.unr = phi i64 [ %indvars.iv83.ph, %for.body6.preheader113 ], [ %indvars.iv.next84.prol, %for.body6.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14, label %for.body6
for.body: ; preds = %for.body.prol.loopexit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%26 = load i32, ptr %gep, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv
store i32 %26, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next
%27 = load i32, ptr %gep.1, align 4, !tbaa !5
%arrayidx3.1 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.next
store i32 %27, ptr %arrayidx3.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.1
%28 = load i32, ptr %gep.2, align 4, !tbaa !5
%arrayidx3.2 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.1
store i32 %28, ptr %arrayidx3.2, align 4, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next.2
%29 = load i32, ptr %gep.3, align 4, !tbaa !5
%arrayidx3.3 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.2
store i32 %29, ptr %arrayidx3.3, align 4, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
br i1 %exitcond.not.3, label %for.cond4.preheader, label %for.body, !llvm.loop !17
for.body6: ; preds = %for.body6.prol.loopexit, %for.body6
%indvars.iv83 = phi i64 [ %indvars.iv.next84.3, %for.body6 ], [ %indvars.iv83.unr, %for.body6.prol.loopexit ]
%gep95 = getelementptr i32, ptr %invariant.gep94, i64 %indvars.iv83
%30 = load i32, ptr %gep95, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv83
store i32 %30, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%gep95.1 = getelementptr i32, ptr %invariant.gep94, i64 %indvars.iv.next84
%31 = load i32, ptr %gep95.1, align 4, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv.next84
store i32 %31, ptr %arrayidx11.1, align 4, !tbaa !5
%indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
%gep95.2 = getelementptr i32, ptr %invariant.gep94, i64 %indvars.iv.next84.1
%32 = load i32, ptr %gep95.2, align 4, !tbaa !5
%arrayidx11.2 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv.next84.1
store i32 %32, ptr %arrayidx11.2, align 4, !tbaa !5
%indvars.iv.next84.2 = add nuw nsw i64 %indvars.iv83, 3
%gep95.3 = getelementptr i32, ptr %invariant.gep94, i64 %indvars.iv.next84.2
%33 = load i32, ptr %gep95.3, align 4, !tbaa !5
%arrayidx11.3 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv.next84.2
store i32 %33, ptr %arrayidx11.3, align 4, !tbaa !5
%indvars.iv.next84.3 = add nuw nsw i64 %indvars.iv83, 4
%exitcond88.not.3 = icmp eq i64 %indvars.iv.next84.3, %wide.trip.count87
br i1 %exitcond88.not.3, label %for.end14, label %for.body6, !llvm.loop !18
for.end14: ; preds = %for.body6.prol.loopexit, %for.body6, %middle.block100, %for.cond4.preheader
%idxprom15 = sext i32 %sub to i64
%arrayidx16 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %idxprom15
store i32 1000000000, ptr %arrayidx16, align 4, !tbaa !5
%idxprom17 = sext i32 %sub1 to i64
%arrayidx18 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %idxprom17
store i32 1000000000, ptr %arrayidx18, align 4, !tbaa !5
%cmp2076 = icmp slt i32 %left, %right
br i1 %cmp2076, label %for.body21.preheader, label %for.end41
for.body21.preheader: ; preds = %for.end14
%count.promoted = load i64, ptr @count, align 8, !tbaa !19
%34 = sext i32 %left to i64
%wide.trip.count92 = sext i32 %right to i64
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.inc39
%indvars.iv89 = phi i64 [ %34, %for.body21.preheader ], [ %indvars.iv.next90, %for.inc39 ]
%j.079 = phi i32 [ 0, %for.body21.preheader ], [ %j.1, %for.inc39 ]
%i.278 = phi i32 [ 0, %for.body21.preheader ], [ %i.3, %for.inc39 ]
%add387577 = phi i64 [ %count.promoted, %for.body21.preheader ], [ %add3874, %for.inc39 ]
%idxprom22 = sext i32 %i.278 to i64
%arrayidx23 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %idxprom22
%35 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%idxprom24 = sext i32 %j.079 to i64
%arrayidx25 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %idxprom24
%36 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26.not = icmp sgt i32 %35, %36
br i1 %cmp26.not, label %if.else, label %if.then
if.then: ; preds = %for.body21
%inc31 = add nsw i32 %i.278, 1
br label %for.inc39
if.else: ; preds = %for.body21
%inc36 = add nsw i32 %j.079, 1
%sub37 = sub nsw i32 %sub, %i.278
%conv = sext i32 %sub37 to i64
%add38 = add nsw i64 %add387577, %conv
store i64 %add38, ptr @count, align 8, !tbaa !19
br label %for.inc39
for.inc39: ; preds = %if.then, %if.else
%.sink = phi i32 [ %36, %if.else ], [ %35, %if.then ]
%add3874 = phi i64 [ %add38, %if.else ], [ %add387577, %if.then ]
%i.3 = phi i32 [ %i.278, %if.else ], [ %inc31, %if.then ]
%j.1 = phi i32 [ %inc36, %if.else ], [ %j.079, %if.then ]
%37 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv89
store i32 %.sink, ptr %37, align 4
%indvars.iv.next90 = add nsw i64 %indvars.iv89, 1
%exitcond93.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count92
br i1 %exitcond93.not, label %for.end41, label %for.body21, !llvm.loop !21
for.end41: ; preds = %for.inc39, %for.end14
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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 {
entry:
%A12 = ptrtoint ptr %A to i64
%add = add nsw i32 %left, 1
%cmp = icmp slt i32 %add, %right
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%add1 = add nsw i32 %right, %left
%div = sdiv i32 %add1, 2
tail call void @mergeSort(ptr noundef %A, i32 noundef %left, i32 noundef %div)
tail call void @mergeSort(ptr noundef %A, i32 noundef %div, i32 noundef %right)
%sub.i = sub nsw i32 %div, %left
%sub1.i = sub i32 %right, %div
%cmp70.i = icmp sgt i32 %sub.i, 0
br i1 %cmp70.i, label %for.body.preheader.i, label %for.cond4.preheader.i
for.body.preheader.i: ; preds = %if.then
%0 = sext i32 %left to i64
%wide.trip.count.i = zext i32 %sub.i to i64
%invariant.gep.i = getelementptr i32, ptr %A, i64 %0
%min.iters.check = icmp ult i32 %sub.i, 12
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.body.preheader.i
%1 = shl nsw i64 %0, 2
%2 = add i64 %1, %A12
%3 = sub i64 ptrtoint (ptr @L to i64), %2
%diff.check = icmp ult i64 %3, 32
br i1 %diff.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%4 = getelementptr i32, ptr %invariant.gep.i, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = getelementptr i32, ptr %4, i64 4
%wide.load13 = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %index
store <4 x i32> %wide.load, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
store <4 x i32> %wide.load13, ptr %7, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %for.cond4.preheader.i, label %for.body.i.preheader
for.body.i.preheader: ; preds = %vector.memcheck, %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%9 = xor i64 %indvars.iv.i.ph, -1
%10 = add nsw i64 %9, %wide.trip.count.i
%xtraiter = and i64 %wide.trip.count.i, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol
%indvars.iv.i.prol = phi i64 [ %indvars.iv.next.i.prol, %for.body.i.prol ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ]
%gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i.prol
%11 = load i32, ptr %gep.i.prol, align 4, !tbaa !5
%arrayidx3.i.prol = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.i.prol
store i32 %11, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%indvars.iv.next.i.prol = add nuw nsw i64 %indvars.iv.i.prol, 1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !23
for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader
%indvars.iv.i.unr = phi i64 [ %indvars.iv.i.ph, %for.body.i.preheader ], [ %indvars.iv.next.i.prol, %for.body.i.prol ]
%12 = icmp ult i64 %10, 3
br i1 %12, label %for.cond4.preheader.i, label %for.body.i
for.cond4.preheader.i: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block, %if.then
%cmp572.i = icmp sgt i32 %sub1.i, 0
br i1 %cmp572.i, label %for.body6.preheader.i, label %for.end14.i
for.body6.preheader.i: ; preds = %for.cond4.preheader.i
%13 = sext i32 %div to i64
%wide.trip.count87.i = zext i32 %sub1.i to i64
%invariant.gep94.i = getelementptr i32, ptr %A, i64 %13
%min.iters.check18 = icmp ult i32 %sub1.i, 12
br i1 %min.iters.check18, label %for.body6.i.preheader, label %vector.memcheck14
vector.memcheck14: ; preds = %for.body6.preheader.i
%14 = shl nsw i64 %13, 2
%15 = add i64 %14, %A12
%16 = sub i64 ptrtoint (ptr @R to i64), %15
%diff.check15 = icmp ult i64 %16, 32
br i1 %diff.check15, label %for.body6.i.preheader, label %vector.ph19
vector.ph19: ; preds = %vector.memcheck14
%n.vec21 = and i64 %wide.trip.count87.i, 4294967288
br label %vector.body24
vector.body24: ; preds = %vector.body24, %vector.ph19
%index25 = phi i64 [ 0, %vector.ph19 ], [ %index.next28, %vector.body24 ]
%17 = getelementptr i32, ptr %invariant.gep94.i, i64 %index25
%wide.load26 = load <4 x i32>, ptr %17, align 4, !tbaa !5
%18 = getelementptr i32, ptr %17, i64 4
%wide.load27 = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %index25
store <4 x i32> %wide.load26, ptr %19, align 16, !tbaa !5
%20 = getelementptr inbounds i32, ptr %19, i64 4
store <4 x i32> %wide.load27, ptr %20, align 16, !tbaa !5
%index.next28 = add nuw i64 %index25, 8
%21 = icmp eq i64 %index.next28, %n.vec21
br i1 %21, label %middle.block16, label %vector.body24, !llvm.loop !24
middle.block16: ; preds = %vector.body24
%cmp.n23 = icmp eq i64 %n.vec21, %wide.trip.count87.i
br i1 %cmp.n23, label %for.end14.i, label %for.body6.i.preheader
for.body6.i.preheader: ; preds = %vector.memcheck14, %for.body6.preheader.i, %middle.block16
%indvars.iv83.i.ph = phi i64 [ 0, %vector.memcheck14 ], [ 0, %for.body6.preheader.i ], [ %n.vec21, %middle.block16 ]
%22 = xor i64 %indvars.iv83.i.ph, -1
%23 = add nsw i64 %22, %wide.trip.count87.i
%xtraiter29 = and i64 %wide.trip.count87.i, 3
%lcmp.mod30.not = icmp eq i64 %xtraiter29, 0
br i1 %lcmp.mod30.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol
for.body6.i.prol: ; preds = %for.body6.i.preheader, %for.body6.i.prol
%indvars.iv83.i.prol = phi i64 [ %indvars.iv.next84.i.prol, %for.body6.i.prol ], [ %indvars.iv83.i.ph, %for.body6.i.preheader ]
%prol.iter31 = phi i64 [ %prol.iter31.next, %for.body6.i.prol ], [ 0, %for.body6.i.preheader ]
%gep95.i.prol = getelementptr i32, ptr %invariant.gep94.i, i64 %indvars.iv83.i.prol
%24 = load i32, ptr %gep95.i.prol, align 4, !tbaa !5
%arrayidx11.i.prol = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv83.i.prol
store i32 %24, ptr %arrayidx11.i.prol, align 4, !tbaa !5
%indvars.iv.next84.i.prol = add nuw nsw i64 %indvars.iv83.i.prol, 1
%prol.iter31.next = add i64 %prol.iter31, 1
%prol.iter31.cmp.not = icmp eq i64 %prol.iter31.next, %xtraiter29
br i1 %prol.iter31.cmp.not, label %for.body6.i.prol.loopexit, label %for.body6.i.prol, !llvm.loop !25
for.body6.i.prol.loopexit: ; preds = %for.body6.i.prol, %for.body6.i.preheader
%indvars.iv83.i.unr = phi i64 [ %indvars.iv83.i.ph, %for.body6.i.preheader ], [ %indvars.iv.next84.i.prol, %for.body6.i.prol ]
%25 = icmp ult i64 %23, 3
br i1 %25, label %for.end14.i, label %for.body6.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.3, %for.body.i ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.i
%26 = load i32, ptr %gep.i, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.i
store i32 %26, ptr %arrayidx3.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i
%27 = load i32, ptr %gep.i.1, align 4, !tbaa !5
%arrayidx3.i.1 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i
store i32 %27, ptr %arrayidx3.i.1, align 4, !tbaa !5
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.1
%28 = load i32, ptr %gep.i.2, align 4, !tbaa !5
%arrayidx3.i.2 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.1
store i32 %28, ptr %arrayidx3.i.2, align 4, !tbaa !5
%indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 3
%gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next.i.2
%29 = load i32, ptr %gep.i.3, align 4, !tbaa !5
%arrayidx3.i.3 = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %indvars.iv.next.i.2
store i32 %29, ptr %arrayidx3.i.3, align 4, !tbaa !5
%indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 4
%exitcond.not.i.3 = icmp eq i64 %indvars.iv.next.i.3, %wide.trip.count.i
br i1 %exitcond.not.i.3, label %for.cond4.preheader.i, label %for.body.i, !llvm.loop !26
for.body6.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i
%indvars.iv83.i = phi i64 [ %indvars.iv.next84.i.3, %for.body6.i ], [ %indvars.iv83.i.unr, %for.body6.i.prol.loopexit ]
%gep95.i = getelementptr i32, ptr %invariant.gep94.i, i64 %indvars.iv83.i
%30 = load i32, ptr %gep95.i, align 4, !tbaa !5
%arrayidx11.i = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv83.i
store i32 %30, ptr %arrayidx11.i, align 4, !tbaa !5
%indvars.iv.next84.i = add nuw nsw i64 %indvars.iv83.i, 1
%gep95.i.1 = getelementptr i32, ptr %invariant.gep94.i, i64 %indvars.iv.next84.i
%31 = load i32, ptr %gep95.i.1, align 4, !tbaa !5
%arrayidx11.i.1 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv.next84.i
store i32 %31, ptr %arrayidx11.i.1, align 4, !tbaa !5
%indvars.iv.next84.i.1 = add nuw nsw i64 %indvars.iv83.i, 2
%gep95.i.2 = getelementptr i32, ptr %invariant.gep94.i, i64 %indvars.iv.next84.i.1
%32 = load i32, ptr %gep95.i.2, align 4, !tbaa !5
%arrayidx11.i.2 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv.next84.i.1
store i32 %32, ptr %arrayidx11.i.2, align 4, !tbaa !5
%indvars.iv.next84.i.2 = add nuw nsw i64 %indvars.iv83.i, 3
%gep95.i.3 = getelementptr i32, ptr %invariant.gep94.i, i64 %indvars.iv.next84.i.2
%33 = load i32, ptr %gep95.i.3, align 4, !tbaa !5
%arrayidx11.i.3 = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %indvars.iv.next84.i.2
store i32 %33, ptr %arrayidx11.i.3, align 4, !tbaa !5
%indvars.iv.next84.i.3 = add nuw nsw i64 %indvars.iv83.i, 4
%exitcond88.not.i.3 = icmp eq i64 %indvars.iv.next84.i.3, %wide.trip.count87.i
br i1 %exitcond88.not.i.3, label %for.end14.i, label %for.body6.i, !llvm.loop !27
for.end14.i: ; preds = %for.body6.i.prol.loopexit, %for.body6.i, %middle.block16, %for.cond4.preheader.i
%idxprom15.i = sext i32 %sub.i to i64
%arrayidx16.i = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %idxprom15.i
store i32 1000000000, ptr %arrayidx16.i, align 4, !tbaa !5
%idxprom17.i = sext i32 %sub1.i to i64
%arrayidx18.i = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %idxprom17.i
store i32 1000000000, ptr %arrayidx18.i, align 4, !tbaa !5
%count.promoted.i = load i64, ptr @count, align 8, !tbaa !19
%34 = sext i32 %left to i64
%wide.trip.count92.i = sext i32 %right to i64
br label %for.body21.i
for.body21.i: ; preds = %for.inc39.i, %for.end14.i
%indvars.iv89.i = phi i64 [ %34, %for.end14.i ], [ %indvars.iv.next90.i, %for.inc39.i ]
%j.079.i = phi i32 [ 0, %for.end14.i ], [ %j.1.i, %for.inc39.i ]
%i.278.i = phi i32 [ 0, %for.end14.i ], [ %i.3.i, %for.inc39.i ]
%add387577.i = phi i64 [ %count.promoted.i, %for.end14.i ], [ %add3874.i, %for.inc39.i ]
%idxprom22.i = sext i32 %i.278.i to i64
%arrayidx23.i = getelementptr inbounds [500000 x i32], ptr @L, i64 0, i64 %idxprom22.i
%35 = load i32, ptr %arrayidx23.i, align 4, !tbaa !5
%idxprom24.i = sext i32 %j.079.i to i64
%arrayidx25.i = getelementptr inbounds [500000 x i32], ptr @R, i64 0, i64 %idxprom24.i
%36 = load i32, ptr %arrayidx25.i, align 4, !tbaa !5
%cmp26.not.i = icmp sgt i32 %35, %36
br i1 %cmp26.not.i, label %if.else.i, label %if.then.i
if.then.i: ; preds = %for.body21.i
%inc31.i = add nsw i32 %i.278.i, 1
br label %for.inc39.i
if.else.i: ; preds = %for.body21.i
%inc36.i = add nsw i32 %j.079.i, 1
%sub37.i = sub nsw i32 %sub.i, %i.278.i
%conv.i = sext i32 %sub37.i to i64
%add38.i = add nsw i64 %add387577.i, %conv.i
store i64 %add38.i, ptr @count, align 8, !tbaa !19
br label %for.inc39.i
for.inc39.i: ; preds = %if.else.i, %if.then.i
%.sink.i = phi i32 [ %36, %if.else.i ], [ %35, %if.then.i ]
%add3874.i = phi i64 [ %add38.i, %if.else.i ], [ %add387577.i, %if.then.i ]
%i.3.i = phi i32 [ %i.278.i, %if.else.i ], [ %inc31.i, %if.then.i ]
%j.1.i = phi i32 [ %inc36.i, %if.else.i ], [ %j.079.i, %if.then.i ]
%37 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv89.i
store i32 %.sink.i, ptr %37, align 4
%indvars.iv.next90.i = add nsw i64 %indvars.iv89.i, 1
%exitcond93.not.i = icmp eq i64 %indvars.iv.next90.i, %wide.trip.count92.i
br i1 %exitcond93.not.i, label %if.end, label %for.body21.i, !llvm.loop !21
if.end: ; preds = %for.inc39.i, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%A = alloca [500000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 2000000, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %0, 0
br i1 %cmp5, 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 [500000 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 !28
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @mergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %.lcssa)
%3 = load i64, ptr @count, align 8, !tbaa !19
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3)
call void @llvm.lifetime.end.p0(i64 2000000, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !10, !11}
!18 = distinct !{!18, !10, !11}
!19 = !{!20, !20, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !11, !12}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !10, !11, !12}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !10, !11}
!27 = distinct !{!27, !10, !11}
!28 = distinct !{!28, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#define MAX_N ((1 << 18) - 1)
#define MAX_L 100000
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
int n;
int val[MAX_N], wgt[MAX_N];
int dpn;
typedef struct wgtval {
int wgt, val;
} wgtval;
struct wgtval_list {
int size;
wgtval *list;
} dp[MAX_N];
#define set_wgtval(wv, w, v) ((wv).wgt = (w), (wv).val = (v))
int compare_wgt(const void *a, const void *b)
{
const wgtval *p = a;
const wgtval *q = b;
if (p->wgt == q->wgt) {
return p->val < q->val ? -1 :
p->val > q->val ? 1 : 0;
}
return p->wgt < q->wgt ? -1 : 1;
}
void compute_dp()
{
int u;
/* initialize */
dpn = min(n, 1 << 12);
dp[0].size = 2;
dp[0].list = malloc(2 * sizeof(wgtval));
set_wgtval(dp[0].list[0], 0, 0);
set_wgtval(dp[0].list[1], wgt[0], val[0]);
/* compute the dp table */
for (u = 1; u < dpn; u++) {
int parent = (u - 1) / 2;
int tail, i;
dp[u].size = dp[parent].size * 2;
dp[u].list = malloc(dp[u].size * sizeof(wgtval));
for (i = 0; i < dp[parent].size; i++) {
dp[u].list[i * 2] = dp[parent].list[i];
set_wgtval(dp[u].list[i * 2 + 1],
dp[parent].list[i].wgt + wgt[u],
dp[parent].list[i].val + val[u]);
}
qsort(dp[u].list, dp[u].size, sizeof(wgtval), compare_wgt);
/* remove unnecessary entries */
tail = 0;
for (i = 1; i < dp[u].size; i++) {
if (dp[u].list[i].wgt > MAX_L) {
break;
}
if (dp[u].list[tail].wgt == dp[u].list[i].wgt) {
dp[u].list[tail] = dp[u].list[i];
} else if (dp[u].list[tail].val < dp[u].list[i].val) {
tail++;
dp[u].list[tail] = dp[u].list[i];
}
}
dp[u].size = tail + 1;
}
}
int bsearch_right(wgtval *list, int size, int target)
{
int lo = 0;
int hi = size;
while (lo < hi) {
int mid = (lo + hi) / 2;
if (target < list[mid].wgt) {
hi = mid;
} else {
lo = mid + 1;
}
}
return lo;
}
int solve(int u, int l)
{
int parent;
int s;
if (u < dpn) {
int x = bsearch_right(dp[u].list, dp[u].size, l) - 1;
return dp[u].list[x].val;
}
parent = (u - 1) / 2;
s = solve(parent, l);
if (l >= wgt[u]) {
int t = val[u] + solve(parent, l - wgt[u]);
s = max(s, t);
}
return s;
}
int main()
{
int i, q;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d%d", &val[i], &wgt[i]);
}
compute_dp();
scanf("%d", &q);
for (i = 0; i < q; i++) {
int u, l;
scanf("%d%d", &u, &l);
printf("%d\n", solve(u - 1, l));
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231382/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231382/source.c"
target datalayout = "e-m:e-p270: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.wgtval_list = type { i32, ptr }
%struct.wgtval = type { i32, i32 }
@n = dso_local global i32 0, align 4
@dpn = dso_local local_unnamed_addr global i32 0, align 4
@dp = dso_local local_unnamed_addr global [262143 x %struct.wgtval_list] zeroinitializer, align 16
@wgt = dso_local global [262143 x i32] zeroinitializer, align 16
@val = dso_local global [262143 x i32] zeroinitializer, align 16
@.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 [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_wgt(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%val = getelementptr inbounds %struct.wgtval, ptr %a, i64 0, i32 1
%2 = load i32, ptr %val, align 4, !tbaa !10
%val2 = getelementptr inbounds %struct.wgtval, ptr %b, i64 0, i32 1
%3 = load i32, ptr %val2, align 4, !tbaa !10
%cmp3 = icmp slt i32 %2, %3
%cmp6 = icmp sgt i32 %2, %3
%cond = zext i1 %cmp6 to i32
%cond7 = select i1 %cmp3, i32 -1, i32 %cond
br label %cleanup
if.end: ; preds = %entry
%cmp10 = icmp slt i32 %0, %1
%cond11 = select i1 %cmp10, i32 -1, i32 1
br label %cleanup
cleanup: ; preds = %if.end, %if.then
%retval.0 = phi i32 [ %cond7, %if.then ], [ %cond11, %if.end ]
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 void @compute_dp() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @n, align 4
%cond = tail call i32 @llvm.smin.i32(i32 %0, i32 4096)
store i32 %cond, ptr @dpn, align 4, !tbaa !11
store i32 2, ptr @dp, align 16, !tbaa !12
%call = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #9
store ptr %call, ptr getelementptr inbounds ([262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 0, i32 1), align 8, !tbaa !15
store i32 0, ptr %call, align 4, !tbaa !5
%val = getelementptr inbounds %struct.wgtval, ptr %call, i64 0, i32 1
store i32 0, ptr %val, align 4, !tbaa !10
%1 = load i32, ptr @wgt, align 16, !tbaa !11
%arrayidx2 = getelementptr inbounds %struct.wgtval, ptr %call, i64 1
store i32 %1, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr @val, align 16, !tbaa !11
%val5 = getelementptr inbounds %struct.wgtval, ptr %call, i64 1, i32 1
store i32 %2, ptr %val5, align 4, !tbaa !10
%cmp6206 = icmp sgt i32 %0, 1
br i1 %cmp6206, label %for.body, label %for.end153
for.body: ; preds = %entry, %for.end146
%indvars.iv214 = phi i64 [ %indvars.iv.next215, %for.end146 ], [ 1, %entry ]
%3 = add nuw i64 %indvars.iv214, 4294967295
%div.udiv220 = lshr i64 %3, 1
%idxprom = and i64 %div.udiv220, 2147483647
%arrayidx7 = getelementptr inbounds [262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 %idxprom
%4 = load i32, ptr %arrayidx7, align 16, !tbaa !12
%mul = shl nsw i32 %4, 1
%arrayidx9 = getelementptr inbounds [262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 %indvars.iv214
store i32 %mul, ptr %arrayidx9, align 16, !tbaa !12
%conv = sext i32 %mul to i64
%mul14 = shl nsw i64 %conv, 3
%call15 = tail call noalias ptr @malloc(i64 noundef %mul14) #9
%list = getelementptr inbounds [262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 %indvars.iv214, i32 1
store ptr %call15, ptr %list, align 8, !tbaa !15
%5 = load i32, ptr %arrayidx7, align 16, !tbaa !12
%cmp22200 = icmp sgt i32 %5, 0
br i1 %cmp22200, label %for.body24.lr.ph, label %for.end
for.body24.lr.ph: ; preds = %for.body
%list33 = getelementptr inbounds [262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 %idxprom, i32 1
%arrayidx43 = getelementptr inbounds [262143 x i32], ptr @wgt, i64 0, i64 %indvars.iv214
%arrayidx59 = getelementptr inbounds [262143 x i32], ptr @val, i64 0, i64 %indvars.iv214
%.pre = load ptr, ptr %list33, align 8, !tbaa !15
br label %for.body24
for.body24: ; preds = %for.body24.lr.ph, %for.body24
%6 = phi ptr [ %.pre, %for.body24.lr.ph ], [ %10, %for.body24 ]
%7 = phi ptr [ %call15, %for.body24.lr.ph ], [ %13, %for.body24 ]
%indvars.iv = phi i64 [ 0, %for.body24.lr.ph ], [ %indvars.iv.next, %for.body24 ]
%8 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx30 = getelementptr inbounds %struct.wgtval, ptr %7, i64 %8
%arrayidx35 = getelementptr inbounds %struct.wgtval, ptr %6, i64 %indvars.iv
%9 = load i64, ptr %arrayidx35, align 4
store i64 %9, ptr %arrayidx30, align 4
%10 = load ptr, ptr %list33, align 8, !tbaa !15
%arrayidx40 = getelementptr inbounds %struct.wgtval, ptr %10, i64 %indvars.iv
%11 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%12 = load i32, ptr %arrayidx43, align 4, !tbaa !11
%add = add nsw i32 %12, %11
%13 = load ptr, ptr %list, align 8, !tbaa !15
%14 = or i64 %8, 1
%arrayidx50 = getelementptr inbounds %struct.wgtval, ptr %13, i64 %14
store i32 %add, ptr %arrayidx50, align 4, !tbaa !5
%val57 = getelementptr inbounds %struct.wgtval, ptr %10, i64 %indvars.iv, i32 1
%15 = load i32, ptr %val57, align 4, !tbaa !10
%16 = load i32, ptr %arrayidx59, align 4, !tbaa !11
%add60 = add nsw i32 %16, %15
%val68 = getelementptr inbounds %struct.wgtval, ptr %13, i64 %14, i32 1
store i32 %add60, ptr %val68, align 4, !tbaa !10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%17 = load i32, ptr %arrayidx7, align 16, !tbaa !12
%18 = sext i32 %17 to i64
%cmp22 = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp22, label %for.body24, label %for.end.loopexit, !llvm.loop !16
for.end.loopexit: ; preds = %for.body24
%.pre218 = load i32, ptr %arrayidx9, align 16, !tbaa !12
%.pre219 = sext i32 %.pre218 to i64
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.body
%conv75.pre-phi = phi i64 [ %.pre219, %for.end.loopexit ], [ %conv, %for.body ]
%19 = phi ptr [ %13, %for.end.loopexit ], [ %call15, %for.body ]
tail call void @qsort(ptr noundef %19, i64 noundef %conv75.pre-phi, i64 noundef 8, ptr noundef nonnull @compare_wgt) #10
%20 = load i32, ptr %arrayidx9, align 16, !tbaa !12
%cmp80202 = icmp sgt i32 %20, 1
br i1 %cmp80202, label %for.body82, label %for.end146
for.body82: ; preds = %for.end, %for.inc144
%indvars.iv211 = phi i64 [ %indvars.iv.next212, %for.inc144 ], [ 1, %for.end ]
%tail.0203 = phi i32 [ %tail.1, %for.inc144 ], [ 0, %for.end ]
%21 = load ptr, ptr %list, align 8, !tbaa !15
%arrayidx87 = getelementptr inbounds %struct.wgtval, ptr %21, i64 %indvars.iv211
%22 = load i32, ptr %arrayidx87, align 4, !tbaa !5
%cmp89 = icmp sgt i32 %22, 100000
br i1 %cmp89, label %for.end146, label %if.end
if.end: ; preds = %for.body82
%idxprom94 = sext i32 %tail.0203 to i64
%arrayidx95 = getelementptr inbounds %struct.wgtval, ptr %21, i64 %idxprom94
%23 = load i32, ptr %arrayidx95, align 4, !tbaa !5
%cmp103 = icmp eq i32 %23, %22
br i1 %cmp103, label %for.inc144.sink.split, label %if.else
if.else: ; preds = %if.end
%val121 = getelementptr inbounds %struct.wgtval, ptr %21, i64 %idxprom94, i32 1
%24 = load i32, ptr %val121, align 4, !tbaa !10
%val127 = getelementptr inbounds %struct.wgtval, ptr %21, i64 %indvars.iv211, i32 1
%25 = load i32, ptr %val127, align 4, !tbaa !10
%cmp128 = icmp slt i32 %24, %25
br i1 %cmp128, label %if.then130, label %for.inc144
if.then130: ; preds = %if.else
%inc131 = add nsw i32 %tail.0203, 1
%idxprom135 = sext i32 %inc131 to i64
%arrayidx136 = getelementptr inbounds %struct.wgtval, ptr %21, i64 %idxprom135
br label %for.inc144.sink.split
for.inc144.sink.split: ; preds = %if.end, %if.then130
%arrayidx95.sink = phi ptr [ %arrayidx136, %if.then130 ], [ %arrayidx95, %if.end ]
%tail.1.ph = phi i32 [ %inc131, %if.then130 ], [ %tail.0203, %if.end ]
%26 = load i64, ptr %arrayidx87, align 4
store i64 %26, ptr %arrayidx95.sink, align 4
br label %for.inc144
for.inc144: ; preds = %for.inc144.sink.split, %if.else
%tail.1 = phi i32 [ %tail.0203, %if.else ], [ %tail.1.ph, %for.inc144.sink.split ]
%indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
%27 = load i32, ptr %arrayidx9, align 16, !tbaa !12
%28 = sext i32 %27 to i64
%cmp80 = icmp slt i64 %indvars.iv.next212, %28
br i1 %cmp80, label %for.body82, label %for.end146, !llvm.loop !18
for.end146: ; preds = %for.inc144, %for.body82, %for.end
%tail.0.lcssa = phi i32 [ 0, %for.end ], [ %tail.0203, %for.body82 ], [ %tail.1, %for.inc144 ]
%add147 = add nsw i32 %tail.0.lcssa, 1
store i32 %add147, ptr %arrayidx9, align 16, !tbaa !12
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%29 = load i32, ptr @dpn, align 4, !tbaa !11
%30 = sext i32 %29 to i64
%cmp6 = icmp slt i64 %indvars.iv.next215, %30
br i1 %cmp6, label %for.body, label %for.end153, !llvm.loop !19
for.end153: ; preds = %for.end146, %entry
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @bsearch_right(ptr nocapture noundef readonly %list, i32 noundef %size, i32 noundef %target) local_unnamed_addr #5 {
entry:
%cmp8 = icmp sgt i32 %size, 0
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%lo.010 = phi i32 [ %lo.1, %while.body ], [ 0, %entry ]
%hi.09 = phi i32 [ %hi.1, %while.body ], [ %size, %entry ]
%add = add nsw i32 %lo.010, %hi.09
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds %struct.wgtval, ptr %list, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %0, %target
%add2 = add nsw i32 %div, 1
%hi.1 = select i1 %cmp1, i32 %div, i32 %hi.09
%lo.1 = select i1 %cmp1, i32 %lo.010, i32 %add2
%cmp = icmp slt i32 %lo.1, %hi.1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !20
while.end: ; preds = %while.body, %entry
%lo.0.lcssa = phi i32 [ 0, %entry ], [ %lo.1, %while.body ]
ret i32 %lo.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @solve(i32 noundef %u, i32 noundef %l) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr @dpn, align 4, !tbaa !11
%cmp = icmp sgt i32 %0, %u
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%idxprom = sext i32 %u to i64
%arrayidx = getelementptr inbounds [262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 %idxprom
%list = getelementptr inbounds [262143 x %struct.wgtval_list], ptr @dp, i64 0, i64 %idxprom, i32 1
%1 = load ptr, ptr %list, align 8, !tbaa !15
%2 = load i32, ptr %arrayidx, align 16, !tbaa !12
%cmp8.i = icmp sgt i32 %2, 0
br i1 %cmp8.i, label %while.body.i, label %bsearch_right.exit
while.body.i: ; preds = %if.then, %while.body.i
%lo.010.i = phi i32 [ %lo.1.i, %while.body.i ], [ 0, %if.then ]
%hi.09.i = phi i32 [ %hi.1.i, %while.body.i ], [ %2, %if.then ]
%add.i = add nsw i32 %hi.09.i, %lo.010.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds %struct.wgtval, ptr %1, i64 %idxprom.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp sgt i32 %3, %l
%add2.i = add nsw i32 %div.i, 1
%hi.1.i = select i1 %cmp1.i, i32 %div.i, i32 %hi.09.i
%lo.1.i = select i1 %cmp1.i, i32 %lo.010.i, i32 %add2.i
%cmp.i = icmp slt i32 %lo.1.i, %hi.1.i
br i1 %cmp.i, label %while.body.i, label %bsearch_right.exit.loopexit, !llvm.loop !20
bsearch_right.exit.loopexit: ; preds = %while.body.i
%4 = add nsw i32 %lo.1.i, -1
%5 = sext i32 %4 to i64
br label %bsearch_right.exit
bsearch_right.exit: ; preds = %bsearch_right.exit.loopexit, %if.then
%lo.0.lcssa.i = phi i64 [ -1, %if.then ], [ %5, %bsearch_right.exit.loopexit ]
%val = getelementptr inbounds %struct.wgtval, ptr %1, i64 %lo.0.lcssa.i, i32 1
%6 = load i32, ptr %val, align 4, !tbaa !10
br label %common.ret37
if.end: ; preds = %entry
%sub8 = add nsw i32 %u, -1
%div = sdiv i32 %sub8, 2
%call9 = tail call i32 @solve(i32 noundef %div, i32 noundef %l)
%idxprom10 = sext i32 %u to i64
%arrayidx11 = getelementptr inbounds [262143 x i32], ptr @wgt, i64 0, i64 %idxprom10
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !11
%cmp12.not = icmp sgt i32 %7, %l
br i1 %cmp12.not, label %common.ret37, label %if.then13
common.ret37: ; preds = %if.end, %bsearch_right.exit, %if.then13
%common.ret37.op = phi i32 [ %cond, %if.then13 ], [ %6, %bsearch_right.exit ], [ %call9, %if.end ]
ret i32 %common.ret37.op
if.then13: ; preds = %if.end
%arrayidx15 = getelementptr inbounds [262143 x i32], ptr @val, i64 0, i64 %idxprom10
%8 = load i32, ptr %arrayidx15, align 4, !tbaa !11
%sub18 = sub nsw i32 %l, %7
%call19 = tail call i32 @solve(i32 noundef %div, i32 noundef %sub18)
%add = add nsw i32 %call19, %8
%cond = tail call i32 @llvm.smax.i32(i32 %call9, i32 %add)
br label %common.ret37
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%q = alloca i32, align 4
%u = alloca i32, align 4
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #10
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !11
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [262143 x i32], ptr @val, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [262143 x i32], ptr @wgt, i64 0, i64 %indvars.iv
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !11
%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 !21
for.end: ; preds = %for.body, %entry
tail call void @compute_dp()
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%3 = load i32, ptr %q, align 4, !tbaa !11
%cmp621 = icmp sgt i32 %3, 0
br i1 %cmp621, label %for.body7, label %for.end13
for.body7: ; preds = %for.end, %for.body7
%i.122 = phi i32 [ %inc12, %for.body7 ], [ 0, %for.end ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #10
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %l)
%4 = load i32, ptr %u, align 4, !tbaa !11
%sub = add nsw i32 %4, -1
%5 = load i32, ptr %l, align 4, !tbaa !11
%call9 = call i32 @solve(i32 noundef %sub, i32 noundef %5)
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call9)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #10
%inc12 = add nuw nsw i32 %i.122, 1
%6 = load i32, ptr %q, align 4, !tbaa !11
%cmp6 = icmp slt i32 %inc12, %6
br i1 %cmp6, label %for.body7, label %for.end13, !llvm.loop !22
for.end13: ; preds = %for.body7, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree 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 #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind allocsize(0) }
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, !7, i64 0}
!6 = !{!"wgtval", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"wgtval_list", !7, i64 0, !14, i64 8}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!13, !14, i64 8}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
|
#include <math.h>
#include <stdio.h>
typedef long long ll;
ll max(ll x, ll y) { return x > y ? x : y; }
ll dig(ll n) { return log10(n) + 1; }
ll f(ll a, ll b) { return max(dig(a), dig(b)); }
int main() {
ll n, ans, min = 10;
scanf("%lld", &n);
for (ll i = 1; i <= sqrt(n); i++) {
if (n % i == 0) {
// printf("%lld %lld\n", i, n / i);
ans = f(i, n / i);
}
if (ans < min) {
min = ans;
}
}
printf("%lld\n", min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231425/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231425/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @dig(i64 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sitofp i64 %n to double
%call = tail call double @log10(double noundef %conv) #7
%add = fadd double %call, 1.000000e+00
%conv1 = fptosi double %add to i64
ret i64 %conv1
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local i64 @f(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%conv.i = sitofp i64 %a to double
%call.i = tail call double @log10(double noundef %conv.i) #7
%add.i = fadd double %call.i, 1.000000e+00
%conv1.i = fptosi double %add.i to i64
%conv.i3 = sitofp i64 %b to double
%call.i4 = tail call double @log10(double noundef %conv.i3) #7
%add.i5 = fadd double %call.i4, 1.000000e+00
%conv1.i6 = fptosi double %add.i5 to i64
%cond.i = tail call i64 @llvm.smax.i64(i64 %conv1.i, i64 %conv1.i6)
ret i64 %cond.i
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%conv118 = sitofp i64 %0 to double
%call219 = call double @sqrt(double noundef %conv118) #7
%cmp20 = fcmp ult double %call219, 1.000000e+00
br i1 %cmp20, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %if.end, %entry
%min.0.lcssa = phi i64 [ 10, %entry ], [ %spec.select, %if.end ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7
ret i32 0
for.body: ; preds = %entry, %if.end
%conv24 = phi double [ %conv, %if.end ], [ 1.000000e+00, %entry ]
%i.023 = phi i64 [ %inc, %if.end ], [ 1, %entry ]
%min.022 = phi i64 [ %spec.select, %if.end ], [ 10, %entry ]
%ans.021 = phi i64 [ %ans.1, %if.end ], [ undef, %entry ]
%1 = load i64, ptr %n, align 8, !tbaa !5
%rem = srem i64 %1, %i.023
%div = sdiv i64 %1, %i.023
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %if.then, label %if.end
if.then: ; preds = %for.body
%call.i.i = call double @log10(double noundef %conv24) #7
%add.i.i = fadd double %call.i.i, 1.000000e+00
%conv1.i.i = fptosi double %add.i.i to i64
%conv.i3.i = sitofp i64 %div to double
%call.i4.i = call double @log10(double noundef %conv.i3.i) #7
%add.i5.i = fadd double %call.i4.i, 1.000000e+00
%conv1.i6.i = fptosi double %add.i5.i to i64
%cond.i.i = call i64 @llvm.smax.i64(i64 %conv1.i.i, i64 %conv1.i6.i)
%.pre = load i64, ptr %n, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%2 = phi i64 [ %.pre, %if.then ], [ %1, %for.body ]
%ans.1 = phi i64 [ %cond.i.i, %if.then ], [ %ans.021, %for.body ]
%spec.select = call i64 @llvm.smin.i64(i64 %ans.1, i64 %min.022)
%inc = add nuw nsw i64 %i.023, 1
%conv = sitofp i64 %inc to double
%conv1 = sitofp i64 %2 to double
%call2 = call double @sqrt(double noundef %conv1) #7
%cmp = fcmp ult double %call2, %conv
br i1 %cmp, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double 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) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
/* sqrt を使わなくてもsqrt(a)*sqrt(a)=n を利用*/
int dig(long long x){
int c = 0;
while(x>0){x/=10;c++;}
return c;
}
int main(void){
long long n,i,j;
scanf("%lld",&n);
int c=dig(n);
for(i=1;i*i<=n;i++){
if(n%i==0){
if(n/i>i)j=n/i;
else j=i;
int d = dig(j);
if(d<c)c=d;
}
}
printf("%d",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231476/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231476/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dig(i64 noundef %x) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i64 %x, 0
br i1 %cmp3, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%c.05 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%x.addr.04 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%div = udiv i64 %x.addr.04, 10
%inc = add nuw nsw i32 %c.05, 1
%cmp.not = icmp ult i64 %x.addr.04, 10
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%c.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
ret i32 %c.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !7
%cmp3.i = icmp sgt i64 %0, 0
br i1 %cmp3.i, label %while.body.i, label %for.end
while.body.i: ; preds = %entry, %while.body.i
%c.05.i = phi i32 [ %inc.i, %while.body.i ], [ 0, %entry ]
%x.addr.04.i = phi i64 [ %div.i, %while.body.i ], [ %0, %entry ]
%div.i = udiv i64 %x.addr.04.i, 10
%inc.i = add nuw nsw i32 %c.05.i, 1
%cmp.not.i = icmp ult i64 %x.addr.04.i, 10
br i1 %cmp.not.i, label %dig.exit, label %while.body.i, !llvm.loop !5
dig.exit: ; preds = %while.body.i
%cmp.not30 = icmp slt i64 %0, 1
br i1 %cmp.not30, label %for.end, label %for.body
for.body: ; preds = %dig.exit, %for.inc
%i.032 = phi i64 [ %inc, %for.inc ], [ 1, %dig.exit ]
%c.031 = phi i32 [ %c.2, %for.inc ], [ %inc.i, %dig.exit ]
%rem = srem i64 %0, %i.032
%div = sdiv i64 %0, %i.032
%cmp2 = icmp eq i64 %rem, 0
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%div.i.0 = call i64 @llvm.smax.i64(i64 %div, i64 %i.032)
br label %while.body.i23
while.body.i23: ; preds = %if.then, %while.body.i23
%c.05.i24 = phi i32 [ %inc.i27, %while.body.i23 ], [ 0, %if.then ]
%x.addr.04.i25 = phi i64 [ %div.i26, %while.body.i23 ], [ %div.i.0, %if.then ]
%div.i26 = udiv i64 %x.addr.04.i25, 10
%inc.i27 = add nuw nsw i32 %c.05.i24, 1
%cmp.not.i28 = icmp ult i64 %x.addr.04.i25, 10
br i1 %cmp.not.i28, label %dig.exit29, label %while.body.i23, !llvm.loop !5
dig.exit29: ; preds = %while.body.i23
%c.1 = call i32 @llvm.smin.i32(i32 %inc.i27, i32 %c.031)
br label %for.inc
for.inc: ; preds = %for.body, %dig.exit29
%c.2 = phi i32 [ %c.1, %dig.exit29 ], [ %c.031, %for.body ]
%inc = add nuw nsw i64 %i.032, 1
%mul = mul nsw i64 %inc, %inc
%cmp.not = icmp sgt i64 %mul, %0
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.inc, %entry, %dig.exit
%c.0.lcssa = phi i32 [ %inc.i, %dig.exit ], [ 0, %entry ], [ %c.2, %for.inc ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
#include <inttypes.h>
/* x*a + y*b == gcd(a, b) */
void hanazawa_kana(int64_t a, int64_t b, int64_t* x, int64_t* y) {
if (b == 0) {
*x = 1;
*y = 0;
} else {
int64_t nx, ny;
hanazawa_kana(b, a % b, x, y);
/* x*b + y*(a % b) == gcd(a, b) */
/* x*b + y*(a - a/b*b) == gcd(a, b) */
/* y*a + (x - y*(a/b))*b == gcd(a, b) */
nx = (*y);
ny = (*x) - (*y) * (a/b);
*x = nx;
*y = ny;
}
}
int main(void) {
int64_t a, b;
int64_t x = 0, y = 0;
if (scanf("%"SCNd64"%"SCNd64, &a, &b) != 2) return 1;
hanazawa_kana(a, b, &x, &y);
printf("%"PRId64" %"PRId64"\n", x, y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231548/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231548/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @hanazawa_kana(i64 noundef %a, i64 noundef %b, ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i64 %b, 0
br i1 %cmp, label %if.end, label %if.else
if.else: ; preds = %entry
%rem = srem i64 %a, %b
tail call void @hanazawa_kana(i64 noundef %b, i64 noundef %rem, ptr noundef %x, ptr noundef %y)
%0 = load i64, ptr %y, align 8, !tbaa !5
%1 = load i64, ptr %x, align 8, !tbaa !5
%div = sdiv i64 %a, %b
%mul = mul nsw i64 %div, %0
%sub = sub nsw i64 %1, %mul
br label %if.end
if.end: ; preds = %entry, %if.else
%storemerge12 = phi i64 [ %0, %if.else ], [ 1, %entry ]
%storemerge = phi i64 [ %sub, %if.else ], [ 0, %entry ]
store i64 %storemerge12, ptr %x, align 8, !tbaa !5
store i64 %storemerge, 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 nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
store i64 0, ptr %x, align 8, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4
store i64 0, ptr %y, align 8, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
call void @hanazawa_kana(i64 noundef %0, i64 noundef %1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%2 = load i64, ptr %x, align 8, !tbaa !5
%3 = load i64, ptr %y, align 8, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %2, i64 noundef %3)
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 0, %if.end ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 %retval.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 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int a[4], b[4];
int hit, blow;
int i, j;
while (1) {
if( scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]) == EOF)
break;
if( scanf("%d %d %d %d", &b[0], &b[1], &b[2], &b[3]) == EOF)
break;
hit = blow = 0;
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
if( a[i] == b[j])
if( i == j) {
hit++;
break;
} else {
blow++;
break;
}
printf("%d %d\n", hit, blow);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231599/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231599/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i32], align 16
%b = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #3
%arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3
%arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp44 = icmp eq i32 %call43, -1
br i1 %cmp44, label %while.end, label %if.end
if.end: ; preds = %entry, %for.inc26.3
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7)
%cmp9 = icmp eq i32 %call8, -1
br i1 %cmp9, label %while.end, label %for.cond13.preheader.preheader
for.cond13.preheader.preheader: ; preds = %if.end
%0 = load i32, ptr %a, align 16, !tbaa !5
%1 = load i32, ptr %b, align 16, !tbaa !5
%cmp19 = icmp eq i32 %0, %1
br i1 %cmp19, label %for.inc26, label %for.inc
for.inc: ; preds = %for.cond13.preheader.preheader
%2 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp19.1 = icmp eq i32 %0, %2
%3 = load i32, ptr %arrayidx6, align 8
%cmp19.2 = icmp eq i32 %0, %3
%or.cond = select i1 %cmp19.1, i1 true, i1 %cmp19.2
%4 = load i32, ptr %arrayidx7, align 4
%cmp19.3 = icmp eq i32 %0, %4
%or.cond57 = select i1 %or.cond, i1 true, i1 %cmp19.3
%spec.select62 = zext i1 %or.cond57 to i32
br label %for.inc26
for.inc26: ; preds = %for.inc, %for.cond13.preheader.preheader
%hit.1 = phi i32 [ 1, %for.cond13.preheader.preheader ], [ 0, %for.inc ]
%blow.1 = phi i32 [ 0, %for.cond13.preheader.preheader ], [ %spec.select62, %for.inc ]
%5 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp19.148 = icmp eq i32 %5, %1
br i1 %cmp19.148, label %if.else.1, label %for.inc.149
for.inc.149: ; preds = %for.inc26
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp19.1.1 = icmp eq i32 %5, %6
br i1 %cmp19.1.1, label %if.then22.1, label %for.inc.1.1
for.inc.1.1: ; preds = %for.inc.149
%7 = load i32, ptr %arrayidx6, align 8, !tbaa !5
%cmp19.2.1 = icmp eq i32 %5, %7
%8 = load i32, ptr %arrayidx7, align 4
%cmp19.3.1 = icmp eq i32 %5, %8
%or.cond58 = select i1 %cmp19.2.1, i1 true, i1 %cmp19.3.1
br i1 %or.cond58, label %if.else.1, label %for.inc26.1
if.else.1: ; preds = %for.inc26, %for.inc.1.1
%inc23.1 = add nuw nsw i32 %blow.1, 1
br label %for.inc26.1
if.then22.1: ; preds = %for.inc.149
%inc.1 = add nuw nsw i32 %hit.1, 1
br label %for.inc26.1
for.inc26.1: ; preds = %for.inc.1.1, %if.then22.1, %if.else.1
%hit.1.1 = phi i32 [ %inc.1, %if.then22.1 ], [ %hit.1, %if.else.1 ], [ %hit.1, %for.inc.1.1 ]
%blow.1.1 = phi i32 [ %blow.1, %if.then22.1 ], [ %inc23.1, %if.else.1 ], [ %blow.1, %for.inc.1.1 ]
%9 = load i32, ptr %arrayidx2, align 8, !tbaa !5
%cmp19.250 = icmp eq i32 %9, %1
%10 = load i32, ptr %arrayidx5, align 4
%cmp19.1.2 = icmp eq i32 %9, %10
%or.cond59 = select i1 %cmp19.250, i1 true, i1 %cmp19.1.2
br i1 %or.cond59, label %if.else.2, label %for.inc.1.2
for.inc.1.2: ; preds = %for.inc26.1
%11 = load i32, ptr %arrayidx6, align 8, !tbaa !5
%cmp19.2.2 = icmp eq i32 %9, %11
br i1 %cmp19.2.2, label %if.then22.2, label %for.inc.2.2
for.inc.2.2: ; preds = %for.inc.1.2
%12 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp19.3.2 = icmp eq i32 %9, %12
br i1 %cmp19.3.2, label %if.else.2, label %for.inc26.2
if.else.2: ; preds = %for.inc26.1, %for.inc.2.2
%inc23.2 = add nuw nsw i32 %blow.1.1, 1
br label %for.inc26.2
if.then22.2: ; preds = %for.inc.1.2
%inc.2 = add nuw nsw i32 %hit.1.1, 1
br label %for.inc26.2
for.inc26.2: ; preds = %for.inc.2.2, %if.then22.2, %if.else.2
%hit.1.2 = phi i32 [ %inc.2, %if.then22.2 ], [ %hit.1.1, %if.else.2 ], [ %hit.1.1, %for.inc.2.2 ]
%blow.1.2 = phi i32 [ %blow.1.1, %if.then22.2 ], [ %inc23.2, %if.else.2 ], [ %blow.1.1, %for.inc.2.2 ]
%13 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp19.352 = icmp eq i32 %13, %1
%14 = load i32, ptr %arrayidx5, align 4
%cmp19.1.3 = icmp eq i32 %13, %14
%or.cond60 = select i1 %cmp19.352, i1 true, i1 %cmp19.1.3
%15 = load i32, ptr %arrayidx6, align 8
%cmp19.2.3 = icmp eq i32 %13, %15
%or.cond61 = select i1 %or.cond60, i1 true, i1 %cmp19.2.3
br i1 %or.cond61, label %if.else.3, label %for.inc.2.3
for.inc.2.3: ; preds = %for.inc26.2
%16 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp19.3.3 = icmp eq i32 %13, %16
%inc.3 = zext i1 %cmp19.3.3 to i32
%spec.select = add nuw nsw i32 %hit.1.2, %inc.3
br label %for.inc26.3
if.else.3: ; preds = %for.inc26.2
%inc23.3 = add nuw nsw i32 %blow.1.2, 1
br label %for.inc26.3
for.inc26.3: ; preds = %for.inc.2.3, %if.else.3
%hit.1.3 = phi i32 [ %hit.1.2, %if.else.3 ], [ %spec.select, %for.inc.2.3 ]
%blow.1.3 = phi i32 [ %inc23.3, %if.else.3 ], [ %blow.1.2, %for.inc.2.3 ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %hit.1.3, i32 noundef %blow.1.3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp = icmp eq i32 %call, -1
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %for.inc26.3, %if.end, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a[4];
int b[4];
int i,j,hit,blow;
while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF){
hit = 0;
blow = 0;
scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
for(i=0;i<4;i++){
if(a[i]==b[i])
hit++;
for(j=0;j<4;j++){
if(i!=j&&a[i]==b[j])
blow++;
}
}
printf("%d %d\n",hit,blow);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_231641/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_231641/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x i32], align 16
%b = alloca [4 x i32], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #4
%arrayidx1 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [4 x i32], ptr %a, i64 0, i64 3
%call47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not48 = icmp eq i32 %call47, -1
br i1 %cmp.not48, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx5 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [4 x i32], ptr %b, i64 0, i64 3
br label %for.inc.3.3
for.inc.3.3: ; preds = %while.body.lr.ph, %for.inc.3.3
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7)
%0 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%1 = load <4 x i32>, ptr %b, align 16, !tbaa !5
%2 = load <2 x i32>, ptr %a, align 16, !tbaa !5
%3 = shufflevector <2 x i32> %2, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 0, i32 0>
%4 = extractelement <4 x i32> %1, i64 0
%shift = shufflevector <2 x i32> %2, <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 poison>
%5 = icmp eq <4 x i32> %shift, %1
%cmp13 = extractelement <4 x i1> %5, i64 0
%inc = zext i1 %cmp13 to i32
%6 = icmp eq <4 x i32> %3, %1
%7 = extractelement <2 x i32> %2, i64 1
%cmp13.1 = icmp eq i32 %7, %0
%inc.1 = zext i1 %cmp13.1 to i32
%8 = load <2 x i32>, ptr %arrayidx6, align 8, !tbaa !5
%spec.select.1 = add nuw nsw i32 %inc, %inc.1
%9 = load i32, ptr %arrayidx6, align 8, !tbaa !5
%10 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%11 = load <2 x i32>, ptr %arrayidx2, align 8, !tbaa !5
%12 = extractelement <2 x i32> %11, i64 0
%cmp13.2 = icmp eq i32 %12, %9
%inc.2 = zext i1 %cmp13.2 to i32
%cmp22.1.2 = icmp eq i32 %12, %0
%inc24.1.2 = zext i1 %cmp22.1.2 to i32
%cmp22.3.2 = icmp eq i32 %12, %10
%inc24.3.2 = zext i1 %cmp22.3.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%13 = extractelement <2 x i32> %11, i64 1
%cmp13.3 = icmp eq i32 %13, %10
%inc.3 = zext i1 %cmp13.3 to i32
%cmp22.366 = icmp eq i32 %13, %4
%inc24.367 = zext i1 %cmp22.366 to i32
%cmp22.1.3 = icmp eq i32 %13, %0
%inc24.1.3 = zext i1 %cmp22.1.3 to i32
%14 = shufflevector <2 x i32> %11, <2 x i32> %8, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
%15 = shufflevector <2 x i32> %2, <2 x i32> poison, <4 x i32> <i32 poison, i32 1, i32 poison, i32 poison>
%16 = shufflevector <4 x i32> %1, <4 x i32> %15, <4 x i32> <i32 0, i32 poison, i32 5, i32 5>
%17 = insertelement <4 x i32> %16, i32 %9, i64 1
%18 = icmp eq <4 x i32> %14, %17
%19 = bitcast <4 x i1> %6 to i4
%20 = call i4 @llvm.ctpop.i4(i4 %19), !range !9
%21 = zext i4 %20 to i32
%22 = bitcast <4 x i1> %18 to i4
%23 = call i4 @llvm.ctpop.i4(i4 %22), !range !9
%24 = zext i4 %23 to i32
%op.rdx79 = add nuw nsw i32 %24, %inc24.1.3
%op.rdx80 = add nuw nsw i32 %inc24.367, %inc24.3.2
%op.rdx81 = add nuw nsw i32 %inc24.1.2, %21
%op.rdx82 = add nuw nsw i32 %op.rdx79, %op.rdx80
%op.rdx83 = add nuw nsw i32 %op.rdx82, %op.rdx81
%spec.select.3 = add nuw nsw i32 %spec.select.2, %inc.3
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.3, i32 noundef %op.rdx83)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.inc.3.3, !llvm.loop !10
while.end: ; preds = %for.inc.3.3, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #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 = !{i4 0, i4 5}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.