Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <math.h>
int main(void)
{
double radius; //Value r.
scanf("%lf", &radius);
printf("%f ", radius * radius * M_PI);
printf("%f\n", radius * 2 * M_PI);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263653/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263653/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%radius = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %radius) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %radius)
%0 = load double, ptr %radius, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442D18
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
%1 = load double, ptr %radius, align 8, !tbaa !5
%mul3 = fmul double %1, 2.000000e+00
%mul4 = fmul double %mul3, 0x400921FB54442D18
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %mul4)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %radius) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
double r, area, cir;
scanf("%lf", &r);
printf("%lf %lf\n", r * r * 3.14159265359, 2 * r * 3.14159265359);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263703/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263703/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442EEA
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442EEA
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
double r, p;
scanf("%lf", &r);
p = 3.141592653589;
printf("%lf %lf\n", r * r * p, 2 * r * p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263769/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263769/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
double r;
scanf("%lf", &r);
printf("%lf %lf\n", 3.141592653589*r*r, 2*3.141592653589*r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lf %lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, 0x400921FB5444261E
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 0x401921FB5444261E
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define p 3.1415926535897931
int main(){
double r;
scanf("%lf",&r);
printf("%.6f %.6f\n",r*r*p,2*r*p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263855/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"%.6f %.6f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442D18
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<math.h>
int main() {
double r,s, c;
scanf("%lf", &r);
s = r * r * M_PI;
c = 2 * r * M_PI;
printf("%f %f\n", s, c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%f %f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load double, ptr %r, align 8, !tbaa !5
%mul = fmul double %0, %0
%mul1 = fmul double %mul, 0x400921FB54442D18
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
int ans=1900*m+100*(n-m);
ans*=pow(2,m);
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263963/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263963/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%mul = mul nsw i32 %0, 1900
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %1, %0
%mul1 = mul nsw i32 %sub, 100
%add = add nsw i32 %mul1, %mul
%ldexp = call double @ldexp(double 1.000000e+00, i32 %0) #4
%conv3 = sitofp i32 %add to double
%mul4 = fmul double %ldexp, %conv3
%conv5 = fptosi double %mul4 to i32
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv5)
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 willreturn
declare double @ldexp(double, i32) 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 willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char s1[11];
char s2[11];
char s3[11];
scanf("%s %s %s", s1, s2, s3);
printf("%c%c%c",s1[0]-32,s2[0]-32,s3[0]-32);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264012/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264012/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%s %s %s\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%c%c%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [11 x i8], align 1
%s2 = alloca [11 x i8], align 1
%s3 = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s2) #3
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3)
%0 = load i8, ptr %s1, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%sub = add nsw i32 %conv, -32
%1 = load i8, ptr %s2, align 1, !tbaa !5
%conv4 = sext i8 %1 to i32
%sub5 = add nsw i32 %conv4, -32
%2 = load i8, ptr %s3, align 1, !tbaa !5
%conv7 = sext i8 %2 to i32
%sub8 = add nsw i32 %conv7, -32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub, i32 noundef %sub5, i32 noundef %sub8)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s3) #3
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
char s1[12],s2[12],s3[12],dif;
scanf("%[^ ]%*c",s1);
scanf("%[^ ]%*c",s2);
scanf("%s",s3);
dif='A'-'a';
printf("%c%c%c\n",s1[0]+dif,s2[0]+dif,s3[0]+dif);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264063/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264063/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%[^ ]%*c\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [12 x i8], align 1
%s2 = alloca [12 x i8], align 1
%s3 = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s2) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s3) #3
%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)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s3)
%0 = load i8, ptr %s1, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, -32
%1 = load i8, ptr %s2, align 1, !tbaa !5
%conv7 = sext i8 %1 to i32
%add9 = add nsw i32 %conv7, -32
%2 = load i8, ptr %s3, align 1, !tbaa !5
%conv11 = sext i8 %2 to i32
%add13 = add nsw i32 %conv11, -32
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %add9, i32 noundef %add13)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s3) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
char a[11],b[11],c[11];
scanf("%s%s%s",a,b,c);
printf("%c%c%c\n",a[0]-0x20,b[0]-0x20,c[0]-0x20);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264106/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264106/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%s%s%s\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%c%c%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [11 x i8], align 1
%b = alloca [11 x i8], align 1
%c = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%sub = add nsw i32 %conv, -32
%1 = load i8, ptr %b, align 1, !tbaa !5
%conv4 = sext i8 %1 to i32
%sub5 = add nsw i32 %conv4, -32
%2 = load i8, ptr %c, align 1, !tbaa !5
%conv7 = sext i8 %2 to i32
%sub8 = add nsw i32 %conv7, -32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub, i32 noundef %sub5, i32 noundef %sub8)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
char s[3][11];
int i;
for(i=0;i<3;i++) scanf("%s",s[i]);
for(i=0;i<3;i++) printf("%c",s[i][0]-'a'+'A');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264157/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264157/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [3 x [11 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 33, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx.1 = getelementptr inbounds [3 x [11 x i8]], ptr %s, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [3 x [11 x i8]], ptr %s, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%0 = load i8, ptr %s, align 16, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, -32
%putchar = call i32 @putchar(i32 %add)
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %1 to i32
%add.1 = add nsw i32 %conv.1, -32
%putchar.1 = call i32 @putchar(i32 %add.1)
%2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%conv.2 = sext i8 %2 to i32
%add.2 = add nsw i32 %conv.2, -32
%putchar.2 = call i32 @putchar(i32 %add.2)
call void @llvm.lifetime.end.p0(i64 33, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (void){
int T, i, n, j, p0, c0, p1, c1, aux;
scanf( "%d", &T );
for( i = 0; i < T; i++ ){
scanf( "%d", &n );
printf( "%d\n", n );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26420/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26420/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%inc = add nuw nsw i32 %i.05, 1
%2 = load i32, ptr %T, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
char s[5][20];
char ans[5][20];
int main() {
int i,j;
for (i = 0; i < 3; i++) {
scanf(" %s",s[i]);
for (j = 0; j < strlen(s[i]); j++) {
ans[i][j] = (s[i][j] - 'a') + 'A';
}
}
for (i = 0; i < 3; i++) {
printf("%c", ans[i][0]);
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264243/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264243/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %s\00", align 1
@s = dso_local global [5 x [20 x i8]] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global [5 x [20 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 @s)
%call5 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #4
%cmp647.not = icmp eq i64 %call5, 0
br i1 %cmp647.not, label %for.inc19, label %iter.check
iter.check: ; preds = %entry
%min.iters.check = icmp ult i64 %call5, 8
br i1 %min.iters.check, label %for.body8.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %iter.check
%min.iters.check61 = icmp ult i64 %call5, 32
br i1 %min.iters.check61, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %call5, -32
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 0, i64 %index
%wide.load = load <16 x i8>, ptr %0, align 16, !tbaa !5
%1 = getelementptr inbounds i8, ptr %0, i64 16
%wide.load62 = load <16 x i8>, ptr %1, align 16, !tbaa !5
%2 = add <16 x i8> %wide.load, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%3 = add <16 x i8> %wide.load62, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%4 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 0, i64 %index
store <16 x i8> %2, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i8, ptr %4, i64 16
store <16 x i8> %3, ptr %5, align 16, !tbaa !5
%index.next = add nuw i64 %index, 32
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %call5, %n.vec
br i1 %cmp.n, label %for.inc19, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%n.vec.remaining = and i64 %call5, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body8.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec64 = and i64 %call5, -8
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index66 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next68, %vec.epilog.vector.body ]
%7 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 0, i64 %index66
%wide.load67 = load <8 x i8>, ptr %7, align 8, !tbaa !5
%8 = add <8 x i8> %wide.load67, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%9 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 0, i64 %index66
store <8 x i8> %8, ptr %9, align 8, !tbaa !5
%index.next68 = add nuw i64 %index66, 8
%10 = icmp eq i64 %index.next68, %n.vec64
br i1 %10, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n65 = icmp eq i64 %call5, %n.vec64
br i1 %cmp.n65, label %for.inc19, label %for.body8.preheader
for.body8.preheader: ; preds = %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec64, %vec.epilog.middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ %indvars.iv.ph, %for.body8.preheader ]
%arrayidx12 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 0, i64 %indvars.iv
%11 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%add = add i8 %11, -32
%arrayidx18 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 0, i64 %indvars.iv
store i8 %add, ptr %arrayidx18, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call5
br i1 %exitcond.not, label %for.inc19, label %for.body8, !llvm.loop !13
for.inc19: ; preds = %for.body8, %middle.block, %vec.epilog.middle.block, %entry
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([5 x [20 x i8]], ptr @s, i64 0, i64 1))
%call5.1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([5 x [20 x i8]], ptr @s, i64 0, i64 1)) #4
%cmp647.not.1 = icmp eq i64 %call5.1, 0
br i1 %cmp647.not.1, label %for.inc19.1, label %iter.check72
iter.check72: ; preds = %for.inc19
%min.iters.check70 = icmp ult i64 %call5.1, 8
br i1 %min.iters.check70, label %for.body8.1.preheader, label %vector.main.loop.iter.check74
vector.main.loop.iter.check74: ; preds = %iter.check72
%min.iters.check73 = icmp ult i64 %call5.1, 32
br i1 %min.iters.check73, label %vec.epilog.ph87, label %vector.ph75
vector.ph75: ; preds = %vector.main.loop.iter.check74
%n.vec77 = and i64 %call5.1, -32
br label %vector.body79
vector.body79: ; preds = %vector.body79, %vector.ph75
%index80 = phi i64 [ 0, %vector.ph75 ], [ %index.next83, %vector.body79 ]
%12 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 1, i64 %index80
%wide.load81 = load <16 x i8>, ptr %12, align 4, !tbaa !5
%13 = getelementptr inbounds i8, ptr %12, i64 16
%wide.load82 = load <16 x i8>, ptr %13, align 4, !tbaa !5
%14 = add <16 x i8> %wide.load81, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%15 = add <16 x i8> %wide.load82, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%16 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 1, i64 %index80
store <16 x i8> %14, ptr %16, align 4, !tbaa !5
%17 = getelementptr inbounds i8, ptr %16, i64 16
store <16 x i8> %15, ptr %17, align 4, !tbaa !5
%index.next83 = add nuw i64 %index80, 32
%18 = icmp eq i64 %index.next83, %n.vec77
br i1 %18, label %middle.block69, label %vector.body79, !llvm.loop !14
middle.block69: ; preds = %vector.body79
%cmp.n78 = icmp eq i64 %call5.1, %n.vec77
br i1 %cmp.n78, label %for.inc19.1, label %vec.epilog.iter.check86
vec.epilog.iter.check86: ; preds = %middle.block69
%n.vec.remaining88 = and i64 %call5.1, 24
%min.epilog.iters.check89 = icmp eq i64 %n.vec.remaining88, 0
br i1 %min.epilog.iters.check89, label %for.body8.1.preheader, label %vec.epilog.ph87
vec.epilog.ph87: ; preds = %vector.main.loop.iter.check74, %vec.epilog.iter.check86
%vec.epilog.resume.val90 = phi i64 [ %n.vec77, %vec.epilog.iter.check86 ], [ 0, %vector.main.loop.iter.check74 ]
%n.vec92 = and i64 %call5.1, -8
br label %vec.epilog.vector.body95
vec.epilog.vector.body95: ; preds = %vec.epilog.vector.body95, %vec.epilog.ph87
%index96 = phi i64 [ %vec.epilog.resume.val90, %vec.epilog.ph87 ], [ %index.next98, %vec.epilog.vector.body95 ]
%19 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 1, i64 %index96
%wide.load97 = load <8 x i8>, ptr %19, align 4, !tbaa !5
%20 = add <8 x i8> %wide.load97, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%21 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 1, i64 %index96
store <8 x i8> %20, ptr %21, align 4, !tbaa !5
%index.next98 = add nuw i64 %index96, 8
%22 = icmp eq i64 %index.next98, %n.vec92
br i1 %22, label %vec.epilog.middle.block84, label %vec.epilog.vector.body95, !llvm.loop !15
vec.epilog.middle.block84: ; preds = %vec.epilog.vector.body95
%cmp.n94 = icmp eq i64 %call5.1, %n.vec92
br i1 %cmp.n94, label %for.inc19.1, label %for.body8.1.preheader
for.body8.1.preheader: ; preds = %iter.check72, %vec.epilog.iter.check86, %vec.epilog.middle.block84
%indvars.iv.1.ph = phi i64 [ 0, %iter.check72 ], [ %n.vec77, %vec.epilog.iter.check86 ], [ %n.vec92, %vec.epilog.middle.block84 ]
br label %for.body8.1
for.body8.1: ; preds = %for.body8.1.preheader, %for.body8.1
%indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.body8.1 ], [ %indvars.iv.1.ph, %for.body8.1.preheader ]
%arrayidx12.1 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 1, i64 %indvars.iv.1
%23 = load i8, ptr %arrayidx12.1, align 1, !tbaa !5
%add.1 = add i8 %23, -32
%arrayidx18.1 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 1, i64 %indvars.iv.1
store i8 %add.1, ptr %arrayidx18.1, align 1, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
%exitcond.1.not = icmp eq i64 %indvars.iv.next.1, %call5.1
br i1 %exitcond.1.not, label %for.inc19.1, label %for.body8.1, !llvm.loop !16
for.inc19.1: ; preds = %for.body8.1, %middle.block69, %vec.epilog.middle.block84, %for.inc19
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([5 x [20 x i8]], ptr @s, i64 0, i64 2))
%call5.2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) getelementptr inbounds ([5 x [20 x i8]], ptr @s, i64 0, i64 2)) #4
%cmp647.not.2 = icmp eq i64 %call5.2, 0
br i1 %cmp647.not.2, label %for.inc19.2, label %iter.check102
iter.check102: ; preds = %for.inc19.1
%min.iters.check100 = icmp ult i64 %call5.2, 8
br i1 %min.iters.check100, label %for.body8.2.preheader, label %vector.main.loop.iter.check104
vector.main.loop.iter.check104: ; preds = %iter.check102
%min.iters.check103 = icmp ult i64 %call5.2, 32
br i1 %min.iters.check103, label %vec.epilog.ph117, label %vector.ph105
vector.ph105: ; preds = %vector.main.loop.iter.check104
%n.vec107 = and i64 %call5.2, -32
br label %vector.body109
vector.body109: ; preds = %vector.body109, %vector.ph105
%index110 = phi i64 [ 0, %vector.ph105 ], [ %index.next113, %vector.body109 ]
%24 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 2, i64 %index110
%wide.load111 = load <16 x i8>, ptr %24, align 8, !tbaa !5
%25 = getelementptr inbounds i8, ptr %24, i64 16
%wide.load112 = load <16 x i8>, ptr %25, align 8, !tbaa !5
%26 = add <16 x i8> %wide.load111, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%27 = add <16 x i8> %wide.load112, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%28 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 2, i64 %index110
store <16 x i8> %26, ptr %28, align 8, !tbaa !5
%29 = getelementptr inbounds i8, ptr %28, i64 16
store <16 x i8> %27, ptr %29, align 8, !tbaa !5
%index.next113 = add nuw i64 %index110, 32
%30 = icmp eq i64 %index.next113, %n.vec107
br i1 %30, label %middle.block99, label %vector.body109, !llvm.loop !17
middle.block99: ; preds = %vector.body109
%cmp.n108 = icmp eq i64 %call5.2, %n.vec107
br i1 %cmp.n108, label %for.inc19.2, label %vec.epilog.iter.check116
vec.epilog.iter.check116: ; preds = %middle.block99
%n.vec.remaining118 = and i64 %call5.2, 24
%min.epilog.iters.check119 = icmp eq i64 %n.vec.remaining118, 0
br i1 %min.epilog.iters.check119, label %for.body8.2.preheader, label %vec.epilog.ph117
vec.epilog.ph117: ; preds = %vector.main.loop.iter.check104, %vec.epilog.iter.check116
%vec.epilog.resume.val120 = phi i64 [ %n.vec107, %vec.epilog.iter.check116 ], [ 0, %vector.main.loop.iter.check104 ]
%n.vec122 = and i64 %call5.2, -8
br label %vec.epilog.vector.body125
vec.epilog.vector.body125: ; preds = %vec.epilog.vector.body125, %vec.epilog.ph117
%index126 = phi i64 [ %vec.epilog.resume.val120, %vec.epilog.ph117 ], [ %index.next128, %vec.epilog.vector.body125 ]
%31 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 2, i64 %index126
%wide.load127 = load <8 x i8>, ptr %31, align 8, !tbaa !5
%32 = add <8 x i8> %wide.load127, <i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32, i8 -32>
%33 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 2, i64 %index126
store <8 x i8> %32, ptr %33, align 8, !tbaa !5
%index.next128 = add nuw i64 %index126, 8
%34 = icmp eq i64 %index.next128, %n.vec122
br i1 %34, label %vec.epilog.middle.block114, label %vec.epilog.vector.body125, !llvm.loop !18
vec.epilog.middle.block114: ; preds = %vec.epilog.vector.body125
%cmp.n124 = icmp eq i64 %call5.2, %n.vec122
br i1 %cmp.n124, label %for.inc19.2, label %for.body8.2.preheader
for.body8.2.preheader: ; preds = %iter.check102, %vec.epilog.iter.check116, %vec.epilog.middle.block114
%indvars.iv.2.ph = phi i64 [ 0, %iter.check102 ], [ %n.vec107, %vec.epilog.iter.check116 ], [ %n.vec122, %vec.epilog.middle.block114 ]
br label %for.body8.2
for.body8.2: ; preds = %for.body8.2.preheader, %for.body8.2
%indvars.iv.2 = phi i64 [ %indvars.iv.next.2, %for.body8.2 ], [ %indvars.iv.2.ph, %for.body8.2.preheader ]
%arrayidx12.2 = getelementptr inbounds [5 x [20 x i8]], ptr @s, i64 0, i64 2, i64 %indvars.iv.2
%35 = load i8, ptr %arrayidx12.2, align 1, !tbaa !5
%add.2 = add i8 %35, -32
%arrayidx18.2 = getelementptr inbounds [5 x [20 x i8]], ptr @ans, i64 0, i64 2, i64 %indvars.iv.2
store i8 %add.2, ptr %arrayidx18.2, align 1, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
%exitcond.2.not = icmp eq i64 %indvars.iv.next.2, %call5.2
br i1 %exitcond.2.not, label %for.inc19.2, label %for.body8.2, !llvm.loop !19
for.inc19.2: ; preds = %for.body8.2, %middle.block99, %vec.epilog.middle.block114, %for.inc19.1
%36 = load i8, ptr @ans, align 16, !tbaa !5
%conv29 = sext i8 %36 to i32
%putchar46 = tail call i32 @putchar(i32 %conv29)
%37 = load i8, ptr getelementptr inbounds ([5 x [20 x i8]], ptr @ans, i64 0, i64 1), align 4, !tbaa !5
%conv29.1 = sext i8 %37 to i32
%putchar46.1 = tail call i32 @putchar(i32 %conv29.1)
%38 = load i8, ptr getelementptr inbounds ([5 x [20 x i8]], ptr @ans, i64 0, i64 2), align 8, !tbaa !5
%conv29.2 = sext i8 %38 to i32
%putchar46.2 = tail call i32 @putchar(i32 %conv29.2)
%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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !10, !11}
!13 = distinct !{!13, !9, !11, !10}
!14 = distinct !{!14, !9, !10, !11}
!15 = distinct !{!15, !9, !10, !11}
!16 = distinct !{!16, !9, !11, !10}
!17 = distinct !{!17, !9, !10, !11}
!18 = distinct !{!18, !9, !10, !11}
!19 = distinct !{!19, !9, !11, !10}
|
#include<stdio.h>
int main()
{
int a;
long b,n;
scanf("%d %ld %ld",&a,&b,&n);
long min = 0;
if(b-1 > n){
min = n;
}else{
min = b-1;
}
printf("%lld",(a*min)/b);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264287/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264287/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, 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 %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%0 = load i64, ptr %b, align 8, !tbaa !5
%sub = add nsw i64 %0, -1
%1 = load i64, ptr %n, align 8, !tbaa !5
%.sub = call i64 @llvm.smin.i64(i64 %sub, i64 %1)
%2 = load i32, ptr %a, align 4, !tbaa !9
%conv = sext i32 %2 to i64
%mul = mul nsw i64 %.sub, %conv
%div = sdiv i64 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, 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 i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
void main()
{
long int t,n;
scanf("%ld",&t);
while(t--)
{
scanf("%ld",&n);
printf("%ld\n",n);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26433/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26433/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec3 = add nsw i64 %0, -1
store i64 %dec3, ptr %t, align 8, !tbaa !5
%tobool.not4 = icmp eq i64 %0, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1)
%2 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %2, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %2, 0
br i1 %tobool.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 %n) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdint.h>
#include <math.h>
int main()
{
int64_t a, b, n;
int64_t t;
scanf("%ld %ld %ld",&a, &b, &n);
if (n >= b) {
t = b - 1;
} else {
t = n;
}
printf("%ld\n", (int64_t)(floor(a*t/b) - a*floor(t/b)));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264373/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264373/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld %ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%n = 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 %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp.not = icmp slt i64 %0, %1
%sub = add nsw i64 %1, -1
%t.0 = select i1 %cmp.not, i64 %0, i64 %sub
%2 = load i64, ptr %a, align 8, !tbaa !5
%mul = mul nsw i64 %t.0, %2
%div = sdiv i64 %mul, %1
%conv = sitofp i64 %div to double
%conv1 = sitofp i64 %2 to double
%div2 = sdiv i64 %t.0, %1
%conv3 = sitofp i64 %div2 to double
%neg = fneg double %conv1
%3 = call double @llvm.fmuladd.f64(double %neg, double %conv3, double %conv)
%conv5 = fptosi double %3 to i64
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %conv5)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define inf 100000000
#define INF 9223372036854775807
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
int mod=(int)1e09+7;
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
double din(void){
double i;scanf("%lf",&i);
return i;
}
void chin(char s[]){
scanf("%s",s);
}
void print(int a){
printf("%d\n",a);
}
void llprint(long long a){
printf("%lld\n",a);
}
void dprint(double a){
printf("%.10f\n",a);
}
void print2(int a,int b){
printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
return a>b?a:b;
}
long long min(long long a,long long b){
return a<b?a:b;
}
int cmp(const void *a,const void *b){
return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
long long gcd(long long x,long long y){
return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
return x/gcd(x,y)*y;
}
// write codes below this
// when you use 'sort',
// make sure TYPE macro is correct
int main(void){
int i,j,l,c,ans=inf,m;
char s[101];
chin(s);
l=strlen(s);
for(j='a';j<='z';j++){
m=c=0;
rep(i,l){
if(s[i]==j){
m=max(m,c);
c=0;
}
else c++;
}
m=max(m,c);
ans=min(ans,m);
}
print(ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264445/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264445/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr global i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #10
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #10
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #10
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #11
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #11
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #7 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #8 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse ]
%y.tr = phi i64 [ %y, %entry ], [ %rem, %tailrecurse ]
%rem = srem i64 %x.tr, %y.tr
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i64 %y.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %x, i64 noundef %y) local_unnamed_addr #8 {
entry:
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%x.tr.i = phi i64 [ %x, %entry ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i = phi i64 [ %y, %entry ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i64 %x.tr.i, %y.tr.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %tailrecurse.i
gcd.exit: ; preds = %tailrecurse.i
%div = sdiv i64 %x, %y.tr.i
%mul = mul nsw i64 %div, %y
ret i64 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #10
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s)
%call = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #11
%conv = trunc i64 %call to i32
%cmp438 = icmp sgt i32 %conv, 0
br i1 %cmp438, label %for.cond3.preheader.us.preheader, label %for.end25
for.cond3.preheader.us.preheader: ; preds = %entry
%wide.trip.count = and i64 %call, 4294967295
%xtraiter = and i64 %call, 1
%0 = icmp eq i64 %wide.trip.count, 1
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond3.preheader.us
for.cond3.preheader.us: ; preds = %for.cond3.preheader.us.preheader, %for.cond3.for.end_crit_edge.us
%ans.044.us = phi i32 [ %8, %for.cond3.for.end_crit_edge.us ], [ 100000000, %for.cond3.preheader.us.preheader ]
%j.043.us = phi i32 [ %inc24.us, %for.cond3.for.end_crit_edge.us ], [ 97, %for.cond3.preheader.us.preheader ]
br i1 %0, label %for.cond3.for.end_crit_edge.us.unr-lcssa, label %for.body6.us
for.body6.us: ; preds = %for.cond3.preheader.us, %for.body6.us
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body6.us ], [ 0, %for.cond3.preheader.us ]
%m.041.us = phi i32 [ %m.1.us.1, %for.body6.us ], [ 0, %for.cond3.preheader.us ]
%c.040.us = phi i32 [ %c.1.us.1, %for.body6.us ], [ 0, %for.cond3.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body6.us ], [ 0, %for.cond3.preheader.us ]
%arrayidx.us = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx.us, align 2, !tbaa !13
%conv7.us = sext i8 %1 to i32
%cmp8.us = icmp eq i32 %j.043.us, %conv7.us
%2 = call i32 @llvm.smax.i32(i32 %m.041.us, i32 %c.040.us)
%inc.us = add nsw i32 %c.040.us, 1
%c.1.us = select i1 %cmp8.us, i32 0, i32 %inc.us
%m.1.us = select i1 %cmp8.us, i32 %2, i32 %m.041.us
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.us.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx.us.1, align 1, !tbaa !13
%conv7.us.1 = sext i8 %3 to i32
%cmp8.us.1 = icmp eq i32 %j.043.us, %conv7.us.1
%4 = call i32 @llvm.smax.i32(i32 %m.1.us, i32 %c.1.us)
%inc.us.1 = add nsw i32 %c.1.us, 1
%c.1.us.1 = select i1 %cmp8.us.1, i32 0, i32 %inc.us.1
%m.1.us.1 = select i1 %cmp8.us.1, i32 %4, i32 %m.1.us
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond3.for.end_crit_edge.us.unr-lcssa, label %for.body6.us, !llvm.loop !14
for.cond3.for.end_crit_edge.us.unr-lcssa: ; preds = %for.body6.us, %for.cond3.preheader.us
%c.1.us.lcssa.ph = phi i32 [ undef, %for.cond3.preheader.us ], [ %c.1.us.1, %for.body6.us ]
%m.1.us.lcssa.ph = phi i32 [ undef, %for.cond3.preheader.us ], [ %m.1.us.1, %for.body6.us ]
%indvars.iv.unr = phi i64 [ 0, %for.cond3.preheader.us ], [ %indvars.iv.next.1, %for.body6.us ]
%m.041.us.unr = phi i32 [ 0, %for.cond3.preheader.us ], [ %m.1.us.1, %for.body6.us ]
%c.040.us.unr = phi i32 [ 0, %for.cond3.preheader.us ], [ %c.1.us.1, %for.body6.us ]
br i1 %lcmp.mod.not, label %for.cond3.for.end_crit_edge.us, label %for.body6.us.epil
for.body6.us.epil: ; preds = %for.cond3.for.end_crit_edge.us.unr-lcssa
%arrayidx.us.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%5 = load i8, ptr %arrayidx.us.epil, align 1, !tbaa !13
%conv7.us.epil = sext i8 %5 to i32
%cmp8.us.epil = icmp eq i32 %j.043.us, %conv7.us.epil
%6 = call i32 @llvm.smax.i32(i32 %m.041.us.unr, i32 %c.040.us.unr)
%inc.us.epil = add nsw i32 %c.040.us.unr, 1
%c.1.us.epil = select i1 %cmp8.us.epil, i32 0, i32 %inc.us.epil
%m.1.us.epil = select i1 %cmp8.us.epil, i32 %6, i32 %m.041.us.unr
br label %for.cond3.for.end_crit_edge.us
for.cond3.for.end_crit_edge.us: ; preds = %for.cond3.for.end_crit_edge.us.unr-lcssa, %for.body6.us.epil
%c.1.us.lcssa = phi i32 [ %c.1.us.lcssa.ph, %for.cond3.for.end_crit_edge.us.unr-lcssa ], [ %c.1.us.epil, %for.body6.us.epil ]
%m.1.us.lcssa = phi i32 [ %m.1.us.lcssa.ph, %for.cond3.for.end_crit_edge.us.unr-lcssa ], [ %m.1.us.epil, %for.body6.us.epil ]
%7 = call i32 @llvm.smax.i32(i32 %m.1.us.lcssa, i32 %c.1.us.lcssa)
%8 = call i32 @llvm.smin.i32(i32 %ans.044.us, i32 %7)
%inc24.us = add nuw nsw i32 %j.043.us, 1
%exitcond48.not = icmp eq i32 %inc24.us, 123
br i1 %exitcond48.not, label %for.end25, label %for.cond3.preheader.us, !llvm.loop !16
for.end25: ; preds = %for.cond3.for.end_crit_edge.us, %entry
%.us-phi = phi i32 [ 0, %entry ], [ %8, %for.cond3.for.end_crit_edge.us ]
%call.i37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #10
ret i32 0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #9
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
|
#include <stdio.h>
int main(void) {
// your code goes here
int t;
scanf("%d",&t);
for(int i=0;i<t;i++){
int n;
scanf("%d",&n);
printf("%d\n",n);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
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)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
%inc = add nuw nsw i32 %i.05, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
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>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
int UF[100000];
int func(int c){
if(c != UF[c]){
UF[c] = func(UF[c]);
}
return UF[c];
}
void u(int a, int b){
UF[func(a)] = UF[func(b)];
}
int cmp_0(const void *a, const void *b){
return (*(int(*)[3])a)[0] - (*(int(*)[3])b)[0];
}
int cmp_1(const void *a, const void *b){
return (*(int(*)[3])a)[1] - (*(int(*)[3])b)[1];
}
int main(void){
int N;
int cities[100000][3], roads[200000][3];
scanf("%d", &N);
int x[N], y[N];
for(int i = 0; i < N; i++){
scanf("%d%d", &x[i], &y[i]);
cities[i][0] = x[i];
cities[i][1] = y[i];
cities[i][2] = i;
}
qsort(cities, N, sizeof(int[3]), cmp_0);
for(int i = 0; i < N-1; i++){
roads[i][0] = cities[i+1][0]-cities[i][0];
roads[i][1] = cities[i][2];
roads[i][2] = cities[i+1][2];
}
qsort(cities, N, sizeof(int[3]), cmp_1);
for(int i = 0; i < N-1; i++){
roads[i+N-1][0] = cities[i+1][1] - cities[i][1];
roads[i+N-1][1] = cities[i][2];
roads[i+N-1][2] = cities[i+1][2];
}
qsort(roads, 2*N-2, sizeof(int[3]), cmp_0);
for(int i = 0; i < 100000; i++){
UF[i] = i;
}
int cost = 0;
int X, Y;
for(int i = 0; i < 2 * N - 2; i++){
X = roads[i][1];
Y = roads[i][2];
if(func(X) != func(Y)){
u(X, Y);
cost += roads[i][0];
}
}
printf("%d\n", cost);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264553/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264553/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@UF = dso_local local_unnamed_addr global [100000 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: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @func(i32 noundef %c) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %c to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %c
br i1 %cmp.not, label %common.ret, label %if.then
common.ret: ; preds = %entry, %if.then
%common.ret.op = phi i32 [ %call, %if.then ], [ %c, %entry ]
ret i32 %common.ret.op
if.then: ; preds = %entry
%call = tail call i32 @func(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @u(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%call = tail call i32 @func(i32 noundef %b)
%idxprom = sext i32 %call to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call1 = tail call i32 @func(i32 noundef %a)
%idxprom2 = sext i32 %call1 to i64
%arrayidx3 = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %idxprom2
store i32 %0, ptr %arrayidx3, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_0(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #2 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_1(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #2 {
entry:
%arrayidx = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %b, i64 0, i64 1
%1 = load i32, ptr %arrayidx1, 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 #3 {
entry:
%N = alloca i32, align 4
%cities = alloca [100000 x [3 x i32]], align 16
%roads = alloca [200000 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #8
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %cities) #8
call void @llvm.lifetime.start.p0(i64 2400000, ptr nonnull %roads) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp169 = icmp sgt i32 %3, 0
br i1 %cmp169, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre203 = 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 [ %.pre203, %entry.for.cond.cleanup_crit_edge ], [ %10, %for.body ]
call void @qsort(ptr noundef nonnull %cities, i64 noundef %conv.pre-phi, i64 noundef 12, ptr noundef nonnull @cmp_0) #8
%5 = load i32, ptr %N, align 4, !tbaa !5
%cmp20171 = icmp sgt i32 %5, 1
br i1 %cmp20171, label %for.body23.preheader, label %for.cond.cleanup22
for.body23.preheader: ; preds = %for.cond.cleanup
%sub = add nsw i32 %5, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %cities, align 16, !tbaa !5
%arrayidx36.phi.trans.insert = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 0, i64 2
%.pre200 = load i32, ptr %arrayidx36.phi.trans.insert, align 8, !tbaa !5
br label %for.body23
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
%arrayidx3 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx8 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv
store i32 %6, ptr %arrayidx8, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv, i64 1
store i32 %7, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv, i64 2
%8 = trunc i64 %indvars.iv to i32
store i32 %8, ptr %arrayidx17, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp = icmp slt i64 %indvars.iv.next, %10
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup22: ; preds = %for.body23, %for.cond.cleanup
%conv51 = sext i32 %5 to i64
call void @qsort(ptr noundef nonnull %cities, i64 noundef %conv51, i64 noundef 12, ptr noundef nonnull @cmp_1) #8
%11 = load i32, ptr %N, align 4, !tbaa !5
%sub54 = add i32 %11, -1
%cmp55174 = icmp sgt i32 %11, 1
br i1 %cmp55174, label %for.body58.lr.ph, label %for.cond.cleanup57
for.body58.lr.ph: ; preds = %for.cond.cleanup22
%wide.trip.count191 = zext i32 %sub54 to i64
%arrayidx65.phi.trans.insert = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 0, i64 1
%.pre201 = load i32, ptr %arrayidx65.phi.trans.insert, align 4, !tbaa !5
%arrayidx74.phi.trans.insert = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 0, i64 2
%.pre202 = load i32, ptr %arrayidx74.phi.trans.insert, align 8, !tbaa !5
br label %for.body58
for.body23: ; preds = %for.body23.preheader, %for.body23
%12 = phi i32 [ %.pre200, %for.body23.preheader ], [ %15, %for.body23 ]
%13 = phi i32 [ %.pre, %for.body23.preheader ], [ %14, %for.body23 ]
%indvars.iv185 = phi i64 [ 0, %for.body23.preheader ], [ %indvars.iv.next186, %for.body23 ]
%indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
%arrayidx25 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv.next186
%14 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%sub30 = sub nsw i32 %14, %13
%arrayidx32 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %indvars.iv185
store i32 %sub30, ptr %arrayidx32, align 4, !tbaa !5
%arrayidx39 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %indvars.iv185, i64 1
store i32 %12, ptr %arrayidx39, align 4, !tbaa !5
%arrayidx43 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv.next186, i64 2
%15 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%arrayidx46 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %indvars.iv185, i64 2
store i32 %15, ptr %arrayidx46, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next186, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup22, label %for.body23, !llvm.loop !11
for.cond.cleanup57: ; preds = %for.body58, %for.cond.cleanup22
%mul = shl nsw i32 %11, 1
%sub93 = add nsw i32 %mul, -2
%conv94 = sext i32 %sub93 to i64
call void @qsort(ptr noundef nonnull %roads, i64 noundef %conv94, i64 noundef 12, ptr noundef nonnull @cmp_0) #8
br label %vector.body
vector.body: ; preds = %vector.body, %for.cond.cleanup57
%index = phi i64 [ 0, %for.cond.cleanup57 ], [ %index.next.1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %for.cond.cleanup57 ], [ %vec.ind.next.1, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%16 = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %16, align 16, !tbaa !5
%17 = getelementptr inbounds i32, ptr %16, i64 4
store <4 x i32> %step.add, ptr %17, align 16, !tbaa !5
%index.next = or i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%step.add.1 = add <4 x i32> %vec.ind, <i32 12, i32 12, i32 12, i32 12>
%18 = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %index.next
store <4 x i32> %vec.ind.next, ptr %18, align 16, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
store <4 x i32> %step.add.1, ptr %19, 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>
%20 = icmp eq i64 %index.next.1, 100000
br i1 %20, label %for.cond107.preheader, label %vector.body, !llvm.loop !12
for.body58: ; preds = %for.body58.lr.ph, %for.body58
%21 = phi i32 [ %.pre202, %for.body58.lr.ph ], [ %25, %for.body58 ]
%22 = phi i32 [ %.pre201, %for.body58.lr.ph ], [ %23, %for.body58 ]
%indvars.iv188 = phi i64 [ 0, %for.body58.lr.ph ], [ %indvars.iv.next189, %for.body58 ]
%indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
%arrayidx62 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv.next189, i64 1
%23 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%sub66 = sub nsw i32 %23, %22
%24 = trunc i64 %indvars.iv188 to i32
%sub68 = add i32 %sub54, %24
%idxprom69 = sext i32 %sub68 to i64
%arrayidx70 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %idxprom69
store i32 %sub66, ptr %arrayidx70, align 4, !tbaa !5
%arrayidx79 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %idxprom69, i64 1
store i32 %21, ptr %arrayidx79, align 4, !tbaa !5
%arrayidx83 = getelementptr inbounds [100000 x [3 x i32]], ptr %cities, i64 0, i64 %indvars.iv.next189, i64 2
%25 = load i32, ptr %arrayidx83, align 4, !tbaa !5
%arrayidx88 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %idxprom69, i64 2
store i32 %25, ptr %arrayidx88, align 4, !tbaa !5
%exitcond192.not = icmp eq i64 %indvars.iv.next189, %wide.trip.count191
br i1 %exitcond192.not, label %for.cond.cleanup57, label %for.body58, !llvm.loop !15
for.cond107.preheader: ; preds = %vector.body
%26 = load i32, ptr %N, align 4, !tbaa !5
%cmp110180 = icmp sgt i32 %26, 1
br i1 %cmp110180, label %for.body113, label %for.cond.cleanup112
for.cond.cleanup112: ; preds = %for.inc128, %for.cond107.preheader
%cost.0.lcssa = phi i32 [ 0, %for.cond107.preheader ], [ %cost.1, %for.inc128 ]
%call131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cost.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 2400000, ptr nonnull %roads) #8
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %cities) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #8
ret i32 0
for.body113: ; preds = %for.cond107.preheader, %for.inc128
%indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.inc128 ], [ 0, %for.cond107.preheader ]
%cost.0181 = phi i32 [ %cost.1, %for.inc128 ], [ 0, %for.cond107.preheader ]
%arrayidx116 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %indvars.iv197, i64 1
%27 = load i32, ptr %arrayidx116, align 4, !tbaa !5
%arrayidx119 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %indvars.iv197, i64 2
%28 = load i32, ptr %arrayidx119, align 4, !tbaa !5
%call120 = call i32 @func(i32 noundef %27)
%call121 = call i32 @func(i32 noundef %28)
%cmp122.not = icmp eq i32 %call120, %call121
br i1 %cmp122.not, label %for.inc128, label %if.then
if.then: ; preds = %for.body113
%arrayidx115 = getelementptr inbounds [200000 x [3 x i32]], ptr %roads, i64 0, i64 %indvars.iv197
%call.i = call i32 @func(i32 noundef %28)
%idxprom.i = sext i32 %call.i to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %idxprom.i
%29 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call1.i = call i32 @func(i32 noundef %27)
%idxprom2.i = sext i32 %call1.i to i64
%arrayidx3.i = getelementptr inbounds [100000 x i32], ptr @UF, i64 0, i64 %idxprom2.i
store i32 %29, ptr %arrayidx3.i, align 4, !tbaa !5
%30 = load i32, ptr %arrayidx115, align 4, !tbaa !5
%add127 = add nsw i32 %30, %cost.0181
br label %for.inc128
for.inc128: ; preds = %for.body113, %if.then
%cost.1 = phi i32 [ %add127, %if.then ], [ %cost.0181, %for.body113 ]
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%31 = load i32, ptr %N, align 4, !tbaa !5
%mul108 = shl nsw i32 %31, 1
%sub109 = add nsw i32 %mul108, -2
%32 = sext i32 %sub109 to i64
%cmp110 = icmp slt i64 %indvars.iv.next198, %32
br i1 %cmp110, label %for.body113, label %for.cond.cleanup112, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6
; 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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
|
#include <stdio.h>
#include <stdlib.h>
int compare_int(const void *a,const void *b){
if(*(long long*)a > *(long long*)b) return 1;
return -1;
}
int main(void){
long long N, C, K;
scanf("%lld%lld%lld", &N, &C, &K);
long long T[N];
for (int i = 0; i < N; i++) {
scanf("%lld", &T[i]);
}
qsort(T, N, sizeof(long long), compare_int);
int ans = 0, cnt = 0, time = T[0];
for (int i = 0; i < N; i++) {
cnt++;
if(time+K < T[i]){
ans++;
cnt = 1;
time = T[i];
}else if(cnt == C){
ans++;
cnt = 0;
time = T[i+1];
}
}
if(cnt != 0) ans++;
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264597/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264597/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.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_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
%. = select i1 %cmp, i32 1, i32 -1
ret i32 %.
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i64, align 8
%C = alloca i64, align 8
%K = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %C, ptr noundef nonnull %K)
%0 = load i64, ptr %N, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %N, align 8, !tbaa !5
%cmp53 = icmp sgt i64 %2, 0
br i1 %cmp53, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %2, %entry ], [ %7, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @compare_int) #6
%3 = load i64, ptr %N, align 8, !tbaa !5
%cmp856 = icmp sgt i64 %3, 0
br i1 %cmp856, label %for.body11.lr.ph, label %for.cond.cleanup10
for.body11.lr.ph: ; preds = %for.cond.cleanup
%4 = load i64, ptr %vla, align 16, !tbaa !5
%conv4 = trunc i64 %4 to i32
%5 = load i64, ptr %K, align 8, !tbaa !5
%6 = load i64, ptr %C, align 8
%invariant.gep = getelementptr i64, ptr %vla, i64 1
br label %for.body11
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%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
%7 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp sgt i64 %7, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup10.loopexit: ; preds = %for.inc32
%8 = icmp ne i32 %cnt.1, 0
%9 = zext i1 %8 to i32
%10 = add nsw i32 %ans.1, %9
br label %for.cond.cleanup10
for.cond.cleanup10: ; preds = %for.cond.cleanup10.loopexit, %for.cond.cleanup
%spec.select = phi i32 [ 0, %for.cond.cleanup ], [ %10, %for.cond.cleanup10.loopexit ]
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #6
ret i32 0
for.body11: ; preds = %for.body11.lr.ph, %for.inc32
%indvars.iv66 = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next67, %for.inc32 ]
%time.059 = phi i32 [ %conv4, %for.body11.lr.ph ], [ %time.1, %for.inc32 ]
%cnt.058 = phi i32 [ 0, %for.body11.lr.ph ], [ %cnt.1, %for.inc32 ]
%ans.057 = phi i32 [ 0, %for.body11.lr.ph ], [ %ans.1, %for.inc32 ]
%conv13 = sext i32 %time.059 to i64
%add = add nsw i64 %5, %conv13
%arrayidx15 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv66
%11 = load i64, ptr %arrayidx15, align 8, !tbaa !5
%cmp16 = icmp slt i64 %add, %11
br i1 %cmp16, label %if.then, label %if.else
if.then: ; preds = %for.body11
%inc18 = add nsw i32 %ans.057, 1
%conv21 = trunc i64 %11 to i32
br label %for.inc32
if.else: ; preds = %for.body11
%inc12 = add nsw i32 %cnt.058, 1
%conv22 = sext i32 %inc12 to i64
%cmp23 = icmp eq i64 %6, %conv22
br i1 %cmp23, label %if.then25, label %for.inc32
if.then25: ; preds = %if.else
%inc26 = add nsw i32 %ans.057, 1
%gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv66
%12 = load i64, ptr %gep, align 8, !tbaa !5
%conv30 = trunc i64 %12 to i32
br label %for.inc32
for.inc32: ; preds = %if.then, %if.then25, %if.else
%ans.1 = phi i32 [ %inc18, %if.then ], [ %inc26, %if.then25 ], [ %ans.057, %if.else ]
%cnt.1 = phi i32 [ 1, %if.then ], [ 0, %if.then25 ], [ %inc12, %if.else ]
%time.1 = phi i32 [ %conv21, %if.then ], [ %conv30, %if.then25 ], [ %time.059, %if.else ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond.not = icmp eq i64 %indvars.iv.next67, %3
br i1 %exitcond.not, label %for.cond.cleanup10.loopexit, label %for.body11, !llvm.loop !11
}
; 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
long long int t, i, n;
scanf("%lld", &t);
for(i=1; i<=t; i++)
{
scanf("%lld", &n);
printf("%lld\n", n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26464/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26464/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%cmp.not4 = icmp slt i64 %0, 1
br i1 %cmp.not4, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%i.05 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1)
%inc = add nuw nsw i64 %i.05, 1
%2 = load i64, ptr %t, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.05, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int i, t = 0, n, p, a[50], koisi;
while(t != 1){
scanf("%d%d",&n,&p);
if(n != 0){
for(i = 0; i < n; i++){
a[i] = 0;
}
koisi = p;
i = 0;
while(i < 100){
if(koisi > 0){
a[i] += 1;
koisi -= 1;
}
else{
koisi = a[i];
a[i] = 0;
}
if(i == n-1){
i = 0;
}
else{
i += 1;
}
if(a[i] > 0 && a[i] == p){
printf("%d\n", i);
break;
}
}
}
if(n == 0){
t = 1;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264683/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264683/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%p = alloca i32, align 4
%a = alloca [50 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 %p) #4
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %a) #4
br label %while.body.critedge
select.unfold: ; preds = %while.body.critedge, %if.end29
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
while.body.critedge: ; preds = %if.end29, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1.not = icmp eq i32 %0, 0
br i1 %cmp1.not, label %select.unfold, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body.critedge
%cmp247 = icmp sgt i32 %0, 0
br i1 %cmp247, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %a, i8 0, i64 %2, i1 false), !tbaa !5
br label %for.end
for.end: ; preds = %for.body.preheader, %for.cond.preheader
%3 = load i32, ptr %p, align 4
%sub14 = add nsw i32 %0, -1
br label %while.cond3
while.cond3: ; preds = %if.end, %for.end
%i.1 = phi i32 [ 0, %for.end ], [ %i.2, %if.end ]
%koisi.0 = phi i32 [ %3, %for.end ], [ %koisi.1, %if.end ]
%cmp4 = icmp slt i32 %i.1, 100
br i1 %cmp4, label %while.body5, label %if.end29
while.body5: ; preds = %while.cond3
%cmp6 = icmp sgt i32 %koisi.0, 0
%idxprom8 = sext i32 %i.1 to i64
%arrayidx9 = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %idxprom8
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
br i1 %cmp6, label %if.then7, label %if.else
if.then7: ; preds = %while.body5
%add = add nsw i32 %4, 1
store i32 %add, ptr %arrayidx9, align 4, !tbaa !5
%sub = add nsw i32 %koisi.0, -1
br label %if.end
if.else: ; preds = %while.body5
store i32 0, ptr %arrayidx9, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then7
%koisi.1 = phi i32 [ %sub, %if.then7 ], [ %4, %if.else ]
%cmp15 = icmp eq i32 %i.1, %sub14
%add18 = add nsw i32 %i.1, 1
%i.2 = select i1 %cmp15, i32 0, i32 %add18
%idxprom20 = sext i32 %i.2 to i64
%arrayidx21 = getelementptr inbounds [50 x i32], ptr %a, i64 0, i64 %idxprom20
%5 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %5, 0
%cmp25 = icmp eq i32 %5, %3
%or.cond = select i1 %cmp22, i1 %cmp25, i1 false
br i1 %or.cond, label %if.then26, label %while.cond3, !llvm.loop !9
if.then26: ; preds = %if.end
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.2)
%.pr.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end29
if.end29: ; preds = %while.cond3, %if.then26
%.pr = phi i32 [ %.pr.pre, %if.then26 ], [ 1, %while.cond3 ]
%cmp30 = icmp eq i32 %.pr, 0
br i1 %cmp30, label %select.unfold, label %while.body.critedge
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#define N 50
int
main (
int argc,
char *argv[ ]
)
{
int i;
for ( ; ; )
{
int d[ N ] = { };
int n, p;
int r;
scanf ( "%d%d", &n, &p );
if ( n == 0 && p == 0 )
break ;
r = p;
for ( i = 0; ; i = ( i + 1 ) % n )
{
if ( r == 0 )
{
r = d[ i ];
d[ i ] = 0;
}
else
{
--r;
++d[ i ];
}
if ( d[ i ] == p )
{
printf ( "%d\n", i );
break ;
}
}
}
return ( EXIT_SUCCESS );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264740/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264740/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%d = alloca [50 x i32], align 16
%n = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %d) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %d, i8 0, i64 200, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp eq i32 %0, 0
%1 = load i32, ptr %p, align 4
%cmp131 = icmp eq i32 %1, 0
%or.cond32 = select i1 %cmp30, i1 %cmp131, i1 false
br i1 %or.cond32, label %for.end19, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %cleanup
%2 = phi i32 [ %8, %cleanup ], [ %1, %entry ]
%3 = phi i32 [ %7, %cleanup ], [ %0, %entry ]
br label %for.cond2
for.cond2: ; preds = %for.cond2.preheader, %for.inc
%i.0 = phi i32 [ %rem, %for.inc ], [ 0, %for.cond2.preheader ]
%r.0 = phi i32 [ %r.1, %for.inc ], [ %2, %for.cond2.preheader ]
%cmp3 = icmp eq i32 %r.0, 0
br i1 %cmp3, label %if.then4, label %if.else
if.then4: ; preds = %for.cond2
%idxprom = sext i32 %i.0 to i64
%arrayidx = getelementptr inbounds [50 x i32], ptr %d, i64 0, i64 %idxprom
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
store i32 0, ptr %arrayidx, align 4, !tbaa !5
br label %if.end9
if.else: ; preds = %for.cond2
%dec = add nsw i32 %r.0, -1
%idxprom7 = sext i32 %i.0 to i64
%arrayidx8 = getelementptr inbounds [50 x i32], ptr %d, i64 0, i64 %idxprom7
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%inc = add nsw i32 %5, 1
store i32 %inc, ptr %arrayidx8, align 4, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.else, %if.then4
%6 = phi i32 [ %inc, %if.else ], [ 0, %if.then4 ]
%r.1 = phi i32 [ %dec, %if.else ], [ %4, %if.then4 ]
%cmp12 = icmp eq i32 %6, %2
br i1 %cmp12, label %cleanup, label %for.inc
for.inc: ; preds = %if.end9
%add = add nsw i32 %i.0, 1
%rem = srem i32 %add, %3
br label %for.cond2
cleanup: ; preds = %if.end9
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %d) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %d, i8 0, i64 200, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %p)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
%8 = load i32, ptr %p, align 4
%cmp1 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %for.end19, label %for.cond2.preheader
for.end19: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %d) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main ()
{
int a,i;
scanf("%d", &a);
int ara[a];
for(i=0;i<a;i++) {
scanf("%d", &ara[i]);
}
for(i=0;i<a;i++) {
printf("%d\n", ara[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, 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 %a, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %3, 0
br i1 %cmp16, label %for.body, label %for.end10
for.cond2.preheader: ; preds = %for.body
%4 = icmp sgt i32 %5, 0
br i1 %4, label %for.body4, label %for.end10
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
%5 = load i32, ptr %a, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv21 = phi i64 [ %indvars.iv.next22, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv21
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next22 = add nuw nsw i64 %indvars.iv21, 1
%8 = load i32, ptr %a, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp3 = icmp slt i64 %indvars.iv.next22, %9
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.body4, %entry, %for.cond2.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<limits.h>
#define LIM 667000
int P,C[6] = {1,5,10,50,100,500};
int N[6],R[6],limit;
int clerk[LIM];
int i,j;
int getChange(int sum){ // clerk
int ret = 0;
int l;
for(l=5;l>=0;l--){
if(sum >= C[l]){
ret += sum/C[l];
sum -= sum/C[l]*C[l];
}
}
return ret;
}
int getChangeBy(int sum){
int ret = 0;
int index = sum;
int e;
for(e = 0;e<6;e++)R[e] = 0;
for(e=5;e>=0;e--){
if(sum >= C[e] && N[e] != 0){
R[e] = sum/C[e]>N[e]?N[e]:sum/C[e];
sum -= R[e]*C[e];
ret += R[e];
}
}
if(sum != 0)return -1;
return ret;
}
void createChange(){
for(i=0;i<LIM;i++)clerk[i] = 0;
int B,f;
for(f=1;f<666001;f++){
B = getChange(f);
clerk[f] = B;
//if(f < 100)printf("%d\n",clerk[f]);
}
}
int main(){
createChange();
while(scanf("%d",&P) && P){
int cnt,pay,ans,res;
limit = 0;
int u;
for(u=0;u<6;u++){
scanf("%d",&N[u]);
limit += N[u]*C[u];
}
ans = INT_MAX;
for(i=0;i<limit;i++)clerk[i] = -1;
for(i=P;i<=P+500;i++){
cnt = getChangeBy(i);
if(cnt == -1 || ans <= cnt)continue;
pay = 0;
for(j = 0;j<6;j++)pay += C[j]*R[j];
if(clerk[pay-P] == -1)clerk[pay-P] = getChange(pay-P);
if(cnt+clerk[pay-P] < ans){
ans = cnt+clerk[pay-P];
}
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264863/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264863/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@C = dso_local local_unnamed_addr global [6 x i32] [i32 1, i32 5, i32 10, i32 50, i32 100, i32 500], align 16
@R = dso_local local_unnamed_addr global [6 x i32] zeroinitializer, align 16
@N = dso_local global [6 x i32] zeroinitializer, align 16
@i = dso_local local_unnamed_addr global i32 0, align 4
@clerk = dso_local local_unnamed_addr global [667000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@P = dso_local global i32 0, align 4
@limit = dso_local local_unnamed_addr global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @getChange(i32 noundef %sum) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %0, %sum
br i1 %cmp1.not, label %for.inc, label %if.then
if.then: ; preds = %entry
%div = sdiv i32 %sum, %0
%mul = mul nsw i32 %div, %0
%sub.recomposed = srem i32 %sum, %0
br label %for.inc
for.inc: ; preds = %entry, %if.then
%sum.addr.1 = phi i32 [ %sub.recomposed, %if.then ], [ %sum, %entry ]
%ret.1 = phi i32 [ %div, %if.then ], [ 0, %entry ]
%1 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%cmp1.not.1 = icmp slt i32 %sum.addr.1, %1
br i1 %cmp1.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%div.1 = sdiv i32 %sum.addr.1, %1
%add.1 = add nsw i32 %div.1, %ret.1
%mul.1 = mul nsw i32 %div.1, %1
%sub.1.recomposed = srem i32 %sum.addr.1, %1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%sum.addr.1.1 = phi i32 [ %sub.1.recomposed, %if.then.1 ], [ %sum.addr.1, %for.inc ]
%ret.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %ret.1, %for.inc ]
%2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%cmp1.not.2 = icmp slt i32 %sum.addr.1.1, %2
br i1 %cmp1.not.2, label %for.inc.2, label %if.then.2
if.then.2: ; preds = %for.inc.1
%div.2 = sdiv i32 %sum.addr.1.1, %2
%add.2 = add nsw i32 %div.2, %ret.1.1
%mul.2 = mul nsw i32 %div.2, %2
%sub.2.recomposed = srem i32 %sum.addr.1.1, %2
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%sum.addr.1.2 = phi i32 [ %sub.2.recomposed, %if.then.2 ], [ %sum.addr.1.1, %for.inc.1 ]
%ret.1.2 = phi i32 [ %add.2, %if.then.2 ], [ %ret.1.1, %for.inc.1 ]
%3 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%cmp1.not.3 = icmp slt i32 %sum.addr.1.2, %3
br i1 %cmp1.not.3, label %for.inc.3, label %if.then.3
if.then.3: ; preds = %for.inc.2
%div.3 = sdiv i32 %sum.addr.1.2, %3
%add.3 = add nsw i32 %div.3, %ret.1.2
%mul.3 = mul nsw i32 %div.3, %3
%sub.3.recomposed = srem i32 %sum.addr.1.2, %3
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%sum.addr.1.3 = phi i32 [ %sub.3.recomposed, %if.then.3 ], [ %sum.addr.1.2, %for.inc.2 ]
%ret.1.3 = phi i32 [ %add.3, %if.then.3 ], [ %ret.1.2, %for.inc.2 ]
%4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%cmp1.not.4 = icmp slt i32 %sum.addr.1.3, %4
br i1 %cmp1.not.4, label %for.inc.4, label %if.then.4
if.then.4: ; preds = %for.inc.3
%div.4 = sdiv i32 %sum.addr.1.3, %4
%add.4 = add nsw i32 %div.4, %ret.1.3
%mul.4 = mul nsw i32 %div.4, %4
%sub.4.recomposed = srem i32 %sum.addr.1.3, %4
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%sum.addr.1.4 = phi i32 [ %sub.4.recomposed, %if.then.4 ], [ %sum.addr.1.3, %for.inc.3 ]
%ret.1.4 = phi i32 [ %add.4, %if.then.4 ], [ %ret.1.3, %for.inc.3 ]
%5 = load i32, ptr @C, align 16, !tbaa !5
%cmp1.not.5 = icmp slt i32 %sum.addr.1.4, %5
br i1 %cmp1.not.5, label %for.inc.5, label %if.then.5
if.then.5: ; preds = %for.inc.4
%div.5 = sdiv i32 %sum.addr.1.4, %5
%add.5 = add nsw i32 %div.5, %ret.1.4
br label %for.inc.5
for.inc.5: ; preds = %if.then.5, %for.inc.4
%ret.1.5 = phi i32 [ %add.5, %if.then.5 ], [ %ret.1.4, %for.inc.4 ]
ret i32 %ret.1.5
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @getChangeBy(i32 noundef %sum) local_unnamed_addr #1 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) @R, i8 0, i64 24, i1 false), !tbaa !5
%0 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %0, %sum
br i1 %cmp6.not, label %for.inc28, label %land.lhs.true
land.lhs.true: ; preds = %entry
%1 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 5), align 4, !tbaa !5
%cmp9.not = icmp eq i32 %1, 0
br i1 %cmp9.not, label %for.inc28, label %if.then
if.then: ; preds = %land.lhs.true
%div = sdiv i32 %sum, %0
%.div = tail call i32 @llvm.smin.i32(i32 %div, i32 %1)
store i32 %.div, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 5), align 4, !tbaa !5
%mul = mul nsw i32 %.div, %0
%sub = sub nsw i32 %sum, %mul
br label %for.inc28
for.inc28: ; preds = %entry, %land.lhs.true, %if.then
%sum.addr.1 = phi i32 [ %sub, %if.then ], [ %sum, %land.lhs.true ], [ %sum, %entry ]
%ret.1 = phi i32 [ %.div, %if.then ], [ 0, %land.lhs.true ], [ 0, %entry ]
%2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%cmp6.not.1 = icmp slt i32 %sum.addr.1, %2
br i1 %cmp6.not.1, label %for.inc28.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.inc28
%3 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 4), align 16, !tbaa !5
%cmp9.not.1 = icmp eq i32 %3, 0
br i1 %cmp9.not.1, label %for.inc28.1, label %if.then.1
if.then.1: ; preds = %land.lhs.true.1
%div.1 = sdiv i32 %sum.addr.1, %2
%.div.1 = tail call i32 @llvm.smin.i32(i32 %div.1, i32 %3)
store i32 %.div.1, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 4), align 16, !tbaa !5
%mul.1 = mul nsw i32 %.div.1, %2
%sub.1 = sub nsw i32 %sum.addr.1, %mul.1
%add.1 = add nsw i32 %.div.1, %ret.1
br label %for.inc28.1
for.inc28.1: ; preds = %if.then.1, %land.lhs.true.1, %for.inc28
%sum.addr.1.1 = phi i32 [ %sub.1, %if.then.1 ], [ %sum.addr.1, %land.lhs.true.1 ], [ %sum.addr.1, %for.inc28 ]
%ret.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %ret.1, %land.lhs.true.1 ], [ %ret.1, %for.inc28 ]
%4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%cmp6.not.2 = icmp slt i32 %sum.addr.1.1, %4
br i1 %cmp6.not.2, label %for.inc28.2, label %land.lhs.true.2
land.lhs.true.2: ; preds = %for.inc28.1
%5 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 3), align 4, !tbaa !5
%cmp9.not.2 = icmp eq i32 %5, 0
br i1 %cmp9.not.2, label %for.inc28.2, label %if.then.2
if.then.2: ; preds = %land.lhs.true.2
%div.2 = sdiv i32 %sum.addr.1.1, %4
%.div.2 = tail call i32 @llvm.smin.i32(i32 %div.2, i32 %5)
store i32 %.div.2, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 3), align 4, !tbaa !5
%mul.2 = mul nsw i32 %.div.2, %4
%sub.2 = sub nsw i32 %sum.addr.1.1, %mul.2
%add.2 = add nsw i32 %.div.2, %ret.1.1
br label %for.inc28.2
for.inc28.2: ; preds = %if.then.2, %land.lhs.true.2, %for.inc28.1
%sum.addr.1.2 = phi i32 [ %sub.2, %if.then.2 ], [ %sum.addr.1.1, %land.lhs.true.2 ], [ %sum.addr.1.1, %for.inc28.1 ]
%ret.1.2 = phi i32 [ %add.2, %if.then.2 ], [ %ret.1.1, %land.lhs.true.2 ], [ %ret.1.1, %for.inc28.1 ]
%6 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%cmp6.not.3 = icmp slt i32 %sum.addr.1.2, %6
br i1 %cmp6.not.3, label %for.inc28.3, label %land.lhs.true.3
land.lhs.true.3: ; preds = %for.inc28.2
%7 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 2), align 8, !tbaa !5
%cmp9.not.3 = icmp eq i32 %7, 0
br i1 %cmp9.not.3, label %for.inc28.3, label %if.then.3
if.then.3: ; preds = %land.lhs.true.3
%div.3 = sdiv i32 %sum.addr.1.2, %6
%.div.3 = tail call i32 @llvm.smin.i32(i32 %div.3, i32 %7)
store i32 %.div.3, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 2), align 8, !tbaa !5
%mul.3 = mul nsw i32 %.div.3, %6
%sub.3 = sub nsw i32 %sum.addr.1.2, %mul.3
%add.3 = add nsw i32 %.div.3, %ret.1.2
br label %for.inc28.3
for.inc28.3: ; preds = %if.then.3, %land.lhs.true.3, %for.inc28.2
%sum.addr.1.3 = phi i32 [ %sub.3, %if.then.3 ], [ %sum.addr.1.2, %land.lhs.true.3 ], [ %sum.addr.1.2, %for.inc28.2 ]
%ret.1.3 = phi i32 [ %add.3, %if.then.3 ], [ %ret.1.2, %land.lhs.true.3 ], [ %ret.1.2, %for.inc28.2 ]
%8 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%cmp6.not.4 = icmp slt i32 %sum.addr.1.3, %8
br i1 %cmp6.not.4, label %for.inc28.4, label %land.lhs.true.4
land.lhs.true.4: ; preds = %for.inc28.3
%9 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 1), align 4, !tbaa !5
%cmp9.not.4 = icmp eq i32 %9, 0
br i1 %cmp9.not.4, label %for.inc28.4, label %if.then.4
if.then.4: ; preds = %land.lhs.true.4
%div.4 = sdiv i32 %sum.addr.1.3, %8
%.div.4 = tail call i32 @llvm.smin.i32(i32 %div.4, i32 %9)
store i32 %.div.4, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 1), align 4, !tbaa !5
%mul.4 = mul nsw i32 %.div.4, %8
%sub.4 = sub nsw i32 %sum.addr.1.3, %mul.4
%add.4 = add nsw i32 %.div.4, %ret.1.3
br label %for.inc28.4
for.inc28.4: ; preds = %if.then.4, %land.lhs.true.4, %for.inc28.3
%sum.addr.1.4 = phi i32 [ %sub.4, %if.then.4 ], [ %sum.addr.1.3, %land.lhs.true.4 ], [ %sum.addr.1.3, %for.inc28.3 ]
%ret.1.4 = phi i32 [ %add.4, %if.then.4 ], [ %ret.1.3, %land.lhs.true.4 ], [ %ret.1.3, %for.inc28.3 ]
%10 = load i32, ptr @C, align 16, !tbaa !5
%cmp6.not.5 = icmp slt i32 %sum.addr.1.4, %10
br i1 %cmp6.not.5, label %for.inc28.5, label %land.lhs.true.5
land.lhs.true.5: ; preds = %for.inc28.4
%11 = load i32, ptr @N, align 16, !tbaa !5
%cmp9.not.5 = icmp eq i32 %11, 0
br i1 %cmp9.not.5, label %for.inc28.5, label %if.then.5
if.then.5: ; preds = %land.lhs.true.5
%div.5 = sdiv i32 %sum.addr.1.4, %10
%.div.5 = tail call i32 @llvm.smin.i32(i32 %div.5, i32 %11)
store i32 %.div.5, ptr @R, align 16, !tbaa !5
%mul.5 = mul nsw i32 %.div.5, %10
%sub.5 = sub nsw i32 %sum.addr.1.4, %mul.5
%add.5 = add nsw i32 %.div.5, %ret.1.4
br label %for.inc28.5
for.inc28.5: ; preds = %if.then.5, %land.lhs.true.5, %for.inc28.4
%sum.addr.1.5 = phi i32 [ %sub.5, %if.then.5 ], [ %sum.addr.1.4, %land.lhs.true.5 ], [ %sum.addr.1.4, %for.inc28.4 ]
%ret.1.5 = phi i32 [ %add.5, %if.then.5 ], [ %ret.1.4, %land.lhs.true.5 ], [ %ret.1.4, %for.inc28.4 ]
%cmp30.not = icmp eq i32 %sum.addr.1.5, 0
%ret.0. = select i1 %cmp30.not, i32 %ret.1.5, i32 -1
ret i32 %ret.0.
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @createChange() local_unnamed_addr #2 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2668000) @clerk, i8 0, i64 2668000, i1 false), !tbaa !5
store i32 667000, ptr @i, align 4, !tbaa !5
%0 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
%1 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%5 = load i32, ptr @C, align 16, !tbaa !5
%6 = sext i32 %0 to i64
br label %for.body3
for.body3: ; preds = %entry, %getChange.exit
%indvars.iv = phi i64 [ 1, %entry ], [ %indvars.iv.next, %getChange.exit ]
%cmp1.not.i = icmp slt i64 %indvars.iv, %6
%7 = trunc i64 %indvars.iv to i32
br i1 %cmp1.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body3
%div.i = sdiv i32 %7, %0
%mul.i = mul nsw i32 %div.i, %0
%sub.i.recomposed = srem i32 %7, %0
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body3
%sum.addr.1.i = phi i32 [ %sub.i.recomposed, %if.then.i ], [ %7, %for.body3 ]
%ret.1.i = phi i32 [ %div.i, %if.then.i ], [ 0, %for.body3 ]
%cmp1.not.1.i = icmp slt i32 %sum.addr.1.i, %1
br i1 %cmp1.not.1.i, label %for.inc.1.i, label %if.then.1.i
if.then.1.i: ; preds = %for.inc.i
%div.1.i = sdiv i32 %sum.addr.1.i, %1
%add.1.i = add nsw i32 %div.1.i, %ret.1.i
%mul.1.i = mul nsw i32 %div.1.i, %1
%sub.1.i.recomposed = srem i32 %sum.addr.1.i, %1
br label %for.inc.1.i
for.inc.1.i: ; preds = %if.then.1.i, %for.inc.i
%sum.addr.1.1.i = phi i32 [ %sub.1.i.recomposed, %if.then.1.i ], [ %sum.addr.1.i, %for.inc.i ]
%ret.1.1.i = phi i32 [ %add.1.i, %if.then.1.i ], [ %ret.1.i, %for.inc.i ]
%cmp1.not.2.i = icmp slt i32 %sum.addr.1.1.i, %2
br i1 %cmp1.not.2.i, label %for.inc.2.i, label %if.then.2.i
if.then.2.i: ; preds = %for.inc.1.i
%div.2.i = sdiv i32 %sum.addr.1.1.i, %2
%add.2.i = add nsw i32 %div.2.i, %ret.1.1.i
%mul.2.i = mul nsw i32 %div.2.i, %2
%sub.2.i.recomposed = srem i32 %sum.addr.1.1.i, %2
br label %for.inc.2.i
for.inc.2.i: ; preds = %if.then.2.i, %for.inc.1.i
%sum.addr.1.2.i = phi i32 [ %sub.2.i.recomposed, %if.then.2.i ], [ %sum.addr.1.1.i, %for.inc.1.i ]
%ret.1.2.i = phi i32 [ %add.2.i, %if.then.2.i ], [ %ret.1.1.i, %for.inc.1.i ]
%cmp1.not.3.i = icmp slt i32 %sum.addr.1.2.i, %3
br i1 %cmp1.not.3.i, label %for.inc.3.i, label %if.then.3.i
if.then.3.i: ; preds = %for.inc.2.i
%div.3.i = sdiv i32 %sum.addr.1.2.i, %3
%add.3.i = add nsw i32 %div.3.i, %ret.1.2.i
%mul.3.i = mul nsw i32 %div.3.i, %3
%sub.3.i.recomposed = srem i32 %sum.addr.1.2.i, %3
br label %for.inc.3.i
for.inc.3.i: ; preds = %if.then.3.i, %for.inc.2.i
%sum.addr.1.3.i = phi i32 [ %sub.3.i.recomposed, %if.then.3.i ], [ %sum.addr.1.2.i, %for.inc.2.i ]
%ret.1.3.i = phi i32 [ %add.3.i, %if.then.3.i ], [ %ret.1.2.i, %for.inc.2.i ]
%cmp1.not.4.i = icmp slt i32 %sum.addr.1.3.i, %4
br i1 %cmp1.not.4.i, label %for.inc.4.i, label %if.then.4.i
if.then.4.i: ; preds = %for.inc.3.i
%div.4.i = sdiv i32 %sum.addr.1.3.i, %4
%add.4.i = add nsw i32 %div.4.i, %ret.1.3.i
%mul.4.i = mul nsw i32 %div.4.i, %4
%sub.4.i.recomposed = srem i32 %sum.addr.1.3.i, %4
br label %for.inc.4.i
for.inc.4.i: ; preds = %if.then.4.i, %for.inc.3.i
%sum.addr.1.4.i = phi i32 [ %sub.4.i.recomposed, %if.then.4.i ], [ %sum.addr.1.3.i, %for.inc.3.i ]
%ret.1.4.i = phi i32 [ %add.4.i, %if.then.4.i ], [ %ret.1.3.i, %for.inc.3.i ]
%cmp1.not.5.i = icmp slt i32 %sum.addr.1.4.i, %5
br i1 %cmp1.not.5.i, label %getChange.exit, label %if.then.5.i
if.then.5.i: ; preds = %for.inc.4.i
%div.5.i = sdiv i32 %sum.addr.1.4.i, %5
%add.5.i = add nsw i32 %div.5.i, %ret.1.4.i
br label %getChange.exit
getChange.exit: ; preds = %for.inc.4.i, %if.then.5.i
%ret.1.5.i = phi i32 [ %add.5.i, %if.then.5.i ], [ %ret.1.4.i, %for.inc.4.i ]
%arrayidx5 = getelementptr inbounds [667000 x i32], ptr @clerk, i64 0, i64 %indvars.iv
store i32 %ret.1.5.i, ptr %arrayidx5, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 666001
br i1 %exitcond.not, label %for.end8, label %for.body3, !llvm.loop !9
for.end8: ; preds = %getChange.exit
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2668000) @clerk, i8 0, i64 2668000, i1 false), !tbaa !5
store i32 667000, ptr @i, align 4, !tbaa !5
%0 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
%1 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%5 = load i32, ptr @C, align 16, !tbaa !5
%6 = sext i32 %0 to i64
br label %for.body3.i
for.body3.i: ; preds = %getChange.exit.i, %entry
%indvars.iv.i = phi i64 [ 1, %entry ], [ %indvars.iv.next.i, %getChange.exit.i ]
%cmp1.not.i.i = icmp slt i64 %indvars.iv.i, %6
%7 = trunc i64 %indvars.iv.i to i32
br i1 %cmp1.not.i.i, label %for.inc.i.i, label %if.then.i.i
if.then.i.i: ; preds = %for.body3.i
%div.i.i = sdiv i32 %7, %0
%mul.i.i = mul nsw i32 %div.i.i, %0
%sub.i.i.recomposed = srem i32 %7, %0
br label %for.inc.i.i
for.inc.i.i: ; preds = %if.then.i.i, %for.body3.i
%sum.addr.1.i.i = phi i32 [ %sub.i.i.recomposed, %if.then.i.i ], [ %7, %for.body3.i ]
%ret.1.i.i = phi i32 [ %div.i.i, %if.then.i.i ], [ 0, %for.body3.i ]
%cmp1.not.1.i.i = icmp slt i32 %sum.addr.1.i.i, %1
br i1 %cmp1.not.1.i.i, label %for.inc.1.i.i, label %if.then.1.i.i
if.then.1.i.i: ; preds = %for.inc.i.i
%div.1.i.i = sdiv i32 %sum.addr.1.i.i, %1
%add.1.i.i = add nsw i32 %div.1.i.i, %ret.1.i.i
%mul.1.i.i = mul nsw i32 %div.1.i.i, %1
%sub.1.i.i.recomposed = srem i32 %sum.addr.1.i.i, %1
br label %for.inc.1.i.i
for.inc.1.i.i: ; preds = %if.then.1.i.i, %for.inc.i.i
%sum.addr.1.1.i.i = phi i32 [ %sub.1.i.i.recomposed, %if.then.1.i.i ], [ %sum.addr.1.i.i, %for.inc.i.i ]
%ret.1.1.i.i = phi i32 [ %add.1.i.i, %if.then.1.i.i ], [ %ret.1.i.i, %for.inc.i.i ]
%cmp1.not.2.i.i = icmp slt i32 %sum.addr.1.1.i.i, %2
br i1 %cmp1.not.2.i.i, label %for.inc.2.i.i, label %if.then.2.i.i
if.then.2.i.i: ; preds = %for.inc.1.i.i
%div.2.i.i = sdiv i32 %sum.addr.1.1.i.i, %2
%add.2.i.i = add nsw i32 %div.2.i.i, %ret.1.1.i.i
%mul.2.i.i = mul nsw i32 %div.2.i.i, %2
%sub.2.i.i.recomposed = srem i32 %sum.addr.1.1.i.i, %2
br label %for.inc.2.i.i
for.inc.2.i.i: ; preds = %if.then.2.i.i, %for.inc.1.i.i
%sum.addr.1.2.i.i = phi i32 [ %sub.2.i.i.recomposed, %if.then.2.i.i ], [ %sum.addr.1.1.i.i, %for.inc.1.i.i ]
%ret.1.2.i.i = phi i32 [ %add.2.i.i, %if.then.2.i.i ], [ %ret.1.1.i.i, %for.inc.1.i.i ]
%cmp1.not.3.i.i = icmp slt i32 %sum.addr.1.2.i.i, %3
br i1 %cmp1.not.3.i.i, label %for.inc.3.i.i, label %if.then.3.i.i
if.then.3.i.i: ; preds = %for.inc.2.i.i
%div.3.i.i = sdiv i32 %sum.addr.1.2.i.i, %3
%add.3.i.i = add nsw i32 %div.3.i.i, %ret.1.2.i.i
%mul.3.i.i = mul nsw i32 %div.3.i.i, %3
%sub.3.i.i.recomposed = srem i32 %sum.addr.1.2.i.i, %3
br label %for.inc.3.i.i
for.inc.3.i.i: ; preds = %if.then.3.i.i, %for.inc.2.i.i
%sum.addr.1.3.i.i = phi i32 [ %sub.3.i.i.recomposed, %if.then.3.i.i ], [ %sum.addr.1.2.i.i, %for.inc.2.i.i ]
%ret.1.3.i.i = phi i32 [ %add.3.i.i, %if.then.3.i.i ], [ %ret.1.2.i.i, %for.inc.2.i.i ]
%cmp1.not.4.i.i = icmp slt i32 %sum.addr.1.3.i.i, %4
br i1 %cmp1.not.4.i.i, label %for.inc.4.i.i, label %if.then.4.i.i
if.then.4.i.i: ; preds = %for.inc.3.i.i
%div.4.i.i = sdiv i32 %sum.addr.1.3.i.i, %4
%add.4.i.i = add nsw i32 %div.4.i.i, %ret.1.3.i.i
%mul.4.i.i = mul nsw i32 %div.4.i.i, %4
%sub.4.i.i.recomposed = srem i32 %sum.addr.1.3.i.i, %4
br label %for.inc.4.i.i
for.inc.4.i.i: ; preds = %if.then.4.i.i, %for.inc.3.i.i
%sum.addr.1.4.i.i = phi i32 [ %sub.4.i.i.recomposed, %if.then.4.i.i ], [ %sum.addr.1.3.i.i, %for.inc.3.i.i ]
%ret.1.4.i.i = phi i32 [ %add.4.i.i, %if.then.4.i.i ], [ %ret.1.3.i.i, %for.inc.3.i.i ]
%cmp1.not.5.i.i = icmp slt i32 %sum.addr.1.4.i.i, %5
br i1 %cmp1.not.5.i.i, label %getChange.exit.i, label %if.then.5.i.i
if.then.5.i.i: ; preds = %for.inc.4.i.i
%div.5.i.i = sdiv i32 %sum.addr.1.4.i.i, %5
%add.5.i.i = add nsw i32 %div.5.i.i, %ret.1.4.i.i
br label %getChange.exit.i
getChange.exit.i: ; preds = %if.then.5.i.i, %for.inc.4.i.i
%ret.1.5.i.i = phi i32 [ %add.5.i.i, %if.then.5.i.i ], [ %ret.1.4.i.i, %for.inc.4.i.i ]
%arrayidx5.i = getelementptr inbounds [667000 x i32], ptr @clerk, i64 0, i64 %indvars.iv.i
store i32 %ret.1.5.i.i, ptr %arrayidx5.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, 666001
br i1 %exitcond.not.i, label %while.cond.preheader, label %for.body3.i, !llvm.loop !9
while.cond.preheader: ; preds = %getChange.exit.i
%call122 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @P)
%tobool123 = icmp ne i32 %call122, 0
%8 = load i32, ptr @P, align 4
%tobool1124 = icmp ne i32 %8, 0
%9 = select i1 %tobool123, i1 %tobool1124, i1 false
br i1 %9, label %while.body, label %while.end
while.body: ; preds = %while.cond.preheader, %for.end57
store i32 0, ptr @limit, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%10 = load i32, ptr @N, align 16, !tbaa !5
%11 = load i32, ptr @C, align 16, !tbaa !5
%mul = mul nsw i32 %11, %10
%12 = load i32, ptr @limit, align 4, !tbaa !5
%add = add nsw i32 %12, %mul
store i32 %add, ptr @limit, align 4, !tbaa !5
%call2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 1))
%13 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 1), align 4, !tbaa !5
%14 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%mul.1 = mul nsw i32 %14, %13
%15 = load i32, ptr @limit, align 4, !tbaa !5
%add.1 = add nsw i32 %15, %mul.1
store i32 %add.1, ptr @limit, align 4, !tbaa !5
%call2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 2))
%16 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 2), align 8, !tbaa !5
%17 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%mul.2 = mul nsw i32 %17, %16
%18 = load i32, ptr @limit, align 4, !tbaa !5
%add.2 = add nsw i32 %18, %mul.2
store i32 %add.2, ptr @limit, align 4, !tbaa !5
%call2.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 3))
%19 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 3), align 4, !tbaa !5
%20 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%mul.3 = mul nsw i32 %20, %19
%21 = load i32, ptr @limit, align 4, !tbaa !5
%add.3 = add nsw i32 %21, %mul.3
store i32 %add.3, ptr @limit, align 4, !tbaa !5
%call2.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 4))
%22 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 4), align 16, !tbaa !5
%23 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%mul.4 = mul nsw i32 %23, %22
%24 = load i32, ptr @limit, align 4, !tbaa !5
%add.4 = add nsw i32 %24, %mul.4
store i32 %add.4, ptr @limit, align 4, !tbaa !5
%call2.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 5))
%25 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 5), align 4
%26 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 5), align 4, !tbaa !5
%mul.5 = mul nsw i32 %26, %25
%27 = load i32, ptr @limit, align 4, !tbaa !5
%add.5 = add nsw i32 %27, %mul.5
store i32 %add.5, ptr @limit, align 4, !tbaa !5
%cmp8116 = icmp sgt i32 %add.5, 0
br i1 %cmp8116, label %for.body9.preheader, label %for.end14
for.body9.preheader: ; preds = %while.body
%28 = zext i32 %add.5 to i64
%29 = shl nuw nsw i64 %28, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @clerk, i8 -1, i64 %29, i1 false), !tbaa !5
br label %for.end14
for.end14: ; preds = %for.body9.preheader, %while.body
%storemerge.lcssa = phi i32 [ 0, %while.body ], [ %add.5, %for.body9.preheader ]
store i32 %storemerge.lcssa, ptr @i, align 4, !tbaa !5
%30 = load i32, ptr @P, align 4, !tbaa !5
%add16 = add i32 %30, 500
%31 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 4), align 16, !tbaa !5
%32 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 3), align 4, !tbaa !5
%33 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 2), align 8, !tbaa !5
%34 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @C, i64 0, i64 1), align 4, !tbaa !5
%35 = load i32, ptr @C, align 16, !tbaa !5
%cmp9.not.i = icmp eq i32 %25, 0
%36 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 4), align 16
%cmp9.not.1.i = icmp eq i32 %36, 0
%37 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 3), align 4
%cmp9.not.2.i = icmp eq i32 %37, 0
%38 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 2), align 8
%cmp9.not.3.i = icmp eq i32 %38, 0
%39 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 1), align 4
%cmp9.not.4.i = icmp eq i32 %39, 0
%40 = load i32, ptr @N, align 16
%cmp9.not.5.i = icmp eq i32 %40, 0
%smax = tail call i32 @llvm.smax.i32(i32 %30, i32 %add16)
%41 = add i32 %smax, 1
br label %for.body18
for.body18: ; preds = %for.end14, %for.inc55
%ans.0121 = phi i32 [ 2147483647, %for.end14 ], [ %ans.1, %for.inc55 ]
%storemerge75120 = phi i32 [ %30, %for.end14 ], [ %inc56, %for.inc55 ]
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) @R, i8 0, i64 24, i1 false), !tbaa !5
%cmp6.not.i = icmp sgt i32 %26, %storemerge75120
%brmerge = or i1 %cmp6.not.i, %cmp9.not.i
br i1 %brmerge, label %for.inc28.i, label %if.then.i
if.then.i: ; preds = %for.body18
%div.i = sdiv i32 %storemerge75120, %26
%.div.i = tail call i32 @llvm.smin.i32(i32 %div.i, i32 %25)
store i32 %.div.i, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 5), align 4, !tbaa !5
%mul.i = mul nsw i32 %.div.i, %26
%sub.i = sub nsw i32 %storemerge75120, %mul.i
br label %for.inc28.i
for.inc28.i: ; preds = %for.body18, %if.then.i
%sum.addr.1.i = phi i32 [ %sub.i, %if.then.i ], [ %storemerge75120, %for.body18 ]
%42 = phi i32 [ %.div.i, %if.then.i ], [ 0, %for.body18 ]
%cmp6.not.1.i = icmp slt i32 %sum.addr.1.i, %31
%brmerge125 = select i1 %cmp6.not.1.i, i1 true, i1 %cmp9.not.1.i
br i1 %brmerge125, label %for.inc28.1.i, label %if.then.1.i
if.then.1.i: ; preds = %for.inc28.i
%div.1.i = sdiv i32 %sum.addr.1.i, %31
%.div.1.i = tail call i32 @llvm.smin.i32(i32 %div.1.i, i32 %36)
store i32 %.div.1.i, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 4), align 16, !tbaa !5
%mul.1.i = mul nsw i32 %.div.1.i, %31
%sub.1.i = sub nsw i32 %sum.addr.1.i, %mul.1.i
%add.1.i = add nsw i32 %.div.1.i, %42
br label %for.inc28.1.i
for.inc28.1.i: ; preds = %for.inc28.i, %if.then.1.i
%43 = phi i32 [ %.div.1.i, %if.then.1.i ], [ 0, %for.inc28.i ]
%sum.addr.1.1.i = phi i32 [ %sub.1.i, %if.then.1.i ], [ %sum.addr.1.i, %for.inc28.i ]
%ret.1.1.i = phi i32 [ %add.1.i, %if.then.1.i ], [ %42, %for.inc28.i ]
%cmp6.not.2.i = icmp slt i32 %sum.addr.1.1.i, %32
%brmerge126 = select i1 %cmp6.not.2.i, i1 true, i1 %cmp9.not.2.i
br i1 %brmerge126, label %for.inc28.2.i, label %if.then.2.i
if.then.2.i: ; preds = %for.inc28.1.i
%div.2.i = sdiv i32 %sum.addr.1.1.i, %32
%.div.2.i = tail call i32 @llvm.smin.i32(i32 %div.2.i, i32 %37)
store i32 %.div.2.i, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 3), align 4, !tbaa !5
%mul.2.i = mul nsw i32 %.div.2.i, %32
%sub.2.i = sub nsw i32 %sum.addr.1.1.i, %mul.2.i
%add.2.i = add nsw i32 %.div.2.i, %ret.1.1.i
br label %for.inc28.2.i
for.inc28.2.i: ; preds = %for.inc28.1.i, %if.then.2.i
%44 = phi i32 [ %.div.2.i, %if.then.2.i ], [ 0, %for.inc28.1.i ]
%sum.addr.1.2.i = phi i32 [ %sub.2.i, %if.then.2.i ], [ %sum.addr.1.1.i, %for.inc28.1.i ]
%ret.1.2.i = phi i32 [ %add.2.i, %if.then.2.i ], [ %ret.1.1.i, %for.inc28.1.i ]
%cmp6.not.3.i = icmp slt i32 %sum.addr.1.2.i, %33
%brmerge127 = select i1 %cmp6.not.3.i, i1 true, i1 %cmp9.not.3.i
br i1 %brmerge127, label %for.inc28.3.i, label %if.then.3.i
if.then.3.i: ; preds = %for.inc28.2.i
%div.3.i = sdiv i32 %sum.addr.1.2.i, %33
%.div.3.i = tail call i32 @llvm.smin.i32(i32 %div.3.i, i32 %38)
store i32 %.div.3.i, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 2), align 8, !tbaa !5
%mul.3.i = mul nsw i32 %.div.3.i, %33
%sub.3.i = sub nsw i32 %sum.addr.1.2.i, %mul.3.i
%add.3.i = add nsw i32 %.div.3.i, %ret.1.2.i
br label %for.inc28.3.i
for.inc28.3.i: ; preds = %for.inc28.2.i, %if.then.3.i
%45 = phi i32 [ %.div.3.i, %if.then.3.i ], [ 0, %for.inc28.2.i ]
%sum.addr.1.3.i = phi i32 [ %sub.3.i, %if.then.3.i ], [ %sum.addr.1.2.i, %for.inc28.2.i ]
%ret.1.3.i = phi i32 [ %add.3.i, %if.then.3.i ], [ %ret.1.2.i, %for.inc28.2.i ]
%cmp6.not.4.i = icmp slt i32 %sum.addr.1.3.i, %34
%brmerge128 = select i1 %cmp6.not.4.i, i1 true, i1 %cmp9.not.4.i
br i1 %brmerge128, label %for.inc28.4.i, label %if.then.4.i
if.then.4.i: ; preds = %for.inc28.3.i
%div.4.i = sdiv i32 %sum.addr.1.3.i, %34
%.div.4.i = tail call i32 @llvm.smin.i32(i32 %div.4.i, i32 %39)
store i32 %.div.4.i, ptr getelementptr inbounds ([6 x i32], ptr @R, i64 0, i64 1), align 4, !tbaa !5
%mul.4.i = mul nsw i32 %.div.4.i, %34
%sub.4.i = sub nsw i32 %sum.addr.1.3.i, %mul.4.i
%add.4.i = add nsw i32 %.div.4.i, %ret.1.3.i
br label %for.inc28.4.i
for.inc28.4.i: ; preds = %for.inc28.3.i, %if.then.4.i
%46 = phi i32 [ %.div.4.i, %if.then.4.i ], [ 0, %for.inc28.3.i ]
%sum.addr.1.4.i = phi i32 [ %sub.4.i, %if.then.4.i ], [ %sum.addr.1.3.i, %for.inc28.3.i ]
%ret.1.4.i = phi i32 [ %add.4.i, %if.then.4.i ], [ %ret.1.3.i, %for.inc28.3.i ]
%cmp6.not.5.i = icmp slt i32 %sum.addr.1.4.i, %35
%brmerge129 = select i1 %cmp6.not.5.i, i1 true, i1 %cmp9.not.5.i
br i1 %brmerge129, label %getChangeBy.exit, label %if.then.5.i
if.then.5.i: ; preds = %for.inc28.4.i
%div.5.i = sdiv i32 %sum.addr.1.4.i, %35
%.div.5.i = tail call i32 @llvm.smin.i32(i32 %div.5.i, i32 %40)
store i32 %.div.5.i, ptr @R, align 16, !tbaa !5
%mul.5.i = mul nsw i32 %.div.5.i, %35
%sub.5.i = sub nsw i32 %sum.addr.1.4.i, %mul.5.i
%add.5.i = add nsw i32 %.div.5.i, %ret.1.4.i
br label %getChangeBy.exit
getChangeBy.exit: ; preds = %for.inc28.4.i, %if.then.5.i
%47 = phi i32 [ %.div.5.i, %if.then.5.i ], [ 0, %for.inc28.4.i ]
%sum.addr.1.5.i = phi i32 [ %sub.5.i, %if.then.5.i ], [ %sum.addr.1.4.i, %for.inc28.4.i ]
%ret.1.5.i = phi i32 [ %add.5.i, %if.then.5.i ], [ %ret.1.4.i, %for.inc28.4.i ]
%cmp30.not.i = icmp eq i32 %sum.addr.1.5.i, 0
%ret.0..i = select i1 %cmp30.not.i, i32 %ret.1.5.i, i32 -1
%cmp20 = icmp ne i32 %ret.0..i, -1
%cmp21.not = icmp sgt i32 %ans.0121, %ret.0..i
%or.cond = select i1 %cmp20, i1 %cmp21.not, i1 false
br i1 %or.cond, label %for.body24.preheader, label %for.inc55
for.body24.preheader: ; preds = %getChangeBy.exit
%mul29 = mul nsw i32 %47, %35
%mul29.1 = mul nsw i32 %46, %34
%add30.1 = add nsw i32 %mul29.1, %mul29
%mul29.2 = mul nsw i32 %45, %33
%add30.2 = add nsw i32 %mul29.2, %add30.1
%mul29.3 = mul nsw i32 %44, %32
%add30.3 = add nsw i32 %mul29.3, %add30.2
%mul29.4 = mul nsw i32 %43, %31
%add30.4 = add nsw i32 %mul29.4, %add30.3
%mul29.5 = mul nsw i32 %42, %26
%add30.5 = add nsw i32 %mul29.5, %add30.4
store i32 6, ptr @j, align 4, !tbaa !5
%sub = sub nsw i32 %add30.5, %30
%idxprom34 = sext i32 %sub to i64
%arrayidx35 = getelementptr inbounds [667000 x i32], ptr @clerk, i64 0, i64 %idxprom34
%48 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%cmp36 = icmp eq i32 %48, -1
br i1 %cmp36, label %if.then37, label %if.end43
if.then37: ; preds = %for.body24.preheader
%cmp1.not.i = icmp sgt i32 %26, %sub
br i1 %cmp1.not.i, label %for.inc.i, label %if.then.i77
if.then.i77: ; preds = %if.then37
%div.i78 = sdiv i32 %sub, %26
%mul.i79 = mul nsw i32 %div.i78, %26
%sub.i80.recomposed = srem i32 %sub, %26
br label %for.inc.i
for.inc.i: ; preds = %if.then.i77, %if.then37
%sum.addr.1.i81 = phi i32 [ %sub.i80.recomposed, %if.then.i77 ], [ %sub, %if.then37 ]
%ret.1.i82 = phi i32 [ %div.i78, %if.then.i77 ], [ 0, %if.then37 ]
%cmp1.not.1.i = icmp slt i32 %sum.addr.1.i81, %31
br i1 %cmp1.not.1.i, label %for.inc.1.i, label %if.then.1.i83
if.then.1.i83: ; preds = %for.inc.i
%div.1.i84 = sdiv i32 %sum.addr.1.i81, %31
%add.1.i85 = add nsw i32 %div.1.i84, %ret.1.i82
%mul.1.i86 = mul nsw i32 %div.1.i84, %31
%sub.1.i87.recomposed = srem i32 %sum.addr.1.i81, %31
br label %for.inc.1.i
for.inc.1.i: ; preds = %if.then.1.i83, %for.inc.i
%sum.addr.1.1.i88 = phi i32 [ %sub.1.i87.recomposed, %if.then.1.i83 ], [ %sum.addr.1.i81, %for.inc.i ]
%ret.1.1.i89 = phi i32 [ %add.1.i85, %if.then.1.i83 ], [ %ret.1.i82, %for.inc.i ]
%cmp1.not.2.i = icmp slt i32 %sum.addr.1.1.i88, %32
br i1 %cmp1.not.2.i, label %for.inc.2.i, label %if.then.2.i90
if.then.2.i90: ; preds = %for.inc.1.i
%div.2.i91 = sdiv i32 %sum.addr.1.1.i88, %32
%add.2.i92 = add nsw i32 %div.2.i91, %ret.1.1.i89
%mul.2.i93 = mul nsw i32 %div.2.i91, %32
%sub.2.i94.recomposed = srem i32 %sum.addr.1.1.i88, %32
br label %for.inc.2.i
for.inc.2.i: ; preds = %if.then.2.i90, %for.inc.1.i
%sum.addr.1.2.i95 = phi i32 [ %sub.2.i94.recomposed, %if.then.2.i90 ], [ %sum.addr.1.1.i88, %for.inc.1.i ]
%ret.1.2.i96 = phi i32 [ %add.2.i92, %if.then.2.i90 ], [ %ret.1.1.i89, %for.inc.1.i ]
%cmp1.not.3.i = icmp slt i32 %sum.addr.1.2.i95, %33
br i1 %cmp1.not.3.i, label %for.inc.3.i, label %if.then.3.i97
if.then.3.i97: ; preds = %for.inc.2.i
%div.3.i98 = sdiv i32 %sum.addr.1.2.i95, %33
%add.3.i99 = add nsw i32 %div.3.i98, %ret.1.2.i96
%mul.3.i100 = mul nsw i32 %div.3.i98, %33
%sub.3.i101.recomposed = srem i32 %sum.addr.1.2.i95, %33
br label %for.inc.3.i
for.inc.3.i: ; preds = %if.then.3.i97, %for.inc.2.i
%sum.addr.1.3.i102 = phi i32 [ %sub.3.i101.recomposed, %if.then.3.i97 ], [ %sum.addr.1.2.i95, %for.inc.2.i ]
%ret.1.3.i103 = phi i32 [ %add.3.i99, %if.then.3.i97 ], [ %ret.1.2.i96, %for.inc.2.i ]
%cmp1.not.4.i = icmp slt i32 %sum.addr.1.3.i102, %34
br i1 %cmp1.not.4.i, label %for.inc.4.i, label %if.then.4.i104
if.then.4.i104: ; preds = %for.inc.3.i
%div.4.i105 = sdiv i32 %sum.addr.1.3.i102, %34
%add.4.i106 = add nsw i32 %div.4.i105, %ret.1.3.i103
%mul.4.i107 = mul nsw i32 %div.4.i105, %34
%sub.4.i108.recomposed = srem i32 %sum.addr.1.3.i102, %34
br label %for.inc.4.i
for.inc.4.i: ; preds = %if.then.4.i104, %for.inc.3.i
%sum.addr.1.4.i109 = phi i32 [ %sub.4.i108.recomposed, %if.then.4.i104 ], [ %sum.addr.1.3.i102, %for.inc.3.i ]
%ret.1.4.i110 = phi i32 [ %add.4.i106, %if.then.4.i104 ], [ %ret.1.3.i103, %for.inc.3.i ]
%cmp1.not.5.i = icmp slt i32 %sum.addr.1.4.i109, %35
br i1 %cmp1.not.5.i, label %getChange.exit, label %if.then.5.i111
if.then.5.i111: ; preds = %for.inc.4.i
%div.5.i112 = sdiv i32 %sum.addr.1.4.i109, %35
%add.5.i113 = add nsw i32 %div.5.i112, %ret.1.4.i110
br label %getChange.exit
getChange.exit: ; preds = %for.inc.4.i, %if.then.5.i111
%ret.1.5.i114 = phi i32 [ %add.5.i113, %if.then.5.i111 ], [ %ret.1.4.i110, %for.inc.4.i ]
store i32 %ret.1.5.i114, ptr %arrayidx35, align 4, !tbaa !5
br label %if.end43
if.end43: ; preds = %getChange.exit, %for.body24.preheader
%49 = phi i32 [ %ret.1.5.i114, %getChange.exit ], [ %48, %for.body24.preheader ]
%add47 = add nsw i32 %49, %ret.0..i
%spec.select = tail call i32 @llvm.smin.i32(i32 %add47, i32 %ans.0121)
br label %for.inc55
for.inc55: ; preds = %if.end43, %getChangeBy.exit
%ans.1 = phi i32 [ %ans.0121, %getChangeBy.exit ], [ %spec.select, %if.end43 ]
%inc56 = add i32 %storemerge75120, 1
%exitcond.not = icmp eq i32 %storemerge75120, %smax
br i1 %exitcond.not, label %for.end57, label %for.body18, !llvm.loop !11
for.end57: ; preds = %for.inc55
store i32 %41, ptr @i, align 4, !tbaa !5
%call58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @P)
%tobool = icmp ne i32 %call, 0
%50 = load i32, ptr @P, align 4
%tobool1 = icmp ne i32 %50, 0
%51 = select i1 %tobool, i1 %tobool1, i1 false
br i1 %51, label %while.body, label %while.end, !llvm.loop !12
while.end: ; preds = %for.end57, %while.cond.preheader
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
int a, b;
scanf("%d %d", &a, &b);
if((a*b)%2==0){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264906/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264906/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
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 () {
unsigned long long int a = 0, b = 0;
scanf("%lld", &a);
for(unsigned long long int x = 0; x < a; x++) {
scanf("%lld", &b);
printf("%d\n", b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26495/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26495/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; 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
store i64 0, ptr %a, align 8, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
store i64 0, ptr %b, align 8, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i64, ptr %a, align 8, !tbaa !5
%cmp4.not = icmp eq i64 %0, 0
br i1 %cmp4.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
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
for.body: ; preds = %entry, %for.body
%x.05 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i64, ptr %b, align 8, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %1)
%inc = add nuw i64 %x.05, 1
%2 = load i64, ptr %a, align 8, !tbaa !5
%cmp = icmp ult i64 %inc, %2
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 = !{!"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>
#include<string.h>
#include<math.h>
#define MAX(p,q) ((p>q)?(p):(q))
#define MIN(p,q) ((p<q)?(p):(q))
#define REP(i,n) for(i=0;i<n;i++)
int gcd(int a,int b);
int main(void)
{
int n,i;
scanf("%d%d",&n,&i);
if(n*i%2==0) printf("No");
else printf("Yes");
return 0;
}
int gcd(int a,int b)
{
int max,min,tmp;
max = MAX(a,b);
min = MIN(a,b);
if(max%min==0) return min;
else
{
tmp = min;
min = max%min;
max = tmp;
return gcd(max,min);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_264993/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_264993/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %i)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %i, align 4, !tbaa !5
%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
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %cond5, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%cond = tail call i32 @llvm.smax.i32(i32 %a.tr, i32 %b.tr)
%cond5 = tail call i32 @llvm.smin.i32(i32 %a.tr, i32 %b.tr)
%rem = srem i32 %cond, %cond5
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %cleanup, label %tailrecurse
cleanup: ; preds = %tailrecurse
ret i32 %cond5
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>{
int main(){
int A,B;
scanf("%d %d",&A,&B);
if(A * B % 2 == 1){
printf("Yes");
}else{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265035/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265035/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
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, -2147483647
%cmp = icmp eq i32 %2, 1
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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;
int b;
scanf("%d %d", &a, &b);
if(a==2||b==2) printf("No");
else printf("Yes");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265079/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265079/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 2
%1 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %1, 2
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
%.str.1..str.2 = select i1 %or.cond, 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()
{
int a, b;
scanf("%d%d", &a, &b);
if (a % 2 == 1 && b % 2 == 1) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265121/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265121/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
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, -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.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 != 2 && b != 2){
printf("Yes");
}else{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265172/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265172/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp ne i32 %0, 2
%1 = load i32, ptr %b, align 4
%cmp1 = icmp ne i32 %1, 2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%.str.1..str.2 = select i1 %or.cond, 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(){
int a,b;
scanf("%d %d",&a,&b);
if(a*b%2==0){
printf("No");
}else{
printf("Yes");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265215/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265215/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%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
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 shouhi(int n,int m){
return n*(100+m)/100;
}
int main(){
int X,Y,s,a,b,i,A=0,B=0;
for(i=0;i<1000;i++){
scanf("%d %d %d",&X,&Y,&s);
A=0;B=0;
if((X==0)&&(Y==0)&&(s==0)){
return 0;}
for(a=1;a<1000;a++){
for(b=a;b<1000;b++){
if((shouhi(a,X) + shouhi(b,X) == s) && (shouhi(a,Y) + shouhi(b,Y) >= shouhi(A,Y) + shouhi(B,Y))){
A = a; B = b;
}
}
}
printf("%d\n",shouhi(A,Y) + shouhi(B,Y));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265266/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265266/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @shouhi(i32 noundef %n, i32 noundef %m) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %m, 100
%mul = mul nsw i32 %add, %n
%div = sdiv i32 %mul, 100
ret i32 %div
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%X = alloca i32, align 4
%Y = alloca i32, align 4
%s = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
br label %for.body
for.body: ; preds = %entry, %for.end26
%i.082 = phi i32 [ 0, %entry ], [ %inc32, %for.end26 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X, ptr noundef nonnull %Y, ptr noundef nonnull %s)
%0 = load i32, ptr %X, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
%1 = load i32, ptr %Y, align 4
%cmp2 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
%2 = load i32, ptr %s, align 4
%cmp4 = icmp eq i32 %2, 0
%or.cond41 = select i1 %or.cond, i1 %cmp4, i1 false
br i1 %or.cond41, label %cleanup, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body
%add.i = add nsw i32 %0, 100
%add.i58 = add nsw i32 %1, 100
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.cond5.preheader, %for.inc24
%B.081 = phi i32 [ 0, %for.cond5.preheader ], [ %B.2, %for.inc24 ]
%A.080 = phi i32 [ 0, %for.cond5.preheader ], [ %A.2, %for.inc24 ]
%a.079 = phi i32 [ 1, %for.cond5.preheader ], [ %inc25, %for.inc24 ]
%mul.i = mul nsw i32 %a.079, %add.i
%div.i = sdiv i32 %mul.i, 100
%mul.i59 = mul nsw i32 %a.079, %add.i58
%div.i60 = sdiv i32 %mul.i59, 100
br label %for.body10
for.body10: ; preds = %for.cond8.preheader, %for.inc
%B.178 = phi i32 [ %B.081, %for.cond8.preheader ], [ %B.2, %for.inc ]
%A.177 = phi i32 [ %A.080, %for.cond8.preheader ], [ %A.2, %for.inc ]
%b.076 = phi i32 [ %a.079, %for.cond8.preheader ], [ %inc, %for.inc ]
%mul.i56 = mul nsw i32 %b.076, %add.i
%div.i57 = sdiv i32 %mul.i56, 100
%add = add nsw i32 %div.i57, %div.i
%cmp13 = icmp eq i32 %add, %2
br i1 %cmp13, label %land.lhs.true14, label %for.inc
land.lhs.true14: ; preds = %for.body10
%mul.i62 = mul nsw i32 %b.076, %add.i58
%div.i63 = sdiv i32 %mul.i62, 100
%add17 = add nsw i32 %div.i63, %div.i60
%mul.i65 = mul nsw i32 %A.177, %add.i58
%div.i66 = sdiv i32 %mul.i65, 100
%mul.i68 = mul nsw i32 %B.178, %add.i58
%div.i69 = sdiv i32 %mul.i68, 100
%add20 = add nsw i32 %div.i69, %div.i66
%cmp21.not = icmp slt i32 %add17, %add20
%spec.select = select i1 %cmp21.not, i32 %A.177, i32 %a.079
%spec.select54 = select i1 %cmp21.not, i32 %B.178, i32 %b.076
br label %for.inc
for.inc: ; preds = %land.lhs.true14, %for.body10
%A.2 = phi i32 [ %A.177, %for.body10 ], [ %spec.select, %land.lhs.true14 ]
%B.2 = phi i32 [ %B.178, %for.body10 ], [ %spec.select54, %land.lhs.true14 ]
%inc = add nuw nsw i32 %b.076, 1
%exitcond.not = icmp eq i32 %inc, 1000
br i1 %exitcond.not, label %for.inc24, label %for.body10, !llvm.loop !9
for.inc24: ; preds = %for.inc
%inc25 = add nuw nsw i32 %a.079, 1
%exitcond83.not = icmp eq i32 %inc25, 1000
br i1 %exitcond83.not, label %for.end26, label %for.cond8.preheader, !llvm.loop !11
for.end26: ; preds = %for.inc24
%mul.i71 = mul nsw i32 %A.2, %add.i58
%div.i72 = sdiv i32 %mul.i71, 100
%mul.i74 = mul nsw i32 %B.2, %add.i58
%div.i75 = sdiv i32 %mul.i74, 100
%add29 = add nsw i32 %div.i75, %div.i72
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add29)
%inc32 = add nuw nsw i32 %i.082, 1
%exitcond84.not = icmp eq i32 %inc32, 1000
br i1 %exitcond84.not, label %cleanup, label %for.body, !llvm.loop !12
cleanup: ; preds = %for.end26, %for.body
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
int x, y, s, max;
int i, j;
while(scanf("%d %d %d", &x, &y, &s),x){
max=0;
for(i=1;i<s;i++){
for(j=1;j<s;j++){
if(i*(100+x)/100+j*(100+x)/100==s){
if(i*(100+y)/100+j*(100+y)/100>max) max=i*(100+y)/100+j*(100+y)/100;
}
}
}
printf("%d\n", max);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265309/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265309/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%s = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call46 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %s)
%0 = load i32, ptr %x, align 4, !tbaa !5
%tobool.not47 = icmp eq i32 %0, 0
br i1 %tobool.not47, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end28
%1 = phi i32 [ %4, %for.end28 ], [ %0, %entry ]
%2 = load i32, ptr %s, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %2, 1
br i1 %cmp42, label %for.cond1.preheader.lr.ph, label %for.end28
for.cond1.preheader.lr.ph: ; preds = %for.cond.preheader
%add = add nsw i32 %1, 100
%3 = load i32, ptr %y, align 4
%add9 = add nsw i32 %3, 100
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.for.inc26_crit_edge.us, %for.cond1.preheader.lr.ph
%i.044.us = phi i32 [ 1, %for.cond1.preheader.lr.ph ], [ %inc27.us, %for.cond1.for.inc26_crit_edge.us ]
%max.043.us = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %max.2.us, %for.cond1.for.inc26_crit_edge.us ]
%mul.us = mul nsw i32 %i.044.us, %add
%div.us = sdiv i32 %mul.us, 100
%mul10.us = mul nsw i32 %add9, %i.044.us
%div11.us = sdiv i32 %mul10.us, 100
br label %for.body3.us
for.body3.us: ; preds = %for.cond1.preheader.us, %for.inc.us
%j.041.us = phi i32 [ 1, %for.cond1.preheader.us ], [ %inc.us, %for.inc.us ]
%max.140.us = phi i32 [ %max.043.us, %for.cond1.preheader.us ], [ %max.2.us, %for.inc.us ]
%mul5.us = mul nsw i32 %j.041.us, %add
%div6.us = sdiv i32 %mul5.us, 100
%add7.us = add nsw i32 %div6.us, %div.us
%cmp8.us = icmp eq i32 %add7.us, %2
br i1 %cmp8.us, label %if.then.us, label %for.inc.us
if.then.us: ; preds = %for.body3.us
%mul13.us = mul nsw i32 %add9, %j.041.us
%div14.us = sdiv i32 %mul13.us, 100
%add15.us = add nsw i32 %div11.us, %div14.us
%spec.select.us = call i32 @llvm.smax.i32(i32 %add15.us, i32 %max.140.us)
br label %for.inc.us
for.inc.us: ; preds = %if.then.us, %for.body3.us
%max.2.us = phi i32 [ %max.140.us, %for.body3.us ], [ %spec.select.us, %if.then.us ]
%inc.us = add nuw nsw i32 %j.041.us, 1
%exitcond.not = icmp eq i32 %inc.us, %2
br i1 %exitcond.not, label %for.cond1.for.inc26_crit_edge.us, label %for.body3.us, !llvm.loop !9
for.cond1.for.inc26_crit_edge.us: ; preds = %for.inc.us
%inc27.us = add nuw nsw i32 %i.044.us, 1
%exitcond48.not = icmp eq i32 %inc27.us, %2
br i1 %exitcond48.not, label %for.end28, label %for.cond1.preheader.us, !llvm.loop !11
for.end28: ; preds = %for.cond1.for.inc26_crit_edge.us, %for.cond.preheader
%max.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %max.2.us, %for.cond1.for.inc26_crit_edge.us ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %s)
%4 = load i32, ptr %x, align 4, !tbaa !5
%tobool.not = icmp eq i32 %4, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !12
while.end: ; preds = %for.end28, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
//セグ木ここから
//*
//↓ここを変える
typedef struct atai{ll a;}atai;
atai xx(atai x,atai y){
atai r;
r.a=x.a+y.a;//sum
return r;
}
//↑ここを変える
int segNUM;
atai segN[1<<18],*seg;
void seguse(int n){segNUM=n;seg=segN+segNUM;}
//seg[]に値を与えてから初期化
void seginit(){for(int node=segNUM-1;node;node--)segN[node]=xx(segN[node*2],segN[node*2+1]);}
void segupdate(int node,atai x){
//seg[node]をxに更新
node+=segNUM;
segN[node]=x;
while(node/=2)segN[node]=xx(segN[node*2],segN[node*2+1]);
}
atai segcalcsub(int l,int r,int k,int cl,int cr){
//完全に含むとき
if(l<=cl&&cr<=r)return segN[k];
int cm=(cl+cr)/2;
//左側だけ
if(r<=cm)return segcalcsub(l,r,2*k ,cl,cm);
//右側だけ
if(cm<=l)return segcalcsub(l,r,2*k+1,cm,cr);
//両方
return xx(segcalcsub(l,r,2*k,cl,cm),segcalcsub(l,r,2*k+1,cm,cr));
}
atai segcalc(int l,int r){return segcalcsub(l,r,1,0,segNUM);}
//セグ木ここまで
char s[200010];
int c[30];
int a[200010];
int p[200010];
ll ans;
int main(){
scanf("%s",s);
ll n=strlen(s);
rep(i,0,n)c[s[i]-'a']++;
int idx=-1;
rep(i,0,26)if(c[i]%2){
if(idx==-1)idx=i;
else{
puts("-1");
return 0;
}
}
rep(i,0,26)c[i]/=2;
c[idx]++;
rep(i,0,n){
int t=s[i]-'a';
if(c[t]){
if(c[t]==1&&t==idx)a[i]=-2;
else a[i]=-1;
c[t]--;
}else a[i]=-3;
}
//前半パート
{
int cnt=0;
rep(i,0,n){
if(a[i]==-1||a[i]==-2)ans+=cnt;
if(a[i]==-2||a[i]==-3)cnt++;
}
}
int cnt=0;
rep(i,0,n)if(a[i]==-1)a[i]=cnt++;
cnt=0;
for(int i=n-1;i>=0;i--)if(a[i]==-3)a[i]=cnt++;
//数列の構成
rep(i,0,26){
for(int l=0,r=n-1;l<r;l++,r--){
while(l<r&&s[l]-'a'!=i)l++;
if(l==r)break;
while(s[r]-'a'!=i)r--;
p[a[l]]=a[r];
}
}
//転倒数の計算
seguse(1<<17);
rep(i,0,n/2){
ans+=segcalc(p[i],n/2).a;
atai r={1};
segupdate(p[i],r);
}
printf("%lld",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265367/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265367/source.c"
target datalayout = "e-m:e-p270: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.atai = type { i64 }
@segNUM = dso_local local_unnamed_addr global i32 0, align 4
@segN = dso_local global [262144 x %struct.atai] zeroinitializer, align 16
@seg = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@s = dso_local global [200010 x i8] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [30 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@a = dso_local local_unnamed_addr global [200010 x i32] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global i64 0, align 8
@p = dso_local local_unnamed_addr global [200010 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @xx(i64 %x.coerce, i64 %y.coerce) local_unnamed_addr #0 {
entry:
%add = add nsw i64 %y.coerce, %x.coerce
ret i64 %add
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @seguse(i32 noundef %n) local_unnamed_addr #1 {
entry:
store i32 %n, ptr @segNUM, align 4, !tbaa !5
%idx.ext = sext i32 %n to i64
%add.ptr = getelementptr inbounds %struct.atai, ptr @segN, i64 %idx.ext
store ptr %add.ptr, ptr @seg, align 8, !tbaa !9
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @seginit() local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @segNUM, align 4, !tbaa !5
%tobool.not13 = icmp eq i32 %0, 1
br i1 %tobool.not13, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = sext i32 %0 to i64
%2 = add nsw i64 %1, -1
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %indvars.iv
%3 = trunc i64 %indvars.iv to i32
%mul = shl nsw i32 %3, 1
%idxprom1 = sext i32 %mul to i64
%arrayidx2 = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom1
%add = or i32 %mul, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom4
%4 = load i64, ptr %arrayidx2, align 16
%5 = load i64, ptr %arrayidx5, align 8
%add.i = add nsw i64 %5, %4
store i64 %add.i, ptr %arrayidx, align 8, !tbaa.struct !11
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%6 = and i64 %indvars.iv.next, 4294967295
%tobool.not = icmp eq i64 %6, 0
br i1 %tobool.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @segupdate(i32 noundef %node, i64 %x.coerce) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr @segNUM, align 4, !tbaa !5
%add = add nsw i32 %0, %node
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom
store i64 %x.coerce, ptr %arrayidx, align 8, !tbaa.struct !11
%node.addr.0.off17 = add i32 %add, 1
%tobool.not18 = icmp ult i32 %node.addr.0.off17, 3
br i1 %tobool.not18, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%node.addr.019 = phi i32 [ %div, %while.body ], [ %add, %entry ]
%div = sdiv i32 %node.addr.019, 2
%idxprom1 = sext i32 %div to i64
%arrayidx2 = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom1
%mul = shl nsw i32 %div, 1
%idxprom3 = sext i32 %mul to i64
%arrayidx4 = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom3
%add6 = or i32 %mul, 1
%idxprom7 = sext i32 %add6 to i64
%arrayidx8 = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom7
%1 = load i64, ptr %arrayidx4, align 16
%2 = load i64, ptr %arrayidx8, align 8
%add.i = add nsw i64 %2, %1
store i64 %add.i, ptr %arrayidx2, align 8, !tbaa.struct !11
%node.addr.0.off = add nsw i32 %div, 1
%tobool.not = icmp ult i32 %node.addr.0.off, 3
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %entry
ret void
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @segcalcsub(i32 noundef %l, i32 noundef %r, i32 noundef %k, i32 noundef %cl, i32 noundef %cr) local_unnamed_addr #3 {
entry:
%cmp.not6677 = icmp sgt i32 %l, %cl
%cmp1.not576778 = icmp sgt i32 %cr, %r
%or.cond586879 = or i1 %cmp.not6677, %cmp1.not576778
br i1 %or.cond586879, label %if.end.lr.ph.lr.ph, label %if.then
if.end.lr.ph.lr.ph: ; preds = %entry, %if.end11
%cmp.not6684 = phi i1 [ false, %if.end11 ], [ %cmp.not6677, %entry ]
%cr.tr.ph83 = phi i32 [ %.us-phi65, %if.end11 ], [ %cr, %entry ]
%cl.tr.ph82 = phi i32 [ %.us-phi, %if.end11 ], [ %cl, %entry ]
%k.tr.ph81 = phi i32 [ %add17, %if.end11 ], [ %k, %entry ]
%accumulator.tr.ph80 = phi i64 [ %add.i, %if.end11 ], [ 0, %entry ]
br label %if.end.lr.ph
if.end.lr.ph: ; preds = %if.end.lr.ph.lr.ph, %if.then6
%cmp.not72 = phi i1 [ %cmp.not6684, %if.end.lr.ph.lr.ph ], [ %cmp.not, %if.then6 ]
%cr.tr.ph5371 = phi i32 [ %cr.tr.ph83, %if.end.lr.ph.lr.ph ], [ %.us-phi65, %if.then6 ]
%cl.tr.ph5270 = phi i32 [ %cl.tr.ph82, %if.end.lr.ph.lr.ph ], [ %.us-phi, %if.then6 ]
%k.tr.ph5169 = phi i32 [ %k.tr.ph81, %if.end.lr.ph.lr.ph ], [ %add8, %if.then6 ]
br i1 %cmp.not72, label %if.end.us, label %if.end
if.end.us: ; preds = %if.end.lr.ph, %if.end.us
%cr.tr60.us = phi i32 [ %div.us, %if.end.us ], [ %cr.tr.ph5371, %if.end.lr.ph ]
%k.tr59.us = phi i32 [ %mul.us, %if.end.us ], [ %k.tr.ph5169, %if.end.lr.ph ]
%add.us = add i32 %cr.tr60.us, %cl.tr.ph5270
%div.us = sdiv i32 %add.us, 2
%cmp2.not.us = icmp slt i32 %div.us, %r
%mul.us = shl nsw i32 %k.tr59.us, 1
br i1 %cmp2.not.us, label %if.end4, label %if.end.us
if.then: ; preds = %if.end11, %if.then6, %if.then3, %entry
%accumulator.tr.ph.lcssa = phi i64 [ 0, %entry ], [ %accumulator.tr.ph80, %if.then3 ], [ %accumulator.tr.ph80, %if.then6 ], [ %add.i, %if.end11 ]
%k.tr.lcssa = phi i32 [ %k, %entry ], [ %mul, %if.then3 ], [ %add8, %if.then6 ], [ %add17, %if.end11 ]
%idxprom = sext i32 %k.tr.lcssa to i64
%arrayidx = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom
%retval.sroa.0.0.copyload = load i64, ptr %arrayidx, align 8, !tbaa.struct !11
%accumulator.ret.tr = add nsw i64 %retval.sroa.0.0.copyload, %accumulator.tr.ph.lcssa
ret i64 %accumulator.ret.tr
if.end: ; preds = %if.end.lr.ph, %if.then3
%cr.tr60 = phi i32 [ %div, %if.then3 ], [ %cr.tr.ph5371, %if.end.lr.ph ]
%k.tr59 = phi i32 [ %mul, %if.then3 ], [ %k.tr.ph5169, %if.end.lr.ph ]
%add = add i32 %cr.tr60, %cl.tr.ph5270
%div = sdiv i32 %add, 2
%cmp2.not = icmp slt i32 %div, %r
br i1 %cmp2.not, label %if.end4, label %if.then3
if.then3: ; preds = %if.end
%mul = shl nsw i32 %k.tr59, 1
%cmp1.not = icmp sgt i32 %div, %r
br i1 %cmp1.not, label %if.end, label %if.then
if.end4: ; preds = %if.end, %if.end.us
%.us-phi = phi i32 [ %div.us, %if.end.us ], [ %div, %if.end ]
%.us-phi64 = phi i32 [ %k.tr59.us, %if.end.us ], [ %k.tr59, %if.end ]
%.us-phi65 = phi i32 [ %cr.tr60.us, %if.end.us ], [ %cr.tr60, %if.end ]
%cmp5.not = icmp sgt i32 %.us-phi, %l
%mul12 = shl nsw i32 %.us-phi64, 1
br i1 %cmp5.not, label %if.end11, label %if.then6
if.then6: ; preds = %if.end4
%add8 = or i32 %mul12, 1
%cmp.not = icmp slt i32 %.us-phi, %l
%cmp1.not57 = icmp sgt i32 %.us-phi65, %r
%or.cond58 = or i1 %cmp.not, %cmp1.not57
br i1 %or.cond58, label %if.end.lr.ph, label %if.then
if.end11: ; preds = %if.end4
%call13 = tail call i64 @segcalcsub(i32 noundef %l, i32 noundef %r, i32 noundef %mul12, i32 noundef %cl.tr.ph5270, i32 noundef %.us-phi)
%add17 = or i32 %mul12, 1
%add.i = add nsw i64 %call13, %accumulator.tr.ph80
%cmp1.not5767 = icmp sgt i32 %.us-phi65, %r
br i1 %cmp1.not5767, label %if.end.lr.ph.lr.ph, label %if.then
}
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i64 @segcalc(i32 noundef %l, i32 noundef %r) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr @segNUM, align 4, !tbaa !5
%call = tail call i64 @segcalcsub(i32 noundef %l, i32 noundef %r, i32 noundef 1, i32 noundef 0, i32 noundef %0)
ret i64 %call
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #9
%cmp272 = icmp sgt i64 %call1, 0
br i1 %cmp272, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call1, 1
%0 = icmp eq i64 %call1, 1
br i1 %0, label %for.cond5.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %call1, -2
br label %for.body
for.cond5.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%i.0273.unr = phi i64 [ 0, %for.body.preheader ], [ %inc3.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond5.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond5.preheader.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [200010 x i8], ptr @s, i64 0, i64 %i.0273.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !17
%conv.epil = sext i8 %1 to i64
%sub.epil = add nsw i64 %conv.epil, -97
%arrayidx2.epil = getelementptr inbounds [30 x i32], ptr @c, i64 0, i64 %sub.epil
%2 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5
%inc.epil = add nsw i32 %2, 1
store i32 %inc.epil, ptr %arrayidx2.epil, align 4, !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body.epil, %for.cond5.preheader.loopexit.unr-lcssa, %entry
%3 = load <2 x i32>, ptr @c, align 16, !tbaa !5
%4 = and <2 x i32> %3, <i32 1, i32 1>
%5 = icmp eq <2 x i32> %4, zeroinitializer
%6 = extractelement <2 x i1> %5, i64 0
br i1 %6, label %for.inc17, label %for.inc17.thread
for.body: ; preds = %for.body, %for.body.preheader.new
%i.0273 = phi i64 [ 0, %for.body.preheader.new ], [ %inc3.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [200010 x i8], ptr @s, i64 0, i64 %i.0273
%7 = load i8, ptr %arrayidx, align 2, !tbaa !17
%conv = sext i8 %7 to i64
%sub = add nsw i64 %conv, -97
%arrayidx2 = getelementptr inbounds [30 x i32], ptr @c, i64 0, i64 %sub
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%inc = add nsw i32 %8, 1
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%inc3 = or i64 %i.0273, 1
%arrayidx.1 = getelementptr inbounds [200010 x i8], ptr @s, i64 0, i64 %inc3
%9 = load i8, ptr %arrayidx.1, align 1, !tbaa !17
%conv.1 = sext i8 %9 to i64
%sub.1 = add nsw i64 %conv.1, -97
%arrayidx2.1 = getelementptr inbounds [30 x i32], ptr @c, i64 0, i64 %sub.1
%10 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%inc.1 = add nsw i32 %10, 1
store i32 %inc.1, ptr %arrayidx2.1, align 4, !tbaa !5
%inc3.1 = add nuw nsw i64 %i.0273, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond5.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
if.else: ; preds = %for.inc17.24.thread, %for.inc17.22.thread, %for.inc17.20.thread, %for.inc17.18.thread, %for.inc17.16.thread, %for.inc17.14.thread, %for.inc17.12.thread, %for.inc17.10.thread, %for.inc17.8.thread, %for.inc17.6.thread, %for.inc17.4.thread, %for.inc17.2.thread, %for.inc17.thread, %for.inc17.1, %if.then.25, %if.then.24, %if.then.23, %if.then.22, %if.then.21, %if.then.20, %if.then.19, %if.then.18, %if.then.17, %if.then.16, %if.then.15, %if.then.14, %if.then.13, %if.then.12, %if.then.11, %if.then.10, %if.then.9, %if.then.8, %if.then.7, %if.then.6, %if.then.5, %if.then.4, %if.then.3
%call15 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup209
for.inc17: ; preds = %for.cond5.preheader
%11 = extractelement <2 x i1> %5, i64 1
br i1 %11, label %for.inc17.1.thread, label %for.inc17.1
for.inc17.thread: ; preds = %for.cond5.preheader
%12 = extractelement <2 x i1> %5, i64 1
br i1 %12, label %for.inc17.1, label %if.else
for.inc17.1: ; preds = %for.inc17, %for.inc17.thread
%idx.1.1 = phi i32 [ 0, %for.inc17.thread ], [ 1, %for.inc17 ]
%13 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
%14 = and i32 %13, 1
%tobool.not.2 = icmp eq i32 %14, 0
br i1 %tobool.not.2, label %for.inc17.2, label %if.else
for.inc17.1.thread: ; preds = %for.inc17
%15 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
%16 = and i32 %15, 1
%tobool.not.2321 = icmp eq i32 %16, 0
br i1 %tobool.not.2321, label %for.inc17.2, label %for.inc17.2.thread
for.inc17.2: ; preds = %for.inc17.1.thread, %for.inc17.1
%17 = phi i32 [ %13, %for.inc17.1 ], [ %15, %for.inc17.1.thread ]
%idx.1.2 = phi i32 [ %idx.1.1, %for.inc17.1 ], [ -1, %for.inc17.1.thread ]
%18 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 3), align 4, !tbaa !5
%19 = and i32 %18, 1
%tobool.not.3 = icmp eq i32 %19, 0
br i1 %tobool.not.3, label %for.inc17.3, label %if.then.3
for.inc17.2.thread: ; preds = %for.inc17.1.thread
%20 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 3), align 4, !tbaa !5
%21 = and i32 %20, 1
%tobool.not.3326 = icmp eq i32 %21, 0
br i1 %tobool.not.3326, label %for.inc17.3, label %if.else
if.then.3: ; preds = %for.inc17.2
%cmp11.3 = icmp eq i32 %idx.1.2, -1
br i1 %cmp11.3, label %for.inc17.3, label %if.else
for.inc17.3: ; preds = %if.then.3, %for.inc17.2.thread, %for.inc17.2
%22 = phi i32 [ %18, %for.inc17.2 ], [ %20, %for.inc17.2.thread ], [ %18, %if.then.3 ]
%23 = phi i32 [ %17, %for.inc17.2 ], [ %15, %for.inc17.2.thread ], [ %17, %if.then.3 ]
%idx.1.3 = phi i32 [ %idx.1.2, %for.inc17.2 ], [ 2, %for.inc17.2.thread ], [ 3, %if.then.3 ]
%24 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 4), align 16, !tbaa !5
%25 = and i32 %24, 1
%tobool.not.4 = icmp eq i32 %25, 0
br i1 %tobool.not.4, label %for.inc17.4, label %if.then.4
if.then.4: ; preds = %for.inc17.3
%cmp11.4 = icmp eq i32 %idx.1.3, -1
br i1 %cmp11.4, label %for.inc17.4.thread, label %if.else
for.inc17.4: ; preds = %for.inc17.3
%26 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 5), align 4, !tbaa !5
%27 = and i32 %26, 1
%tobool.not.5 = icmp eq i32 %27, 0
br i1 %tobool.not.5, label %for.inc17.5, label %if.then.5
for.inc17.4.thread: ; preds = %if.then.4
%28 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 5), align 4, !tbaa !5
%29 = and i32 %28, 1
%tobool.not.5331 = icmp eq i32 %29, 0
br i1 %tobool.not.5331, label %for.inc17.5, label %if.else
if.then.5: ; preds = %for.inc17.4
%cmp11.5 = icmp eq i32 %idx.1.3, -1
br i1 %cmp11.5, label %for.inc17.5, label %if.else
for.inc17.5: ; preds = %if.then.5, %for.inc17.4.thread, %for.inc17.4
%30 = phi i32 [ %26, %for.inc17.4 ], [ %28, %for.inc17.4.thread ], [ %26, %if.then.5 ]
%idx.1.5 = phi i32 [ %idx.1.3, %for.inc17.4 ], [ 4, %for.inc17.4.thread ], [ 5, %if.then.5 ]
%31 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 6), align 8, !tbaa !5
%32 = and i32 %31, 1
%tobool.not.6 = icmp eq i32 %32, 0
br i1 %tobool.not.6, label %for.inc17.6, label %if.then.6
if.then.6: ; preds = %for.inc17.5
%cmp11.6 = icmp eq i32 %idx.1.5, -1
br i1 %cmp11.6, label %for.inc17.6.thread, label %if.else
for.inc17.6: ; preds = %for.inc17.5
%33 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 7), align 4, !tbaa !5
%34 = and i32 %33, 1
%tobool.not.7 = icmp eq i32 %34, 0
br i1 %tobool.not.7, label %for.inc17.7, label %if.then.7
for.inc17.6.thread: ; preds = %if.then.6
%35 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 7), align 4, !tbaa !5
%36 = and i32 %35, 1
%tobool.not.7336 = icmp eq i32 %36, 0
br i1 %tobool.not.7336, label %for.inc17.7, label %if.else
if.then.7: ; preds = %for.inc17.6
%cmp11.7 = icmp eq i32 %idx.1.5, -1
br i1 %cmp11.7, label %for.inc17.7, label %if.else
for.inc17.7: ; preds = %if.then.7, %for.inc17.6.thread, %for.inc17.6
%37 = phi i32 [ %33, %for.inc17.6 ], [ %35, %for.inc17.6.thread ], [ %33, %if.then.7 ]
%idx.1.7 = phi i32 [ %idx.1.5, %for.inc17.6 ], [ 6, %for.inc17.6.thread ], [ 7, %if.then.7 ]
%38 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 8), align 16, !tbaa !5
%39 = and i32 %38, 1
%tobool.not.8 = icmp eq i32 %39, 0
br i1 %tobool.not.8, label %for.inc17.8, label %if.then.8
if.then.8: ; preds = %for.inc17.7
%cmp11.8 = icmp eq i32 %idx.1.7, -1
br i1 %cmp11.8, label %for.inc17.8.thread, label %if.else
for.inc17.8: ; preds = %for.inc17.7
%40 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 9), align 4, !tbaa !5
%41 = and i32 %40, 1
%tobool.not.9 = icmp eq i32 %41, 0
br i1 %tobool.not.9, label %for.inc17.9, label %if.then.9
for.inc17.8.thread: ; preds = %if.then.8
%42 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 9), align 4, !tbaa !5
%43 = and i32 %42, 1
%tobool.not.9341 = icmp eq i32 %43, 0
br i1 %tobool.not.9341, label %for.inc17.9, label %if.else
if.then.9: ; preds = %for.inc17.8
%cmp11.9 = icmp eq i32 %idx.1.7, -1
br i1 %cmp11.9, label %for.inc17.9, label %if.else
for.inc17.9: ; preds = %if.then.9, %for.inc17.8.thread, %for.inc17.8
%44 = phi i32 [ %40, %for.inc17.8 ], [ %42, %for.inc17.8.thread ], [ %40, %if.then.9 ]
%idx.1.9 = phi i32 [ %idx.1.7, %for.inc17.8 ], [ 8, %for.inc17.8.thread ], [ 9, %if.then.9 ]
%45 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 10), align 8, !tbaa !5
%46 = and i32 %45, 1
%tobool.not.10 = icmp eq i32 %46, 0
br i1 %tobool.not.10, label %for.inc17.10, label %if.then.10
if.then.10: ; preds = %for.inc17.9
%cmp11.10 = icmp eq i32 %idx.1.9, -1
br i1 %cmp11.10, label %for.inc17.10.thread, label %if.else
for.inc17.10: ; preds = %for.inc17.9
%47 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 11), align 4, !tbaa !5
%48 = and i32 %47, 1
%tobool.not.11 = icmp eq i32 %48, 0
br i1 %tobool.not.11, label %for.inc17.11, label %if.then.11
for.inc17.10.thread: ; preds = %if.then.10
%49 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 11), align 4, !tbaa !5
%50 = and i32 %49, 1
%tobool.not.11346 = icmp eq i32 %50, 0
br i1 %tobool.not.11346, label %for.inc17.11, label %if.else
if.then.11: ; preds = %for.inc17.10
%cmp11.11 = icmp eq i32 %idx.1.9, -1
br i1 %cmp11.11, label %for.inc17.11, label %if.else
for.inc17.11: ; preds = %if.then.11, %for.inc17.10.thread, %for.inc17.10
%51 = phi i32 [ %47, %for.inc17.10 ], [ %49, %for.inc17.10.thread ], [ %47, %if.then.11 ]
%idx.1.11 = phi i32 [ %idx.1.9, %for.inc17.10 ], [ 10, %for.inc17.10.thread ], [ 11, %if.then.11 ]
%52 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 12), align 16, !tbaa !5
%53 = and i32 %52, 1
%tobool.not.12 = icmp eq i32 %53, 0
br i1 %tobool.not.12, label %for.inc17.12, label %if.then.12
if.then.12: ; preds = %for.inc17.11
%cmp11.12 = icmp eq i32 %idx.1.11, -1
br i1 %cmp11.12, label %for.inc17.12.thread, label %if.else
for.inc17.12: ; preds = %for.inc17.11
%54 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 13), align 4, !tbaa !5
%55 = and i32 %54, 1
%tobool.not.13 = icmp eq i32 %55, 0
br i1 %tobool.not.13, label %for.inc17.13, label %if.then.13
for.inc17.12.thread: ; preds = %if.then.12
%56 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 13), align 4, !tbaa !5
%57 = and i32 %56, 1
%tobool.not.13351 = icmp eq i32 %57, 0
br i1 %tobool.not.13351, label %for.inc17.13, label %if.else
if.then.13: ; preds = %for.inc17.12
%cmp11.13 = icmp eq i32 %idx.1.11, -1
br i1 %cmp11.13, label %for.inc17.13, label %if.else
for.inc17.13: ; preds = %if.then.13, %for.inc17.12.thread, %for.inc17.12
%58 = phi i32 [ %54, %for.inc17.12 ], [ %56, %for.inc17.12.thread ], [ %54, %if.then.13 ]
%idx.1.13 = phi i32 [ %idx.1.11, %for.inc17.12 ], [ 12, %for.inc17.12.thread ], [ 13, %if.then.13 ]
%59 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 14), align 8, !tbaa !5
%60 = and i32 %59, 1
%tobool.not.14 = icmp eq i32 %60, 0
br i1 %tobool.not.14, label %for.inc17.14, label %if.then.14
if.then.14: ; preds = %for.inc17.13
%cmp11.14 = icmp eq i32 %idx.1.13, -1
br i1 %cmp11.14, label %for.inc17.14.thread, label %if.else
for.inc17.14: ; preds = %for.inc17.13
%61 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 15), align 4, !tbaa !5
%62 = and i32 %61, 1
%tobool.not.15 = icmp eq i32 %62, 0
br i1 %tobool.not.15, label %for.inc17.15, label %if.then.15
for.inc17.14.thread: ; preds = %if.then.14
%63 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 15), align 4, !tbaa !5
%64 = and i32 %63, 1
%tobool.not.15356 = icmp eq i32 %64, 0
br i1 %tobool.not.15356, label %for.inc17.15, label %if.else
if.then.15: ; preds = %for.inc17.14
%cmp11.15 = icmp eq i32 %idx.1.13, -1
br i1 %cmp11.15, label %for.inc17.15, label %if.else
for.inc17.15: ; preds = %if.then.15, %for.inc17.14.thread, %for.inc17.14
%65 = phi i32 [ %61, %for.inc17.14 ], [ %63, %for.inc17.14.thread ], [ %61, %if.then.15 ]
%idx.1.15 = phi i32 [ %idx.1.13, %for.inc17.14 ], [ 14, %for.inc17.14.thread ], [ 15, %if.then.15 ]
%66 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 16), align 16, !tbaa !5
%67 = and i32 %66, 1
%tobool.not.16 = icmp eq i32 %67, 0
br i1 %tobool.not.16, label %for.inc17.16, label %if.then.16
if.then.16: ; preds = %for.inc17.15
%cmp11.16 = icmp eq i32 %idx.1.15, -1
br i1 %cmp11.16, label %for.inc17.16.thread, label %if.else
for.inc17.16: ; preds = %for.inc17.15
%68 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 17), align 4, !tbaa !5
%69 = and i32 %68, 1
%tobool.not.17 = icmp eq i32 %69, 0
br i1 %tobool.not.17, label %for.inc17.17, label %if.then.17
for.inc17.16.thread: ; preds = %if.then.16
%70 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 17), align 4, !tbaa !5
%71 = and i32 %70, 1
%tobool.not.17361 = icmp eq i32 %71, 0
br i1 %tobool.not.17361, label %for.inc17.17, label %if.else
if.then.17: ; preds = %for.inc17.16
%cmp11.17 = icmp eq i32 %idx.1.15, -1
br i1 %cmp11.17, label %for.inc17.17, label %if.else
for.inc17.17: ; preds = %if.then.17, %for.inc17.16.thread, %for.inc17.16
%72 = phi i32 [ %68, %for.inc17.16 ], [ %70, %for.inc17.16.thread ], [ %68, %if.then.17 ]
%idx.1.17 = phi i32 [ %idx.1.15, %for.inc17.16 ], [ 16, %for.inc17.16.thread ], [ 17, %if.then.17 ]
%73 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 18), align 8, !tbaa !5
%74 = and i32 %73, 1
%tobool.not.18 = icmp eq i32 %74, 0
br i1 %tobool.not.18, label %for.inc17.18, label %if.then.18
if.then.18: ; preds = %for.inc17.17
%cmp11.18 = icmp eq i32 %idx.1.17, -1
br i1 %cmp11.18, label %for.inc17.18.thread, label %if.else
for.inc17.18: ; preds = %for.inc17.17
%75 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 19), align 4, !tbaa !5
%76 = and i32 %75, 1
%tobool.not.19 = icmp eq i32 %76, 0
br i1 %tobool.not.19, label %for.inc17.19, label %if.then.19
for.inc17.18.thread: ; preds = %if.then.18
%77 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 19), align 4, !tbaa !5
%78 = and i32 %77, 1
%tobool.not.19366 = icmp eq i32 %78, 0
br i1 %tobool.not.19366, label %for.inc17.19, label %if.else
if.then.19: ; preds = %for.inc17.18
%cmp11.19 = icmp eq i32 %idx.1.17, -1
br i1 %cmp11.19, label %for.inc17.19, label %if.else
for.inc17.19: ; preds = %if.then.19, %for.inc17.18.thread, %for.inc17.18
%79 = phi i32 [ %75, %for.inc17.18 ], [ %77, %for.inc17.18.thread ], [ %75, %if.then.19 ]
%idx.1.19 = phi i32 [ %idx.1.17, %for.inc17.18 ], [ 18, %for.inc17.18.thread ], [ 19, %if.then.19 ]
%80 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 20), align 16, !tbaa !5
%81 = and i32 %80, 1
%tobool.not.20 = icmp eq i32 %81, 0
br i1 %tobool.not.20, label %for.inc17.20, label %if.then.20
if.then.20: ; preds = %for.inc17.19
%cmp11.20 = icmp eq i32 %idx.1.19, -1
br i1 %cmp11.20, label %for.inc17.20.thread, label %if.else
for.inc17.20: ; preds = %for.inc17.19
%82 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 21), align 4, !tbaa !5
%83 = and i32 %82, 1
%tobool.not.21 = icmp eq i32 %83, 0
br i1 %tobool.not.21, label %for.inc17.21, label %if.then.21
for.inc17.20.thread: ; preds = %if.then.20
%84 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 21), align 4, !tbaa !5
%85 = and i32 %84, 1
%tobool.not.21371 = icmp eq i32 %85, 0
br i1 %tobool.not.21371, label %for.inc17.21, label %if.else
if.then.21: ; preds = %for.inc17.20
%cmp11.21 = icmp eq i32 %idx.1.19, -1
br i1 %cmp11.21, label %for.inc17.21, label %if.else
for.inc17.21: ; preds = %if.then.21, %for.inc17.20.thread, %for.inc17.20
%86 = phi i32 [ %82, %for.inc17.20 ], [ %84, %for.inc17.20.thread ], [ %82, %if.then.21 ]
%idx.1.21 = phi i32 [ %idx.1.19, %for.inc17.20 ], [ 20, %for.inc17.20.thread ], [ 21, %if.then.21 ]
%87 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 22), align 8, !tbaa !5
%88 = and i32 %87, 1
%tobool.not.22 = icmp eq i32 %88, 0
br i1 %tobool.not.22, label %for.inc17.22, label %if.then.22
if.then.22: ; preds = %for.inc17.21
%cmp11.22 = icmp eq i32 %idx.1.21, -1
br i1 %cmp11.22, label %for.inc17.22.thread, label %if.else
for.inc17.22: ; preds = %for.inc17.21
%89 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 23), align 4, !tbaa !5
%90 = and i32 %89, 1
%tobool.not.23 = icmp eq i32 %90, 0
br i1 %tobool.not.23, label %for.inc17.23, label %if.then.23
for.inc17.22.thread: ; preds = %if.then.22
%91 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 23), align 4, !tbaa !5
%92 = and i32 %91, 1
%tobool.not.23376 = icmp eq i32 %92, 0
br i1 %tobool.not.23376, label %for.inc17.23, label %if.else
if.then.23: ; preds = %for.inc17.22
%cmp11.23 = icmp eq i32 %idx.1.21, -1
br i1 %cmp11.23, label %for.inc17.23, label %if.else
for.inc17.23: ; preds = %if.then.23, %for.inc17.22.thread, %for.inc17.22
%93 = phi i32 [ %89, %for.inc17.22 ], [ %91, %for.inc17.22.thread ], [ %89, %if.then.23 ]
%idx.1.23 = phi i32 [ %idx.1.21, %for.inc17.22 ], [ 22, %for.inc17.22.thread ], [ 23, %if.then.23 ]
%94 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 24), align 16, !tbaa !5
%95 = and i32 %94, 1
%tobool.not.24 = icmp eq i32 %95, 0
br i1 %tobool.not.24, label %for.inc17.24, label %if.then.24
if.then.24: ; preds = %for.inc17.23
%cmp11.24 = icmp eq i32 %idx.1.23, -1
br i1 %cmp11.24, label %for.inc17.24.thread, label %if.else
for.inc17.24: ; preds = %for.inc17.23
%96 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 25), align 4, !tbaa !5
%97 = and i32 %96, 1
%tobool.not.25 = icmp eq i32 %97, 0
br i1 %tobool.not.25, label %for.inc17.25, label %if.then.25
for.inc17.24.thread: ; preds = %if.then.24
%98 = load i32, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 25), align 4, !tbaa !5
%99 = and i32 %98, 1
%tobool.not.25381 = icmp eq i32 %99, 0
br i1 %tobool.not.25381, label %for.inc17.25, label %if.else
if.then.25: ; preds = %for.inc17.24
%cmp11.25 = icmp eq i32 %idx.1.23, -1
br i1 %cmp11.25, label %for.inc17.25, label %if.else
for.inc17.25: ; preds = %if.then.25, %for.inc17.24.thread, %for.inc17.24
%100 = phi i32 [ %96, %for.inc17.24 ], [ %98, %for.inc17.24.thread ], [ %96, %if.then.25 ]
%idx.1.25 = phi i32 [ %idx.1.23, %for.inc17.24 ], [ 24, %for.inc17.24.thread ], [ 25, %if.then.25 ]
%101 = shufflevector <2 x i32> %3, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
%102 = insertelement <4 x i32> %101, i32 %23, i64 2
%103 = insertelement <4 x i32> %102, i32 %22, i64 3
%104 = sdiv <4 x i32> %103, <i32 2, i32 2, i32 2, i32 2>
store <4 x i32> %104, ptr @c, align 16, !tbaa !5
%105 = insertelement <4 x i32> poison, i32 %24, i64 0
%106 = insertelement <4 x i32> %105, i32 %30, i64 1
%107 = insertelement <4 x i32> %106, i32 %31, i64 2
%108 = insertelement <4 x i32> %107, i32 %37, i64 3
%109 = sdiv <4 x i32> %108, <i32 2, i32 2, i32 2, i32 2>
store <4 x i32> %109, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 4), align 16, !tbaa !5
%110 = insertelement <4 x i32> poison, i32 %38, i64 0
%111 = insertelement <4 x i32> %110, i32 %44, i64 1
%112 = insertelement <4 x i32> %111, i32 %45, i64 2
%113 = insertelement <4 x i32> %112, i32 %51, i64 3
%114 = sdiv <4 x i32> %113, <i32 2, i32 2, i32 2, i32 2>
store <4 x i32> %114, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 8), align 16, !tbaa !5
%115 = insertelement <4 x i32> poison, i32 %52, i64 0
%116 = insertelement <4 x i32> %115, i32 %58, i64 1
%117 = insertelement <4 x i32> %116, i32 %59, i64 2
%118 = insertelement <4 x i32> %117, i32 %65, i64 3
%119 = sdiv <4 x i32> %118, <i32 2, i32 2, i32 2, i32 2>
store <4 x i32> %119, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 12), align 16, !tbaa !5
%120 = insertelement <4 x i32> poison, i32 %66, i64 0
%121 = insertelement <4 x i32> %120, i32 %72, i64 1
%122 = insertelement <4 x i32> %121, i32 %73, i64 2
%123 = insertelement <4 x i32> %122, i32 %79, i64 3
%124 = sdiv <4 x i32> %123, <i32 2, i32 2, i32 2, i32 2>
store <4 x i32> %124, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 16), align 16, !tbaa !5
%125 = insertelement <4 x i32> poison, i32 %80, i64 0
%126 = insertelement <4 x i32> %125, i32 %86, i64 1
%127 = insertelement <4 x i32> %126, i32 %87, i64 2
%128 = insertelement <4 x i32> %127, i32 %93, i64 3
%129 = sdiv <4 x i32> %128, <i32 2, i32 2, i32 2, i32 2>
store <4 x i32> %129, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 20), align 16, !tbaa !5
%130 = insertelement <2 x i32> poison, i32 %94, i64 0
%131 = insertelement <2 x i32> %130, i32 %100, i64 1
%132 = sdiv <2 x i32> %131, <i32 2, i32 2>
store <2 x i32> %132, ptr getelementptr inbounds ([30 x i32], ptr @c, i64 0, i64 24), align 16, !tbaa !5
%idxprom31 = sext i32 %idx.1.25 to i64
%arrayidx32 = getelementptr inbounds [30 x i32], ptr @c, i64 0, i64 %idxprom31
%133 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%inc33 = add nsw i32 %133, 1
store i32 %inc33, ptr %arrayidx32, align 4, !tbaa !5
br i1 %cmp272, label %for.body39, label %for.cond68.preheader.thread
for.cond68.preheader.thread: ; preds = %for.inc17.25
%ans.promoted385 = load i64, ptr @ans, align 8, !tbaa !12
br label %for.cond.cleanup101
for.cond68.preheader: ; preds = %if.end62
%ans.promoted = load i64, ptr @ans, align 8, !tbaa !12
br i1 %cmp272, label %for.body72.preheader, label %for.cond.cleanup101
for.body72.preheader: ; preds = %for.cond68.preheader
%134 = add i64 %call1, -1
%xtraiter393 = and i64 %call1, 1
%135 = icmp eq i64 %134, 0
br i1 %135, label %for.cond98.preheader.unr-lcssa, label %for.body72.preheader.new
for.body72.preheader.new: ; preds = %for.body72.preheader
%unroll_iter396 = and i64 %call1, -2
br label %for.body72
for.body39: ; preds = %for.inc17.25, %if.end62
%i34.0278 = phi i64 [ %inc64, %if.end62 ], [ 0, %for.inc17.25 ]
%arrayidx40 = getelementptr inbounds [200010 x i8], ptr @s, i64 0, i64 %i34.0278
%136 = load i8, ptr %arrayidx40, align 1, !tbaa !17
%conv41 = sext i8 %136 to i32
%sub42 = add nsw i32 %conv41, -97
%idxprom43 = sext i32 %sub42 to i64
%arrayidx44 = getelementptr inbounds [30 x i32], ptr @c, i64 0, i64 %idxprom43
%137 = load i32, ptr %arrayidx44, align 4, !tbaa !5
switch i32 %137, label %if.else55 [
i32 0, label %if.else60
i32 1, label %land.lhs.true
]
land.lhs.true: ; preds = %for.body39
%cmp51 = icmp eq i32 %sub42, %idx.1.25
br i1 %cmp51, label %if.end57, label %if.else55
if.else55: ; preds = %for.body39, %land.lhs.true
br label %if.end57
if.end57: ; preds = %land.lhs.true, %if.else55
%.sink = phi i32 [ -1, %if.else55 ], [ -2, %land.lhs.true ]
%arrayidx56 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %i34.0278
store i32 %.sink, ptr %arrayidx56, align 4, !tbaa !5
%dec = add nsw i32 %137, -1
store i32 %dec, ptr %arrayidx44, align 4, !tbaa !5
br label %if.end62
if.else60: ; preds = %for.body39
%arrayidx61 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %i34.0278
store i32 -3, ptr %arrayidx61, align 4, !tbaa !5
br label %if.end62
if.end62: ; preds = %if.else60, %if.end57
%inc64 = add nuw nsw i64 %i34.0278, 1
%exitcond305.not = icmp eq i64 %inc64, %call1
br i1 %exitcond305.not, label %for.cond68.preheader, label %for.body39, !llvm.loop !19
for.cond98.preheader.unr-lcssa: ; preds = %if.end81.1, %for.body72.preheader
%add280.lcssa.ph = phi i64 [ undef, %for.body72.preheader ], [ %add280.1, %if.end81.1 ]
%i67.0285.unr = phi i64 [ 0, %for.body72.preheader ], [ %inc93.1, %if.end81.1 ]
%cnt.0284.unr = phi i32 [ 0, %for.body72.preheader ], [ %spec.select.1, %if.end81.1 ]
%add281283.unr = phi i64 [ %ans.promoted, %for.body72.preheader ], [ %add280.1, %if.end81.1 ]
%lcmp.mod394.not = icmp eq i64 %xtraiter393, 0
br i1 %lcmp.mod394.not, label %for.cond98.preheader, label %for.body72.epil
for.body72.epil: ; preds = %for.cond98.preheader.unr-lcssa
%arrayidx73.epil = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %i67.0285.unr
%138 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5
%switch.epil = icmp ugt i32 %138, -3
br i1 %switch.epil, label %if.then79.epil, label %for.cond98.preheader
if.then79.epil: ; preds = %for.body72.epil
%conv80.epil = zext i32 %cnt.0284.unr to i64
%add.epil = add nsw i64 %add281283.unr, %conv80.epil
store i64 %add.epil, ptr @ans, align 8, !tbaa !12
br label %for.cond98.preheader
for.cond98.preheader: ; preds = %for.body72.epil, %if.then79.epil, %for.cond98.preheader.unr-lcssa
%add280.lcssa = phi i64 [ %add280.lcssa.ph, %for.cond98.preheader.unr-lcssa ], [ %add281283.unr, %for.body72.epil ], [ %add.epil, %if.then79.epil ]
br i1 %cmp272, label %for.body102.preheader, label %for.cond.cleanup101
for.body102.preheader: ; preds = %for.cond98.preheader
%xtraiter398 = and i64 %call1, 1
%139 = icmp eq i64 %134, 0
br i1 %139, label %for.cond.cleanup101.loopexit.unr-lcssa, label %for.body102.preheader.new
for.body102.preheader.new: ; preds = %for.body102.preheader
%unroll_iter400 = and i64 %call1, -2
br label %for.body102
for.body72: ; preds = %if.end81.1, %for.body72.preheader.new
%i67.0285 = phi i64 [ 0, %for.body72.preheader.new ], [ %inc93.1, %if.end81.1 ]
%cnt.0284 = phi i32 [ 0, %for.body72.preheader.new ], [ %spec.select.1, %if.end81.1 ]
%add281283 = phi i64 [ %ans.promoted, %for.body72.preheader.new ], [ %add280.1, %if.end81.1 ]
%niter397 = phi i64 [ 0, %for.body72.preheader.new ], [ %niter397.next.1, %if.end81.1 ]
%arrayidx73 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %i67.0285
%140 = load i32, ptr %arrayidx73, align 8, !tbaa !5
%switch = icmp ugt i32 %140, -3
br i1 %switch, label %if.then79, label %if.end81
if.then79: ; preds = %for.body72
%conv80 = zext i32 %cnt.0284 to i64
%add = add nsw i64 %add281283, %conv80
store i64 %add, ptr @ans, align 8, !tbaa !12
br label %if.end81
if.end81: ; preds = %for.body72, %if.then79
%add280 = phi i64 [ %add281283, %for.body72 ], [ %add, %if.then79 ]
%.off269 = add i32 %140, 3
%switch270 = icmp ult i32 %.off269, 2
%inc90 = zext i1 %switch270 to i32
%spec.select = add nuw nsw i32 %cnt.0284, %inc90
%inc93 = or i64 %i67.0285, 1
%arrayidx73.1 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %inc93
%141 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5
%switch.1 = icmp ugt i32 %141, -3
br i1 %switch.1, label %if.then79.1, label %if.end81.1
if.then79.1: ; preds = %if.end81
%conv80.1 = zext i32 %spec.select to i64
%add.1 = add nsw i64 %add280, %conv80.1
store i64 %add.1, ptr @ans, align 8, !tbaa !12
br label %if.end81.1
if.end81.1: ; preds = %if.then79.1, %if.end81
%add280.1 = phi i64 [ %add280, %if.end81 ], [ %add.1, %if.then79.1 ]
%.off269.1 = add i32 %141, 3
%switch270.1 = icmp ult i32 %.off269.1, 2
%inc90.1 = zext i1 %switch270.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc90.1
%inc93.1 = add nuw nsw i64 %i67.0285, 2
%niter397.next.1 = add i64 %niter397, 2
%niter397.ncmp.1 = icmp eq i64 %niter397.next.1, %unroll_iter396
br i1 %niter397.ncmp.1, label %for.cond98.preheader.unr-lcssa, label %for.body72, !llvm.loop !20
for.cond.cleanup101.loopexit.unr-lcssa: ; preds = %for.inc110.1, %for.body102.preheader
%i97.0288.unr = phi i64 [ 0, %for.body102.preheader ], [ %inc111.1, %for.inc110.1 ]
%cnt96.0287.unr = phi i32 [ 0, %for.body102.preheader ], [ %cnt96.1.1, %for.inc110.1 ]
%lcmp.mod399.not = icmp eq i64 %xtraiter398, 0
br i1 %lcmp.mod399.not, label %for.cond.cleanup101, label %for.body102.epil
for.body102.epil: ; preds = %for.cond.cleanup101.loopexit.unr-lcssa
%arrayidx103.epil = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %i97.0288.unr
%142 = load i32, ptr %arrayidx103.epil, align 4, !tbaa !5
%cmp104.epil = icmp eq i32 %142, -1
br i1 %cmp104.epil, label %if.then106.epil, label %for.cond.cleanup101
if.then106.epil: ; preds = %for.body102.epil
store i32 %cnt96.0287.unr, ptr %arrayidx103.epil, align 4, !tbaa !5
br label %for.cond.cleanup101
for.cond.cleanup101: ; preds = %for.cond.cleanup101.loopexit.unr-lcssa, %if.then106.epil, %for.body102.epil, %for.cond68.preheader, %for.cond68.preheader.thread, %for.cond98.preheader
%ans.promoted297387 = phi i64 [ %add280.lcssa, %for.cond98.preheader ], [ %ans.promoted385, %for.cond68.preheader.thread ], [ %ans.promoted, %for.cond68.preheader ], [ %add280.lcssa, %for.body102.epil ], [ %add280.lcssa, %if.then106.epil ], [ %add280.lcssa, %for.cond.cleanup101.loopexit.unr-lcssa ]
%143 = trunc i64 %call1 to i32
%conv116 = add i32 %143, -1
%cmp118289 = icmp sgt i32 %conv116, -1
br i1 %cmp118289, label %for.body121.preheader, label %for.cond.cleanup139
for.body121.preheader: ; preds = %for.cond.cleanup101
%144 = zext i32 %conv116 to i64
%145 = add nuw nsw i64 %144, 1
%xtraiter402 = and i64 %145, 1
%146 = icmp eq i32 %conv116, 0
br i1 %146, label %for.cond136.preheader.unr-lcssa, label %for.body121.preheader.new
for.body121.preheader.new: ; preds = %for.body121.preheader
%unroll_iter404 = and i64 %145, 8589934590
br label %for.body121
for.body102: ; preds = %for.inc110.1, %for.body102.preheader.new
%i97.0288 = phi i64 [ 0, %for.body102.preheader.new ], [ %inc111.1, %for.inc110.1 ]
%cnt96.0287 = phi i32 [ 0, %for.body102.preheader.new ], [ %cnt96.1.1, %for.inc110.1 ]
%niter401 = phi i64 [ 0, %for.body102.preheader.new ], [ %niter401.next.1, %for.inc110.1 ]
%arrayidx103 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %i97.0288
%147 = load i32, ptr %arrayidx103, align 8, !tbaa !5
%cmp104 = icmp eq i32 %147, -1
br i1 %cmp104, label %if.then106, label %for.inc110
if.then106: ; preds = %for.body102
%inc107 = add nsw i32 %cnt96.0287, 1
store i32 %cnt96.0287, ptr %arrayidx103, align 8, !tbaa !5
br label %for.inc110
for.inc110: ; preds = %for.body102, %if.then106
%cnt96.1 = phi i32 [ %inc107, %if.then106 ], [ %cnt96.0287, %for.body102 ]
%inc111 = or i64 %i97.0288, 1
%arrayidx103.1 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %inc111
%148 = load i32, ptr %arrayidx103.1, align 4, !tbaa !5
%cmp104.1 = icmp eq i32 %148, -1
br i1 %cmp104.1, label %if.then106.1, label %for.inc110.1
if.then106.1: ; preds = %for.inc110
%inc107.1 = add nsw i32 %cnt96.1, 1
store i32 %cnt96.1, ptr %arrayidx103.1, align 4, !tbaa !5
br label %for.inc110.1
for.inc110.1: ; preds = %if.then106.1, %for.inc110
%cnt96.1.1 = phi i32 [ %inc107.1, %if.then106.1 ], [ %cnt96.1, %for.inc110 ]
%inc111.1 = add nuw nsw i64 %i97.0288, 2
%niter401.next.1 = add i64 %niter401, 2
%niter401.ncmp.1 = icmp eq i64 %niter401.next.1, %unroll_iter400
br i1 %niter401.ncmp.1, label %for.cond.cleanup101.loopexit.unr-lcssa, label %for.body102, !llvm.loop !21
for.cond136.preheader.unr-lcssa: ; preds = %for.inc131.1, %for.body121.preheader
%indvars.iv.unr = phi i64 [ %144, %for.body121.preheader ], [ %indvars.iv.next.1, %for.inc131.1 ]
%cnt96.2290.unr = phi i32 [ 0, %for.body121.preheader ], [ %cnt96.3.1, %for.inc131.1 ]
%lcmp.mod403.not = icmp eq i64 %xtraiter402, 0
br i1 %lcmp.mod403.not, label %for.cond136.preheader, label %for.body121.epil
for.body121.epil: ; preds = %for.cond136.preheader.unr-lcssa
%arrayidx123.epil = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv.unr
%149 = load i32, ptr %arrayidx123.epil, align 4, !tbaa !5
%cmp124.epil = icmp eq i32 %149, -3
br i1 %cmp124.epil, label %if.then126.epil, label %for.cond136.preheader
if.then126.epil: ; preds = %for.body121.epil
store i32 %cnt96.2290.unr, ptr %arrayidx123.epil, align 4, !tbaa !5
br label %for.cond136.preheader
for.cond136.preheader: ; preds = %for.body121.epil, %if.then126.epil, %for.cond136.preheader.unr-lcssa
%cmp144293 = icmp sgt i32 %conv116, 0
br i1 %cmp144293, label %for.cond143.preheader.us, label %for.cond.cleanup139
for.cond143.preheader.us: ; preds = %for.cond136.preheader, %cleanup182.us
%i135.0296.us = phi i64 [ %inc186.us, %cleanup182.us ], [ 0, %for.cond136.preheader ]
br label %while.cond.preheader.us
land.rhs.us: ; preds = %while.cond.preheader.us, %while.body.us
%indvars.iv309 = phi i64 [ %156, %while.cond.preheader.us ], [ %indvars.iv.next310, %while.body.us ]
%arrayidx151.us = getelementptr inbounds [200010 x i8], ptr @s, i64 0, i64 %indvars.iv309
%150 = load i8, ptr %arrayidx151.us, align 1, !tbaa !17
%conv152.us = sext i8 %150 to i64
%sub153.us = add nsw i64 %conv152.us, -97
%cmp155.not.us = icmp eq i64 %sub153.us, %i135.0296.us
br i1 %cmp155.not.us, label %while.end.us.split.loop.exit389, label %while.body.us
while.body.us: ; preds = %land.rhs.us
%indvars.iv.next310 = add nsw i64 %indvars.iv309, 1
%cmp148.us = icmp slt i64 %indvars.iv.next310, %157
br i1 %cmp148.us, label %land.rhs.us, label %while.end.us, !llvm.loop !22
while.end.us.split.loop.exit389: ; preds = %land.rhs.us
%151 = trunc i64 %indvars.iv309 to i32
br label %while.end.us
while.end.us: ; preds = %while.body.us, %while.end.us.split.loop.exit389
%l.1.lcssa.us = phi i32 [ %151, %while.end.us.split.loop.exit389 ], [ %smax, %while.body.us ]
%cmp158.us = icmp eq i32 %l.1.lcssa.us, %r.0295.us
br i1 %cmp158.us, label %cleanup182.us, label %while.cond162.us
while.cond162.us: ; preds = %while.end.us, %while.cond162.us
%indvars.iv312 = phi i64 [ %indvars.iv.next313, %while.cond162.us ], [ %157, %while.end.us ]
%arrayidx164.us = getelementptr inbounds [200010 x i8], ptr @s, i64 0, i64 %indvars.iv312
%152 = load i8, ptr %arrayidx164.us, align 1, !tbaa !17
%conv165.us = sext i8 %152 to i64
%sub166.us = add nsw i64 %conv165.us, -97
%cmp168.not.us = icmp eq i64 %sub166.us, %i135.0296.us
%indvars.iv.next313 = add i64 %indvars.iv312, -1
br i1 %cmp168.not.us, label %while.end172.us, label %while.cond162.us, !llvm.loop !23
while.end172.us: ; preds = %while.cond162.us
%153 = trunc i64 %indvars.iv312 to i32
%arrayidx174.us = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv312
%154 = load i32, ptr %arrayidx174.us, align 4, !tbaa !5
%idxprom175.us = sext i32 %l.1.lcssa.us to i64
%arrayidx176.us = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %idxprom175.us
%155 = load i32, ptr %arrayidx176.us, align 4, !tbaa !5
%idxprom177.us = sext i32 %155 to i64
%arrayidx178.us = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %idxprom177.us
store i32 %154, ptr %arrayidx178.us, align 4, !tbaa !5
%inc180.us = add nsw i32 %l.1.lcssa.us, 1
%dec181.us = add nsw i32 %153, -1
%cmp144.us = icmp slt i32 %inc180.us, %dec181.us
br i1 %cmp144.us, label %while.cond.preheader.us, label %cleanup182.us, !llvm.loop !24
cleanup182.us: ; preds = %while.end172.us, %while.end.us
%inc186.us = add nuw nsw i64 %i135.0296.us, 1
%exitcond315.not = icmp eq i64 %inc186.us, 26
br i1 %exitcond315.not, label %for.cond.cleanup139, label %for.cond143.preheader.us, !llvm.loop !25
while.cond.preheader.us: ; preds = %for.cond143.preheader.us, %while.end172.us
%r.0295.us = phi i32 [ %conv116, %for.cond143.preheader.us ], [ %dec181.us, %while.end172.us ]
%l.0294.us = phi i32 [ 0, %for.cond143.preheader.us ], [ %inc180.us, %while.end172.us ]
%156 = sext i32 %l.0294.us to i64
%157 = sext i32 %r.0295.us to i64
%158 = add nsw i32 %l.0294.us, 1
%smax = tail call i32 @llvm.smax.i32(i32 %r.0295.us, i32 %158)
br label %land.rhs.us
for.body121: ; preds = %for.inc131.1, %for.body121.preheader.new
%indvars.iv = phi i64 [ %144, %for.body121.preheader.new ], [ %indvars.iv.next.1, %for.inc131.1 ]
%cnt96.2290 = phi i32 [ 0, %for.body121.preheader.new ], [ %cnt96.3.1, %for.inc131.1 ]
%niter405 = phi i64 [ 0, %for.body121.preheader.new ], [ %niter405.next.1, %for.inc131.1 ]
%arrayidx123 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv
%159 = load i32, ptr %arrayidx123, align 4, !tbaa !5
%cmp124 = icmp eq i32 %159, -3
br i1 %cmp124, label %if.then126, label %for.inc131
if.then126: ; preds = %for.body121
%inc127 = add nsw i32 %cnt96.2290, 1
store i32 %cnt96.2290, ptr %arrayidx123, align 4, !tbaa !5
br label %for.inc131
for.inc131: ; preds = %for.body121, %if.then126
%cnt96.3 = phi i32 [ %inc127, %if.then126 ], [ %cnt96.2290, %for.body121 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx123.1 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv.next
%160 = load i32, ptr %arrayidx123.1, align 4, !tbaa !5
%cmp124.1 = icmp eq i32 %160, -3
br i1 %cmp124.1, label %if.then126.1, label %for.inc131.1
if.then126.1: ; preds = %for.inc131
%inc127.1 = add nsw i32 %cnt96.3, 1
store i32 %cnt96.3, ptr %arrayidx123.1, align 4, !tbaa !5
br label %for.inc131.1
for.inc131.1: ; preds = %if.then126.1, %for.inc131
%cnt96.3.1 = phi i32 [ %inc127.1, %if.then126.1 ], [ %cnt96.3, %for.inc131 ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, -2
%niter405.next.1 = add i64 %niter405, 2
%niter405.ncmp.1.not = icmp eq i64 %niter405.next.1, %unroll_iter404
br i1 %niter405.ncmp.1.not, label %for.cond136.preheader.unr-lcssa, label %for.body121, !llvm.loop !26
for.cond.cleanup139: ; preds = %cleanup182.us, %for.cond.cleanup101, %for.cond136.preheader
store i32 131072, ptr @segNUM, align 4, !tbaa !5
store ptr getelementptr inbounds ([262144 x %struct.atai], ptr @segN, i64 0, i64 131072), ptr @seg, align 8, !tbaa !9
%div191 = sdiv i64 %call1, 2
%cmp192299 = icmp sgt i64 %call1, 1
br i1 %cmp192299, label %for.body195.lr.ph, label %for.cond.cleanup194
for.body195.lr.ph: ; preds = %for.cond.cleanup139
%conv198 = trunc i64 %div191 to i32
br label %for.body195
for.cond.cleanup194: ; preds = %segupdate.exit, %for.cond.cleanup139
%161 = phi i64 [ %ans.promoted297387, %for.cond.cleanup139 ], [ %add200, %segupdate.exit ]
%call208 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %161)
br label %cleanup209
for.body195: ; preds = %for.body195.lr.ph, %segupdate.exit
%i189.0301 = phi i64 [ 0, %for.body195.lr.ph ], [ %inc205, %segupdate.exit ]
%add200298300 = phi i64 [ %ans.promoted297387, %for.body195.lr.ph ], [ %add200, %segupdate.exit ]
%arrayidx196 = getelementptr inbounds [200010 x i32], ptr @p, i64 0, i64 %i189.0301
%162 = load i32, ptr %arrayidx196, align 4, !tbaa !5
%call.i = tail call i64 @segcalcsub(i32 noundef %162, i32 noundef %conv198, i32 noundef 1, i32 noundef 0, i32 noundef 131072)
%add200 = add nsw i64 %add200298300, %call.i
store i64 %add200, ptr @ans, align 8, !tbaa !12
%add.i = add nsw i32 %162, 131072
%idxprom.i = sext i32 %add.i to i64
%arrayidx.i = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom.i
store i64 1, ptr %arrayidx.i, align 8, !tbaa.struct !11
%node.addr.0.off17.i = add i32 %162, 131073
%tobool.not18.i = icmp ult i32 %node.addr.0.off17.i, 3
br i1 %tobool.not18.i, label %segupdate.exit, label %while.body.i
while.body.i: ; preds = %for.body195, %while.body.i
%node.addr.019.i = phi i32 [ %div.i, %while.body.i ], [ %add.i, %for.body195 ]
%div.i = sdiv i32 %node.addr.019.i, 2
%idxprom1.i = sext i32 %div.i to i64
%arrayidx2.i = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom1.i
%mul.i = shl nsw i32 %div.i, 1
%idxprom3.i = sext i32 %mul.i to i64
%arrayidx4.i = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom3.i
%add6.i = or i32 %mul.i, 1
%idxprom7.i = sext i32 %add6.i to i64
%arrayidx8.i = getelementptr inbounds [262144 x %struct.atai], ptr @segN, i64 0, i64 %idxprom7.i
%163 = load i64, ptr %arrayidx4.i, align 16
%164 = load i64, ptr %arrayidx8.i, align 8
%add.i.i = add nsw i64 %164, %163
store i64 %add.i.i, ptr %arrayidx2.i, align 8, !tbaa.struct !11
%node.addr.0.off.i = add nsw i32 %div.i, 1
%tobool.not.i = icmp ult i32 %node.addr.0.off.i, 3
br i1 %tobool.not.i, label %segupdate.exit, label %while.body.i, !llvm.loop !16
segupdate.exit: ; preds = %while.body.i, %for.body195
%inc205 = add nuw nsw i64 %i189.0301, 1
%exitcond316.not = icmp eq i64 %inc205, %div191
br i1 %exitcond316.not, label %for.cond.cleanup194, label %for.body195, !llvm.loop !27
cleanup209: ; preds = %if.else, %for.cond.cleanup194
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; 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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{i64 0, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
!26 = distinct !{!26, !15}
!27 = distinct !{!27, !15}
|
#include <stdio.h>
int n, ns;
int main()
{
int i, j;
scanf("%d%d", &n, &ns);
for ( i = 0; i < ns; ++ i )
{
int m = 1 << i, t = n - (m<<1);
for ( j = 0; j < t; ++j )
printf(" %d"+!j, n-m);
for ( ; j < n-m-1; ++j )
printf(" %d"+!j, j-t+n-m+1);
for ( ; j < n; ++j )
printf(" %d"+!j, n);
puts("");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26541/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26541/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@n = dso_local global i32 0, align 4
@ns = dso_local global i32 0, align 4
@.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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @ns)
%0 = load i32, ptr @ns, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end39
for.body: ; preds = %entry, %for.end35
%i.064 = phi i32 [ %inc38, %for.end35 ], [ 0, %entry ]
%shl = shl nuw i32 1, %i.064
%1 = load i32, ptr @n, align 4, !tbaa !5
%shl1.neg = shl i32 -2, %i.064
%sub = add i32 %1, %shl1.neg
%cmp355 = icmp sgt i32 %sub, 0
br i1 %cmp355, label %for.body4, label %for.cond7.preheader
for.cond7.preheader.loopexit: ; preds = %for.body4
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.cond7.preheader
for.cond7.preheader: ; preds = %for.cond7.preheader.loopexit, %for.body
%2 = phi i32 [ %1, %for.body ], [ %.pre, %for.cond7.preheader.loopexit ]
%j.0.lcssa = phi i32 [ 0, %for.body ], [ %sub, %for.cond7.preheader.loopexit ]
%3 = xor i32 %shl, -1
%sub957 = add i32 %2, %3
%cmp1058 = icmp slt i32 %j.0.lcssa, %sub957
br i1 %cmp1058, label %for.body11.lr.ph, label %for.cond24.preheader
for.body11.lr.ph: ; preds = %for.cond7.preheader
%4 = add i32 %shl, %sub
br label %for.body11
for.body4: ; preds = %for.body, %for.body4
%j.056 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ]
%tobool.not = icmp eq i32 %j.056, 0
%idx.ext = zext i1 %tobool.not to i64
%add.ptr = getelementptr inbounds i8, ptr @.str.1, i64 %idx.ext
%5 = load i32, ptr @n, align 4, !tbaa !5
%sub5 = sub nsw i32 %5, %shl
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %add.ptr, i32 noundef %sub5)
%inc = add nuw nsw i32 %j.056, 1
%exitcond.not = icmp eq i32 %inc, %sub
br i1 %exitcond.not, label %for.cond7.preheader.loopexit, label %for.body4, !llvm.loop !9
for.cond24.preheader: ; preds = %for.body11, %for.cond7.preheader
%6 = phi i32 [ %2, %for.cond7.preheader ], [ %8, %for.body11 ]
%j.1.lcssa = phi i32 [ %j.0.lcssa, %for.cond7.preheader ], [ %inc22, %for.body11 ]
%cmp2561 = icmp slt i32 %j.1.lcssa, %6
br i1 %cmp2561, label %for.body26, label %for.end35
for.body11: ; preds = %for.body11.lr.ph, %for.body11
%7 = phi i32 [ %2, %for.body11.lr.ph ], [ %8, %for.body11 ]
%j.159 = phi i32 [ %j.0.lcssa, %for.body11.lr.ph ], [ %inc22, %for.body11 ]
%tobool12.not = icmp eq i32 %j.159, 0
%idx.ext15 = zext i1 %tobool12.not to i64
%add.ptr16 = getelementptr inbounds i8, ptr @.str.1, i64 %idx.ext15
%reass.sub = sub i32 %j.159, %4
%sub18 = add i32 %reass.sub, 1
%add19 = add i32 %sub18, %7
%call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %add.ptr16, i32 noundef %add19)
%inc22 = add nuw nsw i32 %j.159, 1
%8 = load i32, ptr @n, align 4, !tbaa !5
%sub9 = add i32 %8, %3
%cmp10 = icmp slt i32 %inc22, %sub9
br i1 %cmp10, label %for.body11, label %for.cond24.preheader, !llvm.loop !11
for.body26: ; preds = %for.cond24.preheader, %for.body26
%9 = phi i32 [ %10, %for.body26 ], [ %6, %for.cond24.preheader ]
%j.262 = phi i32 [ %inc34, %for.body26 ], [ %j.1.lcssa, %for.cond24.preheader ]
%tobool27.not = icmp eq i32 %j.262, 0
%idx.ext30 = zext i1 %tobool27.not to i64
%add.ptr31 = getelementptr inbounds i8, ptr @.str.1, i64 %idx.ext30
%call32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %add.ptr31, i32 noundef %9)
%inc34 = add nuw nsw i32 %j.262, 1
%10 = load i32, ptr @n, align 4, !tbaa !5
%cmp25 = icmp slt i32 %inc34, %10
br i1 %cmp25, label %for.body26, label %for.end35, !llvm.loop !12
for.end35: ; preds = %for.body26, %for.cond24.preheader
%putchar = tail call i32 @putchar(i32 10)
%inc38 = add nuw nsw i32 %i.064, 1
%11 = load i32, ptr @ns, align 4, !tbaa !5
%cmp = icmp slt i32 %inc38, %11
br i1 %cmp, label %for.body, label %for.end39, !llvm.loop !13
for.end39: ; preds = %for.end35, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void){
int alphabet[26] = {0};
int c, i;
do{
c = getchar();
alphabet[c-'a'] = 1;
}while(c >= 'a' && c <= 'z');
for(i=0; i<26; i++){
if(alphabet[i] == 0){
printf("%c\n", i+'a');
return 0;
}
}
printf("None\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265453/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265453/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@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:
%alphabet = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alphabet) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alphabet, i8 0, i64 104, i1 false)
br label %do.body
do.body: ; preds = %do.body, %entry
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%sub = add nsw i32 %call.i, -97
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !9
%1 = icmp ult i32 %sub, 26
br i1 %1, label %do.body, label %for.body.preheader, !llvm.loop !11
for.body.preheader: ; preds = %do.body
%2 = load i32, ptr %alphabet, align 16, !tbaa !9
%cmp5 = icmp eq i32 %2, 0
br i1 %cmp5, label %if.then, label %for.inc
if.then: ; preds = %for.inc.24, %for.inc.23, %for.inc.22, %for.inc.21, %for.inc.20, %for.inc.19, %for.inc.18, %for.inc.17, %for.inc.16, %for.inc.15, %for.inc.14, %for.inc.13, %for.inc.12, %for.inc.11, %for.inc.10, %for.inc.9, %for.inc.8, %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %for.body.preheader
%i.016.lcssa.wide = phi i32 [ 97, %for.body.preheader ], [ 98, %for.inc ], [ 99, %for.inc.1 ], [ 100, %for.inc.2 ], [ 101, %for.inc.3 ], [ 102, %for.inc.4 ], [ 103, %for.inc.5 ], [ 104, %for.inc.6 ], [ 105, %for.inc.7 ], [ 106, %for.inc.8 ], [ 107, %for.inc.9 ], [ 108, %for.inc.10 ], [ 109, %for.inc.11 ], [ 110, %for.inc.12 ], [ 111, %for.inc.13 ], [ 112, %for.inc.14 ], [ 113, %for.inc.15 ], [ 114, %for.inc.16 ], [ 115, %for.inc.17 ], [ 116, %for.inc.18 ], [ 117, %for.inc.19 ], [ 118, %for.inc.20 ], [ 119, %for.inc.21 ], [ 120, %for.inc.22 ], [ 121, %for.inc.23 ], [ 122, %for.inc.24 ]
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.016.lcssa.wide)
br label %cleanup
for.inc: ; preds = %for.body.preheader
%arrayidx4.1 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 1
%3 = load i32, ptr %arrayidx4.1, align 4, !tbaa !9
%cmp5.1 = icmp eq i32 %3, 0
br i1 %cmp5.1, label %if.then, label %for.inc.1
for.inc.1: ; preds = %for.inc
%arrayidx4.2 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 2
%4 = load i32, ptr %arrayidx4.2, align 8, !tbaa !9
%cmp5.2 = icmp eq i32 %4, 0
br i1 %cmp5.2, label %if.then, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%arrayidx4.3 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 3
%5 = load i32, ptr %arrayidx4.3, align 4, !tbaa !9
%cmp5.3 = icmp eq i32 %5, 0
br i1 %cmp5.3, label %if.then, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%arrayidx4.4 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 4
%6 = load i32, ptr %arrayidx4.4, align 16, !tbaa !9
%cmp5.4 = icmp eq i32 %6, 0
br i1 %cmp5.4, label %if.then, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%arrayidx4.5 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 5
%7 = load i32, ptr %arrayidx4.5, align 4, !tbaa !9
%cmp5.5 = icmp eq i32 %7, 0
br i1 %cmp5.5, label %if.then, label %for.inc.5
for.inc.5: ; preds = %for.inc.4
%arrayidx4.6 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 6
%8 = load i32, ptr %arrayidx4.6, align 8, !tbaa !9
%cmp5.6 = icmp eq i32 %8, 0
br i1 %cmp5.6, label %if.then, label %for.inc.6
for.inc.6: ; preds = %for.inc.5
%arrayidx4.7 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 7
%9 = load i32, ptr %arrayidx4.7, align 4, !tbaa !9
%cmp5.7 = icmp eq i32 %9, 0
br i1 %cmp5.7, label %if.then, label %for.inc.7
for.inc.7: ; preds = %for.inc.6
%arrayidx4.8 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 8
%10 = load i32, ptr %arrayidx4.8, align 16, !tbaa !9
%cmp5.8 = icmp eq i32 %10, 0
br i1 %cmp5.8, label %if.then, label %for.inc.8
for.inc.8: ; preds = %for.inc.7
%arrayidx4.9 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 9
%11 = load i32, ptr %arrayidx4.9, align 4, !tbaa !9
%cmp5.9 = icmp eq i32 %11, 0
br i1 %cmp5.9, label %if.then, label %for.inc.9
for.inc.9: ; preds = %for.inc.8
%arrayidx4.10 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 10
%12 = load i32, ptr %arrayidx4.10, align 8, !tbaa !9
%cmp5.10 = icmp eq i32 %12, 0
br i1 %cmp5.10, label %if.then, label %for.inc.10
for.inc.10: ; preds = %for.inc.9
%arrayidx4.11 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 11
%13 = load i32, ptr %arrayidx4.11, align 4, !tbaa !9
%cmp5.11 = icmp eq i32 %13, 0
br i1 %cmp5.11, label %if.then, label %for.inc.11
for.inc.11: ; preds = %for.inc.10
%arrayidx4.12 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 12
%14 = load i32, ptr %arrayidx4.12, align 16, !tbaa !9
%cmp5.12 = icmp eq i32 %14, 0
br i1 %cmp5.12, label %if.then, label %for.inc.12
for.inc.12: ; preds = %for.inc.11
%arrayidx4.13 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 13
%15 = load i32, ptr %arrayidx4.13, align 4, !tbaa !9
%cmp5.13 = icmp eq i32 %15, 0
br i1 %cmp5.13, label %if.then, label %for.inc.13
for.inc.13: ; preds = %for.inc.12
%arrayidx4.14 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 14
%16 = load i32, ptr %arrayidx4.14, align 8, !tbaa !9
%cmp5.14 = icmp eq i32 %16, 0
br i1 %cmp5.14, label %if.then, label %for.inc.14
for.inc.14: ; preds = %for.inc.13
%arrayidx4.15 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 15
%17 = load i32, ptr %arrayidx4.15, align 4, !tbaa !9
%cmp5.15 = icmp eq i32 %17, 0
br i1 %cmp5.15, label %if.then, label %for.inc.15
for.inc.15: ; preds = %for.inc.14
%arrayidx4.16 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 16
%18 = load i32, ptr %arrayidx4.16, align 16, !tbaa !9
%cmp5.16 = icmp eq i32 %18, 0
br i1 %cmp5.16, label %if.then, label %for.inc.16
for.inc.16: ; preds = %for.inc.15
%arrayidx4.17 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 17
%19 = load i32, ptr %arrayidx4.17, align 4, !tbaa !9
%cmp5.17 = icmp eq i32 %19, 0
br i1 %cmp5.17, label %if.then, label %for.inc.17
for.inc.17: ; preds = %for.inc.16
%arrayidx4.18 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 18
%20 = load i32, ptr %arrayidx4.18, align 8, !tbaa !9
%cmp5.18 = icmp eq i32 %20, 0
br i1 %cmp5.18, label %if.then, label %for.inc.18
for.inc.18: ; preds = %for.inc.17
%arrayidx4.19 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 19
%21 = load i32, ptr %arrayidx4.19, align 4, !tbaa !9
%cmp5.19 = icmp eq i32 %21, 0
br i1 %cmp5.19, label %if.then, label %for.inc.19
for.inc.19: ; preds = %for.inc.18
%arrayidx4.20 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 20
%22 = load i32, ptr %arrayidx4.20, align 16, !tbaa !9
%cmp5.20 = icmp eq i32 %22, 0
br i1 %cmp5.20, label %if.then, label %for.inc.20
for.inc.20: ; preds = %for.inc.19
%arrayidx4.21 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 21
%23 = load i32, ptr %arrayidx4.21, align 4, !tbaa !9
%cmp5.21 = icmp eq i32 %23, 0
br i1 %cmp5.21, label %if.then, label %for.inc.21
for.inc.21: ; preds = %for.inc.20
%arrayidx4.22 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 22
%24 = load i32, ptr %arrayidx4.22, align 8, !tbaa !9
%cmp5.22 = icmp eq i32 %24, 0
br i1 %cmp5.22, label %if.then, label %for.inc.22
for.inc.22: ; preds = %for.inc.21
%arrayidx4.23 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 23
%25 = load i32, ptr %arrayidx4.23, align 4, !tbaa !9
%cmp5.23 = icmp eq i32 %25, 0
br i1 %cmp5.23, label %if.then, label %for.inc.23
for.inc.23: ; preds = %for.inc.22
%arrayidx4.24 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 24
%26 = load i32, ptr %arrayidx4.24, align 16, !tbaa !9
%cmp5.24 = icmp eq i32 %26, 0
br i1 %cmp5.24, label %if.then, label %for.inc.24
for.inc.24: ; preds = %for.inc.23
%arrayidx4.25 = getelementptr inbounds [26 x i32], ptr %alphabet, i64 0, i64 25
%27 = load i32, ptr %arrayidx4.25, align 4, !tbaa !9
%cmp5.25 = icmp eq i32 %27, 0
br i1 %cmp5.25, label %if.then, label %for.inc.25
for.inc.25: ; preds = %for.inc.24
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
cleanup: ; preds = %for.inc.25, %if.then
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alphabet) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3
; 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int min(int a, int b)
{
if (a < b) {
return a;
} else {
return b;
}
}
int main()
{
int n, k, x = 1, i, j;
scanf("%d %d", &n, &k);
for (i = 0; i < k; i++) {
for (j = 0; j < n; j++) {
if (j > 0) putchar(' ');
printf("%d", min(x + j + 1, n));
}
puts("");
x *= 2;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26554/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26554/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.cond1.preheader, label %for.end12
for.cond1.preheader: ; preds = %entry, %for.end
%i.023 = phi i32 [ %inc11, %for.end ], [ 0, %entry ]
%x.022 = phi i32 [ %mul, %for.end ], [ 1, %entry ]
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp219 = icmp sgt i32 %1, 0
br i1 %cmp219, label %if.end.peel, label %for.end
if.end.peel: ; preds = %for.cond1.preheader
%add = add nuw nsw i32 %x.022, 1
%a.b.i.peel = call i32 @llvm.smin.i32(i32 %add, i32 %1)
%call8.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.b.i.peel)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp2.peel = icmp sgt i32 %2, 1
br i1 %cmp2.peel, label %if.end, label %for.end
if.end: ; preds = %if.end.peel, %if.end
%j.020 = phi i32 [ %inc, %if.end ], [ 1, %if.end.peel ]
%3 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call noundef i32 @putc(i32 noundef 32, ptr noundef %3)
%.pre = load i32, ptr %n, align 4, !tbaa !5
%add6 = add i32 %add, %j.020
%a.b.i = call i32 @llvm.smin.i32(i32 %add6, i32 %.pre)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.b.i)
%inc = add nuw nsw i32 %j.020, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc, %4
br i1 %cmp2, label %if.end, label %for.end, !llvm.loop !11
for.end: ; preds = %if.end, %if.end.peel, %for.cond1.preheader
%5 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i18 = call noundef i32 @putc(i32 noundef 10, ptr noundef %5)
%mul = shl nsw i32 %x.022, 1
%inc11 = add nuw nsw i32 %i.023, 1
%6 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp slt i32 %inc11, %6
br i1 %cmp, label %for.cond1.preheader, label %for.end12, !llvm.loop !14
for.end12: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main(){
int i=0;
char data[100000]={'\0'},al[]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int k[27]={0};
scanf("%s",data);
while(data[i]!='\0'){
k[data[i]-'a']=1;
i++;
}
i=0;
while(k[i]==1){
i++;
}
if(i==26){
printf("None\n");
}else{
printf("%c\n",al[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265590/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265590/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.al = private unnamed_addr constant [26 x i8] c"abcdefghijklmnopqrstuvwxyz", align 16
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%c\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:
%data = alloca [100000 x i8], align 16
%k = alloca [27 x i32], align 16
call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %data) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100000) %data, i8 0, i64 100000, i1 false)
call void @llvm.lifetime.start.p0(i64 108, ptr nonnull %k) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(108) %k, i8 0, i64 108, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %data)
%0 = load i8, ptr %data, align 16, !tbaa !5
%cmp.not28 = icmp eq i8 %0, 0
br i1 %cmp.not28, label %while.cond7.preheader, label %while.body
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%1 = phi i8 [ %2, %while.body ], [ %0, %entry ]
%conv = sext i8 %1 to i64
%sub = add nsw i64 %conv, -97
%arrayidx6 = getelementptr inbounds [27 x i32], ptr %k, i64 0, i64 %sub
store i32 1, ptr %arrayidx6, align 4, !tbaa !8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100000 x i8], ptr %data, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %while.cond7.preheader, label %while.body, !llvm.loop !10
while.cond7.preheader: ; preds = %while.body, %entry
br label %while.cond7
while.cond7: ; preds = %while.cond7.preheader, %while.cond7
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %while.cond7 ], [ 0, %while.cond7.preheader ]
%arrayidx9 = getelementptr inbounds [27 x i32], ptr %k, i64 0, i64 %indvars.iv30
%3 = load i32, ptr %arrayidx9, align 4, !tbaa !8
%cmp10 = icmp eq i32 %3, 1
%indvars.iv.next31 = add nuw i64 %indvars.iv30, 1
br i1 %cmp10, label %while.cond7, label %while.end14, !llvm.loop !12
while.end14: ; preds = %while.cond7
%4 = and i64 %indvars.iv30, 4294967295
%cmp15 = icmp eq i64 %4, 26
br i1 %cmp15, label %if.then, label %if.else
if.then: ; preds = %while.end14
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %while.end14
%arrayidx19 = getelementptr inbounds [26 x i8], ptr @__const.main.al, i64 0, i64 %indvars.iv30
%5 = load i8, ptr %arrayidx19, align 1, !tbaa !5
%conv20 = sext i8 %5 to i32
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv20)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 108, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %data) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h> // printf(), scanf()
#include <stdbool.h>
typedef struct fare_tbl
{
int v;
int w;
int price;
} fare_t;
int
main(int argc, char **argv)
{
const fare_t fare[7] = {{60, 2, 600}, {80, 5, 800}, {100, 10, 1000}, {120, 15, 1200}, {140, 20, 1400}, {160, 25, 1600}, {0, 0, 0}};
while (true)
{
int n;
scanf("%d", &n);
if (n == 0)
break;
int total = 0;
for (int i = 0; i < n; ++i)
{
int x, y, z, w;
scanf("%d%d%d%d", &x, &y, &z, &w);
int v = x + y + z;
int j;
for (j = 0; j < 6; ++j)
{
if (fare[j].v >= v && fare[j].w >= w)
break;
}
total += fare[j].price;
}
printf("%d\n", total);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265640/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265640/source.c"
target datalayout = "e-m:e-p270: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.fare_tbl = type { i32, i32, i32 }
@__const.main.fare = private unnamed_addr constant [7 x %struct.fare_tbl] [%struct.fare_tbl { i32 60, i32 2, i32 600 }, %struct.fare_tbl { i32 80, i32 5, i32 800 }, %struct.fare_tbl { i32 100, i32 10, i32 1000 }, %struct.fare_tbl { i32 120, i32 15, i32 1200 }, %struct.fare_tbl { i32 140, i32 20, i32 1400 }, %struct.fare_tbl { i32 160, i32 25, i32 1600 }, %struct.fare_tbl zeroinitializer], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp36 = icmp eq i32 %0, 0
br i1 %cmp36, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %cleanup
%1 = phi i32 [ %8, %cleanup ], [ %0, %entry ]
%cmp132 = icmp sgt i32 %1, 0
br i1 %cmp132, label %for.body, label %cleanup
for.body: ; preds = %for.cond.preheader, %for.end
%i.034 = phi i32 [ %inc19, %for.end ], [ 0, %for.cond.preheader ]
%total.033 = phi i32 [ %add17, %for.end ], [ 0, %for.cond.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z, ptr noundef nonnull %w)
%2 = load i32, ptr %x, align 4, !tbaa !5
%3 = load i32, ptr %y, align 4, !tbaa !5
%add = add nsw i32 %3, %2
%4 = load i32, ptr %z, align 4, !tbaa !5
%add3 = add nsw i32 %add, %4
%5 = load i32, ptr %w, align 4
%cmp8.not = icmp sgt i32 %add3, 60
br i1 %cmp8.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %for.body
%cmp12.not = icmp sgt i32 %5, 2
br i1 %cmp12.not, label %land.lhs.true.1, label %for.end
for.inc: ; preds = %for.body
%cmp8.not.1 = icmp ugt i32 %add3, 80
br i1 %cmp8.not.1, label %for.inc.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %land.lhs.true, %for.inc
%cmp12.not.1 = icmp sgt i32 %5, 5
br i1 %cmp12.not.1, label %land.lhs.true.2, label %for.end
for.inc.1: ; preds = %for.inc
%cmp8.not.2 = icmp ugt i32 %add3, 100
br i1 %cmp8.not.2, label %for.inc.2, label %land.lhs.true.2
land.lhs.true.2: ; preds = %land.lhs.true.1, %for.inc.1
%cmp12.not.2 = icmp sgt i32 %5, 10
br i1 %cmp12.not.2, label %land.lhs.true.3, label %for.end
for.inc.2: ; preds = %for.inc.1
%cmp8.not.3 = icmp ugt i32 %add3, 120
br i1 %cmp8.not.3, label %for.inc.3, label %land.lhs.true.3
land.lhs.true.3: ; preds = %land.lhs.true.2, %for.inc.2
%cmp12.not.3 = icmp sgt i32 %5, 15
br i1 %cmp12.not.3, label %land.lhs.true.4, label %for.end
for.inc.3: ; preds = %for.inc.2
%cmp8.not.4 = icmp ugt i32 %add3, 140
br i1 %cmp8.not.4, label %for.inc.4, label %land.lhs.true.4
land.lhs.true.4: ; preds = %land.lhs.true.3, %for.inc.3
%cmp12.not.4 = icmp sgt i32 %5, 20
br i1 %cmp12.not.4, label %land.lhs.true.5, label %for.end
for.inc.4: ; preds = %for.inc.3
%cmp8.not.5 = icmp ugt i32 %add3, 160
%cmp12.not.5 = icmp sgt i32 %5, 25
%or.cond = select i1 %cmp8.not.5, i1 true, i1 %cmp12.not.5
br i1 %or.cond, label %for.inc.5, label %for.end
land.lhs.true.5: ; preds = %land.lhs.true.4
%cmp12.not.5.old = icmp sgt i32 %5, 25
br i1 %cmp12.not.5.old, label %for.inc.5, label %for.end
for.inc.5: ; preds = %land.lhs.true.5, %for.inc.4
br label %for.end
for.end: ; preds = %for.inc.4, %for.inc.5, %land.lhs.true.5, %land.lhs.true.4, %land.lhs.true.3, %land.lhs.true.2, %land.lhs.true.1, %land.lhs.true
%j.0.lcssa = phi i64 [ 0, %land.lhs.true ], [ 1, %land.lhs.true.1 ], [ 2, %land.lhs.true.2 ], [ 3, %land.lhs.true.3 ], [ 4, %land.lhs.true.4 ], [ 5, %land.lhs.true.5 ], [ 6, %for.inc.5 ], [ 5, %for.inc.4 ]
%price = getelementptr inbounds [7 x %struct.fare_tbl], ptr @__const.main.fare, i64 0, i64 %j.0.lcssa, i32 2
%6 = load i32, ptr %price, align 4, !tbaa !9
%add17 = add nsw i32 %6, %total.033
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
%inc19 = add nuw nsw i32 %i.034, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc19, %7
br i1 %cmp1, label %for.body, label %cleanup, !llvm.loop !11
cleanup: ; preds = %for.end, %for.cond.preheader
%total.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add17, %for.end ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %total.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %8, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"fare_tbl", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int n,a;
double x[1000], y[1000], sum=0, sum2=0, sum3=0, sum4=0;
scanf("%d", &n);
for (a = 0; a < n; a++)
{
scanf("%lf", &x[a]);
}
for (a = 0; a < n; a++)
{
scanf("%lf", &y[a]);
if (x[a] < y[a])
{
x[a] = -1 * x[a];
y[a] = -1 * y[a];
sum4 = x[a] - y[a];
}
}
for (a = 0; a < n; a++)
{
sum =1.0*( sum + (x[a] - y[a]));
sum2 = 1.0*(sum2 + ((x[a] - y[a])*(x[a] - y[a])));
sum3 = 1.0*(sum3 + ((x[a] - y[a])*(x[a] - y[a])*(x[a] - y[a])));
if ((x[a] - y[a]) > sum4)
{
sum4 = x[a] - y[a];
}
}
printf("%f\n%f\n%f\n%f\n", sum, sqrt(sum2), pow(sum3, 1.0 / 3.0),sum4);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265705/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265705/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"%f\0A%f\0A%f\0A%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca [1000 x double], align 16
%y = alloca [1000 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp122 = icmp sgt i32 %0, 0
br i1 %cmp122, label %for.body, label %for.end83
for.cond2.preheader: ; preds = %for.body
%cmp3124 = icmp sgt i32 %1, 0
br i1 %cmp3124, label %for.body4, label %for.end83
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x double], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond29.preheader: ; preds = %for.inc26
%cmp30128 = icmp sgt i32 %5, 0
br i1 %cmp30128, label %for.body31.preheader, label %for.end83
for.body31.preheader: ; preds = %for.cond29.preheader
%wide.trip.count = zext i32 %5 to i64
br label %for.body31
for.body4: ; preds = %for.cond2.preheader, %for.inc26
%indvars.iv142 = phi i64 [ %indvars.iv.next143, %for.inc26 ], [ 0, %for.cond2.preheader ]
%sum4.0126 = phi double [ %sum4.1, %for.inc26 ], [ 0.000000e+00, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [1000 x double], ptr %y, i64 0, i64 %indvars.iv142
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%arrayidx9 = getelementptr inbounds [1000 x double], ptr %x, i64 0, i64 %indvars.iv142
%3 = load double, ptr %arrayidx9, align 8, !tbaa !11
%4 = load double, ptr %arrayidx6, align 8, !tbaa !11
%cmp12 = fcmp olt double %3, %4
br i1 %cmp12, label %if.then, label %for.inc26
if.then: ; preds = %for.body4
%mul = fneg double %3
store double %mul, ptr %arrayidx9, align 8, !tbaa !11
%mul19 = fneg double %4
store double %mul19, ptr %arrayidx6, align 8, !tbaa !11
%sub = fsub double %4, %3
br label %for.inc26
for.inc26: ; preds = %for.body4, %if.then
%sum4.1 = phi double [ %sub, %if.then ], [ %sum4.0126, %for.body4 ]
%indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp3 = icmp slt i64 %indvars.iv.next143, %6
br i1 %cmp3, label %for.body4, label %for.cond29.preheader, !llvm.loop !13
for.body31: ; preds = %for.body31.preheader, %for.body31
%indvars.iv145 = phi i64 [ 0, %for.body31.preheader ], [ %indvars.iv.next146, %for.body31 ]
%sum4.2133 = phi double [ %sum4.1, %for.body31.preheader ], [ %sum4.3, %for.body31 ]
%sum.0130 = phi double [ 0.000000e+00, %for.body31.preheader ], [ %add, %for.body31 ]
%7 = phi <2 x double> [ zeroinitializer, %for.body31.preheader ], [ %13, %for.body31 ]
%arrayidx33 = getelementptr inbounds [1000 x double], ptr %x, i64 0, i64 %indvars.iv145
%8 = load double, ptr %arrayidx33, align 8, !tbaa !11
%arrayidx35 = getelementptr inbounds [1000 x double], ptr %y, i64 0, i64 %indvars.iv145
%9 = load double, ptr %arrayidx35, align 8, !tbaa !11
%sub36 = fsub double %8, %9
%add = fadd double %sum.0130, %sub36
%mul60 = fmul double %sub36, %sub36
%10 = insertelement <2 x double> poison, double %sub36, i64 0
%11 = insertelement <2 x double> %10, double %mul60, i64 1
%12 = shufflevector <2 x double> %10, <2 x double> poison, <2 x i32> zeroinitializer
%13 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %12, <2 x double> %7)
%cmp73 = fcmp ogt double %sub36, %sum4.2133
%sum4.3 = select i1 %cmp73, double %sub36, double %sum4.2133
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%exitcond.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count
br i1 %exitcond.not, label %for.end83, label %for.body31, !llvm.loop !14
for.end83: ; preds = %for.body31, %entry, %for.cond2.preheader, %for.cond29.preheader
%sum.0.lcssa = phi double [ 0.000000e+00, %for.cond29.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body31 ]
%sum4.2.lcssa = phi double [ %sum4.1, %for.cond29.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %sum4.3, %for.body31 ]
%14 = phi <2 x double> [ zeroinitializer, %for.cond29.preheader ], [ zeroinitializer, %for.cond2.preheader ], [ zeroinitializer, %entry ], [ %13, %for.body31 ]
%15 = extractelement <2 x double> %14, i64 0
%call84 = call double @sqrt(double noundef %15) #5
%16 = extractelement <2 x double> %14, i64 1
%call85 = call double @pow(double noundef %16, double noundef 0x3FD5555555555555) #5
%call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %sum.0.lcssa, double noundef %call84, double noundef %call85, double noundef %sum4.2.lcssa)
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main(){
int x[1000],y[100];
int n,i,max=0;
double D[5],sum1=0,sum2=0;
for(i=0;i<5;i++){
D[i]=0;
}
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&x[i]);
}
for(i=0;i<n;i++){
scanf("%d",&y[i]);
}
for(i=0;i<n;i++){
D[0]+=abs(x[i]-y[i]);
}
for(i=0;i<n;i++){
sum1+=(x[i]-y[i])*(x[i]-y[i]);
}
D[1]=sqrt(sum1);
for(i=0;i<n;i++){
sum2+=pow(abs(x[i]-y[i]),3);
}
D[2]=pow(sum2,0.33333333333);
for(i=0;i<n;i++){
if(max<=abs(x[i]-y[i])){
max=abs(x[i]-y[i]);
}
}
D[3]=max;
for(i=0;i<4;i++){
printf("%.8f\n",D[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265763/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265763/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"%.8f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [1000 x i32], align 16
%y = alloca [100 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %y) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp2134 = icmp sgt i32 %0, 0
br i1 %cmp2134, label %for.body3, label %for.end48
for.cond10.preheader: ; preds = %for.body3
%cmp11136 = icmp sgt i32 %1, 0
br i1 %cmp11136, label %for.body12, label %for.end48
for.body3: ; preds = %entry, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ]
%arrayidx5 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !9
for.cond19.preheader: ; preds = %for.body12
%cmp20139 = icmp sgt i32 %5, 0
br i1 %cmp20139, label %for.body21.preheader, label %for.end48
for.body21.preheader: ; preds = %for.cond19.preheader
%wide.trip.count = zext i32 %5 to i64
%3 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %for.cond30.preheader.unr-lcssa, label %for.body21.preheader.new
for.body21.preheader.new: ; preds = %for.body21.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body21
for.body12: ; preds = %for.cond10.preheader, %for.body12
%indvars.iv158 = phi i64 [ %indvars.iv.next159, %for.body12 ], [ 0, %for.cond10.preheader ]
%arrayidx14 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv158
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx14)
%indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp11 = icmp slt i64 %indvars.iv.next159, %6
br i1 %cmp11, label %for.body12, label %for.cond19.preheader, !llvm.loop !11
for.cond30.preheader.unr-lcssa: ; preds = %for.body21, %for.body21.preheader
%add.lcssa.ph = phi double [ undef, %for.body21.preheader ], [ %add.1, %for.body21 ]
%indvars.iv161.unr = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next162.1, %for.body21 ]
%.unr = phi double [ 0.000000e+00, %for.body21.preheader ], [ %add.1, %for.body21 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond30.preheader, label %for.body21.epil
for.body21.epil: ; preds = %for.cond30.preheader.unr-lcssa
%arrayidx23.epil = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv161.unr
%7 = load i32, ptr %arrayidx23.epil, align 4, !tbaa !5
%arrayidx25.epil = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv161.unr
%8 = load i32, ptr %arrayidx25.epil, align 4, !tbaa !5
%sub.epil = sub nsw i32 %7, %8
%9 = call i32 @llvm.abs.i32(i32 %sub.epil, i1 true)
%conv.epil = sitofp i32 %9 to double
%add.epil = fadd double %.unr, %conv.epil
br label %for.cond30.preheader
for.cond30.preheader: ; preds = %for.cond30.preheader.unr-lcssa, %for.body21.epil
%add.lcssa = phi double [ %add.lcssa.ph, %for.cond30.preheader.unr-lcssa ], [ %add.epil, %for.body21.epil ]
br i1 %cmp20139, label %for.body33.preheader, label %for.end48
for.body33.preheader: ; preds = %for.cond30.preheader
%wide.trip.count167 = zext i32 %5 to i64
%xtraiter204 = and i64 %wide.trip.count167, 1
%10 = icmp eq i64 %3, 0
br i1 %10, label %for.end48.loopexit.unr-lcssa, label %for.body33.preheader.new
for.body33.preheader.new: ; preds = %for.body33.preheader
%unroll_iter207 = and i64 %wide.trip.count167, 4294967294
br label %for.body33
for.body21: ; preds = %for.body21, %for.body21.preheader.new
%indvars.iv161 = phi i64 [ 0, %for.body21.preheader.new ], [ %indvars.iv.next162.1, %for.body21 ]
%11 = phi double [ 0.000000e+00, %for.body21.preheader.new ], [ %add.1, %for.body21 ]
%niter = phi i64 [ 0, %for.body21.preheader.new ], [ %niter.next.1, %for.body21 ]
%arrayidx23 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv161
%12 = load i32, ptr %arrayidx23, align 8, !tbaa !5
%arrayidx25 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv161
%13 = load i32, ptr %arrayidx25, align 8, !tbaa !5
%sub = sub nsw i32 %12, %13
%14 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%conv = sitofp i32 %14 to double
%add = fadd double %11, %conv
%indvars.iv.next162 = or i64 %indvars.iv161, 1
%arrayidx23.1 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next162
%15 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%arrayidx25.1 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv.next162
%16 = load i32, ptr %arrayidx25.1, align 4, !tbaa !5
%sub.1 = sub nsw i32 %15, %16
%17 = call i32 @llvm.abs.i32(i32 %sub.1, i1 true)
%conv.1 = sitofp i32 %17 to double
%add.1 = fadd double %add, %conv.1
%indvars.iv.next162.1 = add nuw nsw i64 %indvars.iv161, 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.cond30.preheader.unr-lcssa, label %for.body21, !llvm.loop !12
for.body33: ; preds = %for.body33, %for.body33.preheader.new
%indvars.iv164 = phi i64 [ 0, %for.body33.preheader.new ], [ %indvars.iv.next165.1, %for.body33 ]
%sum1.0144 = phi double [ 0.000000e+00, %for.body33.preheader.new ], [ %add45.1, %for.body33 ]
%niter208 = phi i64 [ 0, %for.body33.preheader.new ], [ %niter208.next.1, %for.body33 ]
%arrayidx35 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv164
%18 = load i32, ptr %arrayidx35, align 8, !tbaa !5
%arrayidx37 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv164
%19 = load i32, ptr %arrayidx37, align 8, !tbaa !5
%sub38 = sub nsw i32 %18, %19
%mul = mul nsw i32 %sub38, %sub38
%conv44 = sitofp i32 %mul to double
%add45 = fadd double %sum1.0144, %conv44
%indvars.iv.next165 = or i64 %indvars.iv164, 1
%arrayidx35.1 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next165
%20 = load i32, ptr %arrayidx35.1, align 4, !tbaa !5
%arrayidx37.1 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv.next165
%21 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5
%sub38.1 = sub nsw i32 %20, %21
%mul.1 = mul nsw i32 %sub38.1, %sub38.1
%conv44.1 = sitofp i32 %mul.1 to double
%add45.1 = fadd double %add45, %conv44.1
%indvars.iv.next165.1 = add nuw nsw i64 %indvars.iv164, 2
%niter208.next.1 = add i64 %niter208, 2
%niter208.ncmp.1 = icmp eq i64 %niter208.next.1, %unroll_iter207
br i1 %niter208.ncmp.1, label %for.end48.loopexit.unr-lcssa, label %for.body33, !llvm.loop !13
for.end48.loopexit.unr-lcssa: ; preds = %for.body33, %for.body33.preheader
%add45.lcssa.ph = phi double [ undef, %for.body33.preheader ], [ %add45.1, %for.body33 ]
%indvars.iv164.unr = phi i64 [ 0, %for.body33.preheader ], [ %indvars.iv.next165.1, %for.body33 ]
%sum1.0144.unr = phi double [ 0.000000e+00, %for.body33.preheader ], [ %add45.1, %for.body33 ]
%lcmp.mod205.not = icmp eq i64 %xtraiter204, 0
br i1 %lcmp.mod205.not, label %for.end48, label %for.body33.epil
for.body33.epil: ; preds = %for.end48.loopexit.unr-lcssa
%arrayidx35.epil = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv164.unr
%22 = load i32, ptr %arrayidx35.epil, align 4, !tbaa !5
%arrayidx37.epil = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv164.unr
%23 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !5
%sub38.epil = sub nsw i32 %22, %23
%mul.epil = mul nsw i32 %sub38.epil, %sub38.epil
%conv44.epil = sitofp i32 %mul.epil to double
%add45.epil = fadd double %sum1.0144.unr, %conv44.epil
br label %for.end48
for.end48: ; preds = %for.body33.epil, %for.end48.loopexit.unr-lcssa, %for.cond19.preheader, %entry, %for.cond10.preheader, %for.cond30.preheader
%.lcssa138189 = phi double [ %add.lcssa, %for.cond30.preheader ], [ 0.000000e+00, %for.cond10.preheader ], [ 0.000000e+00, %entry ], [ 0.000000e+00, %for.cond19.preheader ], [ %add.lcssa, %for.end48.loopexit.unr-lcssa ], [ %add.lcssa, %for.body33.epil ]
%sum1.0.lcssa = phi double [ 0.000000e+00, %for.cond30.preheader ], [ 0.000000e+00, %for.cond10.preheader ], [ 0.000000e+00, %entry ], [ 0.000000e+00, %for.cond19.preheader ], [ %add45.lcssa.ph, %for.end48.loopexit.unr-lcssa ], [ %add45.epil, %for.body33.epil ]
%call49 = call double @sqrt(double noundef %sum1.0.lcssa) #6
%24 = load i32, ptr %n, align 4, !tbaa !5
%cmp52146 = icmp sgt i32 %24, 0
br i1 %cmp52146, label %for.body54, label %for.end65
for.body54: ; preds = %for.end48, %for.body54
%indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.body54 ], [ 0, %for.end48 ]
%sum2.0148 = phi double [ %add62, %for.body54 ], [ 0.000000e+00, %for.end48 ]
%arrayidx56 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv169
%25 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%arrayidx58 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv169
%26 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%sub59 = sub nsw i32 %25, %26
%27 = call i32 @llvm.abs.i32(i32 %sub59, i1 true)
%conv60 = sitofp i32 %27 to double
%call61 = call double @pow(double noundef %conv60, double noundef 3.000000e+00) #6
%add62 = fadd double %sum2.0148, %call61
%indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1
%28 = load i32, ptr %n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp52 = icmp slt i64 %indvars.iv.next170, %29
br i1 %cmp52, label %for.body54, label %for.end65, !llvm.loop !14
for.end65: ; preds = %for.body54, %for.end48
%sum2.0.lcssa = phi double [ 0.000000e+00, %for.end48 ], [ %add62, %for.body54 ]
%call66 = call double @pow(double noundef %sum2.0.lcssa, double noundef 0x3FD5555555546AC5) #6
%30 = load i32, ptr %n, align 4, !tbaa !5
%cmp69150 = icmp sgt i32 %30, 0
br i1 %cmp69150, label %for.body71.preheader, label %for.end86
for.body71.preheader: ; preds = %for.end65
%wide.trip.count175 = zext i32 %30 to i64
%min.iters.check = icmp ult i32 %30, 8
br i1 %min.iters.check, label %for.body71.preheader198, label %vector.ph
vector.ph: ; preds = %for.body71.preheader
%n.vec = and i64 %wide.trip.count175, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %39, %vector.body ]
%vec.phi194 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
%31 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %31, align 16, !tbaa !5
%32 = getelementptr inbounds i32, ptr %31, i64 4
%wide.load195 = load <4 x i32>, ptr %32, align 16, !tbaa !5
%33 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %index
%wide.load196 = load <4 x i32>, ptr %33, align 16, !tbaa !5
%34 = getelementptr inbounds i32, ptr %33, i64 4
%wide.load197 = load <4 x i32>, ptr %34, align 16, !tbaa !5
%35 = sub nsw <4 x i32> %wide.load, %wide.load196
%36 = sub nsw <4 x i32> %wide.load195, %wide.load197
%37 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %35, i1 true)
%38 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %36, i1 true)
%39 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %37)
%40 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi194, <4 x i32> %38)
%index.next = add nuw i64 %index, 8
%41 = icmp eq i64 %index.next, %n.vec
br i1 %41, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %39, <4 x i32> %40)
%42 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count175
br i1 %cmp.n, label %for.end86.loopexit, label %for.body71.preheader198
for.body71.preheader198: ; preds = %for.body71.preheader, %middle.block
%indvars.iv172.ph = phi i64 [ 0, %for.body71.preheader ], [ %n.vec, %middle.block ]
%max.0152.ph = phi i32 [ 0, %for.body71.preheader ], [ %42, %middle.block ]
br label %for.body71
for.body71: ; preds = %for.body71.preheader198, %for.body71
%indvars.iv172 = phi i64 [ %indvars.iv.next173, %for.body71 ], [ %indvars.iv172.ph, %for.body71.preheader198 ]
%max.0152 = phi i32 [ %spec.select, %for.body71 ], [ %max.0152.ph, %for.body71.preheader198 ]
%arrayidx73 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv172
%43 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%arrayidx75 = getelementptr inbounds [100 x i32], ptr %y, i64 0, i64 %indvars.iv172
%44 = load i32, ptr %arrayidx75, align 4, !tbaa !5
%sub76 = sub nsw i32 %43, %44
%45 = call i32 @llvm.abs.i32(i32 %sub76, i1 true)
%spec.select = call i32 @llvm.smax.i32(i32 %max.0152, i32 %45)
%indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
%exitcond176.not = icmp eq i64 %indvars.iv.next173, %wide.trip.count175
br i1 %exitcond176.not, label %for.end86.loopexit, label %for.body71, !llvm.loop !18
for.end86.loopexit: ; preds = %for.body71, %middle.block
%spec.select.lcssa = phi i32 [ %42, %middle.block ], [ %spec.select, %for.body71 ]
%46 = sitofp i32 %spec.select.lcssa to double
br label %for.end86
for.end86: ; preds = %for.end86.loopexit, %for.end65
%max.0.lcssa = phi double [ 0.000000e+00, %for.end65 ], [ %46, %for.end86.loopexit ]
%call95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %.lcssa138189)
%call95.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call49)
%call95.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call66)
%call95.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %max.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #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 speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
|
#include<stdio.h>
#include<math.h>
double x[101],y[101],sum,max;
int n,i;
void D(int p){
for(i=0,sum=0;i<n;i++) sum+=pow(fabs(x[i]-y[i]),p);
printf("%.8lf\n",pow(sum,(double)1/p));
}
int main(void){
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%lf",&x[i]);
for(i=0;i<n;i++) scanf("%lf",&y[i]);
D(1);D(2);D(3);
for(i=0,max=0;i<n;i++){
if(max<fabs(x[i]-y[i])) max=fabs(x[i]-y[i]);
}
printf("%.8lf\n",max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265820/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265820/source.c"
target datalayout = "e-m:e-p270: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 0, align 4
@sum = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@n = dso_local global i32 0, align 4
@x = dso_local global [101 x double] zeroinitializer, align 16
@y = dso_local global [101 x double] zeroinitializer, align 16
@.str = private unnamed_addr constant [7 x i8] c"%.8lf\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@max = dso_local local_unnamed_addr global double 0.000000e+00, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @D(i32 noundef %p) local_unnamed_addr #0 {
entry:
store i32 0, ptr @i, align 4, !tbaa !5
store double 0.000000e+00, ptr @sum, align 8, !tbaa !9
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
%conv = sitofp i32 %p to double
br i1 %cmp7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%1 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom
%2 = load double, ptr %arrayidx, align 8, !tbaa !9
%arrayidx2 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom
%3 = load double, ptr %arrayidx2, align 8, !tbaa !9
%sub = fsub double %2, %3
%4 = tail call double @llvm.fabs.f64(double %sub)
%call = tail call double @pow(double noundef %4, double noundef %conv) #5
%5 = load double, ptr @sum, align 8, !tbaa !9
%add = fadd double %call, %5
store double %add, ptr @sum, align 8, !tbaa !9
%6 = load i32, ptr @i, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%7 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %7
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%8 = phi double [ 0.000000e+00, %entry ], [ %add, %for.body ]
%div = fdiv double 1.000000e+00, %conv
%call4 = tail call double @pow(double noundef %8, double noundef %div) #5
%call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call4)
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; 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)
store i32 0, ptr @i, align 4, !tbaa !5
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %0, 0
br i1 %cmp59, label %for.body, label %for.end10.thread
for.cond2.preheader: ; preds = %for.body
store i32 0, ptr @i, align 4, !tbaa !5
%cmp361 = icmp sgt i32 %2, 0
br i1 %cmp361, label %for.body4, label %for.end10.thread
for.body: ; preds = %entry, %for.body
%storemerge60 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%idxprom = sext i32 %storemerge60 to i64
%arrayidx = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr @i, align 4, !tbaa !5
%inc = add nsw i32 %1, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%2 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.cond2.preheader, %for.body4
%storemerge3162 = phi i32 [ %inc9, %for.body4 ], [ 0, %for.cond2.preheader ]
%idxprom5 = sext i32 %storemerge3162 to i64
%arrayidx6 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom5
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx6)
%3 = load i32, ptr @i, align 4, !tbaa !5
%inc9 = add nsw i32 %3, 1
%.pr = load i32, ptr @n, align 4, !tbaa !5
store i32 %inc9, ptr @i, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc9, %.pr
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !14
for.end10.thread: ; preds = %entry, %for.cond2.preheader
store i32 0, ptr @i, align 4, !tbaa !5
store double 0.000000e+00, ptr @sum, align 8, !tbaa !9
br label %D.exit
for.end10: ; preds = %for.body4
store i32 0, ptr @i, align 4, !tbaa !5
store double 0.000000e+00, ptr @sum, align 8, !tbaa !9
%cmp7.i = icmp sgt i32 %.pr, 0
br i1 %cmp7.i, label %for.body.i.preheader, label %D.exit
for.body.i.preheader: ; preds = %for.end10
%xtraiter = and i32 %.pr, 1
%4 = icmp eq i32 %.pr, 1
br i1 %4, label %D.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %.pr, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%inc.i66 = phi i32 [ 0, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%add.i64 = phi double [ 0.000000e+00, %for.body.i.preheader.new ], [ %add.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%idxprom.i = zext i32 %inc.i66 to i64
%arrayidx.i = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom.i
%5 = load double, ptr %arrayidx.i, align 16, !tbaa !9
%arrayidx2.i = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom.i
%6 = load double, ptr %arrayidx2.i, align 16, !tbaa !9
%sub.i = fsub double %5, %6
%7 = tail call double @llvm.fabs.f64(double %sub.i)
%add.i = fadd double %add.i64, %7
%inc.i = or i32 %inc.i66, 1
%idxprom.i.1 = zext i32 %inc.i to i64
%arrayidx.i.1 = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom.i.1
%8 = load double, ptr %arrayidx.i.1, align 8, !tbaa !9
%arrayidx2.i.1 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom.i.1
%9 = load double, ptr %arrayidx2.i.1, align 8, !tbaa !9
%sub.i.1 = fsub double %8, %9
%10 = tail call double @llvm.fabs.f64(double %sub.i.1)
%add.i.1 = fadd double %add.i, %10
%inc.i.1 = add nuw nsw i32 %inc.i66, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1.not = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1.not, label %D.exit.loopexit.unr-lcssa.loopexit, label %for.body.i, !llvm.loop !11
D.exit.loopexit.unr-lcssa.loopexit: ; preds = %for.body.i
%11 = zext i32 %inc.i.1 to i64
br label %D.exit.loopexit.unr-lcssa
D.exit.loopexit.unr-lcssa: ; preds = %D.exit.loopexit.unr-lcssa.loopexit, %for.body.i.preheader
%add.i.lcssa.ph = phi double [ undef, %for.body.i.preheader ], [ %add.i.1, %D.exit.loopexit.unr-lcssa.loopexit ]
%inc.i66.unr = phi i64 [ 0, %for.body.i.preheader ], [ %11, %D.exit.loopexit.unr-lcssa.loopexit ]
%add.i64.unr = phi double [ 0.000000e+00, %for.body.i.preheader ], [ %add.i.1, %D.exit.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %D.exit.loopexit, label %for.body.i.epil
for.body.i.epil: ; preds = %D.exit.loopexit.unr-lcssa
%arrayidx.i.epil = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %inc.i66.unr
%12 = load double, ptr %arrayidx.i.epil, align 8, !tbaa !9
%arrayidx2.i.epil = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %inc.i66.unr
%13 = load double, ptr %arrayidx2.i.epil, align 8, !tbaa !9
%sub.i.epil = fsub double %12, %13
%14 = tail call double @llvm.fabs.f64(double %sub.i.epil)
%add.i.epil = fadd double %add.i64.unr, %14
br label %D.exit.loopexit
D.exit.loopexit: ; preds = %D.exit.loopexit.unr-lcssa, %for.body.i.epil
%add.i.lcssa = phi double [ %add.i.lcssa.ph, %D.exit.loopexit.unr-lcssa ], [ %add.i.epil, %for.body.i.epil ]
%smax = tail call i32 @llvm.smax.i32(i32 %.pr, i32 1)
store double %add.i.lcssa, ptr @sum, align 8, !tbaa !9
store i32 %smax, ptr @i, align 4, !tbaa !5
br label %D.exit
D.exit: ; preds = %for.end10.thread, %D.exit.loopexit, %for.end10
%15 = phi double [ 0.000000e+00, %for.end10 ], [ %add.i.lcssa, %D.exit.loopexit ], [ 0.000000e+00, %for.end10.thread ]
%call5.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %15)
store i32 0, ptr @i, align 4, !tbaa !5
store double 0.000000e+00, ptr @sum, align 8, !tbaa !9
%16 = load i32, ptr @n, align 4, !tbaa !5
%cmp7.i32 = icmp sgt i32 %16, 0
br i1 %cmp7.i32, label %for.body.i35.preheader, label %D.exit44
for.body.i35.preheader: ; preds = %D.exit
%xtraiter86 = and i32 %16, 1
%17 = icmp eq i32 %16, 1
br i1 %17, label %D.exit44.loopexit.unr-lcssa, label %for.body.i35.preheader.new
for.body.i35.preheader.new: ; preds = %for.body.i35.preheader
%unroll_iter89 = and i32 %16, -2
br label %for.body.i35
for.body.i35: ; preds = %for.body.i35, %for.body.i35.preheader.new
%inc.i4271 = phi i32 [ 0, %for.body.i35.preheader.new ], [ %inc.i42.1, %for.body.i35 ]
%add.i4168 = phi double [ 0.000000e+00, %for.body.i35.preheader.new ], [ %add.i41.1, %for.body.i35 ]
%niter90 = phi i32 [ 0, %for.body.i35.preheader.new ], [ %niter90.next.1, %for.body.i35 ]
%idxprom.i36 = zext i32 %inc.i4271 to i64
%arrayidx.i37 = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom.i36
%18 = load double, ptr %arrayidx.i37, align 16, !tbaa !9
%arrayidx2.i38 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom.i36
%19 = load double, ptr %arrayidx2.i38, align 16, !tbaa !9
%sub.i39 = fsub double %18, %19
%square = fmul double %sub.i39, %sub.i39
%add.i41 = fadd double %add.i4168, %square
%inc.i42 = or i32 %inc.i4271, 1
%idxprom.i36.1 = zext i32 %inc.i42 to i64
%arrayidx.i37.1 = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom.i36.1
%20 = load double, ptr %arrayidx.i37.1, align 8, !tbaa !9
%arrayidx2.i38.1 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom.i36.1
%21 = load double, ptr %arrayidx2.i38.1, align 8, !tbaa !9
%sub.i39.1 = fsub double %20, %21
%square.1 = fmul double %sub.i39.1, %sub.i39.1
%add.i41.1 = fadd double %add.i41, %square.1
%inc.i42.1 = add nuw nsw i32 %inc.i4271, 2
%niter90.next.1 = add i32 %niter90, 2
%niter90.ncmp.1.not = icmp eq i32 %niter90.next.1, %unroll_iter89
br i1 %niter90.ncmp.1.not, label %D.exit44.loopexit.unr-lcssa.loopexit, label %for.body.i35, !llvm.loop !11
D.exit44.loopexit.unr-lcssa.loopexit: ; preds = %for.body.i35
%22 = zext i32 %inc.i42.1 to i64
br label %D.exit44.loopexit.unr-lcssa
D.exit44.loopexit.unr-lcssa: ; preds = %D.exit44.loopexit.unr-lcssa.loopexit, %for.body.i35.preheader
%add.i41.lcssa.ph = phi double [ undef, %for.body.i35.preheader ], [ %add.i41.1, %D.exit44.loopexit.unr-lcssa.loopexit ]
%inc.i4271.unr = phi i64 [ 0, %for.body.i35.preheader ], [ %22, %D.exit44.loopexit.unr-lcssa.loopexit ]
%add.i4168.unr = phi double [ 0.000000e+00, %for.body.i35.preheader ], [ %add.i41.1, %D.exit44.loopexit.unr-lcssa.loopexit ]
%lcmp.mod87.not = icmp eq i32 %xtraiter86, 0
br i1 %lcmp.mod87.not, label %D.exit44.loopexit, label %for.body.i35.epil
for.body.i35.epil: ; preds = %D.exit44.loopexit.unr-lcssa
%arrayidx.i37.epil = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %inc.i4271.unr
%23 = load double, ptr %arrayidx.i37.epil, align 8, !tbaa !9
%arrayidx2.i38.epil = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %inc.i4271.unr
%24 = load double, ptr %arrayidx2.i38.epil, align 8, !tbaa !9
%sub.i39.epil = fsub double %23, %24
%square.epil = fmul double %sub.i39.epil, %sub.i39.epil
%add.i41.epil = fadd double %add.i4168.unr, %square.epil
br label %D.exit44.loopexit
D.exit44.loopexit: ; preds = %D.exit44.loopexit.unr-lcssa, %for.body.i35.epil
%add.i41.lcssa = phi double [ %add.i41.lcssa.ph, %D.exit44.loopexit.unr-lcssa ], [ %add.i41.epil, %for.body.i35.epil ]
%smax77 = tail call i32 @llvm.smax.i32(i32 %16, i32 1)
store double %add.i41.lcssa, ptr @sum, align 8, !tbaa !9
store i32 %smax77, ptr @i, align 4, !tbaa !5
br label %D.exit44
D.exit44: ; preds = %D.exit44.loopexit, %D.exit
%25 = phi double [ 0.000000e+00, %D.exit ], [ %add.i41.lcssa, %D.exit44.loopexit ]
%call4.i33 = tail call double @pow(double noundef %25, double noundef 5.000000e-01) #5
%call5.i34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call4.i33)
store i32 0, ptr @i, align 4, !tbaa !5
store double 0.000000e+00, ptr @sum, align 8, !tbaa !9
%26 = load i32, ptr @n, align 4, !tbaa !5
%cmp7.i45 = icmp sgt i32 %26, 0
br i1 %cmp7.i45, label %for.body.i48, label %D.exit57
for.body.i48: ; preds = %D.exit44, %for.body.i48
%27 = phi i32 [ %inc.i55, %for.body.i48 ], [ 0, %D.exit44 ]
%idxprom.i49 = sext i32 %27 to i64
%arrayidx.i50 = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %idxprom.i49
%28 = load double, ptr %arrayidx.i50, align 8, !tbaa !9
%arrayidx2.i51 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %idxprom.i49
%29 = load double, ptr %arrayidx2.i51, align 8, !tbaa !9
%sub.i52 = fsub double %28, %29
%30 = tail call double @llvm.fabs.f64(double %sub.i52)
%call.i53 = tail call double @pow(double noundef %30, double noundef 3.000000e+00) #5
%31 = load double, ptr @sum, align 8, !tbaa !9
%add.i54 = fadd double %call.i53, %31
store double %add.i54, ptr @sum, align 8, !tbaa !9
%32 = load i32, ptr @i, align 4, !tbaa !5
%inc.i55 = add nsw i32 %32, 1
store i32 %inc.i55, ptr @i, align 4, !tbaa !5
%33 = load i32, ptr @n, align 4, !tbaa !5
%cmp.i56 = icmp slt i32 %inc.i55, %33
br i1 %cmp.i56, label %for.body.i48, label %D.exit57, !llvm.loop !11
D.exit57: ; preds = %for.body.i48, %D.exit44
%34 = phi double [ 0.000000e+00, %D.exit44 ], [ %add.i54, %for.body.i48 ]
%call4.i46 = tail call double @pow(double noundef %34, double noundef 0x3FD5555555555555) #5
%call5.i47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %call4.i46)
store i32 0, ptr @i, align 4, !tbaa !5
store double 0.000000e+00, ptr @max, align 8, !tbaa !9
%35 = load i32, ptr @n, align 4, !tbaa !5
%cmp1274 = icmp sgt i32 %35, 0
br i1 %cmp1274, label %for.body13.preheader, label %for.end26
for.body13.preheader: ; preds = %D.exit57
%wide.trip.count = zext i32 %35 to i64
%xtraiter91 = and i64 %wide.trip.count, 1
%36 = icmp eq i32 %35, 1
br i1 %36, label %for.cond11.for.end26_crit_edge.unr-lcssa, label %for.body13.preheader.new
for.body13.preheader.new: ; preds = %for.body13.preheader
%unroll_iter94 = and i64 %wide.trip.count, 4294967294
br label %for.body13
for.body13: ; preds = %for.inc24.1, %for.body13.preheader.new
%indvars.iv = phi i64 [ 0, %for.body13.preheader.new ], [ %indvars.iv.next.1, %for.inc24.1 ]
%37 = phi double [ 0.000000e+00, %for.body13.preheader.new ], [ %45, %for.inc24.1 ]
%niter95 = phi i64 [ 0, %for.body13.preheader.new ], [ %niter95.next.1, %for.inc24.1 ]
%arrayidx15 = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %indvars.iv
%38 = load double, ptr %arrayidx15, align 16, !tbaa !9
%arrayidx17 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %indvars.iv
%39 = load double, ptr %arrayidx17, align 16, !tbaa !9
%sub = fsub double %38, %39
%40 = tail call double @llvm.fabs.f64(double %sub)
%cmp18 = fcmp olt double %37, %40
br i1 %cmp18, label %if.then, label %for.inc24
if.then: ; preds = %for.body13
store double %40, ptr @max, align 8, !tbaa !9
br label %for.inc24
for.inc24: ; preds = %for.body13, %if.then
%41 = phi double [ %37, %for.body13 ], [ %40, %if.then ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx15.1 = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %indvars.iv.next
%42 = load double, ptr %arrayidx15.1, align 8, !tbaa !9
%arrayidx17.1 = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %indvars.iv.next
%43 = load double, ptr %arrayidx17.1, align 8, !tbaa !9
%sub.1 = fsub double %42, %43
%44 = tail call double @llvm.fabs.f64(double %sub.1)
%cmp18.1 = fcmp olt double %41, %44
br i1 %cmp18.1, label %if.then.1, label %for.inc24.1
if.then.1: ; preds = %for.inc24
store double %44, ptr @max, align 8, !tbaa !9
br label %for.inc24.1
for.inc24.1: ; preds = %if.then.1, %for.inc24
%45 = phi double [ %41, %for.inc24 ], [ %44, %if.then.1 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter95.next.1 = add i64 %niter95, 2
%niter95.ncmp.1 = icmp eq i64 %niter95.next.1, %unroll_iter94
br i1 %niter95.ncmp.1, label %for.cond11.for.end26_crit_edge.unr-lcssa, label %for.body13, !llvm.loop !15
for.cond11.for.end26_crit_edge.unr-lcssa: ; preds = %for.inc24.1, %for.body13.preheader
%.lcssa.ph = phi double [ undef, %for.body13.preheader ], [ %45, %for.inc24.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next.1, %for.inc24.1 ]
%.unr = phi double [ 0.000000e+00, %for.body13.preheader ], [ %45, %for.inc24.1 ]
%lcmp.mod92.not = icmp eq i64 %xtraiter91, 0
br i1 %lcmp.mod92.not, label %for.cond11.for.end26_crit_edge, label %for.body13.epil
for.body13.epil: ; preds = %for.cond11.for.end26_crit_edge.unr-lcssa
%arrayidx15.epil = getelementptr inbounds [101 x double], ptr @x, i64 0, i64 %indvars.iv.unr
%46 = load double, ptr %arrayidx15.epil, align 8, !tbaa !9
%arrayidx17.epil = getelementptr inbounds [101 x double], ptr @y, i64 0, i64 %indvars.iv.unr
%47 = load double, ptr %arrayidx17.epil, align 8, !tbaa !9
%sub.epil = fsub double %46, %47
%48 = tail call double @llvm.fabs.f64(double %sub.epil)
%cmp18.epil = fcmp olt double %.unr, %48
br i1 %cmp18.epil, label %if.then.epil, label %for.cond11.for.end26_crit_edge
if.then.epil: ; preds = %for.body13.epil
store double %48, ptr @max, align 8, !tbaa !9
br label %for.cond11.for.end26_crit_edge
for.cond11.for.end26_crit_edge: ; preds = %for.body13.epil, %if.then.epil, %for.cond11.for.end26_crit_edge.unr-lcssa
%.lcssa = phi double [ %.lcssa.ph, %for.cond11.for.end26_crit_edge.unr-lcssa ], [ %.unr, %for.body13.epil ], [ %48, %if.then.epil ]
store i32 %35, ptr @i, align 4, !tbaa !5
br label %for.end26
for.end26: ; preds = %for.cond11.for.end26_crit_edge, %D.exit57
%49 = phi double [ %.lcssa, %for.cond11.for.end26_crit_edge ], [ 0.000000e+00, %D.exit57 ]
%call27 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %49)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define NUM 100
double Manhattan(double x[NUM], double y[NUM], int n);
double Euclidean(double x[NUM], double y[NUM], int n);
double MinkowskiP3(double x[NUM], double y[NUM], int n);
double Chebyshev(double x[NUM], double y[NUM], int n);
int a;
int main(void)
{
int i ;
int j = 0;
int n ;
double ans1,ans2,ans3,ans4;
double x[NUM];
double y[NUM];
scanf("%d", &n);
for (i = 0; i < n;i++){
scanf("%lf", &x[i]);
}
for (i = 0; i < n; i++){
scanf("%lf", &y[i]);
}
ans1 = Manhattan(x, y, n);
ans2 = Euclidean(x, y, n);
ans3 = MinkowskiP3(x, y, n);
ans4 = Chebyshev(x, y, n);
printf("%lf\n%lf\n%lf\n%lf\n", ans1,ans2,ans3,ans4);
return 0;
}
double Manhattan(double x[NUM], double y[NUM], int n){
double z[NUM];
double p1 = 0;
for (a = 0; a < n; a++){
z[a] = x[a] - y[a];
p1 += abs(z[a]);
}
return p1;
}
double Euclidean(double x[NUM], double y[NUM], int n){
double z[NUM];
double s[NUM];
double p2 = 0;
for (a = 0; a < n; a++){
z[a] = x[a] - y[a];
s[a] = abs(z[a])*abs(z[a]);
p2 += s[a];
}
return sqrt(p2);
}
double MinkowskiP3(double x[NUM], double y[NUM], int n){
double z[NUM];
double s[NUM];
double p3 = 0;
for (a = 0; a < n; a++){
z[a] = x[a] - y[a];
s[a] = abs(z[a])*abs(z[a])*abs(z[a]);
p3 += s[a];
}
return pow(p3,1.0/3.0);
}
double Chebyshev(double x[NUM], double y[NUM], int n){
double z[NUM];
double s[NUM];
for (a = 0; a < n; a++){
z[a] = x[a] - y[a];
s[a] = abs(z[a]);
}
double max = s[0];
for (a = 0; a < n; a++){
if (max<s[a])
max = s[a];
}
return max;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265886/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.2 = private unnamed_addr constant [17 x i8] c"%lf\0A%lf\0A%lf\0A%lf\0A\00", align 1
@a = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s.i = alloca [100 x double], align 16
%n = alloca i32, align 4
%x = alloca [100 x double], align 16
%y = alloca [100 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %y) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp69 = icmp sgt i32 %0, 0
br i1 %cmp69, label %for.body, label %Euclidean.exit
for.cond2.preheader: ; preds = %for.body
%cmp371 = icmp sgt i32 %1, 0
br i1 %cmp371, label %for.body4, label %Euclidean.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv76
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %.pr to i64
%cmp3 = icmp slt i64 %indvars.iv.next77, %3
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.body4
%cmp9.i = icmp sgt i32 %.pr, 0
br i1 %cmp9.i, label %for.body.preheader.i, label %Euclidean.exit
for.body.preheader.i: ; preds = %for.end10
%wide.trip.count.i = zext i32 %.pr to i64
%4 = add nsw i64 %wide.trip.count.i, -1
%xtraiter = and i64 %wide.trip.count.i, 1
%5 = icmp eq i64 %4, 0
br i1 %5, label %for.body.i31.preheader.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %wide.trip.count.i, 4294967294
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ]
%p1.011.i = phi double [ 0.000000e+00, %for.body.preheader.i.new ], [ %add.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ]
%arrayidx.i = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i
%6 = load double, ptr %arrayidx.i, align 16, !tbaa !12
%arrayidx2.i = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i
%7 = load double, ptr %arrayidx2.i, align 16, !tbaa !12
%sub.i = fsub double %6, %7
%conv.i = fptosi double %sub.i to i32
%8 = call i32 @llvm.abs.i32(i32 %conv.i, i1 true)
%conv7.i = sitofp i32 %8 to double
%add.i = fadd double %p1.011.i, %conv7.i
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.next.i
%9 = load double, ptr %arrayidx.i.1, align 8, !tbaa !12
%arrayidx2.i.1 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.next.i
%10 = load double, ptr %arrayidx2.i.1, align 8, !tbaa !12
%sub.i.1 = fsub double %9, %10
%conv.i.1 = fptosi double %sub.i.1 to i32
%11 = call i32 @llvm.abs.i32(i32 %conv.i.1, i1 true)
%conv7.i.1 = sitofp i32 %11 to double
%add.i.1 = fadd double %add.i, %conv7.i.1
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.body.i31.preheader.unr-lcssa, label %for.body.i, !llvm.loop !14
for.body.i31.preheader.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%add.i.lcssa.ph = phi double [ undef, %for.body.preheader.i ], [ %add.i.1, %for.body.i ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ]
%p1.011.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i ], [ %add.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i31.preheader, label %for.body.i.epil
for.body.i.epil: ; preds = %for.body.i31.preheader.unr-lcssa
%arrayidx.i.epil = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i.unr
%12 = load double, ptr %arrayidx.i.epil, align 8, !tbaa !12
%arrayidx2.i.epil = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i.unr
%13 = load double, ptr %arrayidx2.i.epil, align 8, !tbaa !12
%sub.i.epil = fsub double %12, %13
%conv.i.epil = fptosi double %sub.i.epil to i32
%14 = call i32 @llvm.abs.i32(i32 %conv.i.epil, i1 true)
%conv7.i.epil = sitofp i32 %14 to double
%add.i.epil = fadd double %p1.011.i.unr, %conv7.i.epil
br label %for.body.i31.preheader
for.body.i31.preheader: ; preds = %for.body.i31.preheader.unr-lcssa, %for.body.i.epil
%add.i.lcssa = phi double [ %add.i.lcssa.ph, %for.body.i31.preheader.unr-lcssa ], [ %add.i.epil, %for.body.i.epil ]
%xtraiter87 = and i64 %wide.trip.count.i, 1
%15 = icmp eq i64 %4, 0
br i1 %15, label %Euclidean.exit.loopexit.unr-lcssa, label %for.body.i31.preheader.new
for.body.i31.preheader.new: ; preds = %for.body.i31.preheader
%unroll_iter90 = and i64 %wide.trip.count.i, 4294967294
br label %for.body.i31
for.body.i31: ; preds = %for.body.i31, %for.body.i31.preheader.new
%indvars.iv.i32 = phi i64 [ 0, %for.body.i31.preheader.new ], [ %indvars.iv.next.i38.1, %for.body.i31 ]
%p2.018.i = phi double [ 0.000000e+00, %for.body.i31.preheader.new ], [ %add.i37.1, %for.body.i31 ]
%niter91 = phi i64 [ 0, %for.body.i31.preheader.new ], [ %niter91.next.1, %for.body.i31 ]
%arrayidx.i33 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i32
%16 = load double, ptr %arrayidx.i33, align 16, !tbaa !12
%arrayidx2.i34 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i32
%17 = load double, ptr %arrayidx2.i34, align 16, !tbaa !12
%sub.i35 = fsub double %16, %17
%conv.i36 = fptosi double %sub.i35 to i32
%mul.i = mul i32 %conv.i36, %conv.i36
%conv10.i = sitofp i32 %mul.i to double
%add.i37 = fadd double %p2.018.i, %conv10.i
%indvars.iv.next.i38 = or i64 %indvars.iv.i32, 1
%arrayidx.i33.1 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.next.i38
%18 = load double, ptr %arrayidx.i33.1, align 8, !tbaa !12
%arrayidx2.i34.1 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.next.i38
%19 = load double, ptr %arrayidx2.i34.1, align 8, !tbaa !12
%sub.i35.1 = fsub double %18, %19
%conv.i36.1 = fptosi double %sub.i35.1 to i32
%mul.i.1 = mul i32 %conv.i36.1, %conv.i36.1
%conv10.i.1 = sitofp i32 %mul.i.1 to double
%add.i37.1 = fadd double %add.i37, %conv10.i.1
%indvars.iv.next.i38.1 = add nuw nsw i64 %indvars.iv.i32, 2
%niter91.next.1 = add i64 %niter91, 2
%niter91.ncmp.1 = icmp eq i64 %niter91.next.1, %unroll_iter90
br i1 %niter91.ncmp.1, label %Euclidean.exit.loopexit.unr-lcssa, label %for.body.i31, !llvm.loop !15
Euclidean.exit.loopexit.unr-lcssa: ; preds = %for.body.i31, %for.body.i31.preheader
%add.i37.lcssa.ph = phi double [ undef, %for.body.i31.preheader ], [ %add.i37.1, %for.body.i31 ]
%indvars.iv.i32.unr = phi i64 [ 0, %for.body.i31.preheader ], [ %indvars.iv.next.i38.1, %for.body.i31 ]
%p2.018.i.unr = phi double [ 0.000000e+00, %for.body.i31.preheader ], [ %add.i37.1, %for.body.i31 ]
%lcmp.mod88.not = icmp eq i64 %xtraiter87, 0
br i1 %lcmp.mod88.not, label %Euclidean.exit, label %for.body.i31.epil
for.body.i31.epil: ; preds = %Euclidean.exit.loopexit.unr-lcssa
%arrayidx.i33.epil = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i32.unr
%20 = load double, ptr %arrayidx.i33.epil, align 8, !tbaa !12
%arrayidx2.i34.epil = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i32.unr
%21 = load double, ptr %arrayidx2.i34.epil, align 8, !tbaa !12
%sub.i35.epil = fsub double %20, %21
%conv.i36.epil = fptosi double %sub.i35.epil to i32
%mul.i.epil = mul i32 %conv.i36.epil, %conv.i36.epil
%conv10.i.epil = sitofp i32 %mul.i.epil to double
%add.i37.epil = fadd double %p2.018.i.unr, %conv10.i.epil
br label %Euclidean.exit
Euclidean.exit: ; preds = %for.body.i31.epil, %Euclidean.exit.loopexit.unr-lcssa, %for.end10, %for.cond2.preheader, %entry
%p1.0.lcssa.i67 = phi double [ 0.000000e+00, %entry ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %for.end10 ], [ %add.i.lcssa, %Euclidean.exit.loopexit.unr-lcssa ], [ %add.i.lcssa, %for.body.i31.epil ]
%p2.0.lcssa.i = phi double [ 0.000000e+00, %entry ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %for.end10 ], [ %add.i37.lcssa.ph, %Euclidean.exit.loopexit.unr-lcssa ], [ %add.i37.epil, %for.body.i31.epil ]
%call.i = call double @sqrt(double noundef %p2.0.lcssa.i) #9
%22 = load i32, ptr %n, align 4, !tbaa !5
%cmp20.i = icmp sgt i32 %22, 0
br i1 %cmp20.i, label %for.body.preheader.i42, label %MinkowskiP3.exit
for.body.preheader.i42: ; preds = %Euclidean.exit
%wide.trip.count.i43 = zext i32 %22 to i64
%xtraiter92 = and i64 %wide.trip.count.i43, 1
%23 = icmp eq i32 %22, 1
br i1 %23, label %MinkowskiP3.exit.loopexit.unr-lcssa, label %for.body.preheader.i42.new
for.body.preheader.i42.new: ; preds = %for.body.preheader.i42
%unroll_iter95 = and i64 %wide.trip.count.i43, 4294967294
br label %for.body.i44
for.body.i44: ; preds = %for.body.i44, %for.body.preheader.i42.new
%indvars.iv.i45 = phi i64 [ 0, %for.body.preheader.i42.new ], [ %indvars.iv.next.i52.1, %for.body.i44 ]
%p3.022.i = phi double [ 0.000000e+00, %for.body.preheader.i42.new ], [ %add.i51.1, %for.body.i44 ]
%niter96 = phi i64 [ 0, %for.body.preheader.i42.new ], [ %niter96.next.1, %for.body.i44 ]
%arrayidx.i46 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i45
%24 = load double, ptr %arrayidx.i46, align 16, !tbaa !12
%arrayidx2.i47 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i45
%25 = load double, ptr %arrayidx2.i47, align 16, !tbaa !12
%sub.i48 = fsub double %24, %25
%conv.i49 = fptosi double %sub.i48 to i32
%26 = call i32 @llvm.abs.i32(i32 %conv.i49, i1 true)
%mul.i50 = mul i32 %conv.i49, %conv.i49
%mul13.i = mul nsw i32 %mul.i50, %26
%conv14.i = sitofp i32 %mul13.i to double
%add.i51 = fadd double %p3.022.i, %conv14.i
%indvars.iv.next.i52 = or i64 %indvars.iv.i45, 1
%arrayidx.i46.1 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.next.i52
%27 = load double, ptr %arrayidx.i46.1, align 8, !tbaa !12
%arrayidx2.i47.1 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.next.i52
%28 = load double, ptr %arrayidx2.i47.1, align 8, !tbaa !12
%sub.i48.1 = fsub double %27, %28
%conv.i49.1 = fptosi double %sub.i48.1 to i32
%29 = call i32 @llvm.abs.i32(i32 %conv.i49.1, i1 true)
%mul.i50.1 = mul i32 %conv.i49.1, %conv.i49.1
%mul13.i.1 = mul nsw i32 %mul.i50.1, %29
%conv14.i.1 = sitofp i32 %mul13.i.1 to double
%add.i51.1 = fadd double %add.i51, %conv14.i.1
%indvars.iv.next.i52.1 = add nuw nsw i64 %indvars.iv.i45, 2
%niter96.next.1 = add i64 %niter96, 2
%niter96.ncmp.1 = icmp eq i64 %niter96.next.1, %unroll_iter95
br i1 %niter96.ncmp.1, label %MinkowskiP3.exit.loopexit.unr-lcssa, label %for.body.i44, !llvm.loop !16
MinkowskiP3.exit.loopexit.unr-lcssa: ; preds = %for.body.i44, %for.body.preheader.i42
%add.i51.lcssa.ph = phi double [ undef, %for.body.preheader.i42 ], [ %add.i51.1, %for.body.i44 ]
%indvars.iv.i45.unr = phi i64 [ 0, %for.body.preheader.i42 ], [ %indvars.iv.next.i52.1, %for.body.i44 ]
%p3.022.i.unr = phi double [ 0.000000e+00, %for.body.preheader.i42 ], [ %add.i51.1, %for.body.i44 ]
%lcmp.mod93.not = icmp eq i64 %xtraiter92, 0
br i1 %lcmp.mod93.not, label %MinkowskiP3.exit, label %for.body.i44.epil
for.body.i44.epil: ; preds = %MinkowskiP3.exit.loopexit.unr-lcssa
%arrayidx.i46.epil = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i45.unr
%30 = load double, ptr %arrayidx.i46.epil, align 8, !tbaa !12
%arrayidx2.i47.epil = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i45.unr
%31 = load double, ptr %arrayidx2.i47.epil, align 8, !tbaa !12
%sub.i48.epil = fsub double %30, %31
%conv.i49.epil = fptosi double %sub.i48.epil to i32
%32 = call i32 @llvm.abs.i32(i32 %conv.i49.epil, i1 true)
%mul.i50.epil = mul i32 %conv.i49.epil, %conv.i49.epil
%mul13.i.epil = mul nsw i32 %mul.i50.epil, %32
%conv14.i.epil = sitofp i32 %mul13.i.epil to double
%add.i51.epil = fadd double %p3.022.i.unr, %conv14.i.epil
br label %MinkowskiP3.exit
MinkowskiP3.exit: ; preds = %for.body.i44.epil, %MinkowskiP3.exit.loopexit.unr-lcssa, %Euclidean.exit
%p3.0.lcssa.i = phi double [ 0.000000e+00, %Euclidean.exit ], [ %add.i51.lcssa.ph, %MinkowskiP3.exit.loopexit.unr-lcssa ], [ %add.i51.epil, %for.body.i44.epil ]
%call.i41 = call double @pow(double noundef %p3.0.lcssa.i, double noundef 0x3FD5555555555555) #9
%33 = load i32, ptr %n, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %s.i) #9
%cmp29.i = icmp sgt i32 %33, 0
call void @llvm.assume(i1 %cmp29.i)
%wide.trip.count.i55 = zext i32 %33 to i64
%min.iters.check = icmp ult i32 %33, 4
br i1 %min.iters.check, label %for.body.i56.preheader, label %vector.ph
vector.ph: ; preds = %MinkowskiP3.exit
%n.vec = and i64 %wide.trip.count.i55, 2147483644
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%34 = getelementptr inbounds double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %34, align 16, !tbaa !12
%35 = getelementptr inbounds double, ptr %34, i64 2
%wide.load83 = load <2 x double>, ptr %35, align 16, !tbaa !12
%36 = getelementptr inbounds double, ptr %y, i64 %index
%wide.load84 = load <2 x double>, ptr %36, align 16, !tbaa !12
%37 = getelementptr inbounds double, ptr %36, i64 2
%wide.load85 = load <2 x double>, ptr %37, align 16, !tbaa !12
%38 = fsub <2 x double> %wide.load, %wide.load84
%39 = fsub <2 x double> %wide.load83, %wide.load85
%40 = fptosi <2 x double> %38 to <2 x i32>
%41 = fptosi <2 x double> %39 to <2 x i32>
%42 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %40, i1 true)
%43 = call <2 x i32> @llvm.abs.v2i32(<2 x i32> %41, i1 true)
%44 = sitofp <2 x i32> %42 to <2 x double>
%45 = sitofp <2 x i32> %43 to <2 x double>
%46 = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %index
store <2 x double> %44, ptr %46, align 16, !tbaa !12
%47 = getelementptr inbounds double, ptr %46, i64 2
store <2 x double> %45, ptr %47, align 16, !tbaa !12
%index.next = add nuw i64 %index, 4
%48 = icmp eq i64 %index.next, %n.vec
br i1 %48, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i55
br i1 %cmp.n, label %for.body14.preheader.i, label %for.body.i56.preheader
for.body.i56.preheader: ; preds = %MinkowskiP3.exit, %middle.block
%indvars.iv.i57.ph = phi i64 [ 0, %MinkowskiP3.exit ], [ %n.vec, %middle.block ]
br label %for.body.i56
for.body.i56: ; preds = %for.body.i56.preheader, %for.body.i56
%indvars.iv.i57 = phi i64 [ %indvars.iv.next.i63, %for.body.i56 ], [ %indvars.iv.i57.ph, %for.body.i56.preheader ]
%arrayidx.i58 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.i57
%49 = load double, ptr %arrayidx.i58, align 8, !tbaa !12
%arrayidx2.i59 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.i57
%50 = load double, ptr %arrayidx2.i59, align 8, !tbaa !12
%sub.i60 = fsub double %49, %50
%conv.i61 = fptosi double %sub.i60 to i32
%51 = call i32 @llvm.abs.i32(i32 %conv.i61, i1 true)
%conv7.i62 = sitofp i32 %51 to double
%arrayidx9.i = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %indvars.iv.i57
store double %conv7.i62, ptr %arrayidx9.i, align 8, !tbaa !12
%indvars.iv.next.i63 = add nuw nsw i64 %indvars.iv.i57, 1
%exitcond.not.i64 = icmp eq i64 %indvars.iv.next.i63, %wide.trip.count.i55
br i1 %exitcond.not.i64, label %for.body14.preheader.i, label %for.body.i56, !llvm.loop !20
for.body14.preheader.i: ; preds = %for.body.i56, %middle.block
%.pre.i = load double, ptr %s.i, align 16, !tbaa !12
%xtraiter97 = and i64 %wide.trip.count.i55, 3
%52 = icmp ult i32 %33, 4
br i1 %52, label %Chebyshev.exit.unr-lcssa, label %for.body14.preheader.i.new
for.body14.preheader.i.new: ; preds = %for.body14.preheader.i
%unroll_iter100 = and i64 %wide.trip.count.i55, 2147483644
br label %for.body14.i
for.body14.i: ; preds = %for.body14.i, %for.body14.preheader.i.new
%indvars.iv37.i = phi i64 [ 0, %for.body14.preheader.i.new ], [ %indvars.iv.next38.i.3, %for.body14.i ]
%max.033.i = phi double [ %.pre.i, %for.body14.preheader.i.new ], [ %max.1.i.3, %for.body14.i ]
%niter101 = phi i64 [ 0, %for.body14.preheader.i.new ], [ %niter101.next.3, %for.body14.i ]
%arrayidx16.i = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %indvars.iv37.i
%53 = load double, ptr %arrayidx16.i, align 16, !tbaa !12
%cmp17.i = fcmp olt double %max.033.i, %53
%max.1.i = select i1 %cmp17.i, double %53, double %max.033.i
%indvars.iv.next38.i = or i64 %indvars.iv37.i, 1
%arrayidx16.i.1 = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %indvars.iv.next38.i
%54 = load double, ptr %arrayidx16.i.1, align 8, !tbaa !12
%cmp17.i.1 = fcmp olt double %max.1.i, %54
%max.1.i.1 = select i1 %cmp17.i.1, double %54, double %max.1.i
%indvars.iv.next38.i.1 = or i64 %indvars.iv37.i, 2
%arrayidx16.i.2 = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %indvars.iv.next38.i.1
%55 = load double, ptr %arrayidx16.i.2, align 16, !tbaa !12
%cmp17.i.2 = fcmp olt double %max.1.i.1, %55
%max.1.i.2 = select i1 %cmp17.i.2, double %55, double %max.1.i.1
%indvars.iv.next38.i.2 = or i64 %indvars.iv37.i, 3
%arrayidx16.i.3 = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %indvars.iv.next38.i.2
%56 = load double, ptr %arrayidx16.i.3, align 8, !tbaa !12
%cmp17.i.3 = fcmp olt double %max.1.i.2, %56
%max.1.i.3 = select i1 %cmp17.i.3, double %56, double %max.1.i.2
%indvars.iv.next38.i.3 = add nuw nsw i64 %indvars.iv37.i, 4
%niter101.next.3 = add i64 %niter101, 4
%niter101.ncmp.3 = icmp eq i64 %niter101.next.3, %unroll_iter100
br i1 %niter101.ncmp.3, label %Chebyshev.exit.unr-lcssa, label %for.body14.i, !llvm.loop !21
Chebyshev.exit.unr-lcssa: ; preds = %for.body14.i, %for.body14.preheader.i
%max.1.i.lcssa.ph = phi double [ undef, %for.body14.preheader.i ], [ %max.1.i.3, %for.body14.i ]
%indvars.iv37.i.unr = phi i64 [ 0, %for.body14.preheader.i ], [ %indvars.iv.next38.i.3, %for.body14.i ]
%max.033.i.unr = phi double [ %.pre.i, %for.body14.preheader.i ], [ %max.1.i.3, %for.body14.i ]
%lcmp.mod98.not = icmp eq i64 %xtraiter97, 0
br i1 %lcmp.mod98.not, label %Chebyshev.exit, label %for.body14.i.epil
for.body14.i.epil: ; preds = %Chebyshev.exit.unr-lcssa, %for.body14.i.epil
%indvars.iv37.i.epil = phi i64 [ %indvars.iv.next38.i.epil, %for.body14.i.epil ], [ %indvars.iv37.i.unr, %Chebyshev.exit.unr-lcssa ]
%max.033.i.epil = phi double [ %max.1.i.epil, %for.body14.i.epil ], [ %max.033.i.unr, %Chebyshev.exit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body14.i.epil ], [ 0, %Chebyshev.exit.unr-lcssa ]
%arrayidx16.i.epil = getelementptr inbounds [100 x double], ptr %s.i, i64 0, i64 %indvars.iv37.i.epil
%57 = load double, ptr %arrayidx16.i.epil, align 8, !tbaa !12
%cmp17.i.epil = fcmp olt double %max.033.i.epil, %57
%max.1.i.epil = select i1 %cmp17.i.epil, double %57, double %max.033.i.epil
%indvars.iv.next38.i.epil = add nuw nsw i64 %indvars.iv37.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter97
br i1 %epil.iter.cmp.not, label %Chebyshev.exit, label %for.body14.i.epil, !llvm.loop !22
Chebyshev.exit: ; preds = %for.body14.i.epil, %Chebyshev.exit.unr-lcssa
%max.1.i.lcssa = phi double [ %max.1.i.lcssa.ph, %Chebyshev.exit.unr-lcssa ], [ %max.1.i.epil, %for.body14.i.epil ]
store i32 %33, ptr @a, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %s.i) #9
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %p1.0.lcssa.i67, double noundef %call.i, double noundef %call.i41, double noundef %max.1.i.lcssa)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %y) #9
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none) uwtable
define dso_local double @Manhattan(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp9 = icmp sgt i32 %n, 0
br i1 %cmp9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %n, 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 i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%p1.011 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds double, ptr %x, i64 %indvars.iv
%1 = load double, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds double, ptr %y, i64 %indvars.iv
%2 = load double, ptr %arrayidx2, align 8, !tbaa !12
%sub = fsub double %1, %2
%conv = fptosi double %sub to i32
%3 = tail call i32 @llvm.abs.i32(i32 %conv, i1 true)
%conv7 = sitofp i32 %3 to double
%add = fadd double %p1.011, %conv7
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.next
%4 = load double, ptr %arrayidx.1, align 8, !tbaa !12
%arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.next
%5 = load double, ptr %arrayidx2.1, align 8, !tbaa !12
%sub.1 = fsub double %4, %5
%conv.1 = fptosi double %sub.1 to i32
%6 = tail call i32 @llvm.abs.i32(i32 %conv.1, i1 true)
%conv7.1 = sitofp i32 %6 to double
%add.1 = fadd double %add, %conv7.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !14
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%p1.011.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds double, ptr %x, i64 %indvars.iv.unr
%7 = load double, ptr %arrayidx.epil, align 8, !tbaa !12
%arrayidx2.epil = getelementptr inbounds double, ptr %y, i64 %indvars.iv.unr
%8 = load double, ptr %arrayidx2.epil, align 8, !tbaa !12
%sub.epil = fsub double %7, %8
%conv.epil = fptosi double %sub.epil to i32
%9 = tail call i32 @llvm.abs.i32(i32 %conv.epil, i1 true)
%conv7.epil = sitofp i32 %9 to double
%add.epil = fadd double %p1.011.unr, %conv7.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%storemerge.lcssa = phi i32 [ 0, %entry ], [ %n, %for.end.loopexit.unr-lcssa ], [ %n, %for.body.epil ]
%p1.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ]
store i32 %storemerge.lcssa, ptr @a, align 4, !tbaa !5
ret double %p1.0.lcssa
}
; Function Attrs: nofree nounwind memory(write, argmem: readwrite) uwtable
define dso_local double @Euclidean(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #4 {
entry:
%cmp16 = icmp sgt i32 %n, 0
br i1 %cmp16, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %n, 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 i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%p2.018 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds double, ptr %x, i64 %indvars.iv
%1 = load double, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds double, ptr %y, i64 %indvars.iv
%2 = load double, ptr %arrayidx2, align 8, !tbaa !12
%sub = fsub double %1, %2
%conv = fptosi double %sub to i32
%mul = mul i32 %conv, %conv
%conv10 = sitofp i32 %mul to double
%add = fadd double %p2.018, %conv10
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.next
%3 = load double, ptr %arrayidx.1, align 8, !tbaa !12
%arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.next
%4 = load double, ptr %arrayidx2.1, align 8, !tbaa !12
%sub.1 = fsub double %3, %4
%conv.1 = fptosi double %sub.1 to i32
%mul.1 = mul i32 %conv.1, %conv.1
%conv10.1 = sitofp i32 %mul.1 to double
%add.1 = fadd double %add, %conv10.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !15
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%p2.018.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds double, ptr %x, i64 %indvars.iv.unr
%5 = load double, ptr %arrayidx.epil, align 8, !tbaa !12
%arrayidx2.epil = getelementptr inbounds double, ptr %y, i64 %indvars.iv.unr
%6 = load double, ptr %arrayidx2.epil, align 8, !tbaa !12
%sub.epil = fsub double %5, %6
%conv.epil = fptosi double %sub.epil to i32
%mul.epil = mul i32 %conv.epil, %conv.epil
%conv10.epil = sitofp i32 %mul.epil to double
%add.epil = fadd double %p2.018.unr, %conv10.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%storemerge.lcssa = phi i32 [ 0, %entry ], [ %n, %for.end.loopexit.unr-lcssa ], [ %n, %for.body.epil ]
%p2.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ]
store i32 %storemerge.lcssa, ptr @a, align 4, !tbaa !5
%call = tail call double @sqrt(double noundef %p2.0.lcssa) #9
ret double %call
}
; Function Attrs: nofree nounwind memory(write, argmem: readwrite) uwtable
define dso_local double @MinkowskiP3(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #4 {
entry:
%cmp20 = icmp sgt i32 %n, 0
br i1 %cmp20, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %n, 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 i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%p3.022 = phi double [ 0.000000e+00, %for.body.preheader.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds double, ptr %x, i64 %indvars.iv
%1 = load double, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds double, ptr %y, i64 %indvars.iv
%2 = load double, ptr %arrayidx2, align 8, !tbaa !12
%sub = fsub double %1, %2
%conv = fptosi double %sub to i32
%3 = tail call i32 @llvm.abs.i32(i32 %conv, i1 true)
%mul = mul i32 %conv, %conv
%mul13 = mul nsw i32 %mul, %3
%conv14 = sitofp i32 %mul13 to double
%add = fadd double %p3.022, %conv14
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds double, ptr %x, i64 %indvars.iv.next
%4 = load double, ptr %arrayidx.1, align 8, !tbaa !12
%arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 %indvars.iv.next
%5 = load double, ptr %arrayidx2.1, align 8, !tbaa !12
%sub.1 = fsub double %4, %5
%conv.1 = fptosi double %sub.1 to i32
%6 = tail call i32 @llvm.abs.i32(i32 %conv.1, i1 true)
%mul.1 = mul i32 %conv.1, %conv.1
%mul13.1 = mul nsw i32 %mul.1, %6
%conv14.1 = sitofp i32 %mul13.1 to double
%add.1 = fadd double %add, %conv14.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi double [ undef, %for.body.preheader ], [ %add.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%p3.022.unr = phi double [ 0.000000e+00, %for.body.preheader ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds double, ptr %x, i64 %indvars.iv.unr
%7 = load double, ptr %arrayidx.epil, align 8, !tbaa !12
%arrayidx2.epil = getelementptr inbounds double, ptr %y, i64 %indvars.iv.unr
%8 = load double, ptr %arrayidx2.epil, align 8, !tbaa !12
%sub.epil = fsub double %7, %8
%conv.epil = fptosi double %sub.epil to i32
%9 = tail call i32 @llvm.abs.i32(i32 %conv.epil, i1 true)
%mul.epil = mul i32 %conv.epil, %conv.epil
%mul13.epil = mul nsw i32 %mul.epil, %9
%conv14.epil = sitofp i32 %mul13.epil to double
%add.epil = fadd double %p3.022.unr, %conv14.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%storemerge.lcssa = phi i32 [ 0, %entry ], [ %n, %for.end.loopexit.unr-lcssa ], [ %n, %for.body.epil ]
%p3.0.lcssa = phi double [ 0.000000e+00, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ]
store i32 %storemerge.lcssa, ptr @a, align 4, !tbaa !5
%call = tail call double @pow(double noundef %p3.0.lcssa, double noundef 0x3FD5555555555555) #9
ret double %call
}
; Function Attrs: nofree nosync nounwind memory(write, argmem: read, inaccessiblemem: none) uwtable
define dso_local double @Chebyshev(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %n) local_unnamed_addr #3 {
entry:
%s = alloca [100 x double], align 16
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %s) #9
%cmp29 = icmp sgt i32 %n, 0
br i1 %cmp29, label %for.body.preheader, label %for.end23
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 4
br i1 %min.iters.check, label %for.body.preheader46, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%0 = getelementptr inbounds double, ptr %x, i64 %index
%wide.load = load <2 x double>, ptr %0, align 8, !tbaa !12
%1 = getelementptr inbounds double, ptr %0, i64 2
%wide.load43 = load <2 x double>, ptr %1, align 8, !tbaa !12
%2 = getelementptr inbounds double, ptr %y, i64 %index
%wide.load44 = load <2 x double>, ptr %2, align 8, !tbaa !12
%3 = getelementptr inbounds double, ptr %2, i64 2
%wide.load45 = load <2 x double>, ptr %3, align 8, !tbaa !12
%4 = fsub <2 x double> %wide.load, %wide.load44
%5 = fsub <2 x double> %wide.load43, %wide.load45
%6 = fptosi <2 x double> %4 to <2 x i32>
%7 = fptosi <2 x double> %5 to <2 x i32>
%8 = tail call <2 x i32> @llvm.abs.v2i32(<2 x i32> %6, i1 true)
%9 = tail call <2 x i32> @llvm.abs.v2i32(<2 x i32> %7, i1 true)
%10 = sitofp <2 x i32> %8 to <2 x double>
%11 = sitofp <2 x i32> %9 to <2 x double>
%12 = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %index
store <2 x double> %10, ptr %12, align 16, !tbaa !12
%13 = getelementptr inbounds double, ptr %12, i64 2
store <2 x double> %11, ptr %13, align 16, !tbaa !12
%index.next = add nuw i64 %index, 4
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !24
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader46
for.body.preheader46: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader46, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader46 ]
%arrayidx = getelementptr inbounds double, ptr %x, i64 %indvars.iv
%15 = load double, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds double, ptr %y, i64 %indvars.iv
%16 = load double, ptr %arrayidx2, align 8, !tbaa !12
%sub = fsub double %15, %16
%conv = fptosi double %sub to i32
%17 = tail call i32 @llvm.abs.i32(i32 %conv, i1 true)
%conv7 = sitofp i32 %17 to double
%arrayidx9 = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %indvars.iv
store double %conv7, ptr %arrayidx9, align 8, !tbaa !12
%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 !25
for.end: ; preds = %for.body, %middle.block
%.pre = load double, ptr %s, align 16, !tbaa !12
br i1 %cmp29, label %for.body14.preheader, label %for.end23
for.body14.preheader: ; preds = %for.end
%xtraiter = and i64 %wide.trip.count, 3
%18 = icmp ult i32 %n, 4
br i1 %18, label %for.end23.loopexit.unr-lcssa, label %for.body14.preheader.new
for.body14.preheader.new: ; preds = %for.body14.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body14
for.body14: ; preds = %for.body14, %for.body14.preheader.new
%indvars.iv37 = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next38.3, %for.body14 ]
%max.033 = phi double [ %.pre, %for.body14.preheader.new ], [ %max.1.3, %for.body14 ]
%niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.3, %for.body14 ]
%arrayidx16 = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %indvars.iv37
%19 = load double, ptr %arrayidx16, align 16, !tbaa !12
%cmp17 = fcmp olt double %max.033, %19
%max.1 = select i1 %cmp17, double %19, double %max.033
%indvars.iv.next38 = or i64 %indvars.iv37, 1
%arrayidx16.1 = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %indvars.iv.next38
%20 = load double, ptr %arrayidx16.1, align 8, !tbaa !12
%cmp17.1 = fcmp olt double %max.1, %20
%max.1.1 = select i1 %cmp17.1, double %20, double %max.1
%indvars.iv.next38.1 = or i64 %indvars.iv37, 2
%arrayidx16.2 = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %indvars.iv.next38.1
%21 = load double, ptr %arrayidx16.2, align 16, !tbaa !12
%cmp17.2 = fcmp olt double %max.1.1, %21
%max.1.2 = select i1 %cmp17.2, double %21, double %max.1.1
%indvars.iv.next38.2 = or i64 %indvars.iv37, 3
%arrayidx16.3 = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %indvars.iv.next38.2
%22 = load double, ptr %arrayidx16.3, align 8, !tbaa !12
%cmp17.3 = fcmp olt double %max.1.2, %22
%max.1.3 = select i1 %cmp17.3, double %22, double %max.1.2
%indvars.iv.next38.3 = add nuw nsw i64 %indvars.iv37, 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.end23.loopexit.unr-lcssa, label %for.body14, !llvm.loop !21
for.end23.loopexit.unr-lcssa: ; preds = %for.body14, %for.body14.preheader
%max.1.lcssa.ph = phi double [ undef, %for.body14.preheader ], [ %max.1.3, %for.body14 ]
%indvars.iv37.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next38.3, %for.body14 ]
%max.033.unr = phi double [ %.pre, %for.body14.preheader ], [ %max.1.3, %for.body14 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23, label %for.body14.epil
for.body14.epil: ; preds = %for.end23.loopexit.unr-lcssa, %for.body14.epil
%indvars.iv37.epil = phi i64 [ %indvars.iv.next38.epil, %for.body14.epil ], [ %indvars.iv37.unr, %for.end23.loopexit.unr-lcssa ]
%max.033.epil = phi double [ %max.1.epil, %for.body14.epil ], [ %max.033.unr, %for.end23.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body14.epil ], [ 0, %for.end23.loopexit.unr-lcssa ]
%arrayidx16.epil = getelementptr inbounds [100 x double], ptr %s, i64 0, i64 %indvars.iv37.epil
%23 = load double, ptr %arrayidx16.epil, align 8, !tbaa !12
%cmp17.epil = fcmp olt double %max.033.epil, %23
%max.1.epil = select i1 %cmp17.epil, double %23, double %max.033.epil
%indvars.iv.next38.epil = add nuw nsw i64 %indvars.iv37.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.end23, label %for.body14.epil, !llvm.loop !26
for.end23: ; preds = %for.end23.loopexit.unr-lcssa, %for.body14.epil, %entry, %for.end
%storemerge28.lcssa = phi i32 [ 0, %for.end ], [ 0, %entry ], [ %n, %for.body14.epil ], [ %n, %for.end23.loopexit.unr-lcssa ]
%max.0.lcssa = phi double [ %.pre, %for.end ], [ undef, %entry ], [ %max.1.lcssa.ph, %for.end23.loopexit.unr-lcssa ], [ %max.1.epil, %for.body14.epil ]
store i32 %storemerge28.lcssa, ptr @a, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %s) #9
ret double %max.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.abs.v2i32(<2 x i32>, i1 immarg) #8
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(write, 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 #4 = { nofree nounwind memory(write, argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
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 = !{!"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 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !19, !18}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.unroll.disable"}
!24 = distinct !{!24, !10, !18, !19}
!25 = distinct !{!25, !10, !19, !18}
!26 = distinct !{!26, !23}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int i,n,x[101],y[101];
double Da,Db,Dc,Dd = 0;
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%d",&x[i]);
}
for(i = 0; i < n; i++){
scanf("%d",&y[i]);
}
for(i = 0; i < n; i++){
if(x[i] >= y[i])Da += (x[i] - y[i]);
else Da += (y[i] - x[i]);
}
printf("%lf\n",Da);
for(i = 0; i < n; i++){
if(x[i] >= y[i])Db += (x[i] - y[i]) * (x[i] - y[i]);
else Db += (y[i] - x[i]) * (y[i] - x[i]);
}
printf("%lf\n",sqrt(Db));
for(i = 0; i < n; i++){
if(x[i] >= y[i])Dc += (x[i] - y[i]) * (x[i] - y[i]) * (x[i] - y[i]);
else Dc += (y[i] - x[i]) * (y[i] - x[i]) * (y[i] - x[i]);
}
printf("%lf\n",pow(Dc,0.3333333333));
for(i = 0; i < n; i++){
if(x[i] > y[i] && Dd < (x[i] - y[i]))Dd = (x[i] - y[i]);
if(x[i] < y[i] && Dd < (y[i] - x[i]))Dd = (y[i] - x[i]);
}
printf("%lf\n",Dd);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265943/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265943/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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"%lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca [101 x i32], align 16
%y = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %y) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp263 = icmp sgt i32 %0, 0
br i1 %cmp263, label %for.body, label %for.cond11.preheader
for.cond2.preheader: ; preds = %for.body
%cmp3265 = icmp sgt i32 %1, 0
br i1 %cmp3265, label %for.body4, label %for.cond11.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %x, 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.cond2.preheader, !llvm.loop !9
for.cond11.preheader: ; preds = %for.body4, %entry, %for.cond2.preheader
%.lcssa = phi i32 [ %1, %for.cond2.preheader ], [ %0, %entry ], [ %4, %for.body4 ]
%cmp12267 = icmp sgt i32 %.lcssa, 0
call void @llvm.assume(i1 %cmp12267)
%wide.trip.count = zext i32 %.lcssa to i64
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i32 %.lcssa, 1
br i1 %3, label %for.end32.unr-lcssa, label %for.cond11.preheader.new
for.cond11.preheader.new: ; preds = %for.cond11.preheader
%unroll_iter = and i64 %wide.trip.count, 2147483646
br label %for.body13
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv285 = phi i64 [ %indvars.iv.next286, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv285
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%indvars.iv.next286 = add nuw nsw i64 %indvars.iv285, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp3 = icmp slt i64 %indvars.iv.next286, %5
br i1 %cmp3, label %for.body4, label %for.cond11.preheader, !llvm.loop !11
for.body13: ; preds = %for.body13, %for.cond11.preheader.new
%indvars.iv288 = phi i64 [ 0, %for.cond11.preheader.new ], [ %indvars.iv.next289.1, %for.body13 ]
%Da.0269 = phi double [ undef, %for.cond11.preheader.new ], [ %Da.1.1, %for.body13 ]
%niter = phi i64 [ 0, %for.cond11.preheader.new ], [ %niter.next.1, %for.body13 ]
%arrayidx15 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv288
%6 = load i32, ptr %arrayidx15, align 8, !tbaa !5
%arrayidx17 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv288
%7 = load i32, ptr %arrayidx17, align 8, !tbaa !5
%sub = sub nsw i32 %6, %7
%conv.pn.in = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%conv.pn = sitofp i32 %conv.pn.in to double
%Da.1 = fadd double %Da.0269, %conv.pn
%indvars.iv.next289 = or i64 %indvars.iv288, 1
%arrayidx15.1 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv.next289
%8 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%arrayidx17.1 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv.next289
%9 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5
%sub.1 = sub nsw i32 %8, %9
%conv.pn.in.1 = call i32 @llvm.abs.i32(i32 %sub.1, i1 true)
%conv.pn.1 = sitofp i32 %conv.pn.in.1 to double
%Da.1.1 = fadd double %Da.1, %conv.pn.1
%indvars.iv.next289.1 = add nuw nsw i64 %indvars.iv288, 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.end32.unr-lcssa, label %for.body13, !llvm.loop !12
for.end32.unr-lcssa: ; preds = %for.body13, %for.cond11.preheader
%indvars.iv288.unr = phi i64 [ 0, %for.cond11.preheader ], [ %indvars.iv.next289.1, %for.body13 ]
%Da.0269.unr = phi double [ undef, %for.cond11.preheader ], [ %Da.1.1, %for.body13 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end32, label %for.body13.epil
for.body13.epil: ; preds = %for.end32.unr-lcssa
%arrayidx15.epil = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv288.unr
%10 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !5
%arrayidx17.epil = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv288.unr
%11 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5
%sub.epil = sub nsw i32 %10, %11
%conv.pn.in.epil = call i32 @llvm.abs.i32(i32 %sub.epil, i1 true)
%conv.pn.epil = sitofp i32 %conv.pn.in.epil to double
%Da.1.epil = fadd double %Da.0269.unr, %conv.pn.epil
br label %for.end32
for.end32: ; preds = %for.end32.unr-lcssa, %for.body13.epil
%Da.1.lcssa = phi double [ %Da.0269.unr, %for.end32.unr-lcssa ], [ %Da.1.epil, %for.body13.epil ]
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %Da.1.lcssa)
%12 = load i32, ptr %n, align 4, !tbaa !5
%cmp35271 = icmp sgt i32 %12, 0
call void @llvm.assume(i1 %cmp35271)
%wide.trip.count294 = zext i32 %12 to i64
%xtraiter314 = and i64 %wide.trip.count294, 1
%13 = icmp eq i32 %12, 1
br i1 %13, label %for.end74.unr-lcssa, label %for.end32.new
for.end32.new: ; preds = %for.end32
%unroll_iter317 = and i64 %wide.trip.count294, 2147483646
br label %for.body37
for.body37: ; preds = %for.body37, %for.end32.new
%indvars.iv291 = phi i64 [ 0, %for.end32.new ], [ %indvars.iv.next292.1, %for.body37 ]
%Db.0273 = phi double [ undef, %for.end32.new ], [ %Db.1.1, %for.body37 ]
%niter318 = phi i64 [ 0, %for.end32.new ], [ %niter318.next.1, %for.body37 ]
%arrayidx39 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv291
%14 = load i32, ptr %arrayidx39, align 8, !tbaa !5
%arrayidx41 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv291
%15 = load i32, ptr %arrayidx41, align 8, !tbaa !5
%cmp42.not = icmp slt i32 %14, %15
%sub49 = sub nsw i32 %14, %15
%mul = mul nsw i32 %sub49, %sub49
%sub62 = sub nsw i32 %15, %14
%mul68 = mul nsw i32 %sub62, %sub62
%conv55.pn.in = select i1 %cmp42.not, i32 %mul68, i32 %mul
%conv55.pn = sitofp i32 %conv55.pn.in to double
%Db.1 = fadd double %Db.0273, %conv55.pn
%indvars.iv.next292 = or i64 %indvars.iv291, 1
%arrayidx39.1 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv.next292
%16 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%arrayidx41.1 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv.next292
%17 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5
%cmp42.not.1 = icmp slt i32 %16, %17
%sub49.1 = sub nsw i32 %16, %17
%mul.1 = mul nsw i32 %sub49.1, %sub49.1
%sub62.1 = sub nsw i32 %17, %16
%mul68.1 = mul nsw i32 %sub62.1, %sub62.1
%conv55.pn.in.1 = select i1 %cmp42.not.1, i32 %mul68.1, i32 %mul.1
%conv55.pn.1 = sitofp i32 %conv55.pn.in.1 to double
%Db.1.1 = fadd double %Db.1, %conv55.pn.1
%indvars.iv.next292.1 = add nuw nsw i64 %indvars.iv291, 2
%niter318.next.1 = add i64 %niter318, 2
%niter318.ncmp.1 = icmp eq i64 %niter318.next.1, %unroll_iter317
br i1 %niter318.ncmp.1, label %for.end74.unr-lcssa, label %for.body37, !llvm.loop !13
for.end74.unr-lcssa: ; preds = %for.body37, %for.end32
%indvars.iv291.unr = phi i64 [ 0, %for.end32 ], [ %indvars.iv.next292.1, %for.body37 ]
%Db.0273.unr = phi double [ undef, %for.end32 ], [ %Db.1.1, %for.body37 ]
%lcmp.mod315.not = icmp eq i64 %xtraiter314, 0
br i1 %lcmp.mod315.not, label %for.end74, label %for.body37.epil
for.body37.epil: ; preds = %for.end74.unr-lcssa
%arrayidx39.epil = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv291.unr
%18 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5
%arrayidx41.epil = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv291.unr
%19 = load i32, ptr %arrayidx41.epil, align 4, !tbaa !5
%cmp42.not.epil = icmp slt i32 %18, %19
%sub49.epil = sub nsw i32 %18, %19
%mul.epil = mul nsw i32 %sub49.epil, %sub49.epil
%sub62.epil = sub nsw i32 %19, %18
%mul68.epil = mul nsw i32 %sub62.epil, %sub62.epil
%conv55.pn.in.epil = select i1 %cmp42.not.epil, i32 %mul68.epil, i32 %mul.epil
%conv55.pn.epil = sitofp i32 %conv55.pn.in.epil to double
%Db.1.epil = fadd double %Db.0273.unr, %conv55.pn.epil
br label %for.end74
for.end74: ; preds = %for.end74.unr-lcssa, %for.body37.epil
%Db.1.lcssa = phi double [ %Db.0273.unr, %for.end74.unr-lcssa ], [ %Db.1.epil, %for.body37.epil ]
%call75 = call double @sqrt(double noundef %Db.1.lcssa) #6
%call76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call75)
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp78275 = icmp sgt i32 %20, 0
call void @llvm.assume(i1 %cmp78275)
%wide.trip.count299 = zext i32 %20 to i64
br label %for.body80
for.body80: ; preds = %for.end74, %for.inc128
%indvars.iv296 = phi i64 [ 0, %for.end74 ], [ %indvars.iv.next297, %for.inc128 ]
%Dc.0277 = phi double [ undef, %for.end74 ], [ %Dc.1, %for.inc128 ]
%arrayidx82 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv296
%21 = load i32, ptr %arrayidx82, align 4, !tbaa !5
%arrayidx84 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv296
%22 = load i32, ptr %arrayidx84, align 4, !tbaa !5
%cmp85.not = icmp slt i32 %21, %22
br i1 %cmp85.not, label %if.else107, label %if.then87
if.then87: ; preds = %for.body80
%sub92 = sub nsw i32 %21, %22
%mul98 = mul nsw i32 %sub92, %sub92
%mul104 = mul nsw i32 %mul98, %sub92
br label %for.inc128
if.else107: ; preds = %for.body80
%sub112 = sub nsw i32 %22, %21
%mul118 = mul nsw i32 %sub112, %sub112
%mul124 = mul nsw i32 %mul118, %sub112
br label %for.inc128
for.inc128: ; preds = %if.then87, %if.else107
%conv105.pn.in = phi i32 [ %mul104, %if.then87 ], [ %mul124, %if.else107 ]
%conv105.pn = sitofp i32 %conv105.pn.in to double
%Dc.1 = fadd double %Dc.0277, %conv105.pn
%indvars.iv.next297 = add nuw nsw i64 %indvars.iv296, 1
%exitcond300.not = icmp eq i64 %indvars.iv.next297, %wide.trip.count299
br i1 %exitcond300.not, label %for.end130, label %for.body80, !llvm.loop !14
for.end130: ; preds = %for.inc128
%call131 = call double @pow(double noundef %Dc.1, double noundef 0x3FD55555554C2BB5) #6
%call132 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call131)
%23 = load i32, ptr %n, align 4, !tbaa !5
%cmp134279 = icmp sgt i32 %23, 0
br i1 %cmp134279, label %for.body136.preheader, label %for.end184
for.body136.preheader: ; preds = %for.end130
%wide.trip.count304 = zext i32 %23 to i64
br label %for.body136
for.body136: ; preds = %for.body136.preheader, %for.inc182
%indvars.iv301 = phi i64 [ 0, %for.body136.preheader ], [ %indvars.iv.next302, %for.inc182 ]
%Dd.0281 = phi double [ 0.000000e+00, %for.body136.preheader ], [ %Dd.2, %for.inc182 ]
%arrayidx138 = getelementptr inbounds [101 x i32], ptr %x, i64 0, i64 %indvars.iv301
%24 = load i32, ptr %arrayidx138, align 4, !tbaa !5
%arrayidx140 = getelementptr inbounds [101 x i32], ptr %y, i64 0, i64 %indvars.iv301
%25 = load i32, ptr %arrayidx140, align 4, !tbaa !5
%cmp141 = icmp sgt i32 %24, %25
br i1 %cmp141, label %land.lhs.true, label %if.end158
land.lhs.true: ; preds = %for.body136
%sub147 = sub nsw i32 %24, %25
%conv148 = sitofp i32 %sub147 to double
%cmp149 = fcmp olt double %Dd.0281, %conv148
br i1 %cmp149, label %if.then151, label %if.end158
if.then151: ; preds = %land.lhs.true
br label %if.end158
if.end158: ; preds = %if.then151, %land.lhs.true, %for.body136
%Dd.1 = phi double [ %conv148, %if.then151 ], [ %Dd.0281, %land.lhs.true ], [ %Dd.0281, %for.body136 ]
%cmp163 = icmp slt i32 %24, %25
br i1 %cmp163, label %land.lhs.true165, label %for.inc182
land.lhs.true165: ; preds = %if.end158
%sub170 = sub nsw i32 %25, %24
%conv171 = sitofp i32 %sub170 to double
%cmp172 = fcmp olt double %Dd.1, %conv171
br i1 %cmp172, label %if.then174, label %for.inc182
if.then174: ; preds = %land.lhs.true165
br label %for.inc182
for.inc182: ; preds = %if.end158, %land.lhs.true165, %if.then174
%Dd.2 = phi double [ %conv171, %if.then174 ], [ %Dd.1, %land.lhs.true165 ], [ %Dd.1, %if.end158 ]
%indvars.iv.next302 = add nuw nsw i64 %indvars.iv301, 1
%exitcond305.not = icmp eq i64 %indvars.iv.next302, %wide.trip.count304
br i1 %exitcond305.not, label %for.end184, label %for.body136, !llvm.loop !15
for.end184: ; preds = %for.inc182, %for.end130
%Dd.0.lcssa = phi double [ 0.000000e+00, %for.end130 ], [ %Dd.2, %for.inc182 ]
%call185 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %Dd.0.lcssa)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 404, 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) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: 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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main(){
int n,i;
double sum1=0,sum2=0,sum3,max=0,ans[4];
scanf("%d",&n);
double x[n],y[n];
for(i=0;i<n;i++)
scanf("%lf",&x[i]);
for(i=0;i<n;i++)
scanf("%lf",&y[i]);
for(i=0;i<n;i++){
sum1+=abs(x[i]-y[i]);
if(abs(x[i]-y[i])>max)
max=abs(x[i]-y[i]);
sum2+=pow(abs(x[i]-y[i]),2);
sum3+=pow(abs(x[i]-y[i]),3);
}
printf("%lf\n",sum1);
printf("%lf\n",sqrt(sum2));
printf("%lf\n",cbrt(sum3));
printf("%lf\n",max);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_265994/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_265994/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lf\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) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca double, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca double, i64 %4, align 16
%cmp84 = icmp sgt i32 %3, 0
br i1 %cmp84, label %for.body, label %for.end56
for.cond3.preheader: ; preds = %for.body
%5 = icmp sgt i32 %6, 0
br i1 %5, label %for.body5, label %for.end56
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds double, ptr %vla, 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
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond12.preheader: ; preds = %for.body5
%8 = icmp sgt i32 %9, 0
br i1 %8, label %for.body14, label %for.end56
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds double, ptr %vla1, i64 %indvars.iv98
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp4 = icmp slt i64 %indvars.iv.next99, %10
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.body14: ; preds = %for.cond12.preheader, %for.body14
%indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body14 ], [ 0, %for.cond12.preheader ]
%sum1.092 = phi double [ %add, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%sum2.091 = phi double [ %add44, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%sum3.090 = phi double [ %add53, %for.body14 ], [ undef, %for.cond12.preheader ]
%max.089 = phi double [ %max.1, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%arrayidx16 = getelementptr inbounds double, ptr %vla, i64 %indvars.iv101
%11 = load double, ptr %arrayidx16, align 8, !tbaa !12
%arrayidx18 = getelementptr inbounds double, ptr %vla1, i64 %indvars.iv101
%12 = load double, ptr %arrayidx18, align 8, !tbaa !12
%sub = fsub double %11, %12
%conv = fptosi double %sub to i32
%13 = call i32 @llvm.abs.i32(i32 %conv, i1 true)
%conv19 = sitofp i32 %13 to double
%add = fadd double %sum1.092, %conv19
%cmp27 = fcmp olt double %max.089, %conv19
%max.1 = select i1 %cmp27, double %conv19, double %max.089
%square = fmul double %conv19, %conv19
%add44 = fadd double %sum2.091, %square
%call52 = call double @pow(double noundef %conv19, double noundef 3.000000e+00) #7
%add53 = fadd double %sum3.090, %call52
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp13 = icmp slt i64 %indvars.iv.next102, %15
br i1 %cmp13, label %for.body14, label %for.end56, !llvm.loop !14
for.end56: ; preds = %for.body14, %entry, %for.cond3.preheader, %for.cond12.preheader
%max.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %max.1, %for.body14 ]
%sum3.0.lcssa = phi double [ undef, %for.cond12.preheader ], [ undef, %for.cond3.preheader ], [ undef, %entry ], [ %add53, %for.body14 ]
%sum2.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add44, %for.body14 ]
%sum1.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond3.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body14 ]
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %sum1.0.lcssa)
%call58 = call double @sqrt(double noundef %sum2.0.lcssa) #7
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call58)
%call60 = call double @cbrt(double noundef %sum3.0.lcssa) #8
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call60)
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %max.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
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
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare double @cbrt(double noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
|
// AOJ ITP1_10_D Distance II
// 2018.4.29 bal4u
#include <stdio.h>
#include <math.h>
#define gc() getchar_unlocked()
int in()
{
int n = 0, c = gc();
do n = 10*n + (c & 0xf), c = gc();
while (c >= '0');
return n;
}
int x[102], y[102];
int main()
{
int n, i, t, t2;
int d, d1, d2;
long long d3;
n = in();
for (i = 0; i < n; i++) x[i] = in();
for (i = 0; i < n; i++) y[i] = in();
d = 0, d1 = 0, d2 = 0, d3 = 0;
for (i = 0; i < n; i++) {
t = x[i] - y[i];
if (t < 0) t = -t;
if (t > d) d = t;
d1 += t;
t2 = t*t, d2 += t2;
d3 += t2*t;
}
printf("%d\n", d1);
printf("%.8lf\n", sqrt((double)d2));
printf("%.8lf\n", pow((double)d3, 1.0/3));
printf("%d\n", d);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266058/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266058/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@x = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16
@y = dso_local local_unnamed_addr global [102 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.8lf\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #5
%.pre14.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %do.body.preheader
do.body.preheader: ; preds = %cond.true.i, %cond.false.i
%.ph = phi ptr [ %0, %cond.false.i ], [ %.pre14.pre, %cond.true.i ]
%c.0.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %do.body
do.body: ; preds = %do.body.preheader, %getchar_unlocked.exit13
%4 = phi ptr [ %8, %getchar_unlocked.exit13 ], [ %.ph, %do.body.preheader ]
%n.0 = phi i32 [ %add, %getchar_unlocked.exit13 ], [ 0, %do.body.preheader ]
%c.0 = phi i32 [ %cond.i9, %getchar_unlocked.exit13 ], [ %c.0.ph, %do.body.preheader ]
%mul = mul nsw i32 %n.0, 10
%and = and i32 %c.0, 15
%add = add nsw i32 %and, %mul
%_IO_read_ptr.i4 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4, align 8, !tbaa !9
%_IO_read_end.i5 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5, align 8, !tbaa !14
%cmp.not.i6 = icmp ult ptr %5, %6
br i1 %cmp.not.i6, label %cond.false.i10, label %cond.true.i7, !prof !15
cond.true.i7: ; preds = %do.body
%call.i8 = tail call i32 @__uflow(ptr noundef nonnull %4) #5
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13
cond.false.i10: ; preds = %do.body
%incdec.ptr.i11 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11, ptr %_IO_read_ptr.i4, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i12 = zext i8 %7 to i32
br label %getchar_unlocked.exit13
getchar_unlocked.exit13: ; preds = %cond.true.i7, %cond.false.i10
%8 = phi ptr [ %.pre, %cond.true.i7 ], [ %4, %cond.false.i10 ]
%cond.i9 = phi i32 [ %call.i8, %cond.true.i7 ], [ %conv3.i12, %cond.false.i10 ]
%cmp = icmp sgt i32 %cond.i9, 47
br i1 %cmp, label %do.body, label %do.end, !llvm.loop !17
do.end: ; preds = %getchar_unlocked.exit13
ret i32 %add
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%_IO_read_end.i.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp ult ptr %1, %2
br i1 %cmp.not.i.i, label %cond.false.i.i, label %cond.true.i.i, !prof !15
cond.true.i.i: ; preds = %entry
%call.i.i = tail call i32 @__uflow(ptr noundef nonnull %0) #5
%.pre14.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i.preheader
cond.false.i.i: ; preds = %entry
%incdec.ptr.i.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i.i, ptr %_IO_read_ptr.i.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i.i = zext i8 %3 to i32
br label %do.body.i.preheader
do.body.i.preheader: ; preds = %cond.false.i.i, %cond.true.i.i
%.ph182 = phi ptr [ %0, %cond.false.i.i ], [ %.pre14.pre.i, %cond.true.i.i ]
%c.0.i.ph = phi i32 [ %conv3.i.i, %cond.false.i.i ], [ %call.i.i, %cond.true.i.i ]
br label %do.body.i
do.body.i: ; preds = %do.body.i.preheader, %getchar_unlocked.exit13.i
%4 = phi ptr [ %8, %getchar_unlocked.exit13.i ], [ %.ph182, %do.body.i.preheader ]
%n.0.i = phi i32 [ %add.i, %getchar_unlocked.exit13.i ], [ 0, %do.body.i.preheader ]
%c.0.i = phi i32 [ %cond.i9.i, %getchar_unlocked.exit13.i ], [ %c.0.i.ph, %do.body.i.preheader ]
%mul.i = mul nsw i32 %n.0.i, 10
%and.i = and i32 %c.0.i, 15
%add.i = add nsw i32 %and.i, %mul.i
%_IO_read_ptr.i4.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9
%_IO_read_end.i5.i = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i5.i, align 8, !tbaa !14
%cmp.not.i6.i = icmp ult ptr %5, %6
br i1 %cmp.not.i6.i, label %cond.false.i10.i, label %cond.true.i7.i, !prof !15
cond.true.i7.i: ; preds = %do.body.i
%call.i8.i = tail call i32 @__uflow(ptr noundef nonnull %4) #5
%.pre.i = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i
cond.false.i10.i: ; preds = %do.body.i
%incdec.ptr.i11.i = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i11.i, ptr %_IO_read_ptr.i4.i, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i12.i = zext i8 %7 to i32
br label %getchar_unlocked.exit13.i
getchar_unlocked.exit13.i: ; preds = %cond.false.i10.i, %cond.true.i7.i
%8 = phi ptr [ %.pre.i, %cond.true.i7.i ], [ %4, %cond.false.i10.i ]
%cond.i9.i = phi i32 [ %call.i8.i, %cond.true.i7.i ], [ %conv3.i12.i, %cond.false.i10.i ]
%cmp.i = icmp sgt i32 %cond.i9.i, 47
br i1 %cmp.i, label %do.body.i, label %for.cond.preheader, !llvm.loop !17
for.cond.preheader: ; preds = %getchar_unlocked.exit13.i
%cmp122 = icmp sgt i32 %add.i, 0
br i1 %cmp122, label %for.body.preheader, label %for.end28
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %add.i to i64
br label %for.body
for.cond2.preheader: ; preds = %in.exit90
br i1 %cmp122, label %for.body4.preheader, label %for.end28
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count139 = zext i32 %add.i to i64
br label %for.body4
for.body: ; preds = %for.body.preheader, %in.exit90
%9 = phi ptr [ %8, %for.body.preheader ], [ %18, %in.exit90 ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %in.exit90 ]
%_IO_read_ptr.i.i60 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 1
%10 = load ptr, ptr %_IO_read_ptr.i.i60, align 8, !tbaa !9
%_IO_read_end.i.i61 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 2
%11 = load ptr, ptr %_IO_read_end.i.i61, align 8, !tbaa !14
%cmp.not.i.i62 = icmp ult ptr %10, %11
br i1 %cmp.not.i.i62, label %cond.false.i.i87, label %cond.true.i.i63, !prof !15
cond.true.i.i63: ; preds = %for.body
%call.i.i64 = tail call i32 @__uflow(ptr noundef nonnull %9) #5
%.pre14.pre.i65 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i69.preheader
cond.false.i.i87: ; preds = %for.body
%incdec.ptr.i.i88 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i.i88, ptr %_IO_read_ptr.i.i60, align 8, !tbaa !9
%12 = load i8, ptr %10, align 1, !tbaa !16
%conv3.i.i89 = zext i8 %12 to i32
br label %do.body.i69.preheader
do.body.i69.preheader: ; preds = %cond.false.i.i87, %cond.true.i.i63
%.ph180 = phi ptr [ %9, %cond.false.i.i87 ], [ %.pre14.pre.i65, %cond.true.i.i63 ]
%c.0.i71.ph = phi i32 [ %conv3.i.i89, %cond.false.i.i87 ], [ %call.i.i64, %cond.true.i.i63 ]
br label %do.body.i69
do.body.i69: ; preds = %do.body.i69.preheader, %getchar_unlocked.exit13.i81
%13 = phi ptr [ %18, %getchar_unlocked.exit13.i81 ], [ %.ph180, %do.body.i69.preheader ]
%14 = phi ptr [ %19, %getchar_unlocked.exit13.i81 ], [ %.ph180, %do.body.i69.preheader ]
%n.0.i70 = phi i32 [ %add.i74, %getchar_unlocked.exit13.i81 ], [ 0, %do.body.i69.preheader ]
%c.0.i71 = phi i32 [ %cond.i9.i82, %getchar_unlocked.exit13.i81 ], [ %c.0.i71.ph, %do.body.i69.preheader ]
%mul.i72 = mul nsw i32 %n.0.i70, 10
%and.i73 = and i32 %c.0.i71, 15
%add.i74 = add nsw i32 %and.i73, %mul.i72
%_IO_read_ptr.i4.i75 = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 1
%15 = load ptr, ptr %_IO_read_ptr.i4.i75, align 8, !tbaa !9
%_IO_read_end.i5.i76 = getelementptr inbounds %struct._IO_FILE, ptr %14, i64 0, i32 2
%16 = load ptr, ptr %_IO_read_end.i5.i76, align 8, !tbaa !14
%cmp.not.i6.i77 = icmp ult ptr %15, %16
br i1 %cmp.not.i6.i77, label %cond.false.i10.i84, label %cond.true.i7.i78, !prof !15
cond.true.i7.i78: ; preds = %do.body.i69
%call.i8.i79 = tail call i32 @__uflow(ptr noundef nonnull %14) #5
%.pre.i80 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i81
cond.false.i10.i84: ; preds = %do.body.i69
%incdec.ptr.i11.i85 = getelementptr inbounds i8, ptr %15, i64 1
store ptr %incdec.ptr.i11.i85, ptr %_IO_read_ptr.i4.i75, align 8, !tbaa !9
%17 = load i8, ptr %15, align 1, !tbaa !16
%conv3.i12.i86 = zext i8 %17 to i32
br label %getchar_unlocked.exit13.i81
getchar_unlocked.exit13.i81: ; preds = %cond.false.i10.i84, %cond.true.i7.i78
%18 = phi ptr [ %.pre.i80, %cond.true.i7.i78 ], [ %13, %cond.false.i10.i84 ]
%19 = phi ptr [ %.pre.i80, %cond.true.i7.i78 ], [ %14, %cond.false.i10.i84 ]
%cond.i9.i82 = phi i32 [ %call.i8.i79, %cond.true.i7.i78 ], [ %conv3.i12.i86, %cond.false.i10.i84 ]
%cmp.i83 = icmp sgt i32 %cond.i9.i82, 47
br i1 %cmp.i83, label %do.body.i69, label %in.exit90, !llvm.loop !17
in.exit90: ; preds = %getchar_unlocked.exit13.i81
%arrayidx = getelementptr inbounds [102 x i32], ptr @x, i64 0, i64 %indvars.iv
store i32 %add.i74, ptr %arrayidx, align 4, !tbaa !19
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.preheader, label %for.body, !llvm.loop !20
for.cond11.preheader: ; preds = %in.exit121
br i1 %cmp122, label %for.body13.preheader, label %for.end28
for.body13.preheader: ; preds = %for.cond11.preheader
%wide.trip.count144 = zext i32 %add.i to i64
%min.iters.check = icmp ult i32 %add.i, 4
br i1 %min.iters.check, label %for.body13.preheader165, label %vector.ph
vector.ph: ; preds = %for.body13.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
%vec.phi150 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %41, %vector.body ]
%vec.phi151 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %34, %vector.body ]
%vec.phi152 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %35, %vector.body ]
%vec.phi153 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %30, %vector.body ]
%vec.phi154 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %31, %vector.body ]
%vec.phi155 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %28, %vector.body ]
%vec.phi156 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %29, %vector.body ]
%20 = getelementptr inbounds [102 x i32], ptr @x, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %20, align 16, !tbaa !19
%21 = getelementptr inbounds i32, ptr %20, i64 2
%wide.load157 = load <2 x i32>, ptr %21, align 8, !tbaa !19
%22 = getelementptr inbounds [102 x i32], ptr @y, i64 0, i64 %index
%wide.load158 = load <2 x i32>, ptr %22, align 16, !tbaa !19
%23 = getelementptr inbounds i32, ptr %22, i64 2
%wide.load159 = load <2 x i32>, ptr %23, align 8, !tbaa !19
%24 = sub nsw <2 x i32> %wide.load, %wide.load158
%25 = sub nsw <2 x i32> %wide.load157, %wide.load159
%26 = tail call <2 x i32> @llvm.abs.v2i32(<2 x i32> %24, i1 true)
%27 = tail call <2 x i32> @llvm.abs.v2i32(<2 x i32> %25, i1 true)
%28 = tail call <2 x i32> @llvm.smax.v2i32(<2 x i32> %26, <2 x i32> %vec.phi155)
%29 = tail call <2 x i32> @llvm.smax.v2i32(<2 x i32> %27, <2 x i32> %vec.phi156)
%30 = add <2 x i32> %26, %vec.phi153
%31 = add <2 x i32> %27, %vec.phi154
%32 = mul <2 x i32> %24, %24
%33 = mul <2 x i32> %25, %25
%34 = add <2 x i32> %32, %vec.phi151
%35 = add <2 x i32> %33, %vec.phi152
%36 = mul nsw <2 x i32> %32, %26
%37 = mul nsw <2 x i32> %33, %27
%38 = sext <2 x i32> %36 to <2 x i64>
%39 = sext <2 x i32> %37 to <2 x i64>
%40 = add <2 x i64> %vec.phi, %38
%41 = add <2 x i64> %vec.phi150, %39
%index.next = add nuw i64 %index, 4
%42 = icmp eq i64 %index.next, %n.vec
br i1 %42, label %middle.block, label %vector.body, !llvm.loop !21
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i32> @llvm.smax.v2i32(<2 x i32> %28, <2 x i32> %29)
%43 = tail call i32 @llvm.vector.reduce.smax.v2i32(<2 x i32> %rdx.minmax)
%bin.rdx162 = add <2 x i32> %31, %30
%44 = tail call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx162)
%bin.rdx160 = add <2 x i32> %35, %34
%45 = tail call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx160)
%bin.rdx = add <2 x i64> %41, %40
%46 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end28.loopexit, label %for.body13.preheader165
for.body13.preheader165: ; preds = %for.body13.preheader, %middle.block
%indvars.iv141.ph = phi i64 [ 0, %for.body13.preheader ], [ %n.vec, %middle.block ]
%d3.0131.ph = phi i64 [ 0, %for.body13.preheader ], [ %46, %middle.block ]
%d2.0130.ph = phi i32 [ 0, %for.body13.preheader ], [ %45, %middle.block ]
%d1.0129.ph = phi i32 [ 0, %for.body13.preheader ], [ %44, %middle.block ]
%d.0128.ph = phi i32 [ 0, %for.body13.preheader ], [ %43, %middle.block ]
br label %for.body13
for.body4: ; preds = %for.body4.preheader, %in.exit121
%47 = phi ptr [ %18, %for.body4.preheader ], [ %56, %in.exit121 ]
%indvars.iv136 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next137, %in.exit121 ]
%_IO_read_ptr.i.i91 = getelementptr inbounds %struct._IO_FILE, ptr %47, i64 0, i32 1
%48 = load ptr, ptr %_IO_read_ptr.i.i91, align 8, !tbaa !9
%_IO_read_end.i.i92 = getelementptr inbounds %struct._IO_FILE, ptr %47, i64 0, i32 2
%49 = load ptr, ptr %_IO_read_end.i.i92, align 8, !tbaa !14
%cmp.not.i.i93 = icmp ult ptr %48, %49
br i1 %cmp.not.i.i93, label %cond.false.i.i118, label %cond.true.i.i94, !prof !15
cond.true.i.i94: ; preds = %for.body4
%call.i.i95 = tail call i32 @__uflow(ptr noundef nonnull %47) #5
%.pre14.pre.i96 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %do.body.i100.preheader
cond.false.i.i118: ; preds = %for.body4
%incdec.ptr.i.i119 = getelementptr inbounds i8, ptr %48, i64 1
store ptr %incdec.ptr.i.i119, ptr %_IO_read_ptr.i.i91, align 8, !tbaa !9
%50 = load i8, ptr %48, align 1, !tbaa !16
%conv3.i.i120 = zext i8 %50 to i32
br label %do.body.i100.preheader
do.body.i100.preheader: ; preds = %cond.false.i.i118, %cond.true.i.i94
%.ph177 = phi ptr [ %47, %cond.false.i.i118 ], [ %.pre14.pre.i96, %cond.true.i.i94 ]
%c.0.i102.ph = phi i32 [ %conv3.i.i120, %cond.false.i.i118 ], [ %call.i.i95, %cond.true.i.i94 ]
br label %do.body.i100
do.body.i100: ; preds = %do.body.i100.preheader, %getchar_unlocked.exit13.i112
%51 = phi ptr [ %56, %getchar_unlocked.exit13.i112 ], [ %.ph177, %do.body.i100.preheader ]
%52 = phi ptr [ %57, %getchar_unlocked.exit13.i112 ], [ %.ph177, %do.body.i100.preheader ]
%n.0.i101 = phi i32 [ %add.i105, %getchar_unlocked.exit13.i112 ], [ 0, %do.body.i100.preheader ]
%c.0.i102 = phi i32 [ %cond.i9.i113, %getchar_unlocked.exit13.i112 ], [ %c.0.i102.ph, %do.body.i100.preheader ]
%mul.i103 = mul nsw i32 %n.0.i101, 10
%and.i104 = and i32 %c.0.i102, 15
%add.i105 = add nsw i32 %and.i104, %mul.i103
%_IO_read_ptr.i4.i106 = getelementptr inbounds %struct._IO_FILE, ptr %52, i64 0, i32 1
%53 = load ptr, ptr %_IO_read_ptr.i4.i106, align 8, !tbaa !9
%_IO_read_end.i5.i107 = getelementptr inbounds %struct._IO_FILE, ptr %52, i64 0, i32 2
%54 = load ptr, ptr %_IO_read_end.i5.i107, align 8, !tbaa !14
%cmp.not.i6.i108 = icmp ult ptr %53, %54
br i1 %cmp.not.i6.i108, label %cond.false.i10.i115, label %cond.true.i7.i109, !prof !15
cond.true.i7.i109: ; preds = %do.body.i100
%call.i8.i110 = tail call i32 @__uflow(ptr noundef nonnull %52) #5
%.pre.i111 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit13.i112
cond.false.i10.i115: ; preds = %do.body.i100
%incdec.ptr.i11.i116 = getelementptr inbounds i8, ptr %53, i64 1
store ptr %incdec.ptr.i11.i116, ptr %_IO_read_ptr.i4.i106, align 8, !tbaa !9
%55 = load i8, ptr %53, align 1, !tbaa !16
%conv3.i12.i117 = zext i8 %55 to i32
br label %getchar_unlocked.exit13.i112
getchar_unlocked.exit13.i112: ; preds = %cond.false.i10.i115, %cond.true.i7.i109
%56 = phi ptr [ %.pre.i111, %cond.true.i7.i109 ], [ %51, %cond.false.i10.i115 ]
%57 = phi ptr [ %.pre.i111, %cond.true.i7.i109 ], [ %52, %cond.false.i10.i115 ]
%cond.i9.i113 = phi i32 [ %call.i8.i110, %cond.true.i7.i109 ], [ %conv3.i12.i117, %cond.false.i10.i115 ]
%cmp.i114 = icmp sgt i32 %cond.i9.i113, 47
br i1 %cmp.i114, label %do.body.i100, label %in.exit121, !llvm.loop !17
in.exit121: ; preds = %getchar_unlocked.exit13.i112
%arrayidx7 = getelementptr inbounds [102 x i32], ptr @y, i64 0, i64 %indvars.iv136
store i32 %add.i105, ptr %arrayidx7, align 4, !tbaa !19
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
%exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count139
br i1 %exitcond140.not, label %for.cond11.preheader, label %for.body4, !llvm.loop !24
for.body13: ; preds = %for.body13.preheader165, %for.body13
%indvars.iv141 = phi i64 [ %indvars.iv.next142, %for.body13 ], [ %indvars.iv141.ph, %for.body13.preheader165 ]
%d3.0131 = phi i64 [ %add25, %for.body13 ], [ %d3.0131.ph, %for.body13.preheader165 ]
%d2.0130 = phi i32 [ %add23, %for.body13 ], [ %d2.0130.ph, %for.body13.preheader165 ]
%d1.0129 = phi i32 [ %add, %for.body13 ], [ %d1.0129.ph, %for.body13.preheader165 ]
%d.0128 = phi i32 [ %d.1, %for.body13 ], [ %d.0128.ph, %for.body13.preheader165 ]
%arrayidx15 = getelementptr inbounds [102 x i32], ptr @x, i64 0, i64 %indvars.iv141
%58 = load i32, ptr %arrayidx15, align 4, !tbaa !19
%arrayidx17 = getelementptr inbounds [102 x i32], ptr @y, i64 0, i64 %indvars.iv141
%59 = load i32, ptr %arrayidx17, align 4, !tbaa !19
%sub = sub nsw i32 %58, %59
%spec.select = tail call i32 @llvm.abs.i32(i32 %sub, i1 true)
%d.1 = tail call i32 @llvm.smax.i32(i32 %spec.select, i32 %d.0128)
%add = add nuw nsw i32 %spec.select, %d1.0129
%mul = mul i32 %sub, %sub
%add23 = add nuw nsw i32 %mul, %d2.0130
%mul24 = mul nsw i32 %mul, %spec.select
%conv = sext i32 %mul24 to i64
%add25 = add nsw i64 %d3.0131, %conv
%indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
%exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144
br i1 %exitcond145.not, label %for.end28.loopexit, label %for.body13, !llvm.loop !25
for.end28.loopexit: ; preds = %for.body13, %middle.block
%d.1.lcssa = phi i32 [ %43, %middle.block ], [ %d.1, %for.body13 ]
%add.lcssa = phi i32 [ %44, %middle.block ], [ %add, %for.body13 ]
%add23.lcssa = phi i32 [ %45, %middle.block ], [ %add23, %for.body13 ]
%add25.lcssa = phi i64 [ %46, %middle.block ], [ %add25, %for.body13 ]
%60 = sitofp i32 %add23.lcssa to double
%61 = sitofp i64 %add25.lcssa to double
br label %for.end28
for.end28: ; preds = %for.cond.preheader, %for.cond2.preheader, %for.end28.loopexit, %for.cond11.preheader
%d.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ %d.1.lcssa, %for.end28.loopexit ], [ 0, %for.cond2.preheader ], [ 0, %for.cond.preheader ]
%d1.0.lcssa = phi i32 [ 0, %for.cond11.preheader ], [ %add.lcssa, %for.end28.loopexit ], [ 0, %for.cond2.preheader ], [ 0, %for.cond.preheader ]
%d2.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ %60, %for.end28.loopexit ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %for.cond.preheader ]
%d3.0.lcssa = phi double [ 0.000000e+00, %for.cond11.preheader ], [ %61, %for.end28.loopexit ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %for.cond.preheader ]
%call29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %d1.0.lcssa)
%call31 = tail call double @sqrt(double noundef %d2.0.lcssa) #5
%call32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call31)
%call34 = tail call double @pow(double noundef %d3.0.lcssa, double noundef 0x3FD5555555555555) #5
%call35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call34)
%call36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %d.0.lcssa)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #2
declare i32 @__uflow(ptr noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.abs.v2i32(<2 x i32>, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v2i32(<2 x i32>) #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 = { nofree nounwind "no-trapping-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 = { "no-trapping-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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18, !22, !23}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18, !23, !22}
|
/* ITP1_10_D: Distance II */
/* 20181125 AOJ */
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#define N 100
int main(void) {
double D1, D2, D3, D4, diff0, diff1, diff2, diff3;
int i, n;
double x[N] = {0.0};
double y[N] = {0.0};
D1 = D2 = D3 = D4 = 0.0;
scanf("%d", &n);
for(i = 0; i < n; i++) scanf("%lf", x + i);
for(i = 0; i < n; i++) scanf("%lf", y + i);
for(i = 0; i < n; i++) {
diff0 = x[i] - y[i];
diff2 = pow(diff0, 2);
diff3 = pow(diff0, 3);
diff3 = pow(diff3, 2);
diff3 = sqrt(diff3);
diff1 = sqrt(diff2);
D1 += diff1;
D2 += diff2;
D3 += diff3;
if(D4 < diff1) D4 = diff1;
}
D2 = sqrt(D2);
D3 = pow(D3, 1.0 / 3);
printf("%.8f\n%.8f\n%.8f\n%.8f\n", D1, D2, D3, D4);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266108/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266108/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.2 = private unnamed_addr constant [21 x i8] c"%.8f\0A%.8f\0A%.8f\0A%.8f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca [100 x double], align 16
%y = alloca [100 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %x) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %x, i8 0, i64 800, i1 false)
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %y) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %y, i8 0, i64 800, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.end27
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body4, label %for.end27
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds double, ptr %x, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond12.preheader: ; preds = %for.body4
%4 = icmp sgt i32 %5, 0
br i1 %4, label %for.body14, label %for.end27
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body4 ], [ 0, %for.cond2.preheader ]
%add.ptr7 = getelementptr inbounds double, ptr %y, i64 %indvars.iv68
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr7)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp3 = icmp slt i64 %indvars.iv.next69, %6
br i1 %cmp3, label %for.body4, label %for.cond12.preheader, !llvm.loop !11
for.body14: ; preds = %for.cond12.preheader, %for.body14
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body14 ], [ 0, %for.cond12.preheader ]
%D1.062 = phi double [ %add, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%D2.061 = phi double [ %add22, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%D3.060 = phi double [ %add23, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%D4.059 = phi double [ %D4.1, %for.body14 ], [ 0.000000e+00, %for.cond12.preheader ]
%arrayidx = getelementptr inbounds [100 x double], ptr %x, i64 0, i64 %indvars.iv71
%7 = load double, ptr %arrayidx, align 8, !tbaa !12
%arrayidx16 = getelementptr inbounds [100 x double], ptr %y, i64 0, i64 %indvars.iv71
%8 = load double, ptr %arrayidx16, align 8, !tbaa !12
%sub = fsub double %7, %8
%square = fmul double %sub, %sub
%call18 = call double @pow(double noundef %sub, double noundef 3.000000e+00) #6
%square52 = fmul double %call18, %call18
%sqrt53 = call double @llvm.sqrt.f64(double %square52)
%sqrt = call double @llvm.sqrt.f64(double %square)
%add = fadd double %D1.062, %sqrt
%add22 = fadd double %D2.061, %square
%add23 = fadd double %D3.060, %sqrt53
%cmp24 = fcmp olt double %D4.059, %sqrt
%D4.1 = select i1 %cmp24, double %sqrt, double %D4.059
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp13 = icmp slt i64 %indvars.iv.next72, %10
br i1 %cmp13, label %for.body14, label %for.end27, !llvm.loop !14
for.end27: ; preds = %for.body14, %entry, %for.cond2.preheader, %for.cond12.preheader
%D4.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %D4.1, %for.body14 ]
%D3.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add23, %for.body14 ]
%D2.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add22, %for.body14 ]
%D1.0.lcssa = phi double [ 0.000000e+00, %for.cond12.preheader ], [ 0.000000e+00, %for.cond2.preheader ], [ 0.000000e+00, %entry ], [ %add, %for.body14 ]
%call28 = call double @sqrt(double noundef %D2.0.lcssa) #6
%call29 = call double @pow(double noundef %D3.0.lcssa, double noundef 0x3FD5555555555555) #6
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %D1.0.lcssa, double noundef %call28, double noundef %call29, double noundef %D4.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 800, 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) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<stdlib.h>
int fun(char *);
int fun(char *s)
{
int i,ans=0;
for(i=0;s[i]!='\0';i++)
{
if(s[i]=='2')
{
ans++;
}
}
return ans;
}
int main()
{
char a[10];
scanf("%s",a);
printf("%d\n",fun(a));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266151/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266151/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @fun(ptr nocapture noundef readonly %s) local_unnamed_addr #0 {
entry:
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%ans.0 = phi i32 [ %ans.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 0, label %for.end
i8 50, label %if.then
]
if.then: ; preds = %for.cond
%inc = add nsw i32 %ans.0, 1
br label %for.inc
for.inc: ; preds = %for.cond, %if.then
%ans.1 = phi i32 [ %inc, %if.then ], [ %ans.0, %for.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
ret i32 %ans.0
}
; 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 [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
br label %for.cond.i
for.cond.i: ; preds = %for.inc.i, %entry
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %entry ]
%ans.0.i = phi i32 [ %ans.1.i, %for.inc.i ], [ 0, %entry ]
%arrayidx.i = getelementptr inbounds i8, ptr %a, i64 %indvars.iv.i
%0 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
switch i8 %0, label %for.inc.i [
i8 0, label %fun.exit
i8 50, label %if.then.i
]
if.then.i: ; preds = %for.cond.i
%inc.i = add nsw i32 %ans.0.i, 1
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.cond.i
%ans.1.i = phi i32 [ %inc.i, %if.then.i ], [ %ans.0.i, %for.cond.i ]
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
br label %for.cond.i, !llvm.loop !8
fun.exit: ; preds = %for.cond.i
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.i)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
char str[4];
int cnt = 0;
scanf("%s", str);
for (int i=0; i<4; i++)
if (str[i] == '2') cnt++;
printf("%d\n", cnt);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266195/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266195/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [4 x i8], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%0 = load <4 x i8>, ptr %str, align 4, !tbaa !5
%1 = icmp eq <4 x i8> %0, <i8 50, i8 50, i8 50, i8 50>
%2 = bitcast <4 x i1> %1 to i4
%3 = call i4 @llvm.ctpop.i4(i4 %2), !range !8
%4 = zext i4 %3 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{i4 0, i4 5}
|
#include <stdio.h>
int main(void)
{char ch[10000];
int len,i;
len=0; i=0;
scanf("%s", ch);
while(ch[i] != '\0'){
if(ch[i]=='2'){
len++;
}
i++;
}
printf("%d\n", len);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266238/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266238/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%ch = alloca [10000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %ch) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
br label %while.cond
while.cond: ; preds = %if.end, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%len.0 = phi i32 [ %len.1, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000 x i8], ptr %ch, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.end [
i8 0, label %while.end
i8 50, label %if.then
]
if.then: ; preds = %while.cond
%inc = add nsw i32 %len.0, 1
br label %if.end
if.end: ; preds = %while.cond, %if.then
%len.1 = phi i32 [ %inc, %if.then ], [ %len.0, %while.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %len.0)
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %ch) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define Abs(x) ((x) > 0 ? (x) : -(x))
#define REP(i, n) for(int i = 0; i < n; i++)
#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9 + 7
typedef long long ll;
int
main(int argc, char *argv[])
{
int h, w, d;
scanf("%d %d %d", &h, &w, &d);
int co[90010][2], a;
REP(i, h)REP(j, w){
scanf("%d", &a);
co[a][0] = i;
co[a][1] = j;
}
int u[90010] = {}, p, qq;
for(int i = 1; i <= d; i++){
for(int j = 1; i + j * d <= h * w; j++){
p = i + j * d; qq = p - d;
u[i + j * d] = u[i + (j - 1) * d]
+ Abs(co[p][0] - co[qq][0])
+ Abs(co[p][1] - co[qq][1]);
}
}
int q;
scanf("%d", &q);
int l, r, ans;
REP(i, q){
scanf("%d %d", &l, &r);
printf("%d\n", u[r] - u[l]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266281/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266281/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%d = alloca i32, align 4
%co = alloca [90010 x [2 x i32]], align 16
%a = alloca i32, align 4
%u = alloca [90010 x i32], align 16
%u163 = ptrtoint ptr %u to i64
%q = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %d)
call void @llvm.lifetime.start.p0(i64 720080, ptr nonnull %co) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp136 = icmp sgt i32 %0, 0
%1 = load i32, ptr %w, align 4
%2 = icmp sgt i32 %1, 0
%or.cond = select i1 %cmp136, i1 %2, i1 false
br i1 %or.cond, label %for.cond1.preheader, label %for.cond.cleanup
for.cond1.preheader: ; preds = %entry, %for.cond.cleanup3
%3 = phi i32 [ %19, %for.cond.cleanup3 ], [ %0, %entry ]
%4 = phi i32 [ %20, %for.cond.cleanup3 ], [ %1, %entry ]
%i.0137 = phi i32 [ %inc11, %for.cond.cleanup3 ], [ 0, %entry ]
%cmp2134 = icmp sgt i32 %4, 0
br i1 %cmp2134, label %for.body4, label %for.cond.cleanup3
for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %19, %for.cond.cleanup3 ]
call void @llvm.lifetime.start.p0(i64 360040, ptr nonnull %u) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(360040) %u, i8 0, i64 360040, i1 false)
%5 = load i32, ptr %d, align 4, !tbaa !5
%cmp15.not142 = icmp slt i32 %5, 1
br i1 %cmp15.not142, label %for.cond.cleanup16, label %for.cond19.preheader.lr.ph
for.cond19.preheader.lr.ph: ; preds = %for.cond.cleanup
%6 = load i32, ptr %w, align 4, !tbaa !5
%mul20 = mul nsw i32 %6, %.lcssa
%7 = zext i32 %5 to i64
%8 = sext i32 %mul20 to i64
%9 = add nuw i32 %5, 1
%wide.trip.count = zext i32 %9 to i64
%10 = shl nuw nsw i64 %7, 1
%11 = or i64 %10, 1
%12 = add nsw i64 %8, 1
%13 = xor i64 %10, -1
%14 = or i64 %u163, 4
%15 = shl nuw nsw i64 %7, 1
%16 = or i64 %15, 1
%17 = add nsw i64 %8, 1
%18 = xor i64 %15, -1
%ident.check = icmp ne i32 %5, 1
br label %for.cond19.preheader
for.cond.cleanup3.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %for.cond.cleanup3
for.cond.cleanup3: ; preds = %for.cond.cleanup3.loopexit, %for.cond1.preheader
%19 = phi i32 [ %.pre, %for.cond.cleanup3.loopexit ], [ %3, %for.cond1.preheader ]
%20 = phi i32 [ %22, %for.cond.cleanup3.loopexit ], [ %4, %for.cond1.preheader ]
%inc11 = add nuw nsw i32 %i.0137, 1
%cmp = icmp slt i32 %inc11, %19
br i1 %cmp, label %for.cond1.preheader, label %for.cond.cleanup, !llvm.loop !9
for.body4: ; preds = %for.cond1.preheader, %for.body4
%j.0135 = phi i32 [ %inc, %for.body4 ], [ 0, %for.cond1.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%21 = load i32, ptr %a, align 4, !tbaa !5
%idxprom = sext i32 %21 to i64
%arrayidx = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %idxprom
store i32 %i.0137, ptr %arrayidx, align 8, !tbaa !5
%arrayidx9 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %idxprom, i64 1
store i32 %j.0135, ptr %arrayidx9, align 4, !tbaa !5
%inc = add nuw nsw i32 %j.0135, 1
%22 = load i32, ptr %w, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc, %22
br i1 %cmp2, label %for.body4, label %for.cond.cleanup3.loopexit, !llvm.loop !12
for.cond19.preheader: ; preds = %for.cond19.preheader.lr.ph, %for.cond.cleanup22
%indvar = phi i64 [ 0, %for.cond19.preheader.lr.ph ], [ %indvar.next, %for.cond.cleanup22 ]
%indvars.iv154 = phi i64 [ 1, %for.cond19.preheader.lr.ph ], [ %indvars.iv.next155, %for.cond.cleanup22 ]
%23 = shl i64 %indvar, 32
%sext174 = add i64 %23, 8589934592
%24 = ashr exact i64 %sext174, 30
%25 = add i64 %24, %u163
%26 = shl nuw nsw i64 %indvar, 2
%27 = add i64 %14, %26
%28 = add i64 %11, %indvar
%smax = call i64 @llvm.smax.i64(i64 %28, i64 %12)
%29 = sub i64 %13, %indvar
%30 = add i64 %smax, %29
%31 = icmp ne i64 %30, 0
%umin = zext i1 %31 to i64
%32 = sub i64 %30, %umin
%33 = trunc i64 %indvar to i32
%34 = add i32 %33, 2
%35 = add nuw nsw i64 %indvars.iv154, %7
%cmp21.not139 = icmp sgt i64 %35, %8
br i1 %cmp21.not139, label %for.cond.cleanup22, label %for.body23.preheader
for.body23.preheader: ; preds = %for.cond19.preheader
%36 = add i64 %16, %indvar
%smax164 = call i64 @llvm.smax.i64(i64 %36, i64 %17)
%37 = sub i64 %18, %indvar
%38 = add i64 %smax164, %37
%39 = icmp ne i64 %38, 0
%umin165.neg = sext i1 %39 to i64
%40 = add i64 %38, %umin165.neg
%41 = select i1 %39, i64 2, i64 1
%42 = udiv i64 %40, %7
%43 = add i64 %41, %42
%min.iters.check = icmp ult i64 %43, 8
br i1 %min.iters.check, label %for.body23.preheader177, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body23.preheader
%44 = udiv i64 %32, %7
%45 = add i64 %44, %umin
%46 = trunc i64 %45 to i32
%47 = add i32 %34, %46
%48 = icmp slt i32 %47, %34
%49 = icmp ugt i64 %45, 4294967295
%50 = or i1 %48, %49
%51 = or i1 %ident.check, %50
%52 = sub i64 %25, %27
%diff.check = icmp ult i64 %52, 16
%or.cond176 = select i1 %51, i1 true, i1 %diff.check
br i1 %or.cond176, label %for.body23.preheader177, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %43, -4
%ind.end = or i64 %n.vec, 1
%53 = mul i64 %n.vec, %7
%ind.end166 = add i64 %35, %53
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%54 = mul i64 %index, %7
%offset.idx = add i64 %35, %54
%55 = mul i64 %index, %7
%offset.idx168 = add i64 %35, %55
%56 = mul nsw i64 %index, %7
%57 = add nsw i64 %56, %indvars.iv154
%58 = getelementptr inbounds [90010 x i32], ptr %u, i64 0, i64 %57
%wide.load = load <4 x i32>, ptr %58, align 4, !tbaa !5
%59 = shl i64 %offset.idx168, 32
%60 = ashr exact i64 %59, 32
%61 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %60
%wide.vec = load <8 x i32>, ptr %61, align 8, !tbaa !5
%62 = shl i64 %offset.idx, 32
%sext175 = add i64 %62, -4294967296
%63 = ashr exact i64 %sext175, 32
%64 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %63
%wide.vec171 = load <8 x i32>, ptr %64, align 8, !tbaa !5
%65 = sub nsw <8 x i32> %wide.vec, %wide.vec171
%66 = shufflevector <8 x i32> %65, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%67 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %66, i1 true)
%68 = add nsw <4 x i32> %67, %wide.load
%69 = sub nsw <8 x i32> %wide.vec, %wide.vec171
%70 = shufflevector <8 x i32> %69, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
%71 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %70, i1 true)
%72 = add nsw <4 x i32> %68, %71
%73 = getelementptr inbounds [90010 x i32], ptr %u, i64 0, i64 %60
store <4 x i32> %72, ptr %73, align 4, !tbaa !5
%index.next = add nuw i64 %index, 4
%74 = icmp eq i64 %index.next, %n.vec
br i1 %74, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %43, %n.vec
br i1 %cmp.n, label %for.cond.cleanup22, label %for.body23.preheader177
for.body23.preheader177: ; preds = %vector.scevcheck, %for.body23.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %vector.scevcheck ], [ 1, %for.body23.preheader ], [ %ind.end, %middle.block ]
%add141.in.ph = phi i64 [ %35, %vector.scevcheck ], [ %35, %for.body23.preheader ], [ %ind.end166, %middle.block ]
br label %for.body23
for.cond.cleanup16: ; preds = %for.cond.cleanup22, %for.cond.cleanup
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
%call93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
%75 = load i32, ptr %q, align 4, !tbaa !5
%cmp96144 = icmp sgt i32 %75, 0
br i1 %cmp96144, label %for.body98, label %for.cond.cleanup97
for.cond.cleanup22: ; preds = %for.body23, %middle.block, %for.cond19.preheader
%indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1
%exitcond.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count
%indvar.next = add i64 %indvar, 1
br i1 %exitcond.not, label %for.cond.cleanup16, label %for.cond19.preheader, !llvm.loop !16
for.body23: ; preds = %for.body23.preheader177, %for.body23
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body23 ], [ %indvars.iv.ph, %for.body23.preheader177 ]
%add141.in = phi i64 [ %85, %for.body23 ], [ %add141.in.ph, %for.body23.preheader177 ]
%add141 = trunc i64 %add141.in to i32
%sub = sub nsw i32 %add141, %5
%76 = add nsw i64 %indvars.iv, -1
%77 = mul nsw i64 %76, %7
%78 = add nsw i64 %77, %indvars.iv154
%arrayidx30 = getelementptr inbounds [90010 x i32], ptr %u, i64 0, i64 %78
%79 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%sext = shl i64 %add141.in, 32
%idxprom31 = ashr exact i64 %sext, 32
%arrayidx32 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %idxprom31
%80 = load i32, ptr %arrayidx32, align 8, !tbaa !5
%idxprom34 = sext i32 %sub to i64
%arrayidx35 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %idxprom34
%81 = load i32, ptr %arrayidx35, align 8, !tbaa !5
%sub37 = sub nsw i32 %80, %81
%cond = call i32 @llvm.abs.i32(i32 %sub37, i1 true)
%add54 = add nsw i32 %cond, %79
%arrayidx57 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %idxprom31, i64 1
%82 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%arrayidx60 = getelementptr inbounds [90010 x [2 x i32]], ptr %co, i64 0, i64 %idxprom34, i64 1
%83 = load i32, ptr %arrayidx60, align 4, !tbaa !5
%sub61 = sub nsw i32 %82, %83
%cond81 = call i32 @llvm.abs.i32(i32 %sub61, i1 true)
%add82 = add nsw i32 %add54, %cond81
%arrayidx86 = getelementptr inbounds [90010 x i32], ptr %u, i64 0, i64 %idxprom31
store i32 %add82, ptr %arrayidx86, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%84 = mul nsw i64 %indvars.iv.next, %7
%85 = add nuw nsw i64 %84, %indvars.iv154
%cmp21.not = icmp sgt i64 %85, %8
br i1 %cmp21.not, label %for.cond.cleanup22, label %for.body23, !llvm.loop !17
for.cond.cleanup97: ; preds = %for.body98, %for.cond.cleanup16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 360040, ptr nonnull %u) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 720080, ptr nonnull %co) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
for.body98: ; preds = %for.cond.cleanup16, %for.body98
%i94.0145 = phi i32 [ %inc107, %for.body98 ], [ 0, %for.cond.cleanup16 ]
%call99 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %l, ptr noundef nonnull %r)
%86 = load i32, ptr %r, align 4, !tbaa !5
%idxprom100 = sext i32 %86 to i64
%arrayidx101 = getelementptr inbounds [90010 x i32], ptr %u, i64 0, i64 %idxprom100
%87 = load i32, ptr %arrayidx101, align 4, !tbaa !5
%88 = load i32, ptr %l, align 4, !tbaa !5
%idxprom102 = sext i32 %88 to i64
%arrayidx103 = getelementptr inbounds [90010 x i32], ptr %u, i64 0, i64 %idxprom102
%89 = load i32, ptr %arrayidx103, align 4, !tbaa !5
%sub104 = sub nsw i32 %87, %89
%call105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub104)
%inc107 = add nuw nsw i32 %i94.0145, 1
%90 = load i32, ptr %q, align 4, !tbaa !5
%cmp96 = icmp slt i32 %inc107, %90
br i1 %cmp96, label %for.body98, label %for.cond.cleanup97, !llvm.loop !18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !14}
!18 = distinct !{!18, !10}
|
#include <stdio.h>
int main(){
int N, C[500], S[500], F[500], i, j, t;
scanf("%d",&N);
for (i=0;i<N-1;i++) {scanf("%d %d %d",&C[i],&S[i],&F[i]);}
for (i=0;i<N;i++){
t = 0;
for (j=i;j<N-1;j++){
if (t<S[j]) t=S[j];
else if (t%F[j] == 0);
else t=t+F[j]-t%F[j];
t+=C[j];
}
printf("%d\n",t);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266339/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266339/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%C = alloca [500 x i32], align 16
%S = alloca [500 x i32], align 16
%F = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %C) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %F) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp60 = icmp sgt i32 %0, 1
br i1 %cmp60, label %for.body, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %2, %for.body ]
%cmp765 = icmp sgt i32 %1, 0
br i1 %cmp765, label %for.cond9.preheader, label %for.end39
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [500 x i32], ptr %C, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [500 x i32], ptr %S, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [500 x i32], ptr %F, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%3 = sext i32 %sub to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.cond9.preheader: ; preds = %for.cond6.preheader, %for.end35
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.end35 ], [ 0, %for.cond6.preheader ]
%4 = phi i32 [ %8, %for.end35 ], [ %1, %for.cond6.preheader ]
%indvars73 = trunc i64 %indvars.iv68 to i32
%sub10 = add nsw i32 %4, -1
%cmp1162 = icmp sgt i32 %sub10, %indvars73
br i1 %cmp1162, label %for.body12.preheader, label %for.end35
for.body12.preheader: ; preds = %for.cond9.preheader
%wide.trip.count = zext i32 %sub10 to i64
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %if.end29
%indvars.iv70 = phi i64 [ %indvars.iv68, %for.body12.preheader ], [ %indvars.iv.next71, %if.end29 ]
%t.064 = phi i32 [ 0, %for.body12.preheader ], [ %add32, %if.end29 ]
%arrayidx14 = getelementptr inbounds [500 x i32], ptr %S, i64 0, i64 %indvars.iv70
%5 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp slt i32 %t.064, %5
br i1 %cmp15, label %if.end29, label %if.else
if.else: ; preds = %for.body12
%arrayidx19 = getelementptr inbounds [500 x i32], ptr %F, i64 0, i64 %indvars.iv70
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%rem = srem i32 %t.064, %6
%cmp20 = icmp eq i32 %rem, 0
br i1 %cmp20, label %if.end29, label %if.else22
if.else22: ; preds = %if.else
%add = add nsw i32 %6, %t.064
%sub28 = sub i32 %add, %rem
br label %if.end29
if.end29: ; preds = %for.body12, %if.else22, %if.else
%t.1 = phi i32 [ %t.064, %if.else ], [ %sub28, %if.else22 ], [ %5, %for.body12 ]
%arrayidx31 = getelementptr inbounds [500 x i32], ptr %C, i64 0, i64 %indvars.iv70
%7 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%add32 = add nsw i32 %7, %t.1
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count
br i1 %exitcond.not, label %for.end35, label %for.body12, !llvm.loop !11
for.end35: ; preds = %if.end29, %for.cond9.preheader
%t.0.lcssa = phi i32 [ 0, %for.cond9.preheader ], [ %add32, %if.end29 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t.0.lcssa)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%indvars = trunc i64 %indvars.iv.next69 to i32
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %8, %indvars
br i1 %cmp7, label %for.cond9.preheader, label %for.end39, !llvm.loop !12
for.end39: ; preds = %for.end35, %for.cond6.preheader
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %F) #3
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
int i, j;
int c[502], s[502], f[502];
for (i = 0; i < n - 1; i++)
scanf("%d %d %d", &c[i], &s[i], &f[i]);
int ans;
for (i = 0; i < n; i++)
{
ans = 0;
for (j = i; j < n - 1; j++)
{
if (ans < s[j])
ans = s[j];
else if (ans%f[j] > 0)
ans = ans - (ans%f[j]) + f[j];
ans += c[j];
}
printf("%d\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266382/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266382/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%c = alloca [502 x i32], align 16
%s = alloca [502 x i32], align 16
%f = alloca [502 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 2008, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 2008, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 2008, ptr nonnull %f) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp59 = icmp sgt i32 %0, 1
br i1 %cmp59, label %for.body, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %2, %for.body ]
%cmp764 = icmp sgt i32 %1, 0
br i1 %cmp764, label %for.cond9.preheader, label %for.end38
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [502 x i32], ptr %c, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [502 x i32], ptr %s, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [502 x i32], ptr %f, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %2, -1
%3 = sext i32 %sub to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.cond9.preheader: ; preds = %for.cond6.preheader, %for.end34
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.end34 ], [ 0, %for.cond6.preheader ]
%4 = phi i32 [ %8, %for.end34 ], [ %1, %for.cond6.preheader ]
%indvars72 = trunc i64 %indvars.iv67 to i32
%sub10 = add nsw i32 %4, -1
%cmp1161 = icmp sgt i32 %sub10, %indvars72
br i1 %cmp1161, label %for.body12.preheader, label %for.end34
for.body12.preheader: ; preds = %for.cond9.preheader
%wide.trip.count = zext i32 %sub10 to i64
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %if.end28
%indvars.iv69 = phi i64 [ %indvars.iv67, %for.body12.preheader ], [ %indvars.iv.next70, %if.end28 ]
%ans.063 = phi i32 [ 0, %for.body12.preheader ], [ %add31, %if.end28 ]
%arrayidx14 = getelementptr inbounds [502 x i32], ptr %s, i64 0, i64 %indvars.iv69
%5 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp slt i32 %ans.063, %5
br i1 %cmp15, label %if.end28, label %if.else
if.else: ; preds = %for.body12
%arrayidx19 = getelementptr inbounds [502 x i32], ptr %f, i64 0, i64 %indvars.iv69
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%rem = srem i32 %ans.063, %6
%cmp20 = icmp sgt i32 %rem, 0
br i1 %cmp20, label %if.then21, label %if.end28
if.then21: ; preds = %if.else
%sub25 = add i32 %6, %ans.063
%add = sub i32 %sub25, %rem
br label %if.end28
if.end28: ; preds = %for.body12, %if.else, %if.then21
%ans.1 = phi i32 [ %add, %if.then21 ], [ %ans.063, %if.else ], [ %5, %for.body12 ]
%arrayidx30 = getelementptr inbounds [502 x i32], ptr %c, i64 0, i64 %indvars.iv69
%7 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%add31 = add nsw i32 %7, %ans.1
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count
br i1 %exitcond.not, label %for.end34, label %for.body12, !llvm.loop !11
for.end34: ; preds = %if.end28, %for.cond9.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond9.preheader ], [ %add31, %if.end28 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%indvars = trunc i64 %indvars.iv.next68 to i32
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %8, %indvars
br i1 %cmp7, label %for.cond9.preheader, label %for.end38, !llvm.loop !12
for.end38: ; preds = %for.end34, %for.cond6.preheader
call void @llvm.lifetime.end.p0(i64 2008, ptr nonnull %f) #3
call void @llvm.lifetime.end.p0(i64 2008, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 2008, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
//for
#define REP(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define REPS(i,n) for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define RREP(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define RREPS(i,n) for(int i=(int)(n);i>0;i--)
//printf
#define PRINTD(d) printf("%d\n",(d))
#define PRINTS(s) printf("%s\n",(s))
//memset
#define m0(s) memset(s,0,sizeof(s))
#define ml(s) memset(s,63,sizeof(s))
#define fill(s,c) memset(s,c,sizeof(s))
typedef long long ll;
int main() {
int N;
int C[500], S[500], F[500];
int t[500];
scanf("%d", &N);
REP(i, N-1) {
scanf("%d %d %d", &C[i], &S[i], &F[i]);
}
t[N-1] = 0;
REP(i, N-1) {
t[i] = S[i]+C[i];
for (int j = i+1; j < N - 1; j++) {
if (t[i] < S[j]) {
t[i] = S[j] + C[j];
}
else {
t[i] += (F[j]-(t[i] % F[j]))%F[j]+C[j];
}
}
}
REP(i, N) {
PRINTD(t[i]);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266425/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266425/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%C = alloca [500 x i32], align 16
%S = alloca [500 x i32], align 16
%F = alloca [500 x i32], align 16
%t = alloca [500 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %C) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %F) #3
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%sub = add i32 %0, -1
%cmp98 = icmp sgt i32 %0, 1
br i1 %cmp98, label %for.body.preheader, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%idxprom7127 = sext i32 %sub to i64
%arrayidx8128 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %idxprom7127
store i32 0, ptr %arrayidx8128, align 4, !tbaa !5
br label %for.cond64.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body
%.pre = load i32, ptr %N, align 4, !tbaa !5
%.pre125 = add nsw i32 %.pre, -1
%idxprom7 = sext i32 %.pre125 to i64
%arrayidx8 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %idxprom7
store i32 0, ptr %arrayidx8, align 4, !tbaa !5
%cmp13103 = icmp sgt i32 %.pre, 1
br i1 %cmp13103, label %for.body15.preheader, label %for.cond64.preheader
for.body15.preheader: ; preds = %for.cond.cleanup
%wide.trip.count118 = zext i32 %.pre125 to i64
br label %for.body15
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds [500 x i32], ptr %C, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [500 x i32], ptr %S, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [500 x i32], ptr %F, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
for.cond23.for.cond12.loopexit_crit_edge: ; preds = %for.inc56
store i32 %storemerge, ptr %arrayidx21, align 4, !tbaa !5
br label %for.cond12.loopexit
for.cond12.loopexit: ; preds = %for.cond23.for.cond12.loopexit_crit_edge, %for.body15
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
br i1 %exitcond119.not, label %for.cond64.preheader, label %for.body15, !llvm.loop !11
for.cond64.preheader: ; preds = %for.cond12.loopexit, %for.cond.cleanup.thread, %for.cond.cleanup
%1 = phi i32 [ %0, %for.cond.cleanup.thread ], [ %.pre, %for.cond.cleanup ], [ %.pre, %for.cond12.loopexit ]
%cmp65105 = icmp sgt i32 %1, 0
br i1 %cmp65105, label %for.body67.preheader, label %for.cond.cleanup66
for.body67.preheader: ; preds = %for.cond64.preheader
%wide.trip.count123 = zext i32 %1 to i64
br label %for.body67
for.body15: ; preds = %for.body15.preheader, %for.cond12.loopexit
%indvars.iv115 = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next116, %for.cond12.loopexit ]
%indvars.iv108 = phi i64 [ 1, %for.body15.preheader ], [ %indvars.iv.next109, %for.cond12.loopexit ]
%arrayidx17 = getelementptr inbounds [500 x i32], ptr %S, i64 0, i64 %indvars.iv115
%2 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [500 x i32], ptr %C, i64 0, i64 %indvars.iv115
%3 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%add = add nsw i32 %3, %2
%arrayidx21 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv115
store i32 %add, ptr %arrayidx21, align 4, !tbaa !5
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%cmp25100 = icmp slt i64 %indvars.iv.next116, %idxprom7
br i1 %cmp25100, label %for.body27, label %for.cond12.loopexit
for.body27: ; preds = %for.body15, %for.inc56
%indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.inc56 ], [ %indvars.iv108, %for.body15 ]
%storemerge102 = phi i32 [ %storemerge, %for.inc56 ], [ %add, %for.body15 ]
%arrayidx31 = getelementptr inbounds [500 x i32], ptr %S, i64 0, i64 %indvars.iv110
%4 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp slt i32 %storemerge102, %4
br i1 %cmp32, label %if.then, label %if.else
if.then: ; preds = %for.body27
%arrayidx36 = getelementptr inbounds [500 x i32], ptr %C, i64 0, i64 %indvars.iv110
%5 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%add37 = add nsw i32 %5, %4
br label %for.inc56
if.else: ; preds = %for.body27
%arrayidx41 = getelementptr inbounds [500 x i32], ptr %F, i64 0, i64 %indvars.iv110
%6 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%rem = srem i32 %storemerge102, %6
%sub46 = sub nsw i32 %6, %rem
%rem49 = srem i32 %sub46, %6
%arrayidx51 = getelementptr inbounds [500 x i32], ptr %C, i64 0, i64 %indvars.iv110
%7 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%add52 = add i32 %rem49, %storemerge102
%add55 = add i32 %add52, %7
br label %for.inc56
for.inc56: ; preds = %if.then, %if.else
%storemerge = phi i32 [ %add55, %if.else ], [ %add37, %if.then ]
%indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
%exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count118
br i1 %exitcond114.not, label %for.cond23.for.cond12.loopexit_crit_edge, label %for.body27, !llvm.loop !12
for.cond.cleanup66: ; preds = %for.body67, %for.cond64.preheader
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %F) #3
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %S) #3
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
for.body67: ; preds = %for.body67.preheader, %for.body67
%indvars.iv120 = phi i64 [ 0, %for.body67.preheader ], [ %indvars.iv.next121, %for.body67 ]
%arrayidx69 = getelementptr inbounds [500 x i32], ptr %t, i64 0, i64 %indvars.iv120
%8 = load i32, ptr %arrayidx69, align 4, !tbaa !5
%call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%exitcond124.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count123
br i1 %exitcond124.not, label %for.cond.cleanup66, label %for.body67, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <string.h>
int C,D,W,X;
/* [area][day] */
int E[15][30];
int F[15][30];
/* [day][area][direction][rest fuka][rest multiple] */
int memo[30][16][3][51][6];
int tansaku(int day,int area,int direction,int rest_fuka,int rest_multiple) {
int result=0,nowresult;
int i;
if(day>=D)return 0;
if(memo[day][area][direction][rest_fuka][rest_multiple]>0) {
return memo[day][area][direction][rest_fuka][rest_multiple]-1;
}
result=tansaku(day+1,0,0,rest_fuka,rest_multiple);
if(area==0) {
for(i=0;i<C;i++) {
if(E[i][day]>0 && F[i][day]<=rest_fuka) {
int nownowresult;
nowresult=tansaku(day+1,0,0,rest_fuka-F[i][day],rest_multiple);
if(rest_multiple>0) {
nownowresult=tansaku(day,i+1,0,rest_fuka-F[i][day],rest_multiple-1);
if(nownowresult>nowresult)nowresult=nownowresult;
}
nowresult+=E[i][day];
if(nowresult>result)result=nowresult;
}
}
} else {
/* direction : 0 is none, 1 is left, 2 is right */
if(direction!=2 && area>1 && E[area-2][day]>0 && F[area-2][day]<=rest_fuka) {
nowresult=tansaku(day,area-1,1,rest_fuka-F[area-2][day],rest_multiple);
nowresult+=E[area-2][day];
if(nowresult>result)result=nowresult;
}
if(direction!=1 && area<C && E[area][day]>0 && F[area][day]<=rest_fuka) {
nowresult=tansaku(day,area+1,2,rest_fuka-F[area][day],rest_multiple);
nowresult+=E[area][day];
if(nowresult>result)result=nowresult;
}
}
memo[day][area][direction][rest_fuka][rest_multiple]=result+1;
return result;
}
int main(void) {
int i,j;
while(1) {
scanf("%d%d%d%d",&C,&D,&W,&X);
if((C|D|W|X)==0)break;
for(i=0;i<C;i++) {
for(j=0;j<D;j++) {
scanf("%d",&E[i][j]);
}
}
for(i=0;i<C;i++) {
for(j=0;j<D;j++) {
scanf("%d",&F[i][j]);
}
}
memset(memo,0,sizeof(memo));
printf("%d\n",tansaku(0,0,0,W,X));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266476/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266476/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@D = dso_local global i32 0, align 4
@memo = dso_local local_unnamed_addr global [30 x [16 x [3 x [51 x [6 x i32]]]]] zeroinitializer, align 16
@C = dso_local global i32 0, align 4
@E = dso_local global [15 x [30 x i32]] zeroinitializer, align 16
@F = dso_local global [15 x [30 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@W = dso_local global i32 0, align 4
@X = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @tansaku(i32 noundef %day, i32 noundef %area, i32 noundef %direction, i32 noundef %rest_fuka, i32 noundef %rest_multiple) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @D, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %day
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%idxprom = sext i32 %day to i64
%idxprom1 = sext i32 %area to i64
%idxprom3 = sext i32 %direction to i64
%idxprom5 = sext i32 %rest_fuka to i64
%idxprom7 = sext i32 %rest_multiple to i64
%arrayidx8 = getelementptr inbounds [30 x [16 x [3 x [51 x [6 x i32]]]]], ptr @memo, i64 0, i64 %idxprom, i64 %idxprom1, i64 %idxprom3, i64 %idxprom5, i64 %idxprom7
%1 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %1, 0
br i1 %cmp9, label %if.then10, label %if.end21
if.then10: ; preds = %if.end
%sub = add nsw i32 %1, -1
br label %cleanup
if.end21: ; preds = %if.end
%add = add nsw i32 %day, 1
%call = tail call i32 @tansaku(i32 noundef %add, i32 noundef 0, i32 noundef 0, i32 noundef %rest_fuka, i32 noundef %rest_multiple)
%cmp22 = icmp eq i32 %area, 0
br i1 %cmp22, label %for.cond.preheader, label %if.else
for.cond.preheader: ; preds = %if.end21
%2 = load i32, ptr @C, align 4, !tbaa !5
%cmp24234 = icmp sgt i32 %2, 0
br i1 %cmp24234, label %for.body.lr.ph, label %if.end134
for.body.lr.ph: ; preds = %for.cond.preheader
%cmp43 = icmp sgt i32 %rest_multiple, 0
%sub51 = add nsw i32 %rest_multiple, -1
br i1 %cmp43, label %for.body.us, label %for.body
for.body.us: ; preds = %for.body.lr.ph, %for.inc.us
%3 = phi i32 [ %10, %for.inc.us ], [ %2, %for.body.lr.ph ]
%indvars.iv240 = phi i64 [ %indvars.iv.next241, %for.inc.us ], [ 0, %for.body.lr.ph ]
%result.0235.us = phi i32 [ %result.2.us, %for.inc.us ], [ %call, %for.body.lr.ph ]
%arrayidx28.us = getelementptr inbounds [15 x [30 x i32]], ptr @E, i64 0, i64 %indvars.iv240, i64 %idxprom
%4 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5
%cmp29.us = icmp sgt i32 %4, 0
br i1 %cmp29.us, label %land.lhs.true.us, label %for.inc.us
land.lhs.true.us: ; preds = %for.body.us
%arrayidx33.us = getelementptr inbounds [15 x [30 x i32]], ptr @F, i64 0, i64 %indvars.iv240, i64 %idxprom
%5 = load i32, ptr %arrayidx33.us, align 4, !tbaa !5
%cmp34.not.us = icmp sgt i32 %5, %rest_fuka
br i1 %cmp34.not.us, label %for.inc.us, label %if.then35.us
if.then35.us: ; preds = %land.lhs.true.us
%sub41.us = sub nsw i32 %rest_fuka, %5
%call42.us = tail call i32 @tansaku(i32 noundef %add, i32 noundef 0, i32 noundef 0, i32 noundef %sub41.us, i32 noundef %rest_multiple)
%6 = load i32, ptr %arrayidx33.us, align 4, !tbaa !5
%sub50.us = sub nsw i32 %rest_fuka, %6
%7 = trunc i64 %indvars.iv240 to i32
%8 = add i32 %7, 1
%call52.us = tail call i32 @tansaku(i32 noundef %day, i32 noundef %8, i32 noundef 0, i32 noundef %sub50.us, i32 noundef %sub51)
%spec.select.us = tail call i32 @llvm.smax.i32(i32 %call52.us, i32 %call42.us)
%9 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5
%add61.us = add nsw i32 %9, %spec.select.us
%spec.select230.us = tail call i32 @llvm.smax.i32(i32 %add61.us, i32 %result.0235.us)
%.pre244 = load i32, ptr @C, align 4, !tbaa !5
br label %for.inc.us
for.inc.us: ; preds = %if.then35.us, %land.lhs.true.us, %for.body.us
%10 = phi i32 [ %.pre244, %if.then35.us ], [ %3, %land.lhs.true.us ], [ %3, %for.body.us ]
%result.2.us = phi i32 [ %spec.select230.us, %if.then35.us ], [ %result.0235.us, %land.lhs.true.us ], [ %result.0235.us, %for.body.us ]
%indvars.iv.next241 = add nuw nsw i64 %indvars.iv240, 1
%11 = sext i32 %10 to i64
%cmp24.us = icmp slt i64 %indvars.iv.next241, %11
br i1 %cmp24.us, label %for.body.us, label %if.end134, !llvm.loop !9
for.body: ; preds = %for.body.lr.ph, %for.inc
%12 = phi i32 [ %16, %for.inc ], [ %2, %for.body.lr.ph ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.body.lr.ph ]
%result.0235 = phi i32 [ %result.2, %for.inc ], [ %call, %for.body.lr.ph ]
%arrayidx28 = getelementptr inbounds [15 x [30 x i32]], ptr @E, i64 0, i64 %indvars.iv, i64 %idxprom
%13 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %13, 0
br i1 %cmp29, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%arrayidx33 = getelementptr inbounds [15 x [30 x i32]], ptr @F, i64 0, i64 %indvars.iv, i64 %idxprom
%14 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%cmp34.not = icmp sgt i32 %14, %rest_fuka
br i1 %cmp34.not, label %for.inc, label %if.then35
if.then35: ; preds = %land.lhs.true
%sub41 = sub nsw i32 %rest_fuka, %14
%call42 = tail call i32 @tansaku(i32 noundef %add, i32 noundef 0, i32 noundef 0, i32 noundef %sub41, i32 noundef %rest_multiple)
%15 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add61 = add nsw i32 %15, %call42
%spec.select230 = tail call i32 @llvm.smax.i32(i32 %add61, i32 %result.0235)
%.pre = load i32, ptr @C, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %if.then35
%16 = phi i32 [ %.pre, %if.then35 ], [ %12, %land.lhs.true ], [ %12, %for.body ]
%result.2 = phi i32 [ %spec.select230, %if.then35 ], [ %result.0235, %land.lhs.true ], [ %result.0235, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%17 = sext i32 %16 to i64
%cmp24 = icmp slt i64 %indvars.iv.next, %17
br i1 %cmp24, label %for.body, label %if.end134, !llvm.loop !9
if.else: ; preds = %if.end21
%cmp66 = icmp ne i32 %direction, 2
%cmp68 = icmp sgt i32 %area, 1
%or.cond = and i1 %cmp68, %cmp66
br i1 %or.cond, label %land.lhs.true69, label %if.end101
land.lhs.true69: ; preds = %if.else
%sub70 = add nsw i32 %area, -2
%idxprom71 = zext i32 %sub70 to i64
%arrayidx74 = getelementptr inbounds [15 x [30 x i32]], ptr @E, i64 0, i64 %idxprom71, i64 %idxprom
%18 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%cmp75 = icmp sgt i32 %18, 0
br i1 %cmp75, label %land.lhs.true76, label %if.end101
land.lhs.true76: ; preds = %land.lhs.true69
%arrayidx81 = getelementptr inbounds [15 x [30 x i32]], ptr @F, i64 0, i64 %idxprom71, i64 %idxprom
%19 = load i32, ptr %arrayidx81, align 4, !tbaa !5
%cmp82.not = icmp sgt i32 %19, %rest_fuka
br i1 %cmp82.not, label %if.end101, label %if.then83
if.then83: ; preds = %land.lhs.true76
%sub84 = add nsw i32 %area, -1
%sub90 = sub nsw i32 %rest_fuka, %19
%call91 = tail call i32 @tansaku(i32 noundef %day, i32 noundef %sub84, i32 noundef 1, i32 noundef %sub90, i32 noundef %rest_multiple)
%20 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%add97 = add nsw i32 %20, %call91
%spec.select231 = tail call i32 @llvm.smax.i32(i32 %add97, i32 %call)
br label %if.end101
if.end101: ; preds = %if.then83, %land.lhs.true76, %land.lhs.true69, %if.else
%result.3 = phi i32 [ %call, %land.lhs.true76 ], [ %call, %land.lhs.true69 ], [ %call, %if.else ], [ %spec.select231, %if.then83 ]
%cmp102.not = icmp ne i32 %direction, 1
%21 = load i32, ptr @C, align 4
%cmp104 = icmp sgt i32 %21, %area
%or.cond232 = select i1 %cmp102.not, i1 %cmp104, i1 false
br i1 %or.cond232, label %land.lhs.true105, label %if.end134
land.lhs.true105: ; preds = %if.end101
%arrayidx109 = getelementptr inbounds [15 x [30 x i32]], ptr @E, i64 0, i64 %idxprom1, i64 %idxprom
%22 = load i32, ptr %arrayidx109, align 4, !tbaa !5
%cmp110 = icmp sgt i32 %22, 0
br i1 %cmp110, label %land.lhs.true111, label %if.end134
land.lhs.true111: ; preds = %land.lhs.true105
%arrayidx115 = getelementptr inbounds [15 x [30 x i32]], ptr @F, i64 0, i64 %idxprom1, i64 %idxprom
%23 = load i32, ptr %arrayidx115, align 4, !tbaa !5
%cmp116.not = icmp sgt i32 %23, %rest_fuka
br i1 %cmp116.not, label %if.end134, label %if.then117
if.then117: ; preds = %land.lhs.true111
%add118 = add nsw i32 %area, 1
%sub123 = sub nsw i32 %rest_fuka, %23
%call124 = tail call i32 @tansaku(i32 noundef %day, i32 noundef %add118, i32 noundef 2, i32 noundef %sub123, i32 noundef %rest_multiple)
%24 = load i32, ptr %arrayidx109, align 4, !tbaa !5
%add129 = add nsw i32 %24, %call124
%spec.select233 = tail call i32 @llvm.smax.i32(i32 %add129, i32 %result.3)
br label %if.end134
if.end134: ; preds = %for.inc, %for.inc.us, %for.cond.preheader, %if.then117, %if.end101, %land.lhs.true105, %land.lhs.true111
%result.4 = phi i32 [ %result.3, %land.lhs.true111 ], [ %result.3, %land.lhs.true105 ], [ %result.3, %if.end101 ], [ %spec.select233, %if.then117 ], [ %call, %for.cond.preheader ], [ %result.2.us, %for.inc.us ], [ %result.2, %for.inc ]
%add135 = add nsw i32 %result.4, 1
store i32 %add135, ptr %arrayidx8, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %entry, %if.end134, %if.then10
%retval.0 = phi i32 [ %sub, %if.then10 ], [ %result.4, %if.end134 ], [ 0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call50 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @C, ptr noundef nonnull @D, ptr noundef nonnull @W, ptr noundef nonnull @X)
%0 = load i32, ptr @C, align 4, !tbaa !5
%1 = load i32, ptr @D, align 4, !tbaa !5
%2 = load i32, ptr @W, align 4, !tbaa !5
%3 = load i32, ptr @X, align 4, !tbaa !5
%4 = or i32 %2, %3
%5 = or i32 %4, %0
%or253 = or i32 %5, %1
%cmp54 = icmp eq i32 %or253, 0
br i1 %cmp54, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end29
%6 = phi i32 [ %27, %for.end29 ], [ %1, %entry ]
%7 = phi i32 [ %26, %for.end29 ], [ %0, %entry ]
%cmp344 = icmp sgt i32 %7, 0
%8 = icmp sgt i32 %6, 0
%or.cond = and i1 %cmp344, %8
br i1 %or.cond, label %for.cond4.preheader, label %for.end29
for.cond13.preheader: ; preds = %for.inc10
%cmp1448 = icmp sgt i32 %14, 0
%9 = icmp sgt i32 %15, 0
%or.cond74 = and i1 %cmp1448, %9
br i1 %or.cond74, label %for.cond16.preheader, label %for.end29
for.cond4.preheader: ; preds = %for.cond.preheader, %for.inc10
%10 = phi i32 [ %14, %for.inc10 ], [ %7, %for.cond.preheader ]
%11 = phi i32 [ %15, %for.inc10 ], [ %6, %for.cond.preheader ]
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.inc10 ], [ 0, %for.cond.preheader ]
%cmp542 = icmp sgt i32 %11, 0
br i1 %cmp542, label %for.body6, label %for.inc10
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body6 ], [ 0, %for.cond4.preheader ]
%arrayidx8 = getelementptr inbounds [15 x [30 x i32]], ptr @E, i64 0, i64 %indvars.iv58, i64 %indvars.iv
%call9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr @D, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp5 = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp5, label %for.body6, label %for.inc10.loopexit, !llvm.loop !11
for.inc10.loopexit: ; preds = %for.body6
%.pre = load i32, ptr @C, align 4, !tbaa !5
br label %for.inc10
for.inc10: ; preds = %for.inc10.loopexit, %for.cond4.preheader
%14 = phi i32 [ %.pre, %for.inc10.loopexit ], [ %10, %for.cond4.preheader ]
%15 = phi i32 [ %12, %for.inc10.loopexit ], [ %11, %for.cond4.preheader ]
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%16 = sext i32 %14 to i64
%cmp3 = icmp slt i64 %indvars.iv.next59, %16
br i1 %cmp3, label %for.cond4.preheader, label %for.cond13.preheader, !llvm.loop !12
for.cond16.preheader: ; preds = %for.cond13.preheader, %for.inc27
%17 = phi i32 [ %21, %for.inc27 ], [ %14, %for.cond13.preheader ]
%18 = phi i32 [ %22, %for.inc27 ], [ %15, %for.cond13.preheader ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.inc27 ], [ 0, %for.cond13.preheader ]
%cmp1746 = icmp sgt i32 %18, 0
br i1 %cmp1746, label %for.body18, label %for.inc27
for.body18: ; preds = %for.cond16.preheader, %for.body18
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body18 ], [ 0, %for.cond16.preheader ]
%arrayidx22 = getelementptr inbounds [15 x [30 x i32]], ptr @F, i64 0, i64 %indvars.iv64, i64 %indvars.iv61
%call23 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx22)
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%19 = load i32, ptr @D, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp17 = icmp slt i64 %indvars.iv.next62, %20
br i1 %cmp17, label %for.body18, label %for.inc27.loopexit, !llvm.loop !14
for.inc27.loopexit: ; preds = %for.body18
%.pre67 = load i32, ptr @C, align 4, !tbaa !5
br label %for.inc27
for.inc27: ; preds = %for.inc27.loopexit, %for.cond16.preheader
%21 = phi i32 [ %.pre67, %for.inc27.loopexit ], [ %17, %for.cond16.preheader ]
%22 = phi i32 [ %19, %for.inc27.loopexit ], [ %18, %for.cond16.preheader ]
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%23 = sext i32 %21 to i64
%cmp14 = icmp slt i64 %indvars.iv.next65, %23
br i1 %cmp14, label %for.cond16.preheader, label %for.end29, !llvm.loop !15
for.end29: ; preds = %for.inc27, %for.cond.preheader, %for.cond13.preheader
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1762560) @memo, i8 0, i64 1762560, i1 false)
%24 = load i32, ptr @W, align 4, !tbaa !5
%25 = load i32, ptr @X, align 4, !tbaa !5
%call30 = tail call i32 @tansaku(i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %24, i32 noundef %25)
%call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call30)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @C, ptr noundef nonnull @D, ptr noundef nonnull @W, ptr noundef nonnull @X)
%26 = load i32, ptr @C, align 4, !tbaa !5
%27 = load i32, ptr @D, align 4, !tbaa !5
%28 = load i32, ptr @W, align 4, !tbaa !5
%29 = load i32, ptr @X, align 4, !tbaa !5
%30 = or i32 %28, %29
%31 = or i32 %30, %26
%or2 = or i32 %31, %27
%cmp = icmp eq i32 %or2, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end29, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !13}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
typedef struct{
ll aa;
ll bb;
}frequent;
// (mod MOD1)
ll mod(ll n){return n%=MOD1;}
int main(void){
// char ;
ll n,k,ans=0;
scanf("%lld%lld",&n,&k);
ll a[n];
rep(i,0,n){
scanf("%lld",&a[i]);
}
ll inv1=0,inv2=0;
rep(i,0,n){
rep(j,0,n){
if(a[i]>a[j]){
if(j>i) inv1++;
else inv2++;
}
}
}
ans= (inv1+inv2) * mod( k*(k-1)/2 ) + inv1*k;
ans%=MOD1;
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266526/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266526/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %c.04.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %c.04, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #6 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #12
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #6 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod(i64 noundef %n) local_unnamed_addr #8 {
entry:
%rem = srem i64 %n, 1000000007
ret i64 %rem
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #12
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp42 = icmp sgt i64 %2, 0
br i1 %cmp42, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp450 = icmp sgt i64 %8, 0
br i1 %cmp450, label %for.cond7.preheader.us.preheader, label %for.cond.cleanup5
for.cond7.preheader.us.preheader: ; preds = %for.cond3.preheader
%xtraiter = and i64 %8, 1
%3 = icmp eq i64 %8, 1
%unroll_iter = and i64 %8, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond7.preheader.us
for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.cond.cleanup9_crit_edge.us
%i2.053.us = phi i64 [ %inc23.us, %for.cond7.for.cond.cleanup9_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ]
%inv2.052.us = phi i64 [ %inv2.2.us.lcssa, %for.cond7.for.cond.cleanup9_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ]
%inv1.051.us = phi i64 [ %inv1.2.us.lcssa, %for.cond7.for.cond.cleanup9_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ]
%arrayidx11.us = getelementptr inbounds i64, ptr %vla, i64 %i2.053.us
%4 = load i64, ptr %arrayidx11.us, align 8, !tbaa !5
br i1 %3, label %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa, label %for.body10.us
for.body10.us: ; preds = %for.cond7.preheader.us, %for.inc19.us.1
%j.047.us = phi i64 [ %inc20.us.1, %for.inc19.us.1 ], [ 0, %for.cond7.preheader.us ]
%inv2.146.us = phi i64 [ %inv2.2.us.1, %for.inc19.us.1 ], [ %inv2.052.us, %for.cond7.preheader.us ]
%inv1.145.us = phi i64 [ %inv1.2.us.1, %for.inc19.us.1 ], [ %inv1.051.us, %for.cond7.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc19.us.1 ], [ 0, %for.cond7.preheader.us ]
%arrayidx12.us = getelementptr inbounds i64, ptr %vla, i64 %j.047.us
%5 = load i64, ptr %arrayidx12.us, align 16, !tbaa !5
%cmp13.us = icmp sgt i64 %4, %5
br i1 %cmp13.us, label %if.then.us, label %for.inc19.us
if.then.us: ; preds = %for.body10.us
%cmp14.us = icmp ugt i64 %j.047.us, %i2.053.us
br i1 %cmp14.us, label %if.then15.us, label %if.else.us
if.else.us: ; preds = %if.then.us
%inc17.us = add nsw i64 %inv2.146.us, 1
br label %for.inc19.us
if.then15.us: ; preds = %if.then.us
%inc16.us = add nsw i64 %inv1.145.us, 1
br label %for.inc19.us
for.inc19.us: ; preds = %if.then15.us, %if.else.us, %for.body10.us
%inv1.2.us = phi i64 [ %inc16.us, %if.then15.us ], [ %inv1.145.us, %if.else.us ], [ %inv1.145.us, %for.body10.us ]
%inv2.2.us = phi i64 [ %inv2.146.us, %if.then15.us ], [ %inc17.us, %if.else.us ], [ %inv2.146.us, %for.body10.us ]
%inc20.us = or i64 %j.047.us, 1
%arrayidx12.us.1 = getelementptr inbounds i64, ptr %vla, i64 %inc20.us
%6 = load i64, ptr %arrayidx12.us.1, align 8, !tbaa !5
%cmp13.us.1 = icmp sgt i64 %4, %6
br i1 %cmp13.us.1, label %if.then.us.1, label %for.inc19.us.1
if.then.us.1: ; preds = %for.inc19.us
%cmp14.us.1 = icmp ugt i64 %inc20.us, %i2.053.us
br i1 %cmp14.us.1, label %if.then15.us.1, label %if.else.us.1
if.else.us.1: ; preds = %if.then.us.1
%inc17.us.1 = add nsw i64 %inv2.2.us, 1
br label %for.inc19.us.1
if.then15.us.1: ; preds = %if.then.us.1
%inc16.us.1 = add nsw i64 %inv1.2.us, 1
br label %for.inc19.us.1
for.inc19.us.1: ; preds = %if.then15.us.1, %if.else.us.1, %for.inc19.us
%inv1.2.us.1 = phi i64 [ %inc16.us.1, %if.then15.us.1 ], [ %inv1.2.us, %if.else.us.1 ], [ %inv1.2.us, %for.inc19.us ]
%inv2.2.us.1 = phi i64 [ %inv2.2.us, %if.then15.us.1 ], [ %inc17.us.1, %if.else.us.1 ], [ %inv2.2.us, %for.inc19.us ]
%inc20.us.1 = add nuw nsw i64 %j.047.us, 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.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa, label %for.body10.us, !llvm.loop !19
for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa: ; preds = %for.inc19.us.1, %for.cond7.preheader.us
%inv1.2.us.lcssa.ph = phi i64 [ undef, %for.cond7.preheader.us ], [ %inv1.2.us.1, %for.inc19.us.1 ]
%inv2.2.us.lcssa.ph = phi i64 [ undef, %for.cond7.preheader.us ], [ %inv2.2.us.1, %for.inc19.us.1 ]
%j.047.us.unr = phi i64 [ 0, %for.cond7.preheader.us ], [ %inc20.us.1, %for.inc19.us.1 ]
%inv2.146.us.unr = phi i64 [ %inv2.052.us, %for.cond7.preheader.us ], [ %inv2.2.us.1, %for.inc19.us.1 ]
%inv1.145.us.unr = phi i64 [ %inv1.051.us, %for.cond7.preheader.us ], [ %inv1.2.us.1, %for.inc19.us.1 ]
br i1 %lcmp.mod.not, label %for.cond7.for.cond.cleanup9_crit_edge.us, label %for.body10.us.epil
for.body10.us.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa
%arrayidx12.us.epil = getelementptr inbounds i64, ptr %vla, i64 %j.047.us.unr
%7 = load i64, ptr %arrayidx12.us.epil, align 8, !tbaa !5
%cmp13.us.epil = icmp sgt i64 %4, %7
br i1 %cmp13.us.epil, label %if.then.us.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us
if.then.us.epil: ; preds = %for.body10.us.epil
%cmp14.us.epil = icmp ugt i64 %j.047.us.unr, %i2.053.us
br i1 %cmp14.us.epil, label %if.then15.us.epil, label %if.else.us.epil
if.else.us.epil: ; preds = %if.then.us.epil
%inc17.us.epil = add nsw i64 %inv2.146.us.unr, 1
br label %for.cond7.for.cond.cleanup9_crit_edge.us
if.then15.us.epil: ; preds = %if.then.us.epil
%inc16.us.epil = add nsw i64 %inv1.145.us.unr, 1
br label %for.cond7.for.cond.cleanup9_crit_edge.us
for.cond7.for.cond.cleanup9_crit_edge.us: ; preds = %for.body10.us.epil, %if.else.us.epil, %if.then15.us.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa
%inv1.2.us.lcssa = phi i64 [ %inv1.2.us.lcssa.ph, %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa ], [ %inc16.us.epil, %if.then15.us.epil ], [ %inv1.145.us.unr, %if.else.us.epil ], [ %inv1.145.us.unr, %for.body10.us.epil ]
%inv2.2.us.lcssa = phi i64 [ %inv2.2.us.lcssa.ph, %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa ], [ %inv2.146.us.unr, %if.then15.us.epil ], [ %inc17.us.epil, %if.else.us.epil ], [ %inv2.146.us.unr, %for.body10.us.epil ]
%inc23.us = add nuw nsw i64 %i2.053.us, 1
%exitcond58.not = icmp eq i64 %inc23.us, %8
br i1 %exitcond58.not, label %for.cond.cleanup5, label %for.cond7.preheader.us, !llvm.loop !20
for.body: ; preds = %entry, %for.body
%i.043 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.043
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.043, 1
%8 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %8
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !21
for.cond.cleanup5: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us, %entry, %for.cond3.preheader
%inv1.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %inv1.2.us.lcssa, %for.cond7.for.cond.cleanup9_crit_edge.us ]
%inv2.0.lcssa = phi i64 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %inv2.2.us.lcssa, %for.cond7.for.cond.cleanup9_crit_edge.us ]
%add = add nsw i64 %inv2.0.lcssa, %inv1.0.lcssa
%9 = load i64, ptr %k, align 8, !tbaa !5
%sub = add nsw i64 %9, -1
%mul = mul nsw i64 %sub, %9
%div = sdiv i64 %mul, 2
%rem.i = srem i64 %div, 1000000007
%mul26 = mul nsw i64 %rem.i, %add
%mul27 = mul nsw i64 %9, %inv1.0.lcssa
%add28 = add nsw i64 %mul26, %mul27
%rem = srem i64 %add28, 1000000007
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %rem)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #12
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #12
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #10
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #11
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
|
#include <stdio.h>
int main(void){
int a,b;
char op;
while(1){
scanf("%d %c %d",&a,&op,&b);
if( op =='?')
break;
else if( op == '+')
printf("%d\n",a+b);
else if( op == '-')
printf("%d\n",a-b);
else if( op == '*')
printf("%d\n",a*b);
else if( op == '/')
printf("%d\n",a/b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266584/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266584/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then11
i8 42, label %if.then17
i8 47, label %if.then23
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end28.sink.split
if.then11: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end28.sink.split
if.then17: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end28.sink.split
if.then23: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end28.sink.split
if.end28.sink.split: ; preds = %if.then11, %if.then23, %if.then17, %if.then5
%add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then17 ], [ %div, %if.then23 ], [ %sub, %if.then11 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main (void)
{
int a,b,i;
char op;
for(i=1;i>0;i++){
scanf("%d %c %d",&a,&op,&b);
if (op=='+'){
printf("%d\n",a+b);
}else if (op=='-'){
printf("%d\n",a-b);
} else if (op=='*'){
printf("%d\n",a*b);
}else if (op=='/'){
printf("%d\n",a/b);
}else if (op=='?'){
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266641/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266641/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %for.cond.backedge [
i8 43, label %if.then
i8 45, label %if.then7
i8 42, label %if.then13
i8 47, label %if.then19
i8 63, label %for.end
]
if.then: ; preds = %for.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %for.inc.sink.split
if.then7: ; preds = %for.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %for.inc.sink.split
if.then13: ; preds = %for.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %for.inc.sink.split
if.then19: ; preds = %for.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then7, %if.then19, %if.then13, %if.then
%add.sink = phi i32 [ %add, %if.then ], [ %mul, %if.then13 ], [ %div, %if.then19 ], [ %sub, %if.then7 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.inc.sink.split, %for.cond
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void) {
int a, b, i;
char op;
for (i = 0;;i++) {
scanf("%d %c %d", &a, &op, &b);
if (op == '?') break;
switch(op) {
case '+':printf("%d\n", a+b); break;
case '-':printf("%d\n", a-b); break;
case '*':printf("%d\n", a*b); break;
case '/':printf("%d\n", a/b); break;
default: break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266742/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266742/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp11 = icmp eq i8 %0, 63
br i1 %cmp11, label %for.end, label %if.end
if.end: ; preds = %entry, %for.inc
%1 = phi i8 [ %10, %for.inc ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb6
i32 47, label %sw.bb8
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %for.inc.sink.split
sw.bb4: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %for.inc.sink.split
sw.bb6: ; preds = %if.end
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %for.inc.sink.split
sw.bb8: ; preds = %if.end
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %sw.bb8, %sw.bb6, %sw.bb4, %sw.bb
%add.sink = phi i32 [ %add, %sw.bb ], [ %sub, %sw.bb4 ], [ %mul, %sw.bb6 ], [ %div, %sw.bb8 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 63
br i1 %cmp, label %for.end, label %if.end
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
#include<string.h>
int main()
{
int a;
int b;
char op;
while(1)
{
scanf("%d %c %d",&a,&op,&b);
if(op=='?')
{
break;
}
else if(op=='+')
{
printf("%d\n",a+b);
}
else if(op=='-')
{
printf("%d\n",a-b);
}
else if(op=='*')
{
printf("%d\n",a*b);
}
else if(op=='/')
{
printf("%d\n",a/b);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266829/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266829/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then11
i8 42, label %if.then17
i8 47, label %if.then23
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end28.sink.split
if.then11: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end28.sink.split
if.then17: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end28.sink.split
if.then23: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end28.sink.split
if.end28.sink.split: ; preds = %if.then11, %if.then23, %if.then17, %if.then5
%add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then17 ], [ %div, %if.then23 ], [ %sub, %if.then11 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(void)
{ int a,b,i;
char op;
for(i=1;i>0;i++){
scanf("%d %c %d",&a,&op,&b);
if(op=='+')
{printf("%d\n",a+b);
}
else if(op=='-')
{printf("%d\n",a-b);
}
else if(op=='*')
{printf("%d\n",a*b);
}
else if(op=='/'){
printf("%d\n",a/b);
}else if(op=='?') {
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266872/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266872/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %for.cond.backedge [
i8 43, label %if.then
i8 45, label %if.then7
i8 42, label %if.then13
i8 47, label %if.then19
i8 63, label %for.end
]
if.then: ; preds = %for.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %for.inc.sink.split
if.then7: ; preds = %for.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %for.inc.sink.split
if.then13: ; preds = %for.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %for.inc.sink.split
if.then19: ; preds = %for.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then7, %if.then19, %if.then13, %if.then
%add.sink = phi i32 [ %add, %if.then ], [ %mul, %if.then13 ], [ %div, %if.then19 ], [ %sub, %if.then7 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.inc.sink.split, %for.cond
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
char m;
int a,b,c[256],i,j;
for(i=0;i>-1;i++){
scanf("%d %c %d",&a,&m,&b);
if(m=='?'){
break;
}
if(m=='+'){
c[i]=a+b;
}
if(m=='-'){
c[i]=a-b;
}
if(m=='*'){
c[i]=a*b;
}
if(m=='/'){
c[i]=a/b;
}
}
for(j=0;j<i;j++){
printf("%d\n",c[j]);
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266915/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266915/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i8, align 1
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca [256 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %m) #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 1024, ptr nonnull %c) #3
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv56 = phi i32 [ %indvars.iv.next57, %for.inc ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %m, ptr noundef nonnull %b)
%0 = load i8, ptr %m, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 63, label %for.cond29.preheader
i8 43, label %if.end7.thread
i8 45, label %if.then11
i8 42, label %if.then18
i8 47, label %if.then25
]
for.cond29.preheader: ; preds = %for.cond
%1 = and i64 %indvars.iv, 4294967295
%cmp3050.not = icmp eq i64 %1, 0
br i1 %cmp3050.not, label %for.end38, label %for.body32.preheader
for.body32.preheader: ; preds = %for.cond29.preheader
%wide.trip.count = zext i32 %indvars.iv56 to i64
br label %for.body32
if.end7.thread: ; preds = %for.cond
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %for.inc.sink.split
if.then11: ; preds = %for.cond
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %for.inc.sink.split
if.then18: ; preds = %for.cond
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %for.inc.sink.split
if.then25: ; preds = %for.cond
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then25, %if.then18, %if.end7.thread, %if.then11
%sub.sink = phi i32 [ %sub, %if.then11 ], [ %add, %if.end7.thread ], [ %mul, %if.then18 ], [ %div, %if.then25 ]
%arrayidx13 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv
store i32 %sub.sink, ptr %arrayidx13, align 4, !tbaa !8
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.cond
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next57 = add nuw i32 %indvars.iv56, 1
br label %for.cond, !llvm.loop !10
for.body32: ; preds = %for.body32.preheader, %for.body32
%indvars.iv53 = phi i64 [ 0, %for.body32.preheader ], [ %indvars.iv.next54, %for.body32 ]
%arrayidx34 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv53
%10 = load i32, ptr %arrayidx34, align 4, !tbaa !8
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%exitcond.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count
br i1 %exitcond.not, label %for.end38, label %for.body32, !llvm.loop !12
for.end38: ; preds = %for.body32, %for.cond29.preheader
call void @llvm.lifetime.end.p0(i64 1024, 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 1, 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void)
{
int a, b,ans;
char op;
scanf("%d %c %d", &a, &op, &b);
while (!(op == '?'))
{
if (op == '+')
ans = a + b;
else if (op == '-')
ans = a - b;
else if (op == '*')
ans = a*b;
else if (op == '/')
ans = a / b;
else
break;
printf("%d\n", ans);
scanf("%d %c %d", &a, &op, &b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_266959/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_266959/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end22, %entry
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.end [
i8 47, label %if.then18
i8 43, label %if.then
i8 45, label %if.then8
i8 42, label %if.then13
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end22
if.then8: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end22
if.then13: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end22
if.then18: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end22
if.end22: ; preds = %if.then8, %if.then18, %if.then13, %if.then
%ans.0 = phi i32 [ %add, %if.then ], [ %sub, %if.then8 ], [ %mul, %if.then13 ], [ %div, %if.then18 ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
br label %while.cond, !llvm.loop !10
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (void)
{
int a, b;
char op;
while (1){
scanf("%d %c %d", &a, &op, &b);
if (op == '?')break;
else if (op == '+'){
printf("%d\n", a + b);
}
else if (op == '-'){
printf("%d\n", a - b);
}
else if (op == '*'){
printf("%d\n", a * b);
}
else {
printf("%d\n", a / b);
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267008/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267008/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end23, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %if.else19 [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then11
i8 42, label %if.then17
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end23
if.then11: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end23
if.then17: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end23
if.else19: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end23
if.end23: ; preds = %if.then5, %if.then17, %if.else19, %if.then11
%add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then17 ], [ %div, %if.else19 ], [ %sub, %if.then11 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(){
int a, b;
char op;
while(scanf("%d%s%d", &a, &op, &b)){
switch(op){
case '?':
return 0;
break;
case '+':
printf("%d\n", a + b);
break;
case '-':
printf("%d\n", a - b);
break;
case '*':
printf("%d\n", a * b);
break;
case '/':
printf("%d\n", a / b);
break;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267051/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267051/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%s%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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%tobool.not12 = icmp eq i32 %call11, 0
br i1 %tobool.not12, label %cleanup, label %while.body
while.body: ; preds = %entry, %sw.epilog
%0 = load i8, ptr %op, align 1, !tbaa !5
%conv = sext i8 %0 to i32
switch i32 %conv, label %sw.epilog [
i32 63, label %cleanup
i32 43, label %sw.bb1
i32 45, label %sw.bb3
i32 42, label %sw.bb5
i32 47, label %sw.bb7
]
sw.bb1: ; preds = %while.body
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %sw.epilog.sink.split
sw.bb3: ; preds = %while.body
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %sw.epilog.sink.split
sw.bb5: ; preds = %while.body
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %sw.epilog.sink.split
sw.bb7: ; preds = %while.body
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb1, %sw.bb3, %sw.bb5, %sw.bb7
%div.sink = phi i32 [ %div, %sw.bb7 ], [ %mul, %sw.bb5 ], [ %sub, %sw.bb3 ], [ %add, %sw.bb1 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %cleanup, label %while.body, !llvm.loop !10
cleanup: ; preds = %while.body, %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int a,b;
char op;
while(1){
scanf("%d %c %d",&a,&op,&b);
if(op=='?')break;
switch(op)
{
case '+': printf("%d\n",a+b);break;
case '-': printf("%d\n",a-b);break;
case '*': printf("%d\n",a*b);break;
case '/': printf("%d\n",a/b);break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267095/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267095/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp11 = icmp eq i8 %0, 63
br i1 %cmp11, label %while.end, label %if.end
if.end: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb6
i32 47, label %sw.bb8
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %sw.epilog.sink.split
sw.bb4: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %sw.epilog.sink.split
sw.bb6: ; preds = %if.end
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %sw.epilog.sink.split
sw.bb8: ; preds = %if.end
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb4, %sw.bb6, %sw.bb8
%div.sink = phi i32 [ %div, %sw.bb8 ], [ %mul, %sw.bb6 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 63
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(void)
{
int a;
int b;
char op;
while (1){
scanf("%d %c %d", &a, &op, &b);
if(op == '?'){
break;
}
else if(op == '+'){
printf("%d\n",a + b);
}
else if(op == '-'){
printf("%d\n",a - b);
}
else if(op == '/'){
printf("%d\n", a / b);
}
else if(op == '*'){
printf("%d\n", a * b);
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267145/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267145/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then11
i8 47, label %if.then17
i8 42, label %if.then23
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end28.sink.split
if.then11: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end28.sink.split
if.then17: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %5, %6
br label %if.end28.sink.split
if.then23: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %8, %7
br label %if.end28.sink.split
if.end28.sink.split: ; preds = %if.then11, %if.then23, %if.then17, %if.then5
%add.sink = phi i32 [ %add, %if.then5 ], [ %div, %if.then17 ], [ %mul, %if.then23 ], [ %sub, %if.then11 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(int argc, const char * argv[])
{
int firnum,secnum,ans;
char calc;
while(1){
scanf("%d %c %d",&firnum,&calc,&secnum);
if(calc == '+'){
printf("%d\n",firnum + secnum);
}else if(calc == '-'){
printf("%d\n",firnum - secnum);
}else if(calc == '*'){
printf("%d\n",firnum * secnum);
}else if(calc == '/'){
printf("%d\n",firnum / secnum);
}else if(calc == '?'){
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267189/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267189/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%firnum = alloca i32, align 4
%secnum = alloca i32, align 4
%calc = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %firnum) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %secnum) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %calc) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %firnum, ptr noundef nonnull %calc, ptr noundef nonnull %secnum)
%0 = load i8, ptr %calc, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 43, label %if.then
i8 45, label %if.then6
i8 42, label %if.then12
i8 47, label %if.then18
i8 63, label %while.end
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %firnum, align 4, !tbaa !8
%2 = load i32, ptr %secnum, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end28.sink.split
if.then6: ; preds = %while.cond
%3 = load i32, ptr %firnum, align 4, !tbaa !8
%4 = load i32, ptr %secnum, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end28.sink.split
if.then12: ; preds = %while.cond
%5 = load i32, ptr %firnum, align 4, !tbaa !8
%6 = load i32, ptr %secnum, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end28.sink.split
if.then18: ; preds = %while.cond
%7 = load i32, ptr %firnum, align 4, !tbaa !8
%8 = load i32, ptr %secnum, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end28.sink.split
if.end28.sink.split: ; preds = %if.then, %if.then12, %if.then18, %if.then6
%sub.sink = phi i32 [ %sub, %if.then6 ], [ %div, %if.then18 ], [ %mul, %if.then12 ], [ %add, %if.then ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end28.sink.split, %while.cond
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %calc) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %secnum) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %firnum) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main(void)
{
int a,b;
char op;
scanf("%d %c %d",&a,&op,&b);
(((0<=a)&&(a<=20000))&&((0<=b)&&(b<=20000)));
while(!(op=='?'))
{
if(op=='+')
{
printf("%d\n",a+b);
}
else
{
if(op=='-')
{
printf("%d\n",a-b);
}
else
{
if(op=='*')
{
printf("%d\n",a*b);
}
else
{
if((op=='/')&&(b==0))
{
return 0;
}
else
{
printf("%d\n",a/b);
}
}
}
}
scanf("%d %c %d",&a,&op,&b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267231/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267231/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end35, %entry
%call36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %if.else23 [
i8 63, label %cleanup
i8 43, label %if.then
i8 45, label %if.then15
i8 42, label %if.then21
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end35
if.then15: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end35
if.then21: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end35
if.else23: ; preds = %while.cond
%cmp25 = icmp eq i8 %0, 47
%7 = load i32, ptr %b, align 4
%cmp28 = icmp eq i32 %7, 0
%or.cond39 = select i1 %cmp25, i1 %cmp28, i1 false
br i1 %or.cond39, label %cleanup, label %if.else31
if.else31: ; preds = %if.else23
%8 = load i32, ptr %a, align 4, !tbaa !8
%div = sdiv i32 %8, %7
br label %if.end35
if.end35: ; preds = %if.then15, %if.else31, %if.then21, %if.then
%sub.sink = phi i32 [ %sub, %if.then15 ], [ %div, %if.else31 ], [ %mul, %if.then21 ], [ %add, %if.then ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond, !llvm.loop !10
cleanup: ; preds = %while.cond, %if.else23
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int a,b;
char op;
while(scanf("%d %c %d", &a, &op, &b), op != '?'){
switch(op){
case '+':
printf("%d\n", a + b);
break;
case '-':
printf("%d\n", a - b);
break;
case '*':
printf("%d\n", a * b);
break;
case '/':
printf("%d\n", a / b);
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267275/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267275/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp.not11 = icmp eq i8 %0, 63
br i1 %cmp.not11, label %while.end, label %while.body
while.body: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb6
i32 47, label %sw.bb8
]
sw.bb: ; preds = %while.body
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %sw.epilog.sink.split
sw.bb4: ; preds = %while.body
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %sw.epilog.sink.split
sw.bb6: ; preds = %while.body
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %sw.epilog.sink.split
sw.bb8: ; preds = %while.body
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb4, %sw.bb6, %sw.bb8
%div.sink = phi i32 [ %div, %sw.bb8 ], [ %mul, %sw.bb6 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp.not = icmp eq i8 %10, 63
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !10
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int a,b,r = 0;
char op = 0;
while(1){
scanf("%d %c %d", &a, &op, &b);
if ( op == '?' ) break;
switch (op){
case '+': r = a + b; break;
case '-': r = a - b; break;
case '*': r = a * b; break;
case '/': r = a / b; break;
}
printf("%d\n", r );
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267325/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267325/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
store i8 0, ptr %op, align 1, !tbaa !5
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp8 = icmp eq i8 %0, 63
br i1 %cmp8, label %while.end, label %if.end
if.end: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%r.09 = phi i32 [ %r.1, %sw.epilog ], [ 0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb3
i32 42, label %sw.bb4
i32 47, label %sw.bb5
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %sw.epilog
sw.bb3: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %sw.epilog
sw.bb4: ; preds = %if.end
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %sw.epilog
sw.bb5: ; preds = %if.end
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %sw.epilog
sw.epilog: ; preds = %if.end, %sw.bb5, %sw.bb4, %sw.bb3, %sw.bb
%r.1 = phi i32 [ %r.09, %if.end ], [ %div, %sw.bb5 ], [ %mul, %sw.bb4 ], [ %sub, %sw.bb3 ], [ %add, %sw.bb ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %r.1)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 63
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(void) {
int a, b;
char op;
while(1) {
scanf("%d %c %d", &a, &op, &b);
if (op == '?') break;
switch (op) {
case '+' :
printf("%d\n", a + b); break;
case '-' :
printf("%d\n", a - b); break;
case '*' :
printf("%d\n", a * b); break;
case '/' :
printf("%d\n", a / b); break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267369/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267369/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp11 = icmp eq i8 %0, 63
br i1 %cmp11, label %while.end, label %if.end
if.end: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb6
i32 47, label %sw.bb8
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %sw.epilog.sink.split
sw.bb4: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %sw.epilog.sink.split
sw.bb6: ; preds = %if.end
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %sw.epilog.sink.split
sw.bb8: ; preds = %if.end
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb4, %sw.bb6, %sw.bb8
%div.sink = phi i32 [ %div, %sw.bb8 ], [ %mul, %sw.bb6 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 63
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(void) {
int a,b;
char op;
for(;;){
scanf("%d %c %d",&a,&op,&b);
if(a>=0&&a<=20000&&b>=0&&b<=20000){
if(op=='+') printf("%d\n",a+b);
else if(op=='-') printf("%d\n",a-b);
else if(op=='*') printf("%d\n",a*b);
else if(op=='/'&&b!=0) printf("%d\n",a/b);
else if(op=='?') break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267411/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267411/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%or.cond = icmp ult i32 %0, 20001
%1 = load i32, ptr %b, align 4
%cmp3 = icmp sgt i32 %1, -1
%or.cond40 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %1, 20001
%or.cond41 = select i1 %or.cond40, i1 %cmp5, i1 false
br i1 %or.cond41, label %if.then, label %for.cond.backedge
if.then: ; preds = %for.cond
%2 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %2, label %if.else21 [
i8 43, label %if.then8
i8 45, label %if.then13
i8 42, label %if.then19
]
if.then8: ; preds = %if.then
%add = add nuw nsw i32 %1, %0
br label %if.end39.sink.split
if.then13: ; preds = %if.then
%sub = sub nsw i32 %0, %1
br label %if.end39.sink.split
if.then19: ; preds = %if.then
%mul = mul nuw nsw i32 %1, %0
br label %if.end39.sink.split
if.else21: ; preds = %if.then
%cmp23 = icmp eq i8 %2, 47
%cmp26 = icmp ne i32 %1, 0
%or.cond42 = select i1 %cmp23, i1 %cmp26, i1 false
br i1 %or.cond42, label %if.then28, label %if.else30
if.then28: ; preds = %if.else21
%div.lhs.trunc = trunc i32 %0 to i16
%div.rhs.trunc = trunc i32 %1 to i16
%div44 = udiv i16 %div.lhs.trunc, %div.rhs.trunc
%div.zext = zext i16 %div44 to i32
br label %if.end39.sink.split
if.else30: ; preds = %if.else21
%cmp32 = icmp eq i8 %2, 63
br i1 %cmp32, label %for.end, label %for.cond.backedge
if.end39.sink.split: ; preds = %if.then13, %if.then28, %if.then19, %if.then8
%add.sink = phi i32 [ %add, %if.then8 ], [ %mul, %if.then19 ], [ %div.zext, %if.then28 ], [ %sub, %if.then13 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.cond.backedge
for.cond.backedge: ; preds = %if.end39.sink.split, %if.else30, %for.cond
br label %for.cond
for.end: ; preds = %if.else30
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void) {
int a, b,ans;
char op;
while (1) {
scanf("%d %c %d", &a, &op, &b);
if (op == '?')
break;
switch (op) {
case '+':
ans = a + b;
printf("%d\n", ans);
break;
case '-':
ans = a - b;
printf("%d\n", ans);
break;
case '*':
ans = a * b;
printf("%d\n", ans);
break;
case '/':
ans = a / b;
printf("%d\n", ans);
break;
}
}
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267455/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267455/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp14 = icmp eq i8 %0, 63
br i1 %cmp14, label %while.end, label %if.end
if.end: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb6
i32 47, label %sw.bb8
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %sw.epilog.sink.split
sw.bb4: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %sw.epilog.sink.split
sw.bb6: ; preds = %if.end
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %sw.epilog.sink.split
sw.bb8: ; preds = %if.end
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb4, %sw.bb6, %sw.bb8
%div.sink = phi i32 [ %div, %sw.bb8 ], [ %mul, %sw.bb6 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 63
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(void){
int a, b, op;
for(;;){
scanf("%d %s %d", &a, &op, &b);
if ( op == '+' ){
printf("%d\n",a+b);
} else if ( op == '-' ){
printf("%d\n",a-b);
} else if ( op == '*' ){
printf("%d\n",a*b);
} else if ( op == '/' ){
printf("%d\n",a/b);
} else break ;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267499/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267499/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %s %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
%op = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %if.end16, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i32, ptr %op, align 4, !tbaa !5
switch i32 %0, label %for.end [
i32 43, label %if.then
i32 45, label %if.then3
i32 42, label %if.then7
i32 47, label %if.then11
]
if.then: ; preds = %for.cond
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
br label %if.end16
if.then3: ; preds = %for.cond
%3 = load i32, ptr %a, align 4, !tbaa !5
%4 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %3, %4
br label %if.end16
if.then7: ; preds = %for.cond
%5 = load i32, ptr %a, align 4, !tbaa !5
%6 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %6, %5
br label %if.end16
if.then11: ; preds = %for.cond
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %7, %8
br label %if.end16
if.end16: ; preds = %if.then3, %if.then11, %if.then7, %if.then
%sub.sink = phi i32 [ %sub, %if.then3 ], [ %div, %if.then11 ], [ %mul, %if.then7 ], [ %add, %if.then ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %for.cond
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a,b,i;
char op;
for(i=1;i>0;i++){
scanf("%d %c %d",&a,&op,&b);
if(op=='+') {printf("%d\n",a+b);
}
else if(op=='-')
{
printf("%d\n",a-b);
}
else if(op=='*')
{
printf("%d\n",a*b);
}
else if(op=='/')
{
printf("%d\n",a/b);
}else if(op=='?')
{ break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267541/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267541/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %for.cond.backedge [
i8 43, label %if.then
i8 45, label %if.then7
i8 42, label %if.then13
i8 47, label %if.then19
i8 63, label %for.end
]
if.then: ; preds = %for.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %for.inc.sink.split
if.then7: ; preds = %for.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %for.inc.sink.split
if.then13: ; preds = %for.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %for.inc.sink.split
if.then19: ; preds = %for.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then7, %if.then19, %if.then13, %if.then
%add.sink = phi i32 [ %add, %if.then ], [ %mul, %if.then13 ], [ %div, %if.then19 ], [ %sub, %if.then7 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.inc.sink.split, %for.cond
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main() {
int a, b;
char op;
while (1) {
scanf("%d %c %d", &a, &op, &b);
if (op == '+') {
printf("%d\n", a + b);
}
else if (op == '-') {
printf("%d\n", a - b);
}
else if (op == '*') {
printf("%d\n", a * b);
}
else if (op == '/') {
printf("%d\n", a / b);
}
else {
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267585/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267585/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end23, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.end [
i8 43, label %if.then
i8 45, label %if.then6
i8 42, label %if.then12
i8 47, label %if.then18
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end23
if.then6: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end23
if.then12: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end23
if.then18: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end23
if.end23: ; preds = %if.then6, %if.then18, %if.then12, %if.then
%sub.sink = phi i32 [ %sub, %if.then6 ], [ %div, %if.then18 ], [ %mul, %if.then12 ], [ %add, %if.then ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main(){
int a, b;
char op;
while(scanf("%d %c %d", &a, &op, &b) && op != '?'){
if(op == '+') a += b;
else if(op == '-') a -= b;
else if(op == '*') a *= b;
else if(op == '/') a /= b;
printf("%d\n", a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267628/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267628/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%tobool24 = icmp ne i32 %call23, 0
%0 = load i8, ptr %op, align 1
%cmp25 = icmp ne i8 %0, 63
%1 = select i1 %tobool24, i1 %cmp25, i1 false
br i1 %1, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end21
%2 = phi i8 [ %12, %if.end21 ], [ %0, %entry ]
switch i8 %2, label %while.body.if.end21_crit_edge [
i8 43, label %if.then
i8 45, label %if.then8
i8 42, label %if.then13
i8 47, label %if.then18
]
while.body.if.end21_crit_edge: ; preds = %while.body
%.pre = load i32, ptr %a, align 4, !tbaa !5
br label %if.end21
if.then: ; preds = %while.body
%3 = load i32, ptr %b, align 4, !tbaa !5
%4 = load i32, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %4, %3
store i32 %add, ptr %a, align 4, !tbaa !5
br label %if.end21
if.then8: ; preds = %while.body
%5 = load i32, ptr %b, align 4, !tbaa !5
%6 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %6, %5
store i32 %sub, ptr %a, align 4, !tbaa !5
br label %if.end21
if.then13: ; preds = %while.body
%7 = load i32, ptr %b, align 4, !tbaa !5
%8 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %8, %7
store i32 %mul, ptr %a, align 4, !tbaa !5
br label %if.end21
if.then18: ; preds = %while.body
%9 = load i32, ptr %b, align 4, !tbaa !5
%10 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %10, %9
store i32 %div, ptr %a, align 4, !tbaa !5
br label %if.end21
if.end21: ; preds = %while.body.if.end21_crit_edge, %if.then8, %if.then18, %if.then13, %if.then
%11 = phi i32 [ %.pre, %while.body.if.end21_crit_edge ], [ %sub, %if.then8 ], [ %div, %if.then18 ], [ %mul, %if.then13 ], [ %add, %if.then ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%tobool = icmp ne i32 %call, 0
%12 = load i8, ptr %op, align 1
%cmp = icmp ne i8 %12, 63
%13 = select i1 %tobool, i1 %cmp, i1 false
br i1 %13, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end21, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b;
char op,n;
scanf("%d%c%c%d",&a,&n,&op,&b);
while(op != '?'){
if(op == '+')printf("%d\n",a+b);
else if(op == '-')printf("%d\n",a-b);
else if(op == '*')printf("%d\n",a*b);
else if(op == '/')printf("%d\n",a/b);
scanf("%d%c%c%d",&a,&n,&op,&b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267679/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267679/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%c%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
%op = alloca i8, align 1
%n = alloca i8, align 1
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 1, ptr nonnull %op) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %n) #3
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %n, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %while.cond.backedge [
i8 63, label %while.end
i8 43, label %if.then
i8 45, label %if.then9
i8 42, label %if.then15
i8 47, label %if.then21
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end25.sink.split
if.then9: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end25.sink.split
if.then15: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end25.sink.split
if.then21: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end25.sink.split
if.end25.sink.split: ; preds = %if.then, %if.then15, %if.then21, %if.then9
%sub.sink = phi i32 [ %sub, %if.then9 ], [ %div, %if.then21 ], [ %mul, %if.then15 ], [ %add, %if.then ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub.sink)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end25.sink.split, %while.cond
br label %while.cond, !llvm.loop !10
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
int main(void) {
int a, b;
int ans;
char op;
while(1) {
scanf("%d %c %d", &a, &op, &b);
if(op == '+') ans = a + b;
else if(op == '-') ans = a - b;
else if(op == '*') ans = a * b;
else if(op == '/') ans = a / b;
else if(op == '?') break;
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267721/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267721/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end24, %entry
%ans.0 = phi i32 [ undef, %entry ], [ %ans.1, %if.end24 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %if.end24 [
i8 43, label %if.then
i8 45, label %if.then5
i8 42, label %if.then10
i8 47, label %if.then15
i8 63, label %while.end
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end24
if.then5: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end24
if.then10: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end24
if.then15: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end24
if.end24: ; preds = %while.cond, %if.then5, %if.then15, %if.then10, %if.then
%ans.1 = phi i32 [ %add, %if.then ], [ %sub, %if.then5 ], [ %mul, %if.then10 ], [ %div, %if.then15 ], [ %ans.0, %while.cond ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main(){
int a,b,i,y[1000],j;
char x;
i=0;
while(1){
scanf("%d %c %d", &a, &x, &b);
if(x==63) break;
if(x==43) y[i]=a+b;
if(x==45) y[i]=a-b;
if(x==42) y[i]=a*b;
if(x==47) y[i]=a/b;
i++;
}
for(j=0;j<i;j++){
printf("%d\n",y[j]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267765/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267765/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%y = alloca [1000 x i32], align 16
%x = alloca i8, align 1
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 4000, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #3
br label %while.cond
while.cond: ; preds = %if.end27, %entry
%indvars.iv50 = phi i32 [ %indvars.iv.next51, %if.end27 ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end27 ], [ 0, %entry ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %x, ptr noundef nonnull %b)
%0 = load i8, ptr %x, align 1, !tbaa !5
switch i8 %0, label %if.end27 [
i8 63, label %for.cond.preheader
i8 43, label %if.end6.thread
i8 45, label %if.then10
i8 42, label %if.then17
i8 47, label %if.then24
]
for.cond.preheader: ; preds = %while.cond
%1 = and i64 %indvars.iv, 4294967295
%cmp2844.not = icmp eq i64 %1, 0
br i1 %cmp2844.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %indvars.iv50 to i64
br label %for.body
if.end6.thread: ; preds = %while.cond
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %if.end27.sink.split
if.then10: ; preds = %while.cond
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %if.end27.sink.split
if.then17: ; preds = %while.cond
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %if.end27.sink.split
if.then24: ; preds = %while.cond
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %if.end27.sink.split
if.end27.sink.split: ; preds = %if.then24, %if.then17, %if.end6.thread, %if.then10
%sub.sink = phi i32 [ %sub, %if.then10 ], [ %add, %if.end6.thread ], [ %mul, %if.then17 ], [ %div, %if.then24 ]
%arrayidx12 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv
store i32 %sub.sink, ptr %arrayidx12, align 4, !tbaa !8
br label %if.end27
if.end27: ; preds = %if.end27.sink.split, %while.cond
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next51 = add nuw i32 %indvars.iv50, 1
br label %while.cond
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv47 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next48, %for.body ]
%arrayidx31 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv47
%10 = load i32, ptr %arrayidx31, align 4, !tbaa !8
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10
for.end: ; preds = %for.body, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int a,b;
char op;
while(1)
{
scanf("%d %c %d",&a,&op,&b);
if(op=='?')
{
break;
}
switch(op)
{
case '+':
printf("%d\n",a+b);
break;
case '-':
printf("%d\n",a-b);
break;
case '*':
printf("%d\n",a*b);
break;
case '/':
printf("%d\n",a/b);
break;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267808/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267808/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
%cmp11 = icmp eq i8 %0, 63
br i1 %cmp11, label %while.end, label %if.end
if.end: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb6
i32 47, label %sw.bb8
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %a, align 4, !tbaa !8
%3 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %3, %2
br label %sw.epilog.sink.split
sw.bb4: ; preds = %if.end
%4 = load i32, ptr %a, align 4, !tbaa !8
%5 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %4, %5
br label %sw.epilog.sink.split
sw.bb6: ; preds = %if.end
%6 = load i32, ptr %a, align 4, !tbaa !8
%7 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %7, %6
br label %sw.epilog.sink.split
sw.bb8: ; preds = %if.end
%8 = load i32, ptr %a, align 4, !tbaa !8
%9 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %8, %9
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb4, %sw.bb6, %sw.bb8
%div.sink = phi i32 [ %div, %sw.bb8 ], [ %mul, %sw.bb6 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%10 = load i8, ptr %op, align 1, !tbaa !5
%cmp = icmp eq i8 %10, 63
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main()
{
int a, b;
char op;
do
{
scanf("%d %c %d", &a, &op, &b);
if (op != 63)
{
if ((int)op == 43)
{
printf("%d\n", a + b);
}
else if ((int)op == 45)
{
printf("%d\n", a - b);
}
else if ((int)op == 42)
{
printf("%d\n", a * b);
}
else if ((int)op == 47)
{
printf("%d\n", a / b);
}
}
}
while (op != 63);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267859/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267859/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %do.body
do.body: ; preds = %do.cond, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %do.cond [
i8 47, label %if.then22
i8 43, label %if.then5
i8 45, label %if.then10
i8 42, label %if.then16
]
if.then5: ; preds = %do.body
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %do.condthread-pre-split
if.then10: ; preds = %do.body
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %do.condthread-pre-split
if.then16: ; preds = %do.body
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %do.condthread-pre-split
if.then22: ; preds = %do.body
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %do.condthread-pre-split
do.condthread-pre-split: ; preds = %if.then5, %if.then16, %if.then22, %if.then10
%add.sink = phi i32 [ %add, %if.then5 ], [ %mul, %if.then16 ], [ %div, %if.then22 ], [ %sub, %if.then10 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
%.pr = load i8, ptr %op, align 1, !tbaa !5
br label %do.cond
do.cond: ; preds = %do.condthread-pre-split, %do.body
%9 = phi i8 [ %.pr, %do.condthread-pre-split ], [ %0, %do.body ]
%cmp29.not = icmp eq i8 %9, 63
br i1 %cmp29.not, label %do.end, label %do.body, !llvm.loop !10
do.end: ; preds = %do.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int x,y;
char operator;
while(scanf("%d %c %d", &x, &operator, &y)!=EOF)
{
if(operator=='?')
{
break;
}
switch(operator)
{
case'+':
printf("%d\n", x+y);
break;
case'-':
printf("%d\n", x-y);
break;
case'*':
printf("%d\n", x*y);
break;
case'/':
printf("%d\n", x/y);
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267909/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267909/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %c %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%operator = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %operator) #3
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %operator, ptr noundef nonnull %y)
%cmp12 = icmp eq i32 %call11, -1
%0 = load i8, ptr %operator, align 1
%cmp113 = icmp eq i8 %0, 63
%or.cond14 = select i1 %cmp12, i1 true, i1 %cmp113
br i1 %or.cond14, label %while.end, label %if.end
if.end: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %10, %sw.epilog ], [ %0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb5
i32 42, label %sw.bb7
i32 47, label %sw.bb9
]
sw.bb: ; preds = %if.end
%2 = load i32, ptr %x, align 4, !tbaa !5
%3 = load i32, ptr %y, align 4, !tbaa !5
%add = add nsw i32 %3, %2
br label %sw.epilog.sink.split
sw.bb5: ; preds = %if.end
%4 = load i32, ptr %x, align 4, !tbaa !5
%5 = load i32, ptr %y, align 4, !tbaa !5
%sub = sub nsw i32 %4, %5
br label %sw.epilog.sink.split
sw.bb7: ; preds = %if.end
%6 = load i32, ptr %x, align 4, !tbaa !5
%7 = load i32, ptr %y, align 4, !tbaa !5
%mul = mul nsw i32 %7, %6
br label %sw.epilog.sink.split
sw.bb9: ; preds = %if.end
%8 = load i32, ptr %x, align 4, !tbaa !5
%9 = load i32, ptr %y, align 4, !tbaa !5
%div = sdiv i32 %8, %9
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb5, %sw.bb7, %sw.bb9
%div.sink = phi i32 [ %div, %sw.bb9 ], [ %mul, %sw.bb7 ], [ %sub, %sw.bb5 ], [ %add, %sw.bb ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink)
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %if.end
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %operator, ptr noundef nonnull %y)
%cmp = icmp eq i32 %call, -1
%10 = load i8, ptr %operator, align 1
%cmp1 = icmp eq i8 %10, 63
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end, label %if.end, !llvm.loop !9
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %operator) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int a, b, i;
char op;
for (i = 1; i > 0; i++)
{
scanf("%d %c %d", &a, &op, &b);
if ( op == '+')
{
printf("%d\n", a + b);
}
else if ( op == '-')
{
printf("%d\n", a - b);
}
else if ( op == '*')
{
printf("%d\n", a * b);
}
else if ( op == '/')
{
printf("%d\n", a / b);
}
else if( op == '?')
{
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267952/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267952/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %for.cond
for.cond: ; preds = %for.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %for.cond.backedge [
i8 43, label %if.then
i8 45, label %if.then7
i8 42, label %if.then13
i8 47, label %if.then19
i8 63, label %for.end
]
if.then: ; preds = %for.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %for.inc.sink.split
if.then7: ; preds = %for.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %for.inc.sink.split
if.then13: ; preds = %for.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %for.inc.sink.split
if.then19: ; preds = %for.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then7, %if.then19, %if.then13, %if.then
%add.sink = phi i32 [ %add, %if.then ], [ %mul, %if.then13 ], [ %div, %if.then19 ], [ %sub, %if.then7 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.cond.backedge
for.cond.backedge: ; preds = %for.inc.sink.split, %for.cond
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int a[1000],b[1000];
char op[1000];
int i=0,j;
while(1){
scanf("%d %c%d",&a[i],&op[i],&b[i]);
if(op[i]=='?'){
break;
}
i++;
}
for(j=0;j<i;j++){
if(op[j]=='+'){
printf("%d\n",a[j]+b[j]);
}else if(op[j]=='-'){
printf("%d\n",a[j]-b[j]);
}else if(op[j]=='*'){
printf("%d\n",a[j]*b[j]);
}else if(op[j]=='/'){
printf("%d\n",a[j]/b[j]);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_267996/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_267996/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%d %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 [1000 x i32], align 16
%b = alloca [1000 x i32], align 16
%op = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv85 = phi i32 [ %indvars.iv.next86, %while.cond ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1000 x i8], ptr %op, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%0 = load i8, ptr %arrayidx2, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 63
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next86 = add nuw i32 %indvars.iv85, 1
br i1 %cmp, label %for.cond.preheader, label %while.cond
for.cond.preheader: ; preds = %while.cond
%1 = and i64 %indvars.iv, 4294967295
%cmp879.not = icmp eq i64 %1, 0
br i1 %cmp879.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %indvars.iv85 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv82 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next83, %for.inc ]
%arrayidx11 = getelementptr inbounds [1000 x i8], ptr %op, i64 0, i64 %indvars.iv82
%2 = load i8, ptr %arrayidx11, align 1, !tbaa !5
switch i8 %2, label %for.inc [
i8 43, label %if.then15
i8 45, label %if.then26
i8 42, label %if.then38
i8 47, label %if.then50
]
if.then15: ; preds = %for.body
%arrayidx17 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv82
%3 = load i32, ptr %arrayidx17, align 4, !tbaa !8
%arrayidx19 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv82
%4 = load i32, ptr %arrayidx19, align 4, !tbaa !8
%add = add nsw i32 %4, %3
br label %for.inc.sink.split
if.then26: ; preds = %for.body
%arrayidx28 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv82
%5 = load i32, ptr %arrayidx28, align 4, !tbaa !8
%arrayidx30 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv82
%6 = load i32, ptr %arrayidx30, align 4, !tbaa !8
%sub = sub nsw i32 %5, %6
br label %for.inc.sink.split
if.then38: ; preds = %for.body
%arrayidx40 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv82
%7 = load i32, ptr %arrayidx40, align 4, !tbaa !8
%arrayidx42 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv82
%8 = load i32, ptr %arrayidx42, align 4, !tbaa !8
%mul = mul nsw i32 %8, %7
br label %for.inc.sink.split
if.then50: ; preds = %for.body
%arrayidx52 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv82
%9 = load i32, ptr %arrayidx52, align 4, !tbaa !8
%arrayidx54 = getelementptr inbounds [1000 x i32], ptr %b, i64 0, i64 %indvars.iv82
%10 = load i32, ptr %arrayidx54, align 4, !tbaa !8
%div = sdiv i32 %9, %10
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then26, %if.then50, %if.then38, %if.then15
%add.sink = phi i32 [ %add, %if.then15 ], [ %mul, %if.then38 ], [ %div, %if.then50 ], [ %sub, %if.then26 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%exitcond.not = icmp eq i64 %indvars.iv.next83, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !10
for.end: ; preds = %for.inc, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int a, b;
char op;
while (scanf("%d %c %d", &a, &op, &b) == 3 && op != '?') {
switch (op) {
case '+': a += b; break;
case '-': a -= b; break;
case '*': a *= b; break;
case '/': a /= b; break;
default: continue;
}
printf("%d\n", a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%cmp9 = icmp eq i32 %call8, 3
%0 = load i8, ptr %op, align 1
%cmp110 = icmp ne i8 %0, 63
%1 = select i1 %cmp9, i1 %cmp110, i1 false
br i1 %1, label %while.body, label %while.end
while.body: ; preds = %entry, %while.cond.backedge
%2 = phi i8 [ %12, %while.cond.backedge ], [ %0, %entry ]
%conv = sext i8 %2 to i32
switch i32 %conv, label %while.cond.backedge [
i32 43, label %sw.bb
i32 45, label %sw.bb4
i32 42, label %sw.bb5
i32 47, label %sw.bb6
]
sw.bb: ; preds = %while.body
%3 = load i32, ptr %b, align 4, !tbaa !5
%4 = load i32, ptr %a, align 4, !tbaa !5
%add = add nsw i32 %4, %3
store i32 %add, ptr %a, align 4, !tbaa !5
br label %sw.epilog
sw.bb4: ; preds = %while.body
%5 = load i32, ptr %b, align 4, !tbaa !5
%6 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %6, %5
store i32 %sub, ptr %a, align 4, !tbaa !5
br label %sw.epilog
sw.bb5: ; preds = %while.body
%7 = load i32, ptr %b, align 4, !tbaa !5
%8 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %8, %7
store i32 %mul, ptr %a, align 4, !tbaa !5
br label %sw.epilog
sw.bb6: ; preds = %while.body
%9 = load i32, ptr %b, align 4, !tbaa !5
%10 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %10, %9
store i32 %div, ptr %a, align 4, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %sw.bb6, %sw.bb5, %sw.bb4, %sw.bb
%11 = phi i32 [ %div, %sw.bb6 ], [ %mul, %sw.bb5 ], [ %sub, %sw.bb4 ], [ %add, %sw.bb ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11)
br label %while.cond.backedge
while.cond.backedge: ; preds = %sw.epilog, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%cmp = icmp eq i32 %call, 3
%12 = load i8, ptr %op, align 1
%cmp1 = icmp ne i8 %12, 63
%13 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %13, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.cond.backedge, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a, b;
char op;
int ans;
while(1){
scanf("%d %c %d", &a, &op, &b);
if(op == '?'){
break;
}
if(op == '+'){
ans = a + b;
}
else if(op == '-'){
ans = a - b;
}
else if(op == '*'){
ans = a * b;
}
else if(op == '/'){
ans = a / b;
}
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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
%op = alloca i8, align 1
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 1, ptr nonnull %op) #3
br label %while.cond
while.cond: ; preds = %if.end23, %entry
%ans.0 = phi i32 [ undef, %entry ], [ %ans.1, %if.end23 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %op, ptr noundef nonnull %b)
%0 = load i8, ptr %op, align 1, !tbaa !5
switch i8 %0, label %if.end23 [
i8 63, label %while.end
i8 43, label %if.then5
i8 45, label %if.then9
i8 42, label %if.then14
i8 47, label %if.then19
]
if.then5: ; preds = %while.cond
%1 = load i32, ptr %a, align 4, !tbaa !8
%2 = load i32, ptr %b, align 4, !tbaa !8
%add = add nsw i32 %2, %1
br label %if.end23
if.then9: ; preds = %while.cond
%3 = load i32, ptr %a, align 4, !tbaa !8
%4 = load i32, ptr %b, align 4, !tbaa !8
%sub = sub nsw i32 %3, %4
br label %if.end23
if.then14: ; preds = %while.cond
%5 = load i32, ptr %a, align 4, !tbaa !8
%6 = load i32, ptr %b, align 4, !tbaa !8
%mul = mul nsw i32 %6, %5
br label %if.end23
if.then19: ; preds = %while.cond
%7 = load i32, ptr %a, align 4, !tbaa !8
%8 = load i32, ptr %b, align 4, !tbaa !8
%div = sdiv i32 %7, %8
br label %if.end23
if.end23: ; preds = %while.cond, %if.then9, %if.then19, %if.then14, %if.then5
%ans.1 = phi i32 [ %add, %if.then5 ], [ %sub, %if.then9 ], [ %mul, %if.then14 ], [ %div, %if.then19 ], [ %ans.0, %while.cond ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.1)
br label %while.cond
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %op) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
|
#include<stdio.h>
int main(){
int n,a[105],sum,min,max,i,j,k;
int ave;
for(j=0;j<21;j++){
scanf("%d",&n);
if(n==0)
break;
else{
sum = 0;
min = 1000;
max = 0;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
sum += a[i];
}
for(k=0;k<n;k++){
if(min>a[k])min=a[k];
if(max<a[k])max=a[k];
}
ave = (sum - min -max)/(n-2);
printf("%d\n",ave);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268139/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268139/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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 [105 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %a) #4
br label %for.body
for.body: ; preds = %entry, %for.end26
%j.058 = phi i32 [ 0, %entry ], [ %inc32, %for.end26 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
br i1 %cmp1, label %for.end33, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body
%cmp348 = icmp sgt i32 %0, 0
br i1 %cmp348, label %for.body4, label %for.end26
for.cond8.preheader: ; preds = %for.body4
%cmp952 = icmp sgt i32 %11, 0
br i1 %cmp952, label %for.body10.preheader, label %for.end26
for.body10.preheader: ; preds = %for.cond8.preheader
%wide.trip.count = zext i32 %11 to i64
%min.iters.check = icmp ult i32 %11, 8
br i1 %min.iters.check, label %for.body10.preheader76, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi70 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi71 = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %3, %vector.body ]
%vec.phi72 = phi <4 x i32> [ <i32 1000, i32 1000, i32 1000, i32 1000>, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [105 x i32], ptr %a, 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.load73 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi71, <4 x i32> %wide.load)
%4 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi72, <4 x i32> %wide.load73)
%5 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%6 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi70, <4 x i32> %wide.load73)
%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.minmax74 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %3, <4 x i32> %4)
%8 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax74)
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %5, <4 x i32> %6)
%9 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end26.loopexit, label %for.body10.preheader76
for.body10.preheader76: ; preds = %for.body10.preheader, %middle.block
%indvars.iv61.ph = phi i64 [ 0, %for.body10.preheader ], [ %n.vec, %middle.block ]
%max.054.ph = phi i32 [ 0, %for.body10.preheader ], [ %9, %middle.block ]
%min.053.ph = phi i32 [ 1000, %for.body10.preheader ], [ %8, %middle.block ]
br label %for.body10
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ]
%sum.050 = phi i32 [ %add, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %10, %sum.050
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp3, label %for.body4, label %for.cond8.preheader, !llvm.loop !13
for.body10: ; preds = %for.body10.preheader76, %for.body10
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body10 ], [ %indvars.iv61.ph, %for.body10.preheader76 ]
%max.054 = phi i32 [ %max.1, %for.body10 ], [ %max.054.ph, %for.body10.preheader76 ]
%min.053 = phi i32 [ %spec.select, %for.body10 ], [ %min.053.ph, %for.body10.preheader76 ]
%arrayidx12 = getelementptr inbounds [105 x i32], ptr %a, i64 0, i64 %indvars.iv61
%13 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.053, i32 %13)
%max.1 = call i32 @llvm.smax.i32(i32 %max.054, i32 %13)
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count
br i1 %exitcond.not, label %for.end26.loopexit, label %for.body10, !llvm.loop !14
for.end26.loopexit: ; preds = %for.body10, %middle.block
%spec.select.lcssa = phi i32 [ %8, %middle.block ], [ %spec.select, %for.body10 ]
%max.1.lcssa = phi i32 [ %9, %middle.block ], [ %max.1, %for.body10 ]
%14 = add i32 %spec.select.lcssa, %max.1.lcssa
br label %for.end26
for.end26: ; preds = %for.cond2.preheader, %for.end26.loopexit, %for.cond8.preheader
%.lcssa69 = phi i32 [ %11, %for.cond8.preheader ], [ %11, %for.end26.loopexit ], [ %0, %for.cond2.preheader ]
%sum.0.lcssa68 = phi i32 [ %add, %for.cond8.preheader ], [ %add, %for.end26.loopexit ], [ 0, %for.cond2.preheader ]
%15 = phi i32 [ 1000, %for.cond8.preheader ], [ %14, %for.end26.loopexit ], [ 1000, %for.cond2.preheader ]
%sub27 = sub i32 %sum.0.lcssa68, %15
%sub28 = add nsw i32 %.lcssa69, -2
%div = sdiv i32 %sub27, %sub28
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%inc32 = add nuw nsw i32 %j.058, 1
%exitcond64.not = icmp eq i32 %inc32, 21
br i1 %exitcond64.not, label %for.end33, label %for.body, !llvm.loop !15
for.end33: ; preds = %for.body, %for.end26
call void @llvm.lifetime.end.p0(i64 420, 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
; 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 <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void) {
int i, n, max, min, ans ,tmp;
int array[101];
scanf("%d",&n);
while(n) {
scanf("%d",&tmp);
ans = 0;
array[0] = tmp;
max = tmp;
min = tmp;
for(i = 1; i < n; i++ ) {
scanf("%d",&array[i]);
if(min > array[i]) {
min = array[i];
}
if(max < array[i]) {
max = array[i];
}
}
for(i = 0; i < n; i++ ) {
ans += array[i];
}
ans -= (min + max);
printf("%d\n",ans/(n-2));
scanf("%d",&n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268182/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268182/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
%tmp = alloca i32, align 4
%array = 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 4, ptr nonnull %tmp) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %array) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not53 = icmp eq i32 %0, 0
br i1 %tobool.not53, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end23
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp)
%1 = load i32, ptr %tmp, align 4, !tbaa !5
store i32 %1, ptr %array, align 16, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp43 = icmp sgt i32 %2, 1
br i1 %cmp43, label %for.body, label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.body, %while.body
%max.0.lcssa = phi i32 [ %1, %while.body ], [ %max.1, %for.body ]
%min.0.lcssa = phi i32 [ %1, %while.body ], [ %spec.select, %for.body ]
%.lcssa = phi i32 [ %2, %while.body ], [ %10, %for.body ]
%cmp1749 = icmp sgt i32 %.lcssa, 0
br i1 %cmp1749, label %for.body18.preheader, label %for.end23
for.body18.preheader: ; preds = %for.cond16.preheader
%wide.trip.count = zext i32 %.lcssa to i64
%min.iters.check = icmp ult i32 %.lcssa, 8
br i1 %min.iters.check, label %for.body18.preheader63, label %vector.ph
vector.ph: ; preds = %for.body18.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi61 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%3 = getelementptr inbounds [101 x i32], ptr %array, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load62 = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = add <4 x i32> %wide.load, %vec.phi
%6 = add <4 x i32> %wide.load62, %vec.phi61
%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
%bin.rdx = add <4 x i32> %6, %5
%8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end23, label %for.body18.preheader63
for.body18.preheader63: ; preds = %for.body18.preheader, %middle.block
%indvars.iv56.ph = phi i64 [ 0, %for.body18.preheader ], [ %n.vec, %middle.block ]
%ans.051.ph = phi i32 [ 0, %for.body18.preheader ], [ %8, %middle.block ]
br label %for.body18
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.body ]
%min.046 = phi i32 [ %spec.select, %for.body ], [ %1, %while.body ]
%max.045 = phi i32 [ %max.1, %for.body ], [ %1, %while.body ]
%arrayidx2 = getelementptr inbounds [101 x i32], ptr %array, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2)
%9 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %min.046, i32 %9)
%max.1 = call i32 @llvm.smax.i32(i32 %max.045, i32 %9)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.cond16.preheader, !llvm.loop !13
for.body18: ; preds = %for.body18.preheader63, %for.body18
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body18 ], [ %indvars.iv56.ph, %for.body18.preheader63 ]
%ans.051 = phi i32 [ %add, %for.body18 ], [ %ans.051.ph, %for.body18.preheader63 ]
%arrayidx20 = getelementptr inbounds [101 x i32], ptr %array, i64 0, i64 %indvars.iv56
%12 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add = add nsw i32 %12, %ans.051
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%exitcond.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count
br i1 %exitcond.not, label %for.end23, label %for.body18, !llvm.loop !14
for.end23: ; preds = %for.body18, %middle.block, %for.cond16.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ %8, %middle.block ], [ %add, %for.body18 ]
%13 = add i32 %min.0.lcssa, %max.0.lcssa
%sub = sub i32 %ans.0.lcssa, %13
%sub25 = add nsw i32 %.lcssa, -2
%div = sdiv i32 %sub, %sub25
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%14 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %14, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %for.end23, %entry
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %array) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main(){
int n, i, min, max, sum, ans, p;
while(1){
scanf("%d", &n);
if(n==0){
break;
}
sum=0;
for(i=0; i<n; i++){
scanf("%d", &p);
sum+=p;
if(i==0){
min=max=p;
}else{
if(min>p){
min=p;
}
if(max<p){
max=p;
}
}
}
ans=(sum-max-min)/(n-2);
printf("%d\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64: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
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp eq i32 %0, 0
br i1 %cmp32, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%1 = phi i32 [ %7, %for.end ], [ %0, %entry ]
%max.034 = phi i32 [ %max.1.lcssa, %for.end ], [ undef, %entry ]
%min.033 = phi i32 [ %min.1.lcssa, %for.end ], [ undef, %entry ]
%cmp123 = icmp sgt i32 %1, 0
br i1 %cmp123, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%call2.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%2 = load i32, ptr %p, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp1.peel = icmp sgt i32 %3, 1
br i1 %cmp1.peel, label %for.body, label %for.end
for.body: ; preds = %for.body.preheader, %for.body
%i.027 = phi i32 [ %inc, %for.body ], [ 1, %for.body.preheader ]
%sum.026 = phi i32 [ %add, %for.body ], [ %2, %for.body.preheader ]
%max.125 = phi i32 [ %spec.select22, %for.body ], [ %2, %for.body.preheader ]
%min.124 = phi i32 [ %spec.select, %for.body ], [ %2, %for.body.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%4 = load i32, ptr %p, align 4, !tbaa !5
%add = add nsw i32 %4, %sum.026
%spec.select = call i32 @llvm.smin.i32(i32 %min.124, i32 %4)
%spec.select22 = call i32 @llvm.smax.i32(i32 %max.125, i32 %4)
%inc = add nuw nsw i32 %i.027, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc, %5
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.body.preheader, %for.cond.preheader
%min.1.lcssa = phi i32 [ %min.033, %for.cond.preheader ], [ %2, %for.body.preheader ], [ %spec.select, %for.body ]
%max.1.lcssa = phi i32 [ %max.034, %for.cond.preheader ], [ %2, %for.body.preheader ], [ %spec.select22, %for.body ]
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %2, %for.body.preheader ], [ %add, %for.body ]
%.lcssa = phi i32 [ %1, %for.cond.preheader ], [ %3, %for.body.preheader ], [ %5, %for.body ]
%6 = add i32 %max.1.lcssa, %min.1.lcssa
%sub12 = sub i32 %sum.0.lcssa, %6
%sub13 = add nsw i32 %.lcssa, -2
%div = sdiv i32 %sub12, %sub13
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
int main()
{
int n, s[100], i, max, min, total, average;
while(1){
scanf("%d", &n);
if ( n == 0 ) break;
for(i=0;i<n;i++){
scanf("%d", &s[i]);
}
max = min = s[0];
for(i=1;i<n;i++){
if(max < s[i])
max = s[i];
if(min > s[i])
min = s[i];
}
total = 0;
for(i=0;i<n;i++){
total += s[i];
}
total = total - max - min;
average = total / (n-2);
printf("%d\n", average);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %s) #4
%call64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp eq i32 %0, 0
br i1 %cmp65, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end31
%1 = phi i32 [ %25, %for.end31 ], [ %0, %entry ]
%cmp152 = icmp sgt i32 %1, 0
br i1 %cmp152, label %for.body, label %for.cond24.preheader.thread
for.cond24.preheader.thread: ; preds = %for.cond.preheader
%2 = load i32, ptr %s, align 16, !tbaa !5
br label %for.end31
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%5 = load i32, ptr %s, align 16, !tbaa !5
%cmp554 = icmp sgt i32 %3, 1
br i1 %cmp554, label %for.body6.preheader, label %for.cond24.preheader
for.body6.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%6 = add nsw i64 %wide.trip.count, -1
%min.iters.check90 = icmp ult i32 %3, 9
br i1 %min.iters.check90, label %for.body6.preheader111, label %vector.ph91
vector.ph91: ; preds = %for.body6.preheader
%n.vec93 = and i64 %6, -8
%ind.end = or i64 %n.vec93, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %5, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%minmax.ident.splatinsert102 = insertelement <4 x i32> poison, i32 %5, i64 0
%minmax.ident.splat103 = shufflevector <4 x i32> %minmax.ident.splatinsert102, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body96
vector.body96: ; preds = %vector.body96, %vector.ph91
%index97 = phi i64 [ 0, %vector.ph91 ], [ %index.next106, %vector.body96 ]
%vec.phi98 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph91 ], [ %11, %vector.body96 ]
%vec.phi99 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph91 ], [ %12, %vector.body96 ]
%vec.phi100 = phi <4 x i32> [ %minmax.ident.splat103, %vector.ph91 ], [ %9, %vector.body96 ]
%vec.phi101 = phi <4 x i32> [ %minmax.ident.splat103, %vector.ph91 ], [ %10, %vector.body96 ]
%offset.idx = or i64 %index97, 1
%7 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %offset.idx
%wide.load104 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load105 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi100, <4 x i32> %wide.load104)
%10 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi101, <4 x i32> %wide.load105)
%11 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi98, <4 x i32> %wide.load104)
%12 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi99, <4 x i32> %wide.load105)
%index.next106 = add nuw i64 %index97, 8
%13 = icmp eq i64 %index.next106, %n.vec93
br i1 %13, label %middle.block88, label %vector.body96, !llvm.loop !11
middle.block88: ; preds = %vector.body96
%rdx.minmax108 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %9, <4 x i32> %10)
%14 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax108)
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %11, <4 x i32> %12)
%15 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n95 = icmp eq i64 %6, %n.vec93
br i1 %cmp.n95, label %for.cond24.preheader, label %for.body6.preheader111
for.body6.preheader111: ; preds = %for.body6.preheader, %middle.block88
%indvars.iv68.ph = phi i64 [ 1, %for.body6.preheader ], [ %ind.end, %middle.block88 ]
%min.056.ph = phi i32 [ %5, %for.body6.preheader ], [ %15, %middle.block88 ]
%max.055.ph = phi i32 [ %5, %for.body6.preheader ], [ %14, %middle.block88 ]
br label %for.body6
for.cond24.preheader: ; preds = %for.body6, %middle.block88, %for.end
%max.0.lcssa = phi i32 [ %5, %for.end ], [ %14, %middle.block88 ], [ %spec.select, %for.body6 ]
%min.0.lcssa = phi i32 [ %5, %for.end ], [ %15, %middle.block88 ], [ %min.1, %for.body6 ]
%cmp2560 = icmp sgt i32 %3, 0
br i1 %cmp2560, label %for.body26.preheader, label %for.end31
for.body26.preheader: ; preds = %for.cond24.preheader
%wide.trip.count74 = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body26.preheader110, label %vector.ph
vector.ph: ; preds = %for.body26.preheader
%n.vec = and i64 %wide.trip.count74, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%vec.phi86 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%16 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %16, align 16, !tbaa !5
%17 = getelementptr inbounds i32, ptr %16, i64 4
%wide.load87 = load <4 x i32>, ptr %17, align 16, !tbaa !5
%18 = add <4 x i32> %wide.load, %vec.phi
%19 = add <4 x i32> %wide.load87, %vec.phi86
%index.next = add nuw i64 %index, 8
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count74
br i1 %cmp.n, label %for.end31, label %for.body26.preheader110
for.body26.preheader110: ; preds = %for.body26.preheader, %middle.block
%indvars.iv71.ph = phi i64 [ 0, %for.body26.preheader ], [ %n.vec, %middle.block ]
%total.061.ph = phi i32 [ 0, %for.body26.preheader ], [ %21, %middle.block ]
br label %for.body26
for.body6: ; preds = %for.body6.preheader111, %for.body6
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body6 ], [ %indvars.iv68.ph, %for.body6.preheader111 ]
%min.056 = phi i32 [ %min.1, %for.body6 ], [ %min.056.ph, %for.body6.preheader111 ]
%max.055 = phi i32 [ %spec.select, %for.body6 ], [ %max.055.ph, %for.body6.preheader111 ]
%arrayidx8 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %indvars.iv68
%22 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %max.055, i32 %22)
%min.1 = call i32 @llvm.smin.i32(i32 %min.056, i32 %22)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond.not = icmp eq i64 %indvars.iv.next69, %wide.trip.count
br i1 %exitcond.not, label %for.cond24.preheader, label %for.body6, !llvm.loop !15
for.body26: ; preds = %for.body26.preheader110, %for.body26
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body26 ], [ %indvars.iv71.ph, %for.body26.preheader110 ]
%total.061 = phi i32 [ %add, %for.body26 ], [ %total.061.ph, %for.body26.preheader110 ]
%arrayidx28 = getelementptr inbounds [100 x i32], ptr %s, i64 0, i64 %indvars.iv71
%23 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add = add nsw i32 %23, %total.061
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%exitcond75.not = icmp eq i64 %indvars.iv.next72, %wide.trip.count74
br i1 %exitcond75.not, label %for.end31, label %for.body26, !llvm.loop !16
for.end31: ; preds = %for.body26, %middle.block, %for.cond24.preheader.thread, %for.cond24.preheader
%min.0.lcssa85 = phi i32 [ %min.0.lcssa, %for.cond24.preheader ], [ %2, %for.cond24.preheader.thread ], [ %min.0.lcssa, %middle.block ], [ %min.0.lcssa, %for.body26 ]
%max.0.lcssa84 = phi i32 [ %max.0.lcssa, %for.cond24.preheader ], [ %2, %for.cond24.preheader.thread ], [ %max.0.lcssa, %middle.block ], [ %max.0.lcssa, %for.body26 ]
%.lcssa7883 = phi i32 [ %3, %for.cond24.preheader ], [ %1, %for.cond24.preheader.thread ], [ %3, %middle.block ], [ %3, %for.body26 ]
%total.0.lcssa = phi i32 [ 0, %for.cond24.preheader ], [ 0, %for.cond24.preheader.thread ], [ %21, %middle.block ], [ %add, %for.body26 ]
%24 = add i32 %min.0.lcssa85, %max.0.lcssa84
%sub32 = sub i32 %total.0.lcssa, %24
%sub33 = add nsw i32 %.lcssa7883, -2
%div = sdiv i32 %sub32, %sub33
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%25 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %25, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end31, %entry
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 i32 @llvm.vector.reduce.add.v4i32(<4 x 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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10, !13, !12}
|
#include <stdio.h>
#include <stdlib.h>
typedef struct {
size_t n, c;
int *arr;
} list;
void add(list *l, int x) {
if (l->n+1 > l->c) {
l->c = l->c*2 + !l->c;
l->arr = realloc(l->arr, l->c * sizeof *l->arr);
}
l->arr[l->n++] = x;
}
int seenx[100000], seeny[100000];
list lstx[100000], lsty[100000];
long long int cntx, cnty;
void dfs(int i, long long int* cnt, long long int* cntb, int* seen, int* seenb, list *lst, list *lstb) {
seen[i] = 1;
(*cnt)++;
for (int j = 0; j < lst[i].n; j++) {
int k = lst[i].arr[j];
if (seenb[k]) continue;
dfs(k, cntb, cnt, seenb, seen, lstb, lst);
}
}
int main(void) {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
int x, y;
scanf("%d%d", &x, &y);
add(&lstx[x-1], y-1);
add(&lsty[y-1], x-1);
}
long long int cnt = -n;
for (int i = 0; i < 100000; i++) {
if (seenx[i] || lstx[i].n == 0) continue;
cntx = cnty = 0;
dfs(i, &cntx, &cnty, seenx, seeny, lstx, lsty);
cnt += cntx * cnty;
}
for (int i = 0; i < n; i++) {
free(lstx[i].arr);
free(lsty[i].arr);
}
printf("%lld\n", cnt);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268333/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268333/source.c"
target datalayout = "e-m:e-p270: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.list = type { i64, i64, ptr }
@.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
@lstx = dso_local global [100000 x %struct.list] zeroinitializer, align 16
@lsty = dso_local global [100000 x %struct.list] zeroinitializer, align 16
@seenx = dso_local global [100000 x i32] zeroinitializer, align 16
@cnty = dso_local global i64 0, align 8
@cntx = dso_local global i64 0, align 8
@seeny = dso_local global [100000 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @add(ptr nocapture noundef %l, i32 noundef %x) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %l, align 8, !tbaa !5
%add = add i64 %0, 1
%c = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 1
%1 = load i64, ptr %c, align 8, !tbaa !11
%cmp = icmp ugt i64 %add, %1
br i1 %cmp, label %if.then, label %entry.if.end_crit_edge
entry.if.end_crit_edge: ; preds = %entry
%arr8.phi.trans.insert = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 2
%.pre = load ptr, ptr %arr8.phi.trans.insert, align 8, !tbaa !12
br label %if.end
if.then: ; preds = %entry
%mul = shl i64 %1, 1
%tobool.not = icmp eq i64 %1, 0
%conv = zext i1 %tobool.not to i64
%add3 = or i64 %mul, %conv
store i64 %add3, ptr %c, align 8, !tbaa !11
%arr = getelementptr inbounds %struct.list, ptr %l, i64 0, i32 2
%2 = load ptr, ptr %arr, align 8, !tbaa !12
%mul6 = shl i64 %add3, 2
%call = tail call ptr @realloc(ptr noundef %2, i64 noundef %mul6) #7
store ptr %call, ptr %arr, align 8, !tbaa !12
%.pre19 = load i64, ptr %l, align 8, !tbaa !5
%.pre20 = add i64 %.pre19, 1
br label %if.end
if.end: ; preds = %entry.if.end_crit_edge, %if.then
%inc.pre-phi = phi i64 [ %add, %entry.if.end_crit_edge ], [ %.pre20, %if.then ]
%3 = phi i64 [ %0, %entry.if.end_crit_edge ], [ %.pre19, %if.then ]
%4 = phi ptr [ %.pre, %entry.if.end_crit_edge ], [ %call, %if.then ]
store i64 %inc.pre-phi, ptr %l, align 8, !tbaa !5
%arrayidx = getelementptr inbounds i32, ptr %4, i64 %3
store i32 %x, ptr %arrayidx, align 4, !tbaa !13
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #1
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @dfs(i32 noundef %i, ptr nocapture noundef %cnt, ptr nocapture noundef %cntb, ptr nocapture noundef %seen, ptr nocapture noundef %seenb, ptr nocapture noundef readonly %lst, ptr nocapture noundef readonly %lstb) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds i32, ptr %seen, i64 %idxprom
store i32 1, ptr %arrayidx, align 4, !tbaa !13
%0 = load i64, ptr %cnt, align 8, !tbaa !15
%inc = add nsw i64 %0, 1
store i64 %inc, ptr %cnt, align 8, !tbaa !15
%arrayidx2 = getelementptr inbounds %struct.list, ptr %lst, i64 %idxprom
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%cmp22.not = icmp eq i64 %1, 0
br i1 %cmp22.not, label %for.cond.cleanup, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%arr = getelementptr inbounds %struct.list, ptr %lst, i64 %idxprom, i32 2
br label %for.body
for.cond.cleanup: ; preds = %cleanup, %entry
ret void
for.body: ; preds = %for.body.lr.ph, %cleanup
%2 = phi i64 [ %1, %for.body.lr.ph ], [ %6, %cleanup ]
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %cleanup ]
%3 = load ptr, ptr %arr, align 8, !tbaa !12
%arrayidx7 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
%4 = load i32, ptr %arrayidx7, align 4, !tbaa !13
%idxprom8 = sext i32 %4 to i64
%arrayidx9 = getelementptr inbounds i32, ptr %seenb, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !13
%tobool.not = icmp eq i32 %5, 0
br i1 %tobool.not, label %if.end, label %cleanup
if.end: ; preds = %for.body
tail call void @dfs(i32 noundef %4, ptr noundef %cntb, ptr noundef nonnull %cnt, ptr noundef nonnull %seenb, ptr noundef %seen, ptr noundef %lstb, ptr noundef nonnull %lst)
%.pre = load i64, ptr %arrayidx2, align 8, !tbaa !5
br label %cleanup
cleanup: ; preds = %for.body, %if.end
%6 = phi i64 [ %2, %for.body ], [ %.pre, %if.end ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp = icmp ugt i64 %6, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
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) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !13
%cmp67 = icmp sgt i32 %0, 0
br i1 %cmp67, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %add.exit66, %entry
%1 = phi i32 [ %0, %entry ], [ %16, %add.exit66 ]
%sub7 = sub nsw i32 0, %1
%conv = sext i32 %sub7 to i64
br label %for.body13
for.body: ; preds = %entry, %add.exit66
%i.068 = phi i32 [ %inc, %add.exit66 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #8
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%2 = load i32, ptr %x, align 4, !tbaa !13
%sub = add nsw i32 %2, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [100000 x %struct.list], ptr @lstx, i64 0, i64 %idxprom
%3 = load i32, ptr %y, align 4, !tbaa !13
%sub2 = add nsw i32 %3, -1
%4 = load i64, ptr %arrayidx, align 8, !tbaa !5
%add.i = add i64 %4, 1
%c.i = getelementptr inbounds [100000 x %struct.list], ptr @lstx, i64 0, i64 %idxprom, i32 1
%5 = load i64, ptr %c.i, align 8, !tbaa !11
%cmp.i = icmp ugt i64 %add.i, %5
br i1 %cmp.i, label %if.then.i, label %entry.if.end_crit_edge.i
entry.if.end_crit_edge.i: ; preds = %for.body
%arr8.phi.trans.insert.i = getelementptr inbounds [100000 x %struct.list], ptr @lstx, i64 0, i64 %idxprom, i32 2
%.pre.i = load ptr, ptr %arr8.phi.trans.insert.i, align 8, !tbaa !12
br label %add.exit
if.then.i: ; preds = %for.body
%mul.i = shl i64 %5, 1
%tobool.not.i = icmp eq i64 %5, 0
%conv.i = zext i1 %tobool.not.i to i64
%add3.i = or i64 %mul.i, %conv.i
store i64 %add3.i, ptr %c.i, align 8, !tbaa !11
%arr.i = getelementptr inbounds [100000 x %struct.list], ptr @lstx, i64 0, i64 %idxprom, i32 2
%6 = load ptr, ptr %arr.i, align 8, !tbaa !12
%mul6.i = shl i64 %add3.i, 2
%call.i = call ptr @realloc(ptr noundef %6, i64 noundef %mul6.i) #7
store ptr %call.i, ptr %arr.i, align 8, !tbaa !12
%.pre19.i = load i64, ptr %arrayidx, align 8, !tbaa !5
%.pre20.i = add i64 %.pre19.i, 1
br label %add.exit
add.exit: ; preds = %entry.if.end_crit_edge.i, %if.then.i
%inc.pre-phi.i = phi i64 [ %add.i, %entry.if.end_crit_edge.i ], [ %.pre20.i, %if.then.i ]
%7 = phi i64 [ %4, %entry.if.end_crit_edge.i ], [ %.pre19.i, %if.then.i ]
%8 = phi ptr [ %.pre.i, %entry.if.end_crit_edge.i ], [ %call.i, %if.then.i ]
store i64 %inc.pre-phi.i, ptr %arrayidx, align 8, !tbaa !5
%arrayidx.i = getelementptr inbounds i32, ptr %8, i64 %7
store i32 %sub2, ptr %arrayidx.i, align 4, !tbaa !13
%9 = load i32, ptr %y, align 4, !tbaa !13
%sub3 = add nsw i32 %9, -1
%idxprom4 = sext i32 %sub3 to i64
%arrayidx5 = getelementptr inbounds [100000 x %struct.list], ptr @lsty, i64 0, i64 %idxprom4
%10 = load i32, ptr %x, align 4, !tbaa !13
%sub6 = add nsw i32 %10, -1
%11 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%add.i48 = add i64 %11, 1
%c.i49 = getelementptr inbounds [100000 x %struct.list], ptr @lsty, i64 0, i64 %idxprom4, i32 1
%12 = load i64, ptr %c.i49, align 8, !tbaa !11
%cmp.i50 = icmp ugt i64 %add.i48, %12
br i1 %cmp.i50, label %if.then.i56, label %entry.if.end_crit_edge.i51
entry.if.end_crit_edge.i51: ; preds = %add.exit
%arr8.phi.trans.insert.i52 = getelementptr inbounds [100000 x %struct.list], ptr @lsty, i64 0, i64 %idxprom4, i32 2
%.pre.i53 = load ptr, ptr %arr8.phi.trans.insert.i52, align 8, !tbaa !12
br label %add.exit66
if.then.i56: ; preds = %add.exit
%mul.i57 = shl i64 %12, 1
%tobool.not.i58 = icmp eq i64 %12, 0
%conv.i59 = zext i1 %tobool.not.i58 to i64
%add3.i60 = or i64 %mul.i57, %conv.i59
store i64 %add3.i60, ptr %c.i49, align 8, !tbaa !11
%arr.i61 = getelementptr inbounds [100000 x %struct.list], ptr @lsty, i64 0, i64 %idxprom4, i32 2
%13 = load ptr, ptr %arr.i61, align 8, !tbaa !12
%mul6.i62 = shl i64 %add3.i60, 2
%call.i63 = call ptr @realloc(ptr noundef %13, i64 noundef %mul6.i62) #7
store ptr %call.i63, ptr %arr.i61, align 8, !tbaa !12
%.pre19.i64 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%.pre20.i65 = add i64 %.pre19.i64, 1
br label %add.exit66
add.exit66: ; preds = %entry.if.end_crit_edge.i51, %if.then.i56
%inc.pre-phi.i54 = phi i64 [ %add.i48, %entry.if.end_crit_edge.i51 ], [ %.pre20.i65, %if.then.i56 ]
%14 = phi i64 [ %11, %entry.if.end_crit_edge.i51 ], [ %.pre19.i64, %if.then.i56 ]
%15 = phi ptr [ %.pre.i53, %entry.if.end_crit_edge.i51 ], [ %call.i63, %if.then.i56 ]
store i64 %inc.pre-phi.i54, ptr %arrayidx5, align 8, !tbaa !5
%arrayidx.i55 = getelementptr inbounds i32, ptr %15, i64 %14
store i32 %sub6, ptr %arrayidx.i55, align 4, !tbaa !13
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #8
%inc = add nuw nsw i32 %i.068, 1
%16 = load i32, ptr %n, align 4, !tbaa !13
%cmp = icmp slt i32 %inc, %16
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19
for.cond25.preheader: ; preds = %for.inc21
%cmp2671 = icmp sgt i32 %1, 0
br i1 %cmp2671, label %for.body29, label %for.cond.cleanup28
for.body13: ; preds = %for.cond.cleanup, %for.inc21
%indvars.iv = phi i64 [ 0, %for.cond.cleanup ], [ %indvars.iv.next, %for.inc21 ]
%cnt.069 = phi i64 [ %conv, %for.cond.cleanup ], [ %cnt.1, %for.inc21 ]
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr @seenx, i64 0, i64 %indvars.iv
%17 = load i32, ptr %arrayidx15, align 4, !tbaa !13
%tobool.not = icmp eq i32 %17, 0
br i1 %tobool.not, label %lor.lhs.false, label %for.inc21
lor.lhs.false: ; preds = %for.body13
%arrayidx17 = getelementptr inbounds [100000 x %struct.list], ptr @lstx, i64 0, i64 %indvars.iv
%18 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%cmp19 = icmp eq i64 %18, 0
br i1 %cmp19, label %for.inc21, label %if.end
if.end: ; preds = %lor.lhs.false
store i64 0, ptr @cnty, align 8, !tbaa !15
store i64 0, ptr @cntx, align 8, !tbaa !15
%19 = trunc i64 %indvars.iv to i32
call void @dfs(i32 noundef %19, ptr noundef nonnull @cntx, ptr noundef nonnull @cnty, ptr noundef nonnull @seenx, ptr noundef nonnull @seeny, ptr noundef nonnull @lstx, ptr noundef nonnull @lsty)
%20 = load i64, ptr @cntx, align 8, !tbaa !15
%21 = load i64, ptr @cnty, align 8, !tbaa !15
%mul = mul nsw i64 %21, %20
%add = add nsw i64 %mul, %cnt.069
br label %for.inc21
for.inc21: ; preds = %for.body13, %lor.lhs.false, %if.end
%cnt.1 = phi i64 [ %cnt.069, %for.body13 ], [ %cnt.069, %lor.lhs.false ], [ %add, %if.end ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 100000
br i1 %exitcond.not, label %for.cond25.preheader, label %for.body13, !llvm.loop !20
for.cond.cleanup28: ; preds = %for.body29, %for.cond25.preheader
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %cnt.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
for.body29: ; preds = %for.cond25.preheader, %for.body29
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body29 ], [ 0, %for.cond25.preheader ]
%arr = getelementptr inbounds [100000 x %struct.list], ptr @lstx, i64 0, i64 %indvars.iv75, i32 2
%22 = load ptr, ptr %arr, align 8, !tbaa !12
call void @free(ptr noundef %22) #8
%arr34 = getelementptr inbounds [100000 x %struct.list], ptr @lsty, i64 0, i64 %indvars.iv75, i32 2
%23 = load ptr, ptr %arr34, align 8, !tbaa !12
call void @free(ptr noundef %23) #8
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%24 = load i32, ptr %n, align 4, !tbaa !13
%25 = sext i32 %24 to i64
%cmp26 = icmp slt i64 %indvars.iv.next76, %25
br i1 %cmp26, label %for.body29, label %for.cond.cleanup28, !llvm.loop !21
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
attributes #0 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind allocsize(1) }
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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !10, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long long", !8, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
|
#include<stdio.h>
#include<string.h>
int main()
{
int i,n,m,t,p,k;
char a[100];
char b[100];
scanf("%s",&a);
n=0; m=0;
for(i=0;i<strlen(a);i++)
{
if(a[i]=='C')
n++;
if(a[i]=='F')
m++;
}
t=0;p=0;
for(i=0;i<strlen(a);i++)
{
if(a[i]=='C')
{
t=i;
for(k=i+1;k<strlen(a);k++)
if(a[k]=='F')
p=k;
}
if(t<p)
break;
}
if(t<p)
printf("Yes\n");
else
printf("No\n");} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268391/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268391/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%cmp1980.not = icmp eq i64 %call1, 0
br i1 %cmp1980.not, label %if.else, label %for.body21
for.cond15: ; preds = %if.end45
%indvars.iv.next94 = add nuw i64 %indvars.iv93, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next94, %call1
br i1 %exitcond.not, label %for.end52, label %for.body21, !llvm.loop !5
for.body21: ; preds = %entry, %for.cond15
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.cond15 ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond15 ], [ 1, %entry ]
%p.082 = phi i32 [ %p.3, %for.cond15 ], [ 0, %entry ]
%t.081 = phi i32 [ %t.1, %for.cond15 ], [ 0, %entry ]
%arrayidx23 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %indvars.iv93
%0 = load i8, ptr %arrayidx23, align 1, !tbaa !7
%cmp25 = icmp eq i8 %0, 67
br i1 %cmp25, label %for.cond28.preheader, label %if.end45
for.cond28.preheader: ; preds = %for.body21
%1 = add nuw nsw i64 %indvars.iv93, 1
%cmp3276 = icmp ugt i64 %call1, %1
%2 = trunc i64 %indvars.iv93 to i32
br i1 %cmp3276, label %for.body34, label %if.end45
for.body34: ; preds = %for.cond28.preheader, %for.body34
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body34 ], [ %indvars.iv, %for.cond28.preheader ]
%p.177 = phi i32 [ %spec.select73, %for.body34 ], [ %p.082, %for.cond28.preheader ]
%arrayidx36 = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %indvars.iv90
%3 = load i8, ptr %arrayidx36, align 1, !tbaa !7
%cmp38 = icmp eq i8 %3, 70
%4 = trunc i64 %indvars.iv90 to i32
%spec.select73 = select i1 %cmp38, i32 %4, i32 %p.177
%indvars.iv.next91 = add nuw i64 %indvars.iv90, 1
%cmp32 = icmp ugt i64 %call1, %indvars.iv.next91
br i1 %cmp32, label %for.body34, label %if.end45, !llvm.loop !10
if.end45: ; preds = %for.body34, %for.cond28.preheader, %for.body21
%t.1 = phi i32 [ %t.081, %for.body21 ], [ %2, %for.cond28.preheader ], [ %2, %for.body34 ]
%p.3 = phi i32 [ %p.082, %for.body21 ], [ %p.082, %for.cond28.preheader ], [ %spec.select73, %for.body34 ]
%cmp46 = icmp slt i32 %t.1, %p.3
br i1 %cmp46, label %for.end52, label %for.cond15
for.end52: ; preds = %for.cond15, %if.end45
%cmp53 = icmp slt i32 %t.1, %p.3
br i1 %cmp53, label %if.end58, label %if.else
if.else: ; preds = %entry, %for.end52
br label %if.end58
if.end58: ; preds = %for.end52, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end52 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !6}
|
#include<stdio.h>
#include<string.h>
int main()
{
int len,i;
int isClr=0;
char s[101];
char c[1] = "C";
char f[1] = "F";
int cNum=-1,fNum=0;
// 文字列の入力
scanf("%s",s);
len = strlen(s);
for(i=0;i<len; i++) {
if(s[i] == c[0]){
cNum = i;
}
if(cNum<i && cNum>=0){
if(s[i] == f[0]){
isClr=1;
}
}
}
// 出力
if(isClr){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268449/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268449/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call2 to i32
%cmp36 = icmp sgt i32 %conv, 0
br i1 %cmp36, label %for.body.preheader, label %if.else
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call2, 4294967295
%xtraiter = and i64 %call2, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.end.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%cNum.038 = phi i32 [ -1, %for.body.preheader.new ], [ %spec.select.1, %for.body ]
%isClr.037 = phi i32 [ 0, %for.body.preheader.new ], [ %isClr.1.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 2, !tbaa !5
%cmp7 = icmp eq i8 %1, 67
%2 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %cmp7, i32 %2, i32 %cNum.038
%3 = zext i32 %spec.select to i64
%or.cond = icmp ugt i64 %indvars.iv, %3
%cmp19 = icmp eq i8 %1, 70
%4 = select i1 %or.cond, i1 %cmp19, i1 false
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%5 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp7.1 = icmp eq i8 %5, 67
%6 = trunc i64 %indvars.iv.next to i32
%spec.select.1 = select i1 %cmp7.1, i32 %6, i32 %spec.select
%7 = zext i32 %spec.select.1 to i64
%or.cond.1 = icmp ugt i64 %indvars.iv.next, %7
%cmp19.1 = icmp eq i8 %5, 70
%8 = select i1 %or.cond.1, i1 %cmp19.1, i1 false
%9 = select i1 %8, i1 true, i1 %4
%isClr.1.1 = select i1 %9, i32 1, i32 %isClr.037
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.unr-lcssa, label %for.body, !llvm.loop !8
for.end.unr-lcssa: ; preds = %for.body, %for.body.preheader
%isClr.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %isClr.1.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%cNum.038.unr = phi i32 [ -1, %for.body.preheader ], [ %spec.select.1, %for.body ]
%isClr.037.unr = phi i32 [ 0, %for.body.preheader ], [ %isClr.1.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.unr-lcssa
%arrayidx.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%10 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%cmp7.epil = icmp eq i8 %10, 67
%11 = trunc i64 %indvars.iv.unr to i32
%spec.select.epil = select i1 %cmp7.epil, i32 %11, i32 %cNum.038.unr
%12 = zext i32 %spec.select.epil to i64
%or.cond.epil = icmp ugt i64 %indvars.iv.unr, %12
%cmp19.epil = icmp eq i8 %10, 70
%13 = select i1 %or.cond.epil, i1 %cmp19.epil, i1 false
%isClr.1.epil = select i1 %13, i32 1, i32 %isClr.037.unr
br label %for.end
for.end: ; preds = %for.end.unr-lcssa, %for.body.epil
%isClr.1.lcssa = phi i32 [ %isClr.1.lcssa.ph, %for.end.unr-lcssa ], [ %isClr.1.epil, %for.body.epil ]
%14 = icmp eq i32 %isClr.1.lcssa, 0
br i1 %14, label %if.else, label %if.end27
if.else: ; preds = %entry, %for.end
br label %if.end27
if.end27: ; preds = %for.end, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.end ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 101, 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: 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.mustprogress"}
|
#include <stdio.h>
int main()
{ int H,N,sum;
scanf("%d%d",&H,&N);
int arr[N];
for(int i=0;i<N;i++)
{
scanf("%d",&arr[i]);
sum+=arr[i];
}
if(sum>=H)
{
printf("Yes");
}
else
{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268492/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268492/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %3, 0
br i1 %cmp11, label %for.body, label %if.end
for.cond.cleanup: ; preds = %for.body
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp4.not = icmp slt i32 %add, %4
%spec.select = select i1 %cmp4.not, ptr @.str.3, ptr @.str.2
br label %if.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.012 = phi i32 [ %add, %for.body ], [ undef, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %5, %sum.012
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.end: ; preds = %for.cond.cleanup, %entry
%.str.3.sink = phi ptr [ @.str.2, %entry ], [ %spec.select, %for.cond.cleanup ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include "stdio.h"
#define N 30020
long a[N];
long n,t;
int check();
int main()
{
long i,j;
while(scanf("%ld%ld", &n, &t)==2){
for(i=1;i<n;i++){
scanf("%ld",&j);
a[i]=i+j;
}
if(check()) printf("YES\n");
else printf("NO\n");
}
return 0;
}
int check()
{
long j;
j=1;
while(a[j]!=n){
if(a[j]==t) return 1;
a[j]=a[a[j]];
}
if(a[j]==n && t==n) return 1;
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26855/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@n = dso_local global i64 0, align 8
@t = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@a = dso_local local_unnamed_addr global [30020 x i64] zeroinitializer, align 16
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%j = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %j) #5
%call14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @t)
%cmp15 = icmp eq i32 %call14, 2
br i1 %cmp15, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %if.end
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp112 = icmp sgt i64 %0, 1
br i1 %cmp112, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.013 = phi i64 [ %inc, %for.body ], [ 1, %for.cond.preheader ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %j)
%1 = load i64, ptr %j, align 8, !tbaa !5
%add = add nsw i64 %1, %i.013
%arrayidx = getelementptr inbounds [30020 x i64], ptr @a, i64 0, i64 %i.013
store i64 %add, ptr %arrayidx, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.013, 1
%2 = load i64, ptr @n, align 8, !tbaa !5
%cmp1 = icmp slt i64 %inc, %2
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.cond.preheader
%.lcssa = phi i64 [ %0, %for.cond.preheader ], [ %2, %for.body ]
%.promoted.i = load i64, ptr getelementptr inbounds ([30020 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
%cmp.not17.i = icmp eq i64 %.promoted.i, %.lcssa
%.pre.i = load i64, ptr @t, align 8, !tbaa !5
br i1 %cmp.not17.i, label %check.exit, label %while.body.i
while.body.i: ; preds = %for.end, %if.end.i
%3 = phi i64 [ %4, %if.end.i ], [ %.promoted.i, %for.end ]
%cmp2.i = icmp eq i64 %3, %.pre.i
br i1 %cmp2.i, label %if.end, label %if.end.i
if.end.i: ; preds = %while.body.i
%arrayidx4.i = getelementptr inbounds [30020 x i64], ptr @a, i64 0, i64 %3
%4 = load i64, ptr %arrayidx4.i, align 8, !tbaa !5
store i64 %4, ptr getelementptr inbounds ([30020 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
%cmp.not.i = icmp eq i64 %4, %.lcssa
br i1 %cmp.not.i, label %check.exit, label %while.body.i, !llvm.loop !11
check.exit: ; preds = %if.end.i, %for.end
%cmp8.i.not = icmp eq i64 %.pre.i, %.lcssa
%spec.select = select i1 %cmp8.i.not, ptr @str.4, ptr @str
br label %if.end
if.end: ; preds = %while.body.i, %check.exit
%str.sink = phi ptr [ %spec.select, %check.exit ], [ @str.4, %while.body.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @t)
%cmp = icmp eq i32 %call, 2
br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !12
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %j) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @check() local_unnamed_addr #3 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !5
%.promoted = load i64, ptr getelementptr inbounds ([30020 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
%cmp.not17 = icmp eq i64 %.promoted, %0
%.pre = load i64, ptr @t, align 8, !tbaa !5
br i1 %cmp.not17, label %land.lhs.true, label %while.body
while.body: ; preds = %entry, %if.end
%1 = phi i64 [ %2, %if.end ], [ %.promoted, %entry ]
%cmp2 = icmp eq i64 %1, %.pre
br i1 %cmp2, label %cleanup, label %if.end
if.end: ; preds = %while.body
%arrayidx4 = getelementptr inbounds [30020 x i64], ptr @a, i64 0, i64 %1
%2 = load i64, ptr %arrayidx4, align 8, !tbaa !5
store i64 %2, ptr getelementptr inbounds ([30020 x i64], ptr @a, i64 0, i64 1), align 8, !tbaa !5
%cmp.not = icmp eq i64 %2, %0
br i1 %cmp.not, label %land.lhs.true, label %while.body, !llvm.loop !11
land.lhs.true: ; preds = %if.end, %entry
%cmp8 = icmp eq i64 %.pre, %0
%. = zext i1 %cmp8 to i32
br label %cleanup
cleanup: ; preds = %while.body, %land.lhs.true
%retval.0 = phi i32 [ %., %land.lhs.true ], [ 1, %while.body ]
ret i32 %retval.0
}
; 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 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void)
{
int H,N,i,T,I;
scanf("%d%d",&H,&N);
T=0;
for(i=0;i<N;i++){
scanf("%d",&I);
T=T+I;}
if(H<=T)printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_268593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_268593/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%N = alloca i32, align 4
%I = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %I) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%T.010 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %I)
%1 = load i32, ptr %I, align 4, !tbaa !5
%add = add nsw i32 %1, %T.010
%inc = add nuw nsw i32 %i.09, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%T.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%3 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %3, %T.0.lcssa
%str.str.4 = select i1 %cmp2.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %I) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.