Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define N 4001
typedef struct {
int num,
sum,
index;
}DATA;
void Initialization(DATA[], int *);
#include<stdio.h>
int main() {
DATA d[N];
int flg, n, e, p, q, index = 1, i;
while (scanf("%d", &n), n != 0) {
Initialization(d, &flg);
for (n; n > 0; --n) {
scanf("%d%d%d", &e, &p, &q);
d[e].num = e;
d[e].sum += p*q;
if (d[e].index == 0)d[e].index = index++;
flg = d[e].sum >= 1000000;
}
if (!flg) puts("NA");
else {
for (n = 1; n < index; n++) {
for (i = 1; i < N; i++) if (d[i].index == n&&d[i].sum >= 1000000) printf("%d\n", d[i].num);
}
}
}
return 0;
}
void Initialization(DATA d[], int *flg) {
int i;
for (i = 1; i < N; i++) d[i].num = d[i].sum = d[i].index = 0;
flg = 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_258909/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_258909/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.DATA = type { i32, i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca [4001 x %struct.DATA], align 16
%n = alloca i32, align 4
%e = alloca i32, align 4
%p = alloca i32, align 4
%q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 48012, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
%call59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not60 = icmp eq i32 %0, 0
br i1 %cmp.not60, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%scevgep.i = getelementptr inbounds i8, ptr %d, i64 12
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end48
%1 = phi i32 [ %0, %while.body.lr.ph ], [ %13, %if.end48 ]
%index.062 = phi i32 [ 1, %while.body.lr.ph ], [ %index.1.lcssa, %if.end48 ]
%flg.061 = phi i32 [ undef, %while.body.lr.ph ], [ %flg.1.lcssa, %if.end48 ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48000) %scevgep.i, i8 0, i64 48000, i1 false), !tbaa !5
%cmp154 = icmp sgt i32 %1, 0
br i1 %cmp154, label %for.body, label %for.end
for.body: ; preds = %while.body, %if.end
%index.155 = phi i32 [ %index.2, %if.end ], [ %index.062, %while.body ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %e, ptr noundef nonnull %p, ptr noundef nonnull %q)
%2 = load i32, ptr %e, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [4001 x %struct.DATA], ptr %d, i64 0, i64 %idxprom
store i32 %2, ptr %arrayidx, align 4, !tbaa !9
%3 = load i32, ptr %p, align 4, !tbaa !5
%4 = load i32, ptr %q, align 4, !tbaa !5
%mul = mul nsw i32 %4, %3
%sum = getelementptr inbounds [4001 x %struct.DATA], ptr %d, i64 0, i64 %idxprom, i32 1
%5 = load i32, ptr %sum, align 4, !tbaa !11
%add = add nsw i32 %5, %mul
store i32 %add, ptr %sum, align 4, !tbaa !11
%index7 = getelementptr inbounds [4001 x %struct.DATA], ptr %d, i64 0, i64 %idxprom, i32 2
%6 = load i32, ptr %index7, align 4, !tbaa !12
%cmp8 = icmp eq i32 %6, 0
br i1 %cmp8, label %if.then, label %if.end
if.then: ; preds = %for.body
%inc = add nsw i32 %index.155, 1
store i32 %index.155, ptr %index7, align 4, !tbaa !12
br label %if.end
if.end: ; preds = %if.then, %for.body
%index.2 = phi i32 [ %inc, %if.then ], [ %index.155, %for.body ]
%7 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %7, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %7, 1
br i1 %cmp1, label %for.body, label %for.cond.for.end_crit_edge, !llvm.loop !13
for.cond.for.end_crit_edge: ; preds = %if.end
%cmp15.le = icmp sgt i32 %add, 999999
%conv.le = zext i1 %cmp15.le to i32
br label %for.end
for.end: ; preds = %for.cond.for.end_crit_edge, %while.body
%flg.1.lcssa = phi i32 [ %conv.le, %for.cond.for.end_crit_edge ], [ %flg.061, %while.body ]
%index.1.lcssa = phi i32 [ %index.2, %for.cond.for.end_crit_edge ], [ %index.062, %while.body ]
%tobool.not = icmp eq i32 %flg.1.lcssa, 0
br i1 %tobool.not, label %if.then16, label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.end
store i32 1, ptr %n, align 4, !tbaa !5
%cmp1958 = icmp sgt i32 %index.1.lcssa, 1
br i1 %cmp1958, label %for.body25, label %if.end48
if.then16: ; preds = %for.end
%call17 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end48
for.body25: ; preds = %for.cond18.preheader, %for.body25.backedge
%indvars.iv = phi i64 [ %indvars.iv.be, %for.body25.backedge ], [ 1, %for.cond18.preheader ]
%arrayidx27 = getelementptr inbounds [4001 x %struct.DATA], ptr %d, i64 0, i64 %indvars.iv
%index28 = getelementptr inbounds [4001 x %struct.DATA], ptr %d, i64 0, i64 %indvars.iv, i32 2
%8 = load i32, ptr %index28, align 4, !tbaa !12
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp29 = icmp eq i32 %8, %9
br i1 %cmp29, label %land.lhs.true, label %for.inc42
land.lhs.true: ; preds = %for.body25
%sum33 = getelementptr inbounds [4001 x %struct.DATA], ptr %d, i64 0, i64 %indvars.iv, i32 1
%10 = load i32, ptr %sum33, align 4, !tbaa !11
%cmp34 = icmp sgt i32 %10, 999999
br i1 %cmp34, label %if.then36, label %for.inc42
if.then36: ; preds = %land.lhs.true
%11 = load i32, ptr %arrayidx27, align 4, !tbaa !9
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %11)
br label %for.inc42
for.inc42: ; preds = %for.body25, %land.lhs.true, %if.then36
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 4001
br i1 %exitcond.not, label %for.inc45, label %for.body25.backedge
for.body25.backedge: ; preds = %for.inc42, %for.inc45
%indvars.iv.be = phi i64 [ %indvars.iv.next, %for.inc42 ], [ 1, %for.inc45 ]
br label %for.body25, !llvm.loop !15
for.inc45: ; preds = %for.inc42
%12 = load i32, ptr %n, align 4, !tbaa !5
%inc46 = add nsw i32 %12, 1
store i32 %inc46, ptr %n, align 4, !tbaa !5
%cmp19 = icmp slt i32 %inc46, %index.1.lcssa
br i1 %cmp19, label %for.body25.backedge, label %if.end48
if.end48: ; preds = %for.inc45, %for.cond18.preheader, %if.then16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %13, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %if.end48, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 48012, ptr nonnull %d) #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 nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @Initialization(ptr nocapture noundef writeonly %d, ptr nocapture noundef readnone %flg) local_unnamed_addr #3 {
entry:
%scevgep = getelementptr i8, ptr %d, i64 12
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(48000) %scevgep, i8 0, i64 48000, i1 false), !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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) #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 nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 4}
!12 = !{!10, !6, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
|
#include<stdio.h>
int main()
{
int n,m,ans=0;
scanf("%d%d",&n,&m);
if(n<m)
printf("-1\n");
else
{
if(n%2==0)
ans=n/2;
else
ans=n/2+1;
while(1)
{
if(ans%m==0)
break;
else
{
ans=ans+1;
}
if(ans>n)
{
ans=-1;
break;
}
}
printf("%d\n",ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25896/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25896/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end16
if.else: ; preds = %entry
%2 = and i32 %0, 1
%div = sdiv i32 %0, 2
%ans.0 = add nsw i32 %div, %2
%smax = call i32 @llvm.smax.i32(i32 %ans.0, i32 %0)
br label %while.cond
while.cond: ; preds = %if.else9, %if.else
%ans.1 = phi i32 [ %ans.0, %if.else ], [ %add10, %if.else9 ]
%rem6 = srem i32 %ans.1, %1
%cmp7 = icmp eq i32 %rem6, 0
br i1 %cmp7, label %while.end, label %if.else9
if.else9: ; preds = %while.cond
%add10 = add i32 %ans.1, 1
%exitcond.not = icmp eq i32 %ans.1, %smax
br i1 %exitcond.not, label %while.end, label %while.cond
while.end: ; preds = %if.else9, %while.cond
%ans.2 = phi i32 [ %ans.1, %while.cond ], [ -1, %if.else9 ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.2)
br label %if.end16
if.end16: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int i,a,b,c,d,e;
while(scanf("%d", &a)!= EOF) {
b=600/a;
int sum=0;
for(i=1;i<b;i++){
e=i*a;
d=e*e;
c=a*d;
sum+=c;
}
printf("%d\n",sum);
if(a == 0) {
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259009/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259009/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
br label %while.cond
while.cond: ; preds = %for.end, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body
while.body: ; preds = %while.cond
%0 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 600, %0
%cmp116 = icmp sgt i32 %div, 1
br i1 %cmp116, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%1 = mul i32 %0, %0
%2 = add nsw i32 %div, -2
%3 = zext i32 %2 to i33
%4 = add nsw i32 %div, -3
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = add nsw i32 %div, -4
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = mul i32 %11, 1431655766
%13 = add i32 %12, -7
%14 = lshr i33 %6, 1
%15 = trunc i33 %14 to i32
%16 = mul i32 %15, 5
%17 = add i32 %13, %16
%18 = shl nuw nsw i32 %div, 2
%19 = add i32 %17, %18
%20 = mul i32 %0, %1
%21 = mul i32 %20, %19
br label %for.end
for.end: ; preds = %for.body.preheader, %while.body
%sum.0.lcssa = phi i32 [ 0, %while.body ], [ %21, %for.body.preheader ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%22 = load i32, ptr %a, align 4, !tbaa !5
%cmp5 = icmp eq i32 %22, 0
br i1 %cmp5, label %while.end, label %while.cond
while.end: ; preds = %for.end, %while.cond
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 x=0,d,i=0;
while(scanf("%d",&d)!=EOF){
for(i=d;i<=600-d;i=i+d){
x=(i*i*d)+x;
}
printf("%d\n",x);
x=0;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259052/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259052/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not13 = icmp eq i32 %call12, -1
br i1 %cmp.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%sub = sub nsw i32 600, %0
%cmp1.not9 = icmp sgt i32 %0, %sub
br i1 %cmp1.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %while.body
%1 = mul i32 %0, %0
%2 = mul i32 %0, %1
%3 = shl i32 %0, 1
%4 = sub i32 601, %0
%smax = call i32 @llvm.smax.i32(i32 %3, i32 %4)
%5 = icmp slt i32 %3, %4
%umin = zext i1 %5 to i32
%not. = xor i1 %5, true
%6 = sext i1 %not. to i32
%7 = or i32 %3, %umin
%8 = sub i32 %smax, %7
%umax = call i32 @llvm.umax.i32(i32 %0, i32 1)
%9 = udiv i32 %8, %umax
%10 = add i32 %9, %6
%11 = select i1 %5, i32 -1, i32 -2
%12 = add i32 %11, %9
%13 = add i32 %9, %umin
%14 = shl i32 %13, 2
%15 = zext i32 %10 to i33
%16 = zext i32 %12 to i33
%17 = mul i33 %15, %16
%18 = zext i32 %13 to i33
%19 = mul i33 %17, %18
%20 = lshr i33 %19, 1
%21 = trunc i33 %20 to i32
%22 = mul i32 %21, 1431655766
%23 = or i32 %22, 1
%24 = mul i33 %15, %18
%25 = lshr i33 %24, 1
%26 = trunc i33 %25 to i32
%27 = mul i32 %26, 5
%28 = add i32 %23, %27
%29 = add i32 %28, %14
%30 = mul i32 %2, %29
br label %for.end
for.end: ; preds = %for.body.preheader, %while.body
%x.1.lcssa = phi i32 [ 0, %while.body ], [ %30, %for.body.preheader ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.1.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, 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: 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.umax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int d;
long area=0;
int i;
while(scanf("%d",&d) != EOF){
area=0;
for(i=d; i<=600-d; i+=d){
area+=i*i*d;
}
printf("%ld\n",area);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259096/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259096/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not13 = icmp eq i32 %call12, -1
br i1 %cmp.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%sub = sub nsw i32 600, %0
%cmp1.not9 = icmp sgt i32 %0, %sub
br i1 %cmp1.not9, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %while.body
%1 = sext i32 %0 to i64
%2 = sext i32 %sub to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%area.010 = phi i64 [ 0, %for.body.preheader ], [ %add, %for.body ]
%3 = trunc i64 %indvars.iv to i32
%mul = mul i32 %0, %3
%mul2 = mul i32 %mul, %3
%conv = sext i32 %mul2 to i64
%add = add nsw i64 %area.010, %conv
%indvars.iv.next = add i64 %indvars.iv, %1
%cmp1.not = icmp sgt i64 %indvars.iv.next, %2
br i1 %cmp1.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %while.body
%area.0.lcssa = phi i64 [ 0, %while.body ], [ %add, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %area.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int i,a,b,c,d,e;
while(scanf("%d", &a)!= EOF) {
b=600/a;
int sum=0;
for(i=1;i<b;i++){
e=i*a;
d=e*e;
c=a*d;
sum+=c;
}
printf("%d\n",sum);
if(a == 0) {
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259139/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259139/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
br label %while.cond
while.cond: ; preds = %for.end, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body
while.body: ; preds = %while.cond
%0 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 600, %0
%cmp116 = icmp sgt i32 %div, 1
br i1 %cmp116, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %while.body
%1 = mul i32 %0, %0
%2 = add nsw i32 %div, -2
%3 = zext i32 %2 to i33
%4 = add nsw i32 %div, -3
%5 = zext i32 %4 to i33
%6 = mul i33 %3, %5
%7 = add nsw i32 %div, -4
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = mul i32 %11, 1431655766
%13 = add i32 %12, -7
%14 = lshr i33 %6, 1
%15 = trunc i33 %14 to i32
%16 = mul i32 %15, 5
%17 = add i32 %13, %16
%18 = shl nuw nsw i32 %div, 2
%19 = add i32 %17, %18
%20 = mul i32 %0, %1
%21 = mul i32 %20, %19
br label %for.end
for.end: ; preds = %for.body.preheader, %while.body
%sum.0.lcssa = phi i32 [ 0, %while.body ], [ %21, %for.body.preheader ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa)
%22 = load i32, ptr %a, align 4, !tbaa !5
%cmp5 = icmp eq i32 %22, 0
br i1 %cmp5, label %while.end, label %while.cond
while.end: ; preds = %for.end, %while.cond
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=0,ans;
while(scanf("%d",&a) !=EOF){
b=a;
ans=0;
while(b<600){
ans+=a*b*b;
b+=a;
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259197/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259197/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not16 = icmp eq i32 %call15, -1
br i1 %cmp.not16, label %while.end7, label %while.body
while.body: ; preds = %entry, %while.end
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp212 = icmp slt i32 %0, 600
br i1 %cmp212, label %while.body3.preheader, label %while.end
while.body3.preheader: ; preds = %while.body
%1 = shl i32 %0, 1
%smax = call i32 @llvm.smax.i32(i32 %1, i32 600)
%2 = icmp slt i32 %1, 600
%umin.neg = sext i1 %2 to i32
%3 = select i1 %2, i32 2, i32 1
%4 = add i32 %smax, %umin.neg
%5 = sub i32 %4, %1
%6 = udiv i32 %5, %0
%7 = add i32 %3, %6
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %while.body3.preheader23, label %vector.ph
vector.ph: ; preds = %while.body3.preheader
%n.vec = and i32 %7, -8
%8 = or i32 %n.vec, 1
%ind.end = mul i32 %0, %8
%.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%.splatinsert18 = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat19 = shufflevector <4 x i32> %.splatinsert18, <4 x i32> poison, <4 x i32> zeroinitializer
%9 = mul <4 x i32> %.splat19, <i32 0, i32 1, i32 2, i32 3>
%induction = add <4 x i32> %.splat, %9
%10 = shl i32 %0, 2
%.splatinsert20 = insertelement <4 x i32> poison, i32 %10, i64 0
%.splat21 = shufflevector <4 x i32> %.splatinsert20, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi17 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, %.splat21
%11 = mul nsw <4 x i32> %vec.ind, %broadcast.splat
%12 = mul nsw <4 x i32> %step.add, %broadcast.splat
%13 = mul nsw <4 x i32> %11, %vec.ind
%14 = mul nsw <4 x i32> %12, %step.add
%15 = add <4 x i32> %13, %vec.phi
%16 = add <4 x i32> %14, %vec.phi17
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %step.add, %.splat21
%17 = icmp eq i32 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %16, %15
%18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %7, %n.vec
br i1 %cmp.n, label %while.end, label %while.body3.preheader23
while.body3.preheader23: ; preds = %while.body3.preheader, %middle.block
%ans.014.ph = phi i32 [ 0, %while.body3.preheader ], [ %18, %middle.block ]
%b.013.ph = phi i32 [ %0, %while.body3.preheader ], [ %ind.end, %middle.block ]
br label %while.body3
while.body3: ; preds = %while.body3.preheader23, %while.body3
%ans.014 = phi i32 [ %add, %while.body3 ], [ %ans.014.ph, %while.body3.preheader23 ]
%b.013 = phi i32 [ %add5, %while.body3 ], [ %b.013.ph, %while.body3.preheader23 ]
%mul = mul nsw i32 %b.013, %0
%mul4 = mul nsw i32 %mul, %b.013
%add = add nsw i32 %mul4, %ans.014
%add5 = add nsw i32 %b.013, %0
%cmp2 = icmp slt i32 %add5, 600
br i1 %cmp2, label %while.body3, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body3, %middle.block, %while.body
%ans.0.lcssa = phi i32 [ 0, %while.body ], [ %18, %middle.block ], [ %add, %while.body3 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end7, label %while.body, !llvm.loop !14
while.end7: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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, !12, !11}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(void)
{
int d;
int i;
int S;
while (scanf("%d", &d) != EOF){
S = 0;
for (i = 0; i < 600; i += d){
S += (d * i * i);
}
printf("%d\n", S);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259254/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259254/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not12 = icmp eq i32 %call11, -1
br i1 %cmp.not12, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%smax = call i32 @llvm.smax.i32(i32 %0, i32 600)
%1 = add nsw i32 %smax, -1
%2 = udiv i32 %1, %0
%3 = add nuw nsw i32 %2, 1
%min.iters.check = icmp ult i32 %2, 7
br i1 %min.iters.check, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %for.cond.preheader
%n.vec = and i32 %3, -8
%ind.end = mul i32 %n.vec, %0
%.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = mul <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
%5 = shl i32 %0, 2
%.splatinsert14 = insertelement <4 x i32> poison, i32 %5, i64 0
%.splat15 = shufflevector <4 x i32> %.splatinsert14, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi13 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.ind = phi <4 x i32> [ %4, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, %.splat15
%6 = mul <4 x i32> %vec.ind, %vec.ind
%7 = mul <4 x i32> %step.add, %step.add
%8 = mul <4 x i32> %6, %broadcast.splat
%9 = mul <4 x i32> %7, %broadcast.splat
%10 = add <4 x i32> %8, %vec.phi
%11 = add <4 x i32> %9, %vec.phi13
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %step.add, %.splat15
%12 = icmp eq i32 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %11, %10
%13 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %3, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.cond.preheader, %middle.block
%S.010.ph = phi i32 [ 0, %for.cond.preheader ], [ %13, %middle.block ]
%i.09.ph = phi i32 [ 0, %for.cond.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%S.010 = phi i32 [ %add, %for.body ], [ %S.010.ph, %for.body.preheader ]
%i.09 = phi i32 [ %add3, %for.body ], [ %i.09.ph, %for.body.preheader ]
%mul = mul i32 %i.09, %i.09
%mul2 = mul i32 %mul, %0
%add = add nsw i32 %mul2, %S.010
%add3 = add nsw i32 %0, %i.09
%cmp1 = icmp slt i32 %add3, 600
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block
%add.lcssa = phi i32 [ %13, %middle.block ], [ %add, %for.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !14
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, 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: 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.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#define sqr(x) ((x) * (x))
int main()
{
int d;
while(scanf("%d",&d)!=EOF){
unsigned long s=0;
if(600%d!=0) break;
int i;
for(i=d; i<600; i+=d){
s += sqr(i)*d;
}
printf("%lu\n",s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259304/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259304/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lu\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not17 = icmp eq i32 %call16, -1
br i1 %cmp.not17, label %while.end, label %while.body
while.body: ; preds = %entry, %cleanup
%0 = load i32, ptr %d, align 4, !tbaa !5
%rem = srem i32 600, %0
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %while.body
%cmp213 = icmp slt i32 %0, 600
br i1 %cmp213, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %for.cond.preheader
%1 = sext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%s.014 = phi i64 [ 0, %for.body.preheader ], [ %add, %for.body ]
%2 = trunc i64 %indvars.iv to i32
%mul = mul i32 %0, %2
%mul3 = mul i32 %mul, %2
%conv = sext i32 %mul3 to i64
%add = add i64 %s.014, %conv
%indvars.iv.next = add i64 %indvars.iv, %1
%cmp2 = icmp slt i64 %indvars.iv.next, 600
br i1 %cmp2, label %for.body, label %cleanup, !llvm.loop !9
cleanup: ; preds = %for.body, %for.cond.preheader
%s.0.lcssa = phi i64 [ 0, %for.cond.preheader ], [ %add, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %s.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body
while.end: ; preds = %cleanup, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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 d;
while(scanf("%d",&d) != EOF)
{
int value=0,s=0;
while(value != 600-d)
{
value += d;
int line = value*value;
s += line*d;
}
printf("%d\n",s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not16 = icmp eq i32 %call15, -1
br i1 %cmp.not16, label %while.end7, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %while.end
%0 = load i32, ptr %d, align 4, !tbaa !5
%sub = sub nsw i32 600, %0
%cmp2.not12 = icmp eq i32 %0, 600
br i1 %cmp2.not12, label %while.end, label %while.body3
while.body3: ; preds = %while.cond1.preheader, %while.body3
%value.014 = phi i32 [ %add, %while.body3 ], [ 0, %while.cond1.preheader ]
%s.013 = phi i32 [ %add5, %while.body3 ], [ 0, %while.cond1.preheader ]
%add = add nsw i32 %0, %value.014
%mul = mul i32 %add, %0
%mul4 = mul i32 %mul, %add
%add5 = add nsw i32 %mul4, %s.013
%cmp2.not = icmp eq i32 %add, %sub
br i1 %cmp2.not, label %while.end, label %while.body3, !llvm.loop !9
while.end: ; preds = %while.body3, %while.cond1.preheader
%s.0.lcssa = phi i32 [ 0, %while.cond1.preheader ], [ %add5, %while.body3 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %s.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end7, label %while.cond1.preheader, !llvm.loop !11
while.end7: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
typedef int64_t ll;
typedef uint64_t ull;
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)
#define MAXN (1000006)
#define MOD (1000000007)
// べき乗余
int64_t modpow(int64_t b, int64_t e)
{
int64_t result = 1;
while(e>0)
{
if(e&1) result = (result * b) % MOD;
e >>= 1;
b = (b * b) % MOD;
}
return result;
}
// 組み合わせ数
// nCk % MOD
ll cf[MAXN+1]; // 1*2*3*...*i
ll ci[MAXN+1]; // 1/ 1*2*3*...*i
void CombInit(ll n)
{
cf[0] = 1;
for(int i=1;i<=n;i++) cf[i] = cf[i-1] * i %MOD;
ci[n] = modpow(cf[n],MOD-2);
for(int i=n-1;i>=0;i--) ci[i] = ci[i+1] * (i+1) %MOD;
}
ll Comb(ll a,ll b)
{
return cf[a]*ci[b]%MOD*ci[a-b]%MOD;
}
// カタラン数 2nまで参照することに注意
ll Catalan(ll n)
{
return cf[2*n]*ci[n+1]%MOD*ci[n]%MOD;
}
int main(void)
{
ll x,y;
scanf("%ld %ld",&x,&y);
CombInit(MAXN);
if((x+y)%3!=0)
{
printf("0\n");
return 0;
}
ll c2 = x - ((x+y)/3);
ll c1 = ((x+y)/3) - c2;
if(c2<0||c1<0)
{
printf("0\n");
return 0;
}
printf("%ld\n",cf[c1+c2]*ci[c1]%MOD*ci[c2]%MOD);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259399/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259399/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cf = dso_local local_unnamed_addr global [1000007 x i64] zeroinitializer, align 16
@ci = dso_local local_unnamed_addr global [1000007 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @modpow(i64 noundef %b, i64 noundef %e) local_unnamed_addr #1 {
entry:
%cmp8 = icmp sgt i64 %e, 0
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end
%result.011 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%e.addr.010 = phi i64 [ %shr, %if.end ], [ %e, %entry ]
%b.addr.09 = phi i64 [ %rem2, %if.end ], [ %b, %entry ]
%and = and i64 %e.addr.010, 1
%tobool.not = icmp eq i64 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i64 %result.011, %b.addr.09
%rem = srem i64 %mul, 1000000007
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.011, %while.body ]
%shr = lshr i64 %e.addr.010, 1
%mul1 = mul nsw i64 %b.addr.09, %b.addr.09
%rem2 = urem i64 %mul1, 1000000007
%cmp.not = icmp ult i64 %e.addr.010, 2
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @CombInit(i64 noundef %n) local_unnamed_addr #3 {
entry:
store i64 1, ptr @cf, align 16, !tbaa !11
%cmp.not36 = icmp slt i64 %n, 1
br i1 %cmp.not36, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %n, 1
%0 = icmp eq i64 %n, 1
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %n, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.1, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%mul.epil = mul nsw i64 %.unr, %indvars.iv.unr
%rem.epil = srem i64 %mul.epil, 1000000007
%arrayidx4.epil = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %indvars.iv.unr
store i64 %rem.epil, ptr %arrayidx4.epil, align 8, !tbaa !11
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry
%arrayidx5 = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %n
%1 = load i64, ptr %arrayidx5, align 8, !tbaa !11
br label %while.body.i
while.body.i: ; preds = %if.end.i, %for.cond.cleanup
%result.011.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %for.cond.cleanup ]
%e.addr.010.i = phi i64 [ %shr.i, %if.end.i ], [ 1000000005, %for.cond.cleanup ]
%b.addr.09.i = phi i64 [ %rem2.i, %if.end.i ], [ %1, %for.cond.cleanup ]
%and.i = and i64 %e.addr.010.i, 1
%tobool.not.i = icmp eq i64 %and.i, 0
br i1 %tobool.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul nsw i64 %b.addr.09.i, %result.011.i
%rem.i = srem i64 %mul.i, 1000000007
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.011.i, %while.body.i ]
%shr.i = lshr i64 %e.addr.010.i, 1
%mul1.i = mul nsw i64 %b.addr.09.i, %b.addr.09.i
%rem2.i = urem i64 %mul1.i, 1000000007
%cmp.not.i = icmp ult i64 %e.addr.010.i, 2
br i1 %cmp.not.i, label %modpow.exit, label %while.body.i, !llvm.loop !9
modpow.exit: ; preds = %if.end.i
%arrayidx6 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %n
store i64 %result.1.i, ptr %arrayidx6, align 8, !tbaa !11
%2 = trunc i64 %n to i32
%i7.039 = add i32 %2, -1
%cmp1140 = icmp sgt i32 %i7.039, -1
br i1 %cmp1140, label %for.body14.preheader, label %for.cond.cleanup13
for.body14.preheader: ; preds = %modpow.exit
%3 = zext i32 %i7.039 to i64
%4 = and i64 %3, 1
%lcmp.mod49.not.not = icmp eq i64 %4, 0
br i1 %lcmp.mod49.not.not, label %for.body14.prol, label %for.body14.prol.loopexit
for.body14.prol: ; preds = %for.body14.preheader
%sext.prol = shl i64 %n, 32
%idxprom15.prol = ashr exact i64 %sext.prol, 32
%arrayidx16.prol = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %idxprom15.prol
%5 = load i64, ptr %arrayidx16.prol, align 8, !tbaa !11
%mul19.prol = mul nsw i64 %5, %idxprom15.prol
%rem20.prol = srem i64 %mul19.prol, 1000000007
%arrayidx22.prol = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %3
store i64 %rem20.prol, ptr %arrayidx22.prol, align 8, !tbaa !11
%indvars.iv.next46.prol = add nsw i64 %3, -1
br label %for.body14.prol.loopexit
for.body14.prol.loopexit: ; preds = %for.body14.prol, %for.body14.preheader
%indvars.iv45.unr = phi i64 [ %3, %for.body14.preheader ], [ %indvars.iv.next46.prol, %for.body14.prol ]
%i7.0.in41.unr = phi i64 [ %n, %for.body14.preheader ], [ %3, %for.body14.prol ]
%6 = icmp eq i32 %i7.039, 0
br i1 %6, label %for.cond.cleanup13, label %for.body14
for.body: ; preds = %for.body, %for.body.preheader.new
%7 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.1, %for.body ]
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%mul = mul nsw i64 %7, %indvars.iv
%rem = srem i64 %mul, 1000000007
%arrayidx4 = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %indvars.iv
store i64 %rem, ptr %arrayidx4, align 8, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%arrayidx4.1 = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %indvars.iv.next
store i64 %rem.1, ptr %arrayidx4.1, align 8, !tbaa !11
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !13
for.cond.cleanup13: ; preds = %for.body14.prol.loopexit, %for.body14, %modpow.exit
ret void
for.body14: ; preds = %for.body14.prol.loopexit, %for.body14
%indvars.iv45 = phi i64 [ %indvars.iv.next46.1, %for.body14 ], [ %indvars.iv45.unr, %for.body14.prol.loopexit ]
%i7.0.in41 = phi i64 [ %indvars.iv.next46, %for.body14 ], [ %i7.0.in41.unr, %for.body14.prol.loopexit ]
%sext = shl i64 %i7.0.in41, 32
%idxprom15 = ashr exact i64 %sext, 32
%arrayidx16 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %idxprom15
%8 = load i64, ptr %arrayidx16, align 8, !tbaa !11
%mul19 = mul nsw i64 %8, %idxprom15
%rem20 = srem i64 %mul19, 1000000007
%arrayidx22 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %indvars.iv45
store i64 %rem20, ptr %arrayidx22, align 8, !tbaa !11
%indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
%sext.1 = shl i64 %indvars.iv45, 32
%idxprom15.1 = ashr exact i64 %sext.1, 32
%arrayidx16.1 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %idxprom15.1
%9 = load i64, ptr %arrayidx16.1, align 8, !tbaa !11
%mul19.1 = mul nsw i64 %9, %idxprom15.1
%rem20.1 = srem i64 %mul19.1, 1000000007
%arrayidx22.1 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %indvars.iv.next46
store i64 %rem20.1, ptr %arrayidx22.1, align 8, !tbaa !11
%indvars.iv.next46.1 = add nsw i64 %indvars.iv45, -2
%cmp11.not.1 = icmp eq i64 %indvars.iv.next46, 0
br i1 %cmp11.not.1, label %for.cond.cleanup13, label %for.body14, !llvm.loop !14
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @Comb(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%arrayidx = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %a
%0 = load i64, ptr %arrayidx, align 8, !tbaa !11
%arrayidx1 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %b
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !11
%mul = mul nsw i64 %1, %0
%rem = srem i64 %mul, 1000000007
%sub = sub nsw i64 %a, %b
%arrayidx2 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !11
%mul3 = mul nsw i64 %rem, %2
%rem4 = srem i64 %mul3, 1000000007
ret i64 %rem4
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @Catalan(i64 noundef %n) local_unnamed_addr #4 {
entry:
%mul = shl nsw i64 %n, 1
%arrayidx = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %mul
%0 = load i64, ptr %arrayidx, align 16, !tbaa !11
%add = add nsw i64 %n, 1
%arrayidx1 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %add
%1 = load i64, ptr %arrayidx1, align 8, !tbaa !11
%mul2 = mul nsw i64 %1, %0
%rem = srem i64 %mul2, 1000000007
%arrayidx3 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %n
%2 = load i64, ptr %arrayidx3, align 8, !tbaa !11
%mul4 = mul nsw i64 %rem, %2
%rem5 = srem i64 %mul4, 1000000007
ret i64 %rem5
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
store i64 1, ptr @cf, align 16, !tbaa !11
br label %for.body.i
for.cond.cleanup.i: ; preds = %for.body.i
%0 = load i64, ptr getelementptr inbounds ([1000007 x i64], ptr @cf, i64 0, i64 1000006), align 16, !tbaa !11
br label %while.body.i.i
while.body.i.i: ; preds = %if.end.i.i, %for.cond.cleanup.i
%result.011.i.i = phi i64 [ %result.1.i.i, %if.end.i.i ], [ 1, %for.cond.cleanup.i ]
%e.addr.010.i.i = phi i64 [ %shr.i.i, %if.end.i.i ], [ 1000000005, %for.cond.cleanup.i ]
%b.addr.09.i.i = phi i64 [ %rem2.i.i, %if.end.i.i ], [ %0, %for.cond.cleanup.i ]
%and.i.i = and i64 %e.addr.010.i.i, 1
%tobool.not.i.i = icmp eq i64 %and.i.i, 0
br i1 %tobool.not.i.i, label %if.end.i.i, label %if.then.i.i
if.then.i.i: ; preds = %while.body.i.i
%mul.i.i = mul nsw i64 %b.addr.09.i.i, %result.011.i.i
%rem.i.i = srem i64 %mul.i.i, 1000000007
br label %if.end.i.i
if.end.i.i: ; preds = %if.then.i.i, %while.body.i.i
%result.1.i.i = phi i64 [ %rem.i.i, %if.then.i.i ], [ %result.011.i.i, %while.body.i.i ]
%shr.i.i = lshr i64 %e.addr.010.i.i, 1
%mul1.i.i = mul nsw i64 %b.addr.09.i.i, %b.addr.09.i.i
%rem2.i.i = urem i64 %mul1.i.i, 1000000007
%cmp.not.i.i = icmp ult i64 %e.addr.010.i.i, 2
br i1 %cmp.not.i.i, label %modpow.exit.i, label %while.body.i.i, !llvm.loop !9
modpow.exit.i: ; preds = %if.end.i.i
store i64 %result.1.i.i, ptr getelementptr inbounds ([1000007 x i64], ptr @ci, i64 0, i64 1000006), align 16, !tbaa !11
br label %for.body14.i
for.body.i: ; preds = %for.body.i, %entry
%1 = phi i64 [ 1, %entry ], [ %rem.i.1, %for.body.i ]
%indvars.iv.i = phi i64 [ 1, %entry ], [ %indvars.iv.next.i.1, %for.body.i ]
%mul.i = mul nsw i64 %indvars.iv.i, %1
%rem.i = srem i64 %mul.i, 1000000007
%arrayidx4.i = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %indvars.iv.i
store i64 %rem.i, ptr %arrayidx4.i, align 8, !tbaa !11
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%mul.i.1 = mul nsw i64 %indvars.iv.next.i, %rem.i
%rem.i.1 = srem i64 %mul.i.1, 1000000007
%arrayidx4.i.1 = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %indvars.iv.next.i
store i64 %rem.i.1, ptr %arrayidx4.i.1, align 8, !tbaa !11
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%exitcond.i.1 = icmp eq i64 %indvars.iv.next.i, 1000006
br i1 %exitcond.i.1, label %for.cond.cleanup.i, label %for.body.i, !llvm.loop !13
for.body14.i: ; preds = %for.body14.i, %modpow.exit.i
%store_forwarded = phi i64 [ %result.1.i.i, %modpow.exit.i ], [ %rem20.i.1, %for.body14.i ]
%indvars.iv45.i = phi i64 [ 1000005, %modpow.exit.i ], [ %indvars.iv.next46.i.1, %for.body14.i ]
%i7.0.in41.i = phi i64 [ 1000006, %modpow.exit.i ], [ %indvars.iv.next46.i, %for.body14.i ]
%sext.i = shl i64 %i7.0.in41.i, 32
%idxprom15.i = ashr exact i64 %sext.i, 32
%mul19.i = mul nsw i64 %idxprom15.i, %store_forwarded
%rem20.i = srem i64 %mul19.i, 1000000007
%arrayidx22.i = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %indvars.iv45.i
store i64 %rem20.i, ptr %arrayidx22.i, align 8, !tbaa !11
%indvars.iv.next46.i = add nsw i64 %indvars.iv45.i, -1
%sext.i.1 = shl i64 %indvars.iv45.i, 32
%idxprom15.i.1 = ashr exact i64 %sext.i.1, 32
%mul19.i.1 = mul nsw i64 %idxprom15.i.1, %rem20.i
%rem20.i.1 = srem i64 %mul19.i.1, 1000000007
%arrayidx22.i.1 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %indvars.iv.next46.i
store i64 %rem20.i.1, ptr %arrayidx22.i.1, align 8, !tbaa !11
%indvars.iv.next46.i.1 = add nsw i64 %indvars.iv45.i, -2
%cmp11.not.i.1 = icmp eq i64 %indvars.iv.next46.i, 0
br i1 %cmp11.not.i.1, label %CombInit.exit, label %for.body14.i, !llvm.loop !14
CombInit.exit: ; preds = %for.body14.i
%2 = load i64, ptr %x, align 8, !tbaa !11
%3 = load i64, ptr %y, align 8, !tbaa !11
%add = add nsw i64 %3, %2
%rem = srem i64 %add, 3
%div = sdiv i64 %add, 3
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %CombInit.exit
%puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %cleanup19
if.end: ; preds = %CombInit.exit
%sub = sub nsw i64 %2, %div
%sub5 = sub nsw i64 %div, %sub
%cmp6 = icmp slt i64 %sub, 0
%cmp7 = icmp slt i64 %sub5, 0
%or.cond = select i1 %cmp6, i1 true, i1 %cmp7
br i1 %or.cond, label %if.then8, label %if.end10
if.then8: ; preds = %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %cleanup19
if.end10: ; preds = %if.end
%arrayidx = getelementptr inbounds [1000007 x i64], ptr @cf, i64 0, i64 %div
%4 = load i64, ptr %arrayidx, align 8, !tbaa !11
%arrayidx12 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %sub5
%5 = load i64, ptr %arrayidx12, align 8, !tbaa !11
%mul = mul nsw i64 %5, %4
%rem13 = srem i64 %mul, 1000000007
%arrayidx14 = getelementptr inbounds [1000007 x i64], ptr @ci, i64 0, i64 %sub
%6 = load i64, ptr %arrayidx14, align 8, !tbaa !11
%mul15 = mul nsw i64 %rem13, %6
%rem16 = srem i64 %mul15, 1000000007
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %rem16)
br label %cleanup19
cleanup19: ; preds = %if.then8, %if.end10, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { 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 #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 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int n, k; long long p = 0;
int main() {
scanf("%d%d", &n, &k);
while (--n) p += p / (k - 1) + 1;
printf("%lld\n", p);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259441/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259441/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@p = dso_local local_unnamed_addr global i64 0, align 8
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@n = dso_local global i32 0, align 4
@k = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @k)
%n.promoted = load i32, ptr @n, align 4, !tbaa !5
%dec5 = add nsw i32 %n.promoted, -1
%tobool.not6 = icmp eq i32 %dec5, 0
%.pre = load i64, ptr @p, align 8, !tbaa !9
br i1 %tobool.not6, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%0 = load i32, ptr @k, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%conv = sext i32 %sub to i64
%xtraiter = and i32 %dec5, 1
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.body.prol.loopexit, label %while.body.prol
while.body.prol: ; preds = %while.body.lr.ph
%div.prol = sdiv i64 %.pre, %conv
%add.prol = add i64 %.pre, 1
%add1.prol = add i64 %add.prol, %div.prol
%dec.prol = add nsw i32 %n.promoted, -2
br label %while.body.prol.loopexit
while.body.prol.loopexit: ; preds = %while.body.prol, %while.body.lr.ph
%add1.lcssa.unr = phi i64 [ undef, %while.body.lr.ph ], [ %add1.prol, %while.body.prol ]
%dec8.unr = phi i32 [ %dec5, %while.body.lr.ph ], [ %dec.prol, %while.body.prol ]
%add147.unr = phi i64 [ %.pre, %while.body.lr.ph ], [ %add1.prol, %while.body.prol ]
%1 = icmp eq i32 %n.promoted, 2
br i1 %1, label %while.cond.while.end_crit_edge, label %while.body
while.body: ; preds = %while.body.prol.loopexit, %while.body
%dec8 = phi i32 [ %dec.1, %while.body ], [ %dec8.unr, %while.body.prol.loopexit ]
%add147 = phi i64 [ %add1.1, %while.body ], [ %add147.unr, %while.body.prol.loopexit ]
%div = sdiv i64 %add147, %conv
%add = add i64 %add147, 1
%add1 = add i64 %add, %div
%div.1 = sdiv i64 %add1, %conv
%add.1 = add i64 %add1, 1
%add1.1 = add i64 %add.1, %div.1
%dec.1 = add nsw i32 %dec8, -2
%tobool.not.1 = icmp eq i32 %dec.1, 0
br i1 %tobool.not.1, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !11
while.cond.while.end_crit_edge: ; preds = %while.body, %while.body.prol.loopexit
%add1.lcssa = phi i64 [ %add1.lcssa.unr, %while.body.prol.loopexit ], [ %add1.1, %while.body ]
store i64 %add1.lcssa, ptr @p, align 8, !tbaa !9
br label %while.end
while.end: ; preds = %entry, %while.cond.while.end_crit_edge
%2 = phi i64 [ %add1.lcssa, %while.cond.while.end_crit_edge ], [ %.pre, %entry ]
store i32 0, ptr @n, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %2)
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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
/* ex4_3
suzuto */
#include <stdio.h>
int snow_height(int len_1, int len_2); /*プロトタイプ宣言*/
int main(void) {
int west, east, height; /*変数の宣言*/
scanf("%d %d", &west, &east); /*塔の露出部分の長さを出力*/
height = snow_height(west, east);
printf("%d\n", height);
return 0;
}
int snow_height(int len_1, int len_2){
int count, dif, west_num, west_height, res; /*変数の宣言*/
dif = len_2 - len_1; /*difは東側の塔が西から何番目かを表す数と等しい*/
west_num = dif - 1; /*西側の塔の位置*/
west_height = 0; /*west_heightの初期化*/
for(count = 1; count <= west_num; count++){ /*西側の塔の高さを算出する*/
west_height = west_height + count;
}
res = west_height - len_1; /*雪からの露出分の高さを引く(これが雪の積雪の高さ)*/
return res;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259485/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259485/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%west = alloca i32, align 4
%east = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %west) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %east) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %west, ptr noundef nonnull %east)
%0 = load i32, ptr %west, align 4, !tbaa !5
%1 = load i32, ptr %east, align 4, !tbaa !5
%2 = xor i32 %0, -1
%sub1.i = add i32 %1, %2
%cmp.not7.i = icmp slt i32 %sub1.i, 1
br i1 %cmp.not7.i, label %snow_height.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%reass.sub = sub i32 %1, %0
%3 = add i32 %reass.sub, -2
%4 = zext i32 %3 to i33
%5 = add i32 %reass.sub, -3
%6 = zext i32 %5 to i33
%7 = mul i33 %4, %6
%8 = lshr i33 %7, 1
%9 = trunc i33 %8 to i32
%reass.sub5 = shl i32 %reass.sub, 1
%10 = add i32 %reass.sub5, -3
%11 = add i32 %10, %9
br label %snow_height.exit
snow_height.exit: ; preds = %entry, %for.body.preheader.i
%west_height.0.lcssa.i = phi i32 [ 0, %entry ], [ %11, %for.body.preheader.i ]
%sub2.i = sub nsw i32 %west_height.0.lcssa.i, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %east) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %west) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @snow_height(i32 noundef %len_1, i32 noundef %len_2) local_unnamed_addr #3 {
entry:
%0 = xor i32 %len_1, -1
%sub1 = add i32 %0, %len_2
%cmp.not7 = icmp slt i32 %sub1, 1
br i1 %cmp.not7, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = shl i32 %len_2, 1
%2 = add i32 %len_2, -2
%3 = sub i32 %2, %len_1
%4 = zext i32 %3 to i33
%5 = add i32 %len_2, -3
%6 = sub i32 %5, %len_1
%7 = zext i32 %6 to i33
%8 = mul i33 %4, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %1, %10
%12 = shl i32 %len_1, 1
%13 = add i32 %11, -3
%14 = sub i32 %13, %12
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%west_height.0.lcssa = phi i32 [ 0, %entry ], [ %14, %for.body.preheader ]
%sub2 = sub nsw i32 %west_height.0.lcssa, %len_1
ret i32 %sub2
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex4_3
kento_titech*/
#include<stdio.h>
int snow_height(int h_west,int h_east);
int main(void){
int a,b;//a,bはそれぞれ西と東に見える高さ
scanf("%d %d",&a,&b);
printf("%d\n",snow_height(a,b));//積雪を求める関数
return 0;
}
int snow_height(int h_west,int h_east){//h_west,h_eastはそれぞれ西と東に見える部分の高さ
int height;
height=(h_east-h_west)*(h_east-h_west+1)/2-h_east;//1からh_east-h_westまでの総和が東側の塔の高さ。
//積雪heightはそこからh_eastを引いたもの.
return(height);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259528/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259528/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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
%sub.i = sub nsw i32 %1, %0
%add.i = add nsw i32 %sub.i, 1
%mul.i = mul nsw i32 %add.i, %sub.i
%div.i = sdiv i32 %mul.i, 2
%sub2.i = sub nsw i32 %div.i, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @snow_height(i32 noundef %h_west, i32 noundef %h_east) local_unnamed_addr #3 {
entry:
%sub = sub nsw i32 %h_east, %h_west
%add = add nsw i32 %sub, 1
%mul = mul nsw i32 %add, %sub
%div = sdiv i32 %mul, 2
%sub2 = sub nsw i32 %div, %h_east
ret i32 %sub2
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex4_3
pptenshi */
#include<stdio.h>
int num_west_tower(int height_west, int height_east);
int height_tower(int num);
int main(void) {
int height_west, // a
height_east, // b
snowfall; // 積雪量
// input
scanf("%d%d", &height_west, &height_east);
// calculate ans
snowfall = height_tower(
num_west_tower(height_west, height_east)
) - height_west;
// output
printf("%d\n", snowfall);
return 0;
}
int num_west_tower(int height_west, int height_east) {
return height_east - height_west - 1;
}
int height_tower(int num) {
return num * (num + 1) / 2;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259571/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259571/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%height_west = alloca i32, align 4
%height_east = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height_west) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height_east) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height_west, ptr noundef nonnull %height_east)
%0 = load i32, ptr %height_west, align 4, !tbaa !5
%1 = load i32, ptr %height_east, align 4, !tbaa !5
%2 = xor i32 %0, -1
%sub1.i = add i32 %1, %2
%add.i = sub i32 %1, %0
%mul.i = mul nsw i32 %add.i, %sub1.i
%div.i = sdiv i32 %mul.i, 2
%sub = sub nsw i32 %div.i, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height_east) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height_west) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @height_tower(i32 noundef %num) local_unnamed_addr #3 {
entry:
%add = add nsw i32 %num, 1
%mul = mul nsw i32 %add, %num
%div = sdiv i32 %mul, 2
ret i32 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @num_west_tower(i32 noundef %height_west, i32 noundef %height_east) local_unnamed_addr #3 {
entry:
%0 = xor i32 %height_west, -1
%sub1 = add i32 %0, %height_east
ret i32 %sub1
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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,j,c[1000];
scanf("%d %d",&a,&b);
for(i=0;i<1000;i++){c[i]=(i+1)*(i+2)/2;}
for(i=1;;i++){
for(j=0;j<1000;j++){
if(c[j]==a+i&&c[j+1]==b+i){printf("%d",i);return 0;}
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259614/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259614/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca [1000 x i32], align 16
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 %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i64> [ <i64 0, i64 1, i64 2, i64 3>, %entry ], [ %vec.ind.next, %vector.body ]
%0 = add nuw nsw <4 x i64> %vec.ind, <i64 1, i64 1, i64 1, i64 1>
%1 = add nuw nsw <4 x i64> %vec.ind, <i64 2, i64 2, i64 2, i64 2>
%2 = mul nuw nsw <4 x i64> %0, %1
%3 = trunc <4 x i64> %2 to <4 x i32>
%4 = lshr <4 x i32> %3, <i32 1, i32 1, i32 1, i32 1>
%5 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %index
store <4 x i32> %4, ptr %5, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%6 = icmp eq i64 %index.next, 1000
br i1 %6, label %for.cond2.preheader, label %vector.body, !llvm.loop !9
for.cond2.preheader: ; preds = %vector.body
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = load i32, ptr %b, align 4
br label %for.cond2
for.cond2: ; preds = %for.cond2.preheader, %for.inc19
%i.1 = phi i32 [ %inc20, %for.inc19 ], [ 1, %for.cond2.preheader ]
%add8 = add nsw i32 %7, %i.1
%add13 = add nsw i32 %8, %i.1
br label %for.body5
for.body5: ; preds = %for.inc16.1, %for.cond2
%indvars.iv38 = phi i64 [ 0, %for.cond2 ], [ %13, %for.inc16.1 ]
%arrayidx7 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %indvars.iv38
%9 = load i32, ptr %arrayidx7, align 8, !tbaa !5
%cmp9 = icmp eq i32 %9, %add8
%10 = or i64 %indvars.iv38, 1
br i1 %cmp9, label %land.lhs.true, label %for.inc16
land.lhs.true: ; preds = %for.body5
%arrayidx12 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %10
%11 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp14 = icmp eq i32 %11, %add13
br i1 %cmp14, label %if.then, label %for.inc16
if.then: ; preds = %land.lhs.true.1, %land.lhs.true
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.1)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
for.inc16: ; preds = %for.body5, %land.lhs.true
%arrayidx7.1 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %10
%12 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5
%cmp9.1 = icmp eq i32 %12, %add8
%13 = add nuw nsw i64 %indvars.iv38, 2
br i1 %cmp9.1, label %land.lhs.true.1, label %for.inc16.1
land.lhs.true.1: ; preds = %for.inc16
%arrayidx12.1 = getelementptr inbounds [1000 x i32], ptr %c, i64 0, i64 %13
%14 = load i32, ptr %arrayidx12.1, align 8, !tbaa !5
%cmp14.1 = icmp eq i32 %14, %add13
br i1 %cmp14.1, label %if.then, label %for.inc16.1
for.inc16.1: ; preds = %land.lhs.true.1, %for.inc16
%exitcond42.not.1 = icmp eq i64 %13, 1000
br i1 %exitcond42.not.1, label %for.inc19, label %for.body5, !llvm.loop !13
for.inc19: ; preds = %for.inc16.1
%inc20 = add nuw nsw i32 %i.1, 1
br label %for.cond2
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void){
int a , b;
scanf("%d %d", &a , &b);
int sa = b - a;
int sum = 0;
for(int i = 1 ; i <= sa ; i++){
sum += i;
}
printf("%d", sum - b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259658/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259658/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp.not6.not = icmp sgt i32 %0, %1
br i1 %cmp.not6.not, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%2 = shl i32 %0, 1
%3 = xor i32 %1, -1
%4 = add i32 %0, %3
%5 = zext i32 %4 to i33
%6 = add i32 %0, -2
%7 = sub i32 %6, %1
%8 = zext i32 %7 to i33
%9 = mul i33 %5, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %2, %11
%13 = shl i32 %1, 1
%14 = xor i32 %13, -1
%15 = add i32 %12, %14
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.preheader, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %15, %for.body.preheader ]
%sub1 = sub nsw i32 %sum.0.lcssa, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1)
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: 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"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
int main()
{
int a, b;
scanf("%d%d", &a, &b);
int d = b-a;
int ans = d*(d+1)/2 - b;
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259708/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259708/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%add = add nsw i32 %sub, 1
%mul = mul nsw i32 %add, %sub
%div = sdiv i32 %mul, 2
%sub1 = sub nsw i32 %div, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1)
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,c;
scanf("%d %d",&a,&b);
c=b-a;
printf("%d",(c*(c+1)/2)-b);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259751/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259751/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%add = add nsw i32 %sub, 1
%mul = mul nsw i32 %add, %sub
%div = sdiv i32 %mul, 2
%sub1 = sub nsw i32 %div, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1)
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,c,i;
int g = 1;
int z = 0;
scanf("%d %d",&a,&b);
c = b - a ;
for(i = 0;i < c;i++){
z = z + g;
g += 1;
}
printf("%d",z - b );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259795/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259795/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, %1
br i1 %cmp7, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%2 = shl i32 %0, 1
%3 = xor i32 %1, -1
%4 = add i32 %0, %3
%5 = zext i32 %4 to i33
%6 = add i32 %0, -2
%7 = sub i32 %6, %1
%8 = zext i32 %7 to i33
%9 = mul i33 %5, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %2, %11
%13 = shl i32 %1, 1
%14 = xor i32 %13, -1
%15 = add i32 %12, %14
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%z.0.lcssa = phi i32 [ 0, %entry ], [ %15, %for.body.preheader ]
%sub2 = sub nsw i32 %z.0.lcssa, %0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2)
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);
printf("%d\n", ((b - a)*(b - a - 1) / 2) - a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259838/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259838/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%sub2 = add nsw i32 %sub, -1
%mul = mul nsw i32 %sub2, %sub
%div = sdiv i32 %mul, 2
%sub3 = sub nsw i32 %div, %1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub3)
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 n, t, sum, ans;
scanf("%d", &t);
while (t)
{
--t;
scanf("%d", &n);
sum = n % 7;
if (sum == 0) printf("%d\n", n);
else
{
ans = 7 - sum;
if (n % 10 + ans >= 10)
{
printf("%d\n", n - sum);
}
else
{
printf("%d\n", n + ans);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_25991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_25991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %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
%tobool.not15 = icmp eq i32 %0, 0
br i1 %tobool.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end11
%1 = phi i32 [ %3, %if.end11 ], [ %0, %entry ]
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%2 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %2, 7
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.end11, label %if.else
if.else: ; preds = %while.body
%sub = sub nsw i32 7, %rem
%rem3 = srem i32 %2, 10
%add = add nsw i32 %sub, %rem3
%cmp4 = icmp sgt i32 %add, 9
br i1 %cmp4, label %if.then5, label %if.else8
if.then5: ; preds = %if.else
%sub6 = sub nsw i32 %2, %rem
br label %if.end11
if.else8: ; preds = %if.else
%add9 = add nsw i32 %sub, %2
br label %if.end11
if.end11: ; preds = %while.body, %if.then5, %if.else8
%sub6.sink = phi i32 [ %sub6, %if.then5 ], [ %add9, %if.else8 ], [ %2, %while.body ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub6.sink)
%3 = load i32, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end11, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #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"}
|
#include <stdio.h>
int main(){
char C;
scanf("%c", &C);
printf("%c",C+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259953/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259953/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%C = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %C) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C)
%0 = load i8, ptr %C, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%putchar = call i32 @putchar(i32 %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %C) #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() {
char br;
scanf("%c", &br);
printf("%c\n", br + 1);
return 0 ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_259997/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_259997/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%br = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %br) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %br)
%0 = load i8, ptr %br, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %br) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
char a;
scanf("%c",&a);
printf("%c\n",a+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 1, 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(){
char input;
scanf("%c",&input);
int output = input + 1;
printf("%c\n",output);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %input) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%0 = load i8, ptr %input, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %input) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
char c;
scanf("%c", &c);
c+=1;
printf("%c\n", c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !5
%add = add i8 %0, 1
store i8 %add, ptr %c, align 1, !tbaa !5
%conv2 = sext i8 %add to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv2)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
char a;
scanf("%c",&a);
a++;
printf("%c",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260168/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260168/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%inc = add i8 %0, 1
store i8 %inc, ptr %a, align 1, !tbaa !5
%conv = sext i8 %inc to i32
%putchar = call i32 @putchar(i32 %conv)
call void @llvm.lifetime.end.p0(i64 1, 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 @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()
{
char c;
scanf("%c", &c);
printf("%c\n", c + 1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260210/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260210/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
char S[10];
scanf("%s",S);
S[0] = S[0] + 1;
printf("%c\n",S[0]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260254/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260254/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 1, !tbaa !5
%add = add i8 %0, 1
store i8 %add, ptr %S, align 1, !tbaa !5
%conv4 = sext i8 %add to i32
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv4)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
char a[1],*p;
scanf("%s",a);
if(a!='z')
{
p=a;
*p+=1;
printf("%s",a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260298/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260298/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca [1 x i8], align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp.not = icmp eq ptr %a, inttoptr (i64 122 to ptr)
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%0 = load i8, ptr %a, align 1, !tbaa !5
%add = add i8 %0, 1
store i8 %add, ptr %a, align 1, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %a)
br label %if.end
if.end: ; preds = %if.then, %entry
call void @llvm.lifetime.end.p0(i64 1, 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()
{
char a;
scanf("%c",&a);
printf("%c\n",a+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260340/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260340/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 1, 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(){
char c;
scanf("%c",&c);
printf("%c",c+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260384/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260384/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%putchar = call i32 @putchar(i32 %add)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #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)
{
char a;
scanf("%c", &a);
printf("%c", a+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260427/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260427/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%add = add nsw i32 %conv, 1
%putchar = call i32 @putchar(i32 %add)
call void @llvm.lifetime.end.p0(i64 1, 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 @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>
#define ll long long
int main(){
ll n;
scanf("%lld",&n);
if(n % 2 == 1){
puts("0");
return 0;
}
ll ans = 0;
for(ll i = 10; i <= n; i *= 5)
ans += n / i;
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260470/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260470/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"0\00", align 1
@.str.2 = 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:
%n = alloca i64, align 8
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 %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = and i64 %0, -9223372036854775807
%cmp = icmp eq i64 %1, 1
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp2.not7 = icmp slt i64 %0, 10
br i1 %cmp2.not7, label %for.cond.cleanup, label %for.body
if.then: ; preds = %entry
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
for.cond.cleanup: ; preds = %for.body, %for.cond.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond.preheader ], [ %add, %for.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
br label %cleanup
for.body: ; preds = %for.cond.preheader, %for.body
%i.09 = phi i64 [ %mul, %for.body ], [ 10, %for.cond.preheader ]
%ans.08 = phi i64 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%div = sdiv i64 %0, %i.09
%add = add nsw i64 %div, %ans.08
%mul = mul nuw nsw i64 %i.09, 5
%cmp2.not = icmp sgt i64 %mul, %0
br i1 %cmp2.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
cleanup: ; preds = %for.cond.cleanup, %if.then
call void @llvm.lifetime.end.p0(i64 8, 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 = !{!"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()
{
int i;
long long n;
long long ans = 0;
scanf("%lld", &n);
if(n % 2 == 0){
n /= 2;
while(1){
if(n == 0) break;
n /= 5;
ans += n;
}
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260513/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260513/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i64, align 8
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 %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = and i64 %0, 1
%cmp = icmp eq i64 %1, 0
br i1 %cmp, label %if.then, label %if.end4
if.then: ; preds = %entry
%div = sdiv i64 %0, 2
store i64 %div, ptr %n, align 8, !tbaa !5
%cmp17 = icmp ult i64 %0, 2
br i1 %cmp17, label %if.end4, label %if.end
if.end: ; preds = %if.then, %if.end
%ans.08 = phi i64 [ %add, %if.end ], [ 0, %if.then ]
%2 = phi i64 [ %div3, %if.end ], [ %div, %if.then ]
%div3 = sdiv i64 %2, 5
%add = add nsw i64 %ans.08, %div3
%.off9 = add nsw i64 %2, 4
%cmp1 = icmp ult i64 %.off9, 9
br i1 %cmp1, label %while.cond.if.end4.loopexit_crit_edge, label %if.end
while.cond.if.end4.loopexit_crit_edge: ; preds = %if.end
store i64 %div3, ptr %n, align 8, !tbaa !5
br label %if.end4
if.end4: ; preds = %if.then, %while.cond.if.end4.loopexit_crit_edge, %entry
%ans.1 = phi i64 [ 0, %entry ], [ %add, %while.cond.if.end4.loopexit_crit_edge ], [ 0, %if.then ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
char a,b;
scanf("%c %c",&a,&b);
if(a == b)
printf("H");
else
printf("D");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260557/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260557/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i8, ptr %a, align 1, !tbaa !5
%1 = load i8, ptr %b, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
%. = select i1 %cmp, i32 72, i32 68
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 1, 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 @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)
{
char str1[2],str2[2];
scanf("%s%s",str1,str2);
if(str1[0] == 'H')
{
if(str2[0] == 'H')
{printf("H");}
else
{printf("D");}
}
else
{
if(str2[0] == 'H')
{printf("D");}
else
{printf("H");}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260643/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260643/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str1 = alloca [2 x i8], align 1
%str2 = alloca [2 x i8], align 1
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %str1) #4
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %str2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1, ptr noundef nonnull %str2)
%0 = load i8, ptr %str1, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 72
%1 = load i8, ptr %str2, align 1, !tbaa !5
%cmp5 = icmp eq i8 %1, 72
%. = select i1 %cmp5, i32 72, i32 68
%.24 = select i1 %cmp5, i32 68, i32 72
%.sink = select i1 %cmp, i32 %., i32 %.24
%putchar21 = call i32 @putchar(i32 %.sink)
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %str2) #4
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %str1) #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>
#include <string.h>
#define MAX 101
int M[ MAX ][ MAX ];
int n, m;
int P[ MAX ];
int min( int a, int b ) { return ( a < b )?a:b;}
int main(){
int i, j, k, res, x, y;
scanf("%d %d", &n, &m );
for( i = 0; i<n; i++ )
scanf("%d", &P[ i ] );
memset( M, 0, sizeof( M ) );
for( i = 0; i<m; i++ ){
scanf("%d %d", &x, &y );
M[ x-1 ][ y-1 ] = M[ y-1 ][ x-1 ] = 1;
}
res = (1<<22);
for( i = 0; i<n; i++ )
for( j = i+1; j<n; j++ )
for( k = j+1; k<n; k++ )
res = ( M[ i ][ j ] && M[ j ][ k ] && M[ i ][ k ] )?min( res, P[ i ]+P[j ]+ P[ k ] ):res;
if( res == (1<<22 ) ) printf("-1\n");
else printf("%d\n", res );
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26073/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26073/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@n = dso_local global i32 0, align 4
@m = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@P = dso_local global [101 x i32] zeroinitializer, align 16
@M = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #7
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp88 = icmp sgt i32 %0, 0
br i1 %cmp88, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr @P, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%3 = phi i32 [ %0, %entry ], [ %1, %for.body ]
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) @M, i8 0, i64 40804, i1 false)
%4 = load i32, ptr @m, align 4, !tbaa !5
%cmp390 = icmp sgt i32 %4, 0
br i1 %cmp390, label %for.body4, label %for.cond20.preheader
for.cond20.preheader.loopexit: ; preds = %for.body4
%.pre = load i32, ptr @n, align 4, !tbaa !5
br label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.cond20.preheader.loopexit, %for.end
%5 = phi i32 [ %.pre, %for.cond20.preheader.loopexit ], [ %3, %for.end ]
%cmp2199 = icmp sgt i32 %5, 0
br i1 %cmp2199, label %for.body22.preheader, label %if.then
for.body22.preheader: ; preds = %for.cond20.preheader
%6 = zext i32 %5 to i64
%wide.trip.count120 = zext i32 %5 to i64
br label %for.body22
for.body4: ; preds = %for.end, %for.body4
%i.191 = phi i32 [ %inc18, %for.body4 ], [ 0, %for.end ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%7 = load i32, ptr %y, align 4, !tbaa !5
%sub = add nsw i32 %7, -1
%idxprom6 = sext i32 %sub to i64
%8 = load i32, ptr %x, align 4, !tbaa !5
%sub8 = add nsw i32 %8, -1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %idxprom6, i64 %idxprom9
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %idxprom9, i64 %idxprom6
store i32 1, ptr %arrayidx16, align 4, !tbaa !5
%inc18 = add nuw nsw i32 %i.191, 1
%9 = load i32, ptr @m, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc18, %9
br i1 %cmp3, label %for.body4, label %for.cond20.preheader.loopexit, !llvm.loop !11
for.cond20.loopexit: ; preds = %for.cond23.loopexit, %for.body22
%res.1.lcssa = phi i32 [ %res.0101, %for.body22 ], [ %res.2.lcssa, %for.cond23.loopexit ]
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120
br i1 %exitcond121.not, label %for.end62, label %for.body22, !llvm.loop !12
for.body22: ; preds = %for.body22.preheader, %for.cond20.loopexit
%indvars.iv117 = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next118, %for.cond20.loopexit ]
%indvars.iv112 = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next113, %for.cond20.loopexit ]
%indvars.iv105 = phi i64 [ 2, %for.body22.preheader ], [ %indvars.iv.next106, %for.cond20.loopexit ]
%res.0101 = phi i32 [ 4194304, %for.body22.preheader ], [ %res.1.lcssa, %for.cond20.loopexit ]
%indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
%cmp2495 = icmp ult i64 %indvars.iv.next118, %6
br i1 %cmp2495, label %for.body25.lr.ph, label %for.cond20.loopexit
for.body25.lr.ph: ; preds = %for.body22
%arrayidx46 = getelementptr inbounds [101 x i32], ptr @P, i64 0, i64 %indvars.iv117
br label %for.body25
for.cond23.loopexit: ; preds = %cond.end, %for.body29.lr.ph, %for.body25
%res.2.lcssa = phi i32 [ %res.197, %for.body25 ], [ %res.197, %for.body29.lr.ph ], [ %cond, %cond.end ]
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%exitcond.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count120
br i1 %exitcond.not, label %for.cond20.loopexit, label %for.body25, !llvm.loop !13
for.body25: ; preds = %for.body25.lr.ph, %for.cond23.loopexit
%indvars.iv114 = phi i64 [ %indvars.iv112, %for.body25.lr.ph ], [ %indvars.iv.next115, %for.cond23.loopexit ]
%indvars.iv107 = phi i64 [ %indvars.iv105, %for.body25.lr.ph ], [ %indvars.iv.next108, %for.cond23.loopexit ]
%res.197 = phi i32 [ %res.0101, %for.body25.lr.ph ], [ %res.2.lcssa, %for.cond23.loopexit ]
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%10 = trunc i64 %indvars.iv.next115 to i32
%cmp2892 = icmp sgt i32 %5, %10
br i1 %cmp2892, label %for.body29.lr.ph, label %for.cond23.loopexit
for.body29.lr.ph: ; preds = %for.body25
%arrayidx33 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %indvars.iv117, i64 %indvars.iv114
%11 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%tobool.not = icmp eq i32 %11, 0
%arrayidx48 = getelementptr inbounds [101 x i32], ptr @P, i64 0, i64 %indvars.iv114
br i1 %tobool.not, label %for.cond23.loopexit, label %for.body29
for.body29: ; preds = %for.body29.lr.ph, %cond.end
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %cond.end ], [ %indvars.iv107, %for.body29.lr.ph ]
%res.294 = phi i32 [ %cond, %cond.end ], [ %res.197, %for.body29.lr.ph ]
%arrayidx37 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %indvars.iv114, i64 %indvars.iv109
%12 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%tobool38.not = icmp eq i32 %12, 0
br i1 %tobool38.not, label %cond.end, label %land.lhs.true39
land.lhs.true39: ; preds = %for.body29
%arrayidx43 = getelementptr inbounds [101 x [101 x i32]], ptr @M, i64 0, i64 %indvars.iv117, i64 %indvars.iv109
%13 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%tobool44.not = icmp eq i32 %13, 0
br i1 %tobool44.not, label %cond.end, label %cond.true
cond.true: ; preds = %land.lhs.true39
%14 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%15 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%add49 = add nsw i32 %15, %14
%arrayidx51 = getelementptr inbounds [101 x i32], ptr @P, i64 0, i64 %indvars.iv109
%16 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%add52 = add nsw i32 %add49, %16
%cond.i = call i32 @llvm.smin.i32(i32 %res.294, i32 %add52)
br label %cond.end
cond.end: ; preds = %for.body29, %land.lhs.true39, %cond.true
%cond = phi i32 [ %cond.i, %cond.true ], [ %res.294, %land.lhs.true39 ], [ %res.294, %for.body29 ]
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
%17 = trunc i64 %indvars.iv.next110 to i32
%cmp28 = icmp sgt i32 %5, %17
br i1 %cmp28, label %for.body29, label %for.cond23.loopexit, !llvm.loop !14
for.end62: ; preds = %for.cond20.loopexit
%cmp63 = icmp eq i32 %res.1.lcssa, 4194304
br i1 %cmp63, label %if.then, label %if.else
if.then: ; preds = %for.cond20.preheader, %for.end62
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %for.end62
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %res.1.lcssa)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main()
{
char a,b;
while(~scanf("%c %c",&a,&b))
{
if(a=='H'&&b=='H')
printf("H");
else if(a=='H'&&b=='D')
printf("D");
else if(a=='D'&&b=='H')
printf("D");
else if(a=='D'&&b=='D')
printf("H");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c %c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4
%call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not45 = icmp eq i32 %call44, -1
br i1 %tobool.not45, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end37
%0 = load i8, ptr %a, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 72
%1 = load i8, ptr %b, align 1
%cmp3 = icmp eq i8 %1, 72
%or.cond = select i1 %cmp, i1 %cmp3, i1 false
br i1 %or.cond, label %if.end37.sink.split, label %if.else
if.else: ; preds = %while.body
%cmp11 = icmp eq i8 %1, 68
%or.cond38 = select i1 %cmp, i1 %cmp11, i1 false
br i1 %or.cond38, label %if.end37.sink.split, label %if.else15
if.else15: ; preds = %if.else
%cmp17 = icmp eq i8 %0, 68
%or.cond39 = select i1 %cmp17, i1 %cmp3, i1 false
br i1 %or.cond39, label %if.end37.sink.split, label %if.else25
if.else25: ; preds = %if.else15
%or.cond40 = select i1 %cmp17, i1 %cmp11, i1 false
br i1 %or.cond40, label %if.end37.sink.split, label %if.end37
if.end37.sink.split: ; preds = %if.else25, %if.else15, %if.else, %while.body
%.sink = phi i32 [ 72, %while.body ], [ 68, %if.else ], [ 68, %if.else15 ], [ 72, %if.else25 ]
%putchar42 = call i32 @putchar(i32 %.sink)
br label %if.end37
if.end37: ; preds = %if.end37.sink.split, %if.else25
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %if.end37, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 1, 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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main(void)
{
int a=700, x, i;
char s[11];
scanf("%s",s);
for(i=0;i<strlen(s)-2;i++){
x=(s[i]-0x30)*100+(s[i+1]-0x30)*10+(s[i+2]-0x30);
if(x>753){
if(x-753<a)
a=x-753;
}
else
if(753-x<a)
a=753-x;
}
printf("%d\n",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%sub = add i64 %call2, -2
%cmp44.not = icmp eq i64 %sub, 0
br i1 %cmp44.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%.pre = load i8, ptr %s, align 1, !tbaa !5
%arrayidx7.phi.trans.insert = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 1
%.pre50 = load i8, ptr %arrayidx7.phi.trans.insert, align 1, !tbaa !5
%min.iters.check = icmp ult i64 %sub, 8
br i1 %min.iters.check, label %for.body.preheader58, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %sub, -8
%vector.recur.init = insertelement <4 x i8> poison, i8 %.pre50, i64 3
%vector.recur.init51 = insertelement <4 x i8> poison, i8 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i8> [ %vector.recur.init, %vector.ph ], [ %wide.load54, %vector.body ]
%vector.recur52 = phi <4 x i8> [ %vector.recur.init51, %vector.ph ], [ %4, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 700, i32 700, i32 700, i32 700>, %vector.ph ], [ %29, %vector.body ]
%vec.phi53 = phi <4 x i32> [ <i32 700, i32 700, i32 700, i32 700>, %vector.ph ], [ %30, %vector.body ]
%0 = or i64 %index, 2
%1 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %0
%wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !5
%2 = getelementptr inbounds i8, ptr %1, i64 4
%wide.load54 = load <4 x i8>, ptr %2, align 1, !tbaa !5
%3 = shufflevector <4 x i8> %vector.recur, <4 x i8> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%4 = shufflevector <4 x i8> %wide.load, <4 x i8> %wide.load54, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = shufflevector <4 x i8> %vector.recur52, <4 x i8> %3, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = shufflevector <4 x i8> %3, <4 x i8> %4, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%7 = sext <4 x i8> %5 to <4 x i32>
%8 = sext <4 x i8> %6 to <4 x i32>
%9 = mul nsw <4 x i32> %7, <i32 100, i32 100, i32 100, i32 100>
%10 = mul nsw <4 x i32> %8, <i32 100, i32 100, i32 100, i32 100>
%11 = sext <4 x i8> %3 to <4 x i32>
%12 = sext <4 x i8> %4 to <4 x i32>
%13 = mul nsw <4 x i32> %11, <i32 10, i32 10, i32 10, i32 10>
%14 = mul nsw <4 x i32> %12, <i32 10, i32 10, i32 10, i32 10>
%15 = add nsw <4 x i32> %13, %9
%16 = add nsw <4 x i32> %14, %10
%17 = sext <4 x i8> %wide.load to <4 x i32>
%18 = sext <4 x i8> %wide.load54 to <4 x i32>
%19 = add nsw <4 x i32> %15, %17
%20 = add nsw <4 x i32> %16, %18
%21 = icmp sgt <4 x i32> %19, <i32 6081, i32 6081, i32 6081, i32 6081>
%22 = icmp sgt <4 x i32> %20, <i32 6081, i32 6081, i32 6081, i32 6081>
%23 = sub nsw <4 x i32> <i32 6081, i32 6081, i32 6081, i32 6081>, %19
%24 = sub nsw <4 x i32> <i32 6081, i32 6081, i32 6081, i32 6081>, %20
%25 = add nsw <4 x i32> %19, <i32 -6081, i32 -6081, i32 -6081, i32 -6081>
%26 = add nsw <4 x i32> %20, <i32 -6081, i32 -6081, i32 -6081, i32 -6081>
%27 = select <4 x i1> %21, <4 x i32> %25, <4 x i32> %23
%28 = select <4 x i1> %22, <4 x i32> %26, <4 x i32> %24
%29 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %27, <4 x i32> %vec.phi)
%30 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %28, <4 x i32> %vec.phi53)
%index.next = add nuw i64 %index, 8
%31 = icmp eq i64 %index.next, %n.vec
br i1 %31, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %29, <4 x i32> %30)
%32 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %sub, %n.vec
%vector.recur.extract = extractelement <4 x i8> %wide.load54, i64 3
%vector.recur.extract55 = extractelement <4 x i8> %wide.load54, i64 2
br i1 %cmp.n, label %for.end, label %for.body.preheader58
for.body.preheader58: ; preds = %for.body.preheader, %middle.block
%scalar.recur.ph = phi i8 [ %vector.recur.extract, %middle.block ], [ %.pre50, %for.body.preheader ]
%scalar.recur57.ph = phi i8 [ %vector.recur.extract55, %middle.block ], [ %.pre, %for.body.preheader ]
%indvars.iv.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body.preheader ]
%a.045.ph = phi i32 [ %32, %middle.block ], [ 700, %for.body.preheader ]
br label %for.body
for.body: ; preds = %for.body.preheader58, %for.body
%scalar.recur = phi i8 [ %36, %for.body ], [ %scalar.recur.ph, %for.body.preheader58 ]
%scalar.recur57 = phi i8 [ %scalar.recur, %for.body ], [ %scalar.recur57.ph, %for.body.preheader58 ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader58 ]
%a.045 = phi i32 [ %spec.select43, %for.body ], [ %a.045.ph, %for.body.preheader58 ]
%conv4 = sext i8 %scalar.recur57 to i32
%33 = mul nsw i32 %conv4, 100
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%conv8 = sext i8 %scalar.recur to i32
%34 = mul nsw i32 %conv8, 10
%mul10 = add nsw i32 %34, %33
%35 = add nuw nsw i64 %indvars.iv, 2
%arrayidx14 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %35
%36 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%conv15 = sext i8 %36 to i32
%sub16 = add nsw i32 %mul10, %conv15
%cmp18 = icmp sgt i32 %sub16, 6081
%sub25 = sub nsw i32 6081, %sub16
%sub20 = add nsw i32 %sub16, -6081
%sub25.sink = select i1 %cmp18, i32 %sub20, i32 %sub25
%spec.select43 = call i32 @llvm.smin.i32(i32 %sub25.sink, i32 %a.045)
%exitcond.not = icmp eq i64 %indvars.iv.next, %sub
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.body, %middle.block, %entry
%a.0.lcssa = phi i32 [ 700, %entry ], [ %32, %middle.block ], [ %spec.select43, %for.body ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
char lun[11];
scanf("%s", lun);
int min=643;
int x;
int i=0;
while(lun[i+2] != '\0'){
x=0;
x+=(lun[i]-'0')*100;
x+=(lun[i+1]-'0')*10;
x+=lun[i+2]-'0';
x= abs(x-753);
if(x<min) min = x;
i++;
}
printf("%d", min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%lun = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %lun) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %lun)
%arrayidx33 = getelementptr inbounds [11 x i8], ptr %lun, i64 0, i64 2
%0 = load i8, ptr %arrayidx33, align 1, !tbaa !5
%cmp.not34 = icmp eq i8 %0, 0
br i1 %cmp.not34, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%.pre = load i8, ptr %lun, align 1, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%1 = phi i8 [ %.pre, %while.body.preheader ], [ %4, %while.body ]
%indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%2 = phi i8 [ %0, %while.body.preheader ], [ %8, %while.body ]
%min.035 = phi i32 [ 643, %while.body.preheader ], [ %spec.select, %while.body ]
%conv = sext i8 %2 to i32
%conv4 = sext i8 %1 to i32
%3 = mul nsw i32 %conv4, 100
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx8 = getelementptr inbounds [11 x i8], ptr %lun, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%conv9 = sext i8 %4 to i32
%5 = mul nsw i32 %conv9, 10
%mul11 = add nsw i32 %conv, -6081
%sub17 = add nsw i32 %mul11, %3
%sub19 = add nsw i32 %sub17, %5
%6 = call i32 @llvm.abs.i32(i32 %sub19, i1 true)
%spec.select = call i32 @llvm.smin.i32(i32 %6, i32 %min.035)
%7 = add nuw nsw i64 %indvars.iv, 3
%arrayidx = getelementptr inbounds [11 x i8], ptr %lun, i64 0, i64 %7
%8 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %8, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %while.body, %entry
%min.0.lcssa = phi i32 [ 643, %entry ], [ %spec.select, %while.body ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %lun) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <ctype.h>
int zakl(int n, int i);
int main()
{
int c;
int len = 0;
int initial_sum = 0;
while((EOF != (c = getc(stdin)) && isdigit(c))){
initial_sum += c - '0';
++len;
}
printf("%d\n", len > 1 ? zakl(initial_sum, 0) + 1 : 0);
return 0;
}
int zakl(int n, int i){
if(n < 10) return i;
int sum = 0;
int res;
while(n){
res = n % 10;
sum += res;
n -= res;
n /= 10;
}
return zakl(sum, i+1);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26091/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26091/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call10 = tail call i32 @getc(ptr noundef %0)
%cmp.not11 = icmp eq i32 %call10, -1
br i1 %cmp.not11, label %cond.end, label %land.rhs.lr.ph
land.rhs.lr.ph: ; preds = %entry
%call1 = tail call ptr @__ctype_b_loc() #4
br label %land.rhs
land.rhs: ; preds = %land.rhs.lr.ph, %while.body
%call14 = phi i32 [ %call10, %land.rhs.lr.ph ], [ %call, %while.body ]
%initial_sum.013 = phi i32 [ 0, %land.rhs.lr.ph ], [ %add, %while.body ]
%len.012 = phi i32 [ 0, %land.rhs.lr.ph ], [ %inc, %while.body ]
%1 = load ptr, ptr %call1, align 8, !tbaa !5
%idxprom = sext i32 %call14 to i64
%arrayidx = getelementptr inbounds i16, ptr %1, i64 %idxprom
%2 = load i16, ptr %arrayidx, align 2, !tbaa !9
%3 = and i16 %2, 2048
%tobool.not = icmp eq i16 %3, 0
br i1 %tobool.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%sub = add i32 %initial_sum.013, -48
%add = add i32 %sub, %call14
%inc = add nuw nsw i32 %len.012, 1
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call i32 @getc(ptr noundef %4)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body
%len.0.lcssa.ph = phi i32 [ %len.012, %land.rhs ], [ %inc, %while.body ]
%initial_sum.0.lcssa.ph = phi i32 [ %initial_sum.013, %land.rhs ], [ %add, %while.body ]
%5 = icmp ugt i32 %len.0.lcssa.ph, 1
br i1 %5, label %cond.true, label %cond.end
cond.true: ; preds = %while.end
%cmp11.i = icmp slt i32 %initial_sum.0.lcssa.ph, 10
br i1 %cmp11.i, label %cond.end, label %while.cond.preheader.i
while.cond.preheader.i: ; preds = %cond.true, %while.end.i
%i.tr13.i = phi i32 [ %add1.i, %while.end.i ], [ 0, %cond.true ]
%n.tr12.i = phi i32 [ %add.i, %while.end.i ], [ %initial_sum.0.lcssa.ph, %cond.true ]
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.cond.preheader.i
%sum.010.i = phi i32 [ 0, %while.cond.preheader.i ], [ %add.i, %while.body.i ]
%n.addr.09.i = phi i32 [ %n.tr12.i, %while.cond.preheader.i ], [ %div.i, %while.body.i ]
%rem.i = urem i32 %n.addr.09.i, 10
%add.i = add nuw nsw i32 %rem.i, %sum.010.i
%sub.i = sub nuw nsw i32 %n.addr.09.i, %rem.i
%div.i = sdiv i32 %sub.i, 10
%sub.off.i = add i32 %sub.i, 9
%tobool.not.i = icmp ult i32 %sub.off.i, 19
br i1 %tobool.not.i, label %while.end.i, label %while.body.i, !llvm.loop !13
while.end.i: ; preds = %while.body.i
%add1.i = add nuw nsw i32 %i.tr13.i, 1
%cmp.i = icmp ult i32 %add.i, 10
br i1 %cmp.i, label %zakl.exit.loopexit, label %while.cond.preheader.i
zakl.exit.loopexit: ; preds = %while.end.i
%6 = add nuw nsw i32 %i.tr13.i, 2
br label %cond.end
cond.end: ; preds = %entry, %cond.true, %zakl.exit.loopexit, %while.end
%cond = phi i32 [ 0, %while.end ], [ 1, %cond.true ], [ %6, %zakl.exit.loopexit ], [ 0, %entry ]
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cond)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @zakl(i32 noundef %n, i32 noundef %i) local_unnamed_addr #3 {
entry:
%cmp11 = icmp slt i32 %n, 10
br i1 %cmp11, label %return, label %while.cond.preheader
while.cond.preheader: ; preds = %entry, %while.end
%i.tr13 = phi i32 [ %add1, %while.end ], [ %i, %entry ]
%n.tr12 = phi i32 [ %add, %while.end ], [ %n, %entry ]
br label %while.body
while.body: ; preds = %while.cond.preheader, %while.body
%sum.010 = phi i32 [ 0, %while.cond.preheader ], [ %add, %while.body ]
%n.addr.09 = phi i32 [ %n.tr12, %while.cond.preheader ], [ %div, %while.body ]
%rem = urem i32 %n.addr.09, 10
%add = add nuw nsw i32 %sum.010, %rem
%sub = sub nuw nsw i32 %n.addr.09, %rem
%div = sdiv i32 %sub, 10
%sub.off = add i32 %sub, 9
%tobool.not = icmp ult i32 %sub.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %while.body
%add1 = add nsw i32 %i.tr13, 1
%cmp = icmp ult i32 %add, 10
br i1 %cmp, label %return, label %while.cond.preheader
return: ; preds = %while.end, %entry
%i.tr.lcssa = phi i32 [ %i, %entry ], [ %add1, %while.end ]
ret i32 %i.tr.lcssa
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
char input[10];
char a[4];
int b;
int c;
int i;
int min;
scanf("%s",&input);
min=999;
for(i=0;1<10;i++){
a[0]=input[i];
a[1]=input[i+1];
a[2]=input[i+2];
a[3]='\0';
b=atoi(a);
c=abs(753-b);
if( c < min )
min=c;
if(input[i+3]=='\0')
break;
}
printf("%d\n",min);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_260960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_260960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%input = alloca [10 x i8], align 1
%a = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %input) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%arrayidx4 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 1
%arrayidx8 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 2
%arrayidx9 = getelementptr inbounds [4 x i8], ptr %a, i64 0, i64 3
%arrayidx7.phi.trans.insert = getelementptr inbounds [10 x i8], ptr %input, i64 0, i64 2
%.pre = load i8, ptr %arrayidx7.phi.trans.insert, align 1, !tbaa !5
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%0 = phi i8 [ %5, %for.cond ], [ %.pre, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%min.0 = phi i32 [ %spec.select, %for.cond ], [ 999, %entry ]
%arrayidx = getelementptr inbounds [10 x i8], ptr %input, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
store i8 %1, ptr %a, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx3 = getelementptr inbounds [10 x i8], ptr %input, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx3, align 1, !tbaa !5
store i8 %2, ptr %arrayidx4, align 1, !tbaa !5
store i8 %0, ptr %arrayidx8, align 1, !tbaa !5
store i8 0, ptr %arrayidx9, align 1, !tbaa !5
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %a, ptr noundef null, i32 noundef 10) #6
%conv.i = trunc i64 %call.i to i32
%sub = sub nsw i32 753, %conv.i
%3 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%spec.select = call i32 @llvm.smin.i32(i32 %3, i32 %min.0)
%4 = add nuw nsw i64 %indvars.iv, 3
%arrayidx13 = getelementptr inbounds [10 x i8], ptr %input, i64 0, i64 %4
%5 = load i8, ptr %arrayidx13, align 1, !tbaa !5
%cmp14 = icmp eq i8 %5, 0
br i1 %cmp14, label %for.end, label %for.cond
for.end: ; preds = %for.cond
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %input) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int n, k, i, j, t, chk, len;
char s[51], v[51];
scanf("%d%d%s", &n, &t, s);
for (i = 0 ; i < n ; i++) v[i] = s[i];
v[i] = 0;
for (i = 1 ; i < n ; i++) {
chk = 1;
for (j = 0, k = i ; k < n ; j++, k++) {
if (v[j] != v[k]) {
chk = 0;
break;
}
}
if (chk) {
v[i] = 0;
break;
}
}
for (i = 0 ; i < t - 1 ; i++) {
printf("%s", v);
}
printf("%s", s);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26101/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26101/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%s\00", align 1
@.str.1 = 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:
%n = alloca i32, align 4
%t = alloca i32, align 4
%s = alloca [51 x i8], align 16
%v = alloca [51 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %v) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.end, label %for.end.thread
for.end.thread: ; preds = %entry
store i8 0, ptr %v, align 16, !tbaa !9
br label %for.end28
for.end: ; preds = %entry
%1 = zext i32 %0 to i64
call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %v, ptr nonnull align 16 %s, i64 %1, i1 false), !tbaa !9
%2 = zext i32 %0 to i64
%arrayidx4 = getelementptr inbounds [51 x i8], ptr %v, i64 0, i64 %2
store i8 0, ptr %arrayidx4, align 1, !tbaa !9
%cmp659.not = icmp eq i32 %0, 1
br i1 %cmp659.not, label %for.end28, label %for.cond8.preheader.preheader
for.cond8.preheader.preheader: ; preds = %for.end
%wide.trip.count74 = zext i32 %0 to i64
%sext = sext i32 %0 to i64
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.cond8.preheader.preheader, %for.inc26
%indvars.iv = phi i64 [ 1, %for.cond8.preheader.preheader ], [ %indvars.iv.next, %for.inc26 ]
br label %for.body10
for.body10: ; preds = %for.cond8.preheader, %for.inc18
%indvars.iv68 = phi i64 [ 0, %for.cond8.preheader ], [ %indvars.iv.next69, %for.inc18 ]
%indvars.iv66 = phi i64 [ %indvars.iv, %for.cond8.preheader ], [ %indvars.iv.next67, %for.inc18 ]
%arrayidx12 = getelementptr inbounds [51 x i8], ptr %v, i64 0, i64 %indvars.iv68
%3 = load i8, ptr %arrayidx12, align 1, !tbaa !9
%arrayidx14 = getelementptr inbounds [51 x i8], ptr %v, i64 0, i64 %indvars.iv66
%4 = load i8, ptr %arrayidx14, align 1, !tbaa !9
%cmp16.not = icmp eq i8 %3, %4
br i1 %cmp16.not, label %for.inc18, label %for.inc26
for.inc18: ; preds = %for.body10
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%5 = icmp slt i64 %indvars.iv.next67, %sext
br i1 %5, label %for.body10, label %if.then22, !llvm.loop !10
if.then22: ; preds = %for.inc18
%idxprom23 = and i64 %indvars.iv, 4294967295
%arrayidx24 = getelementptr inbounds [51 x i8], ptr %v, i64 0, i64 %idxprom23
store i8 0, ptr %arrayidx24, align 1, !tbaa !9
br label %for.end28
for.inc26: ; preds = %for.body10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count74
br i1 %exitcond.not, label %for.end28, label %for.cond8.preheader, !llvm.loop !12
for.end28: ; preds = %for.inc26, %for.end.thread, %for.end, %if.then22
%6 = load i32, ptr %t, align 4, !tbaa !5
%cmp3062 = icmp sgt i32 %6, 1
br i1 %cmp3062, label %for.body32, label %for.end37
for.body32: ; preds = %for.end28, %for.body32
%i.263 = phi i32 [ %inc36, %for.body32 ], [ 0, %for.end28 ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %v)
%inc36 = add nuw nsw i32 %i.263, 1
%7 = load i32, ptr %t, align 4, !tbaa !5
%sub = add nsw i32 %7, -1
%cmp30 = icmp slt i32 %inc36, %sub
br i1 %cmp30, label %for.body32, label %for.end37, !llvm.loop !13
for.end37: ; preds = %for.body32, %for.end28
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %v) #4
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, 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: readwrite) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
typedef long long int int64;
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))
void run(void){
char s[11];
scanf("%s",s);
int min=1000;
int i;
for(i=0;s[i+2]!='\0';i++){
min=MIN(min,ABS(100*(s[i]-'0')+10*(s[i+1]-'0')+s[i+2]-'0'-753));
}
printf("%d\n",min);
}
int main(void){
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261060/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261060/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @run() local_unnamed_addr #0 {
entry:
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx152 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 2
%0 = load i8, ptr %arrayidx152, align 1, !tbaa !5
%cmp.not153 = icmp eq i8 %0, 0
br i1 %cmp.not153, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%.pre = load i8, ptr %s, align 1, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%1 = phi i8 [ %.pre, %for.body.preheader ], [ %4, %for.body ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%2 = phi i8 [ %0, %for.body.preheader ], [ %7, %for.body ]
%min.0154 = phi i32 [ 1000, %for.body.preheader ], [ %cond129, %for.body ]
%conv = sext i8 %2 to i32
%conv4 = sext i8 %1 to i32
%3 = mul nsw i32 %conv4, 100
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx7 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%conv8 = sext i8 %4 to i32
%5 = mul nsw i32 %conv8, 10
%mul10 = add nsw i32 %conv, -5280
%add11 = add nsw i32 %mul10, %3
%add16 = add nsw i32 %add11, %5
%cmp19 = icmp sgt i32 %add16, 801
%sub18 = add nsw i32 %add16, -801
%sub59 = sub nsw i32 801, %add16
%cond = select i1 %cmp19, i32 %sub18, i32 %sub59
%cond129 = call i32 @llvm.smin.i32(i32 %min.0154, i32 %cond)
%6 = add nuw nsw i64 %indvars.iv, 3
%arrayidx = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %6
%7 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %7, 0
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.body, %entry
%min.0.lcssa = phi i32 [ 1000, %entry ], [ %cond129, %for.body ]
%call130 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #4
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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s.i = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s.i) #4
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s.i)
%arrayidx152.i = getelementptr inbounds [11 x i8], ptr %s.i, i64 0, i64 2
%0 = load i8, ptr %arrayidx152.i, align 1, !tbaa !5
%cmp.not153.i = icmp eq i8 %0, 0
br i1 %cmp.not153.i, label %run.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%.pre.i = load i8, ptr %s.i, align 1, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%1 = phi i8 [ %.pre.i, %for.body.preheader.i ], [ %4, %for.body.i ]
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%2 = phi i8 [ %0, %for.body.preheader.i ], [ %7, %for.body.i ]
%min.0154.i = phi i32 [ 1000, %for.body.preheader.i ], [ %cond129.i, %for.body.i ]
%conv.i = sext i8 %2 to i32
%conv4.i = sext i8 %1 to i32
%3 = mul nsw i32 %conv4.i, 100
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx7.i = getelementptr inbounds [11 x i8], ptr %s.i, i64 0, i64 %indvars.iv.next.i
%4 = load i8, ptr %arrayidx7.i, align 1, !tbaa !5
%conv8.i = sext i8 %4 to i32
%5 = mul nsw i32 %conv8.i, 10
%mul10.i = add nsw i32 %3, -5280
%add11.i = add nsw i32 %mul10.i, %conv.i
%add16.i = add nsw i32 %add11.i, %5
%cmp19.i = icmp sgt i32 %add16.i, 801
%sub18.i = add nsw i32 %add16.i, -801
%sub59.i = sub nsw i32 801, %add16.i
%cond.i = select i1 %cmp19.i, i32 %sub18.i, i32 %sub59.i
%cond129.i = call i32 @llvm.smin.i32(i32 %min.0154.i, i32 %cond.i)
%6 = add nuw nsw i64 %indvars.iv.i, 3
%arrayidx.i = getelementptr inbounds [11 x i8], ptr %s.i, i64 0, i64 %6
%7 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%cmp.not.i = icmp eq i8 %7, 0
br i1 %cmp.not.i, label %run.exit, label %for.body.i, !llvm.loop !8
run.exit: ; preds = %for.body.i, %entry
%min.0.lcssa.i = phi i32 [ 1000, %entry ], [ %cond129.i, %for.body.i ]
%call130.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s.i) #4
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
long long h,w;
scanf("%lld %lld",&h,&w);
if (h==1&&w==1)printf("1\n");
else if(h==1||w==1)printf("%lld\n",h+w-3);
else printf("%lld\n",(h-2)*(w-2));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261132/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261132/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i64, align 8
%w = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i64, ptr %h, align 8, !tbaa !5
%cmp = icmp eq i64 %0, 1
%1 = load i64, ptr %w, align 8
%cmp1 = icmp eq i64 %1, 1
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end11
if.else: ; preds = %entry
%or.cond12 = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond12, label %if.then5, label %if.else7
if.then5: ; preds = %if.else
%add = add i64 %0, -3
%sub = add i64 %add, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub)
br label %if.end11
if.else7: ; preds = %if.else
%sub8 = add nsw i64 %0, -2
%sub9 = add nsw i64 %1, -2
%mul = mul nsw i64 %sub9, %sub8
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul)
br label %if.end11
if.end11: ; preds = %if.then5, %if.else7, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 8, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int h1, m1, s1, h2, m2, s2, sum;
int i,j;
int time[2] = {3600, 60};
for (i = 0; i < 3; i++){
scanf("%d %d %d", &h1, &m1, &s1);
scanf("%d %d %d", &h2, &m2, &s2);
sum = (h2*3600 + m2*60 + s2) - (h1*3600 + m1*60 + s1);
for (j = 0; j < 2; j++){
if (j) printf(" ");
printf("%d", sum/time[j]);
sum = sum%time[j];
}
printf(" %d\n", sum);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261176/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261176/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c" %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
if.end.1.2:
%h1 = alloca i32, align 4
%m1 = alloca i32, align 4
%s1 = alloca i32, align 4
%h2 = alloca i32, align 4
%m2 = alloca i32, align 4
%s2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2)
%0 = load i32, ptr %s2, align 4, !tbaa !5
%1 = load i32, ptr %s1, align 4, !tbaa !5
%add = sub i32 %0, %1
%2 = load i32, ptr %h2, align 4, !tbaa !5
%3 = load i32, ptr %h1, align 4, !tbaa !5
%reass.add27 = sub i32 %2, %3
%reass.mul28 = mul i32 %reass.add27, 3600
%add3 = add i32 %add, %reass.mul28
%4 = load i32, ptr %m2, align 4, !tbaa !5
%5 = load i32, ptr %m1, align 4, !tbaa !5
%reass.add = sub i32 %4, %5
%reass.mul = mul i32 %reass.add, 60
%sub = add i32 %add3, %reass.mul
%div = sdiv i32 %sub, 3600
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div)
%rem = srem i32 %sub, 3600
%putchar.1 = call i32 @putchar(i32 32)
%div.1.lhs.trunc = trunc i32 %rem to i16
%div.139 = sdiv i16 %div.1.lhs.trunc, 60
%div.1.sext = sext i16 %div.139 to i32
%call12.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div.1.sext)
%rem.1.lhs.trunc = trunc i32 %rem to i16
%rem.140 = srem i16 %rem.1.lhs.trunc, 60
%rem.1.sext = sext i16 %rem.140 to i32
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %rem.1.sext)
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1)
%call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2)
%6 = load i32, ptr %s2, align 4, !tbaa !5
%7 = load i32, ptr %s1, align 4, !tbaa !5
%add.1 = sub i32 %6, %7
%8 = load i32, ptr %h2, align 4, !tbaa !5
%9 = load i32, ptr %h1, align 4, !tbaa !5
%reass.add27.1 = sub i32 %8, %9
%reass.mul28.1 = mul i32 %reass.add27.1, 3600
%add3.1 = add i32 %add.1, %reass.mul28.1
%10 = load i32, ptr %m2, align 4, !tbaa !5
%11 = load i32, ptr %m1, align 4, !tbaa !5
%reass.add.1 = sub i32 %10, %11
%reass.mul.1 = mul i32 %reass.add.1, 60
%sub.1 = add i32 %add3.1, %reass.mul.1
%div.135 = sdiv i32 %sub.1, 3600
%call12.136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div.135)
%rem.137 = srem i32 %sub.1, 3600
%putchar.1.1 = call i32 @putchar(i32 32)
%div.1.1.lhs.trunc = trunc i32 %rem.137 to i16
%div.1.141 = sdiv i16 %div.1.1.lhs.trunc, 60
%div.1.1.sext = sext i16 %div.1.141 to i32
%call12.1.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div.1.1.sext)
%rem.1.1.lhs.trunc = trunc i32 %rem.137 to i16
%rem.1.142 = srem i16 %rem.1.1.lhs.trunc, 60
%rem.1.1.sext = sext i16 %rem.1.142 to i32
%call15.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %rem.1.1.sext)
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1)
%call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2)
%12 = load i32, ptr %s2, align 4, !tbaa !5
%13 = load i32, ptr %s1, align 4, !tbaa !5
%add.2 = sub i32 %12, %13
%14 = load i32, ptr %h2, align 4, !tbaa !5
%15 = load i32, ptr %h1, align 4, !tbaa !5
%reass.add27.2 = sub i32 %14, %15
%reass.mul28.2 = mul i32 %reass.add27.2, 3600
%add3.2 = add i32 %add.2, %reass.mul28.2
%16 = load i32, ptr %m2, align 4, !tbaa !5
%17 = load i32, ptr %m1, align 4, !tbaa !5
%reass.add.2 = sub i32 %16, %17
%reass.mul.2 = mul i32 %reass.add.2, 60
%sub.2 = add i32 %add3.2, %reass.mul.2
%div.2 = sdiv i32 %sub.2, 3600
%call12.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div.2)
%putchar.1.2 = call i32 @putchar(i32 32)
%rem.2 = srem i32 %sub.2, 3600
%div.1.2.lhs.trunc = trunc i32 %rem.2 to i16
%div.1.243 = sdiv i16 %div.1.2.lhs.trunc, 60
%div.1.2.sext = sext i16 %div.1.243 to i32
%call12.1.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div.1.2.sext)
%rem.1.2.lhs.trunc = trunc i32 %rem.2 to i16
%rem.1.244 = srem i16 %rem.1.2.lhs.trunc, 60
%rem.1.2.sext = sext i16 %rem.1.244 to i32
%call15.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %rem.1.2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int h1[3],m1[3],s1[3];
int h2[3],m2[3],s2[3];
int h[3],m[3],s[3];
int i;
for(i=0;i<3;i++){
scanf("%d%d%d%d%d%d",&h1[i],&m1[i],&s1[i],&h2[i],&m2[i],&s2[i]);
}
for(i=0;i<3;i++){
int x[3];
int y[3];
y[i]=h2[i]*3600+m2[i]*60+s2[i];
x[i]=h1[i]*3600+m1[i]*60+s1[i];
int z[3];
z[i]=y[i]-x[i];
h[i]=z[i]/3600;
z[i] -= h[i]*3600;
m[i] = z[i]/60;
z[i] -= m[i]*60;
s[i] = z[i];
printf("%d %d %d\n",h[i],m[i],s[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261219/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261219/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h1 = alloca [3 x i32], align 4
%m1 = alloca [3 x i32], align 4
%s1 = alloca [3 x i32], align 4
%h2 = alloca [3 x i32], align 4
%m2 = alloca [3 x i32], align 4
%s2 = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %h1) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %m1) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s1) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %h2) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %m2) #3
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s2) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %m1, ptr noundef nonnull %s1, ptr noundef nonnull %h2, ptr noundef nonnull %m2, ptr noundef nonnull %s2)
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %h1, i64 0, i64 1
%arrayidx2.1 = getelementptr inbounds [3 x i32], ptr %m1, i64 0, i64 1
%arrayidx4.1 = getelementptr inbounds [3 x i32], ptr %s1, i64 0, i64 1
%arrayidx6.1 = getelementptr inbounds [3 x i32], ptr %h2, i64 0, i64 1
%arrayidx8.1 = getelementptr inbounds [3 x i32], ptr %m2, i64 0, i64 1
%arrayidx10.1 = getelementptr inbounds [3 x i32], ptr %s2, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx2.1, ptr noundef nonnull %arrayidx4.1, ptr noundef nonnull %arrayidx6.1, ptr noundef nonnull %arrayidx8.1, ptr noundef nonnull %arrayidx10.1)
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %h1, i64 0, i64 2
%arrayidx2.2 = getelementptr inbounds [3 x i32], ptr %m1, i64 0, i64 2
%arrayidx4.2 = getelementptr inbounds [3 x i32], ptr %s1, i64 0, i64 2
%arrayidx6.2 = getelementptr inbounds [3 x i32], ptr %h2, i64 0, i64 2
%arrayidx8.2 = getelementptr inbounds [3 x i32], ptr %m2, i64 0, i64 2
%arrayidx10.2 = getelementptr inbounds [3 x i32], ptr %s2, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx2.2, ptr noundef nonnull %arrayidx4.2, ptr noundef nonnull %arrayidx6.2, ptr noundef nonnull %arrayidx8.2, ptr noundef nonnull %arrayidx10.2)
%0 = load i32, ptr %h2, align 4, !tbaa !5
%1 = load i32, ptr %m2, align 4, !tbaa !5
%2 = load i32, ptr %s2, align 4, !tbaa !5
%3 = load i32, ptr %h1, align 4, !tbaa !5
%4 = load i32, ptr %m1, align 4, !tbaa !5
%5 = load i32, ptr %s1, align 4, !tbaa !5
%reass.add = sub i32 %1, %4
%reass.mul = mul i32 %reass.add, 60
%reass.add111 = sub i32 %0, %3
%reass.mul112 = mul i32 %reass.add111, 3600
%add = sub i32 %2, %5
%add21 = add i32 %add, %reass.mul112
%sub = add i32 %add21, %reass.mul
%div = sdiv i32 %sub, 3600
%mul48.neg = mul nsw i32 %div, -3600
%sub51 = add i32 %mul48.neg, %sub
%div54 = sdiv i32 %sub51, 60
%mul59.neg = mul nsw i32 %div54, -60
%sub62 = add i32 %mul59.neg, %sub51
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div54, i32 noundef %sub62)
%6 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx4.1, align 4, !tbaa !5
%reass.add.1 = sub i32 %7, %10
%reass.mul.1 = mul i32 %reass.add.1, 60
%reass.add111.1 = sub i32 %6, %9
%reass.mul112.1 = mul i32 %reass.add111.1, 3600
%add.1 = sub i32 %8, %11
%add21.1 = add i32 %add.1, %reass.mul112.1
%sub.1 = add i32 %add21.1, %reass.mul.1
%div.1 = sdiv i32 %sub.1, 3600
%mul48.neg.1 = mul nsw i32 %div.1, -3600
%sub51.1 = add i32 %mul48.neg.1, %sub.1
%div54.1 = sdiv i32 %sub51.1, 60
%mul59.neg.1 = mul nsw i32 %div54.1, -60
%sub62.1 = add i32 %mul59.neg.1, %sub51.1
%call73.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.1, i32 noundef %div54.1, i32 noundef %sub62.1)
%12 = load i32, ptr %arrayidx6.2, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx8.2, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%15 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%reass.add.2 = sub i32 %13, %16
%reass.mul.2 = mul i32 %reass.add.2, 60
%reass.add111.2 = sub i32 %12, %15
%reass.mul112.2 = mul i32 %reass.add111.2, 3600
%add.2 = sub i32 %14, %17
%add21.2 = add i32 %add.2, %reass.mul112.2
%sub.2 = add i32 %add21.2, %reass.mul.2
%div.2 = sdiv i32 %sub.2, 3600
%mul48.neg.2 = mul nsw i32 %div.2, -3600
%sub51.2 = add i32 %mul48.neg.2, %sub.2
%div54.2 = sdiv i32 %sub51.2, 60
%mul59.neg.2 = mul nsw i32 %div54.2, -60
%sub62.2 = add i32 %mul59.neg.2, %sub51.2
%call73.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.2, i32 noundef %div54.2, i32 noundef %sub62.2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s2) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %m2) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %h2) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s1) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %m1) #3
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %h1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
int max=999999999;
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(abs(a+b-(c+d))<=max){max=abs(a+b-(c+d));}
if(abs(a+c-(b+d))<=max){max=abs(a+c-(b+d));}
if(abs(a+d-(c+b))<=max){max=abs(a+d-(c+b));}
if(abs(c+b-(a+d))<=max){max=abs(c+b-(a+d));}
printf("%d\n",max);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261262/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261262/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%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
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%add1.neg = add i32 %1, %0
%4 = add i32 %2, %3
%sub = sub i32 %add1.neg, %4
%5 = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%6 = add i32 %0, %2
%7 = add i32 %1, %3
%sub7 = sub i32 %6, %7
%8 = call i32 @llvm.abs.i32(i32 %sub7, i1 true)
%spec.select = call i32 @llvm.umin.i32(i32 %5, i32 %8)
%add14 = add nsw i32 %3, %0
%add15 = add nsw i32 %2, %1
%sub16 = sub nsw i32 %add14, %add15
%9 = call i32 @llvm.abs.i32(i32 %sub16, i1 true)
%max.1 = call i32 @llvm.umin.i32(i32 %spec.select, i32 %9)
%sub25 = sub nsw i32 %add15, %add14
%10 = call i32 @llvm.abs.i32(i32 %sub25, i1 true)
%max.2 = call i32 @llvm.umin.i32(i32 %max.1, i32 %10)
%max.3 = call i32 @llvm.umin.i32(i32 %max.2, i32 999999999)
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
typedef struct {
long value;
long type;
} S_DATA;
int cmpAscVal(const void * n1, const void * n2)
{
if (((S_DATA *)n1)->value > ((S_DATA *)n2)->value)
{
return 1;
}
else if (((S_DATA *)n1)->value < ((S_DATA *)n2)->value)
{
return -1;
}
else
{
return 0;
}
}
int main(void) {
long n;
scanf("%ld", &n);
long a[n];
S_DATA pair_count[n*2];
for (long i = 0; i < n; i++) {
scanf("%ld", &a[i]);
pair_count[i].value = i+1+a[i];
pair_count[i].type = 0;
pair_count[i+n].value = i+1-a[i];
pair_count[i+n].type = 1;
}
qsort(pair_count, n*2, sizeof(S_DATA), cmpAscVal);
long count0 = 0;
long count1 = 0;
long pairs = 0;
for (long i = 0; i < n*2; i++) {
if (i != 0 && pair_count[i].value != pair_count[i-1].value) {
pairs += count0*count1;
count0 = 0;
count1 = 0;
}
if (pair_count[i].type == 0) {
count0++;
} else {
count1++;
}
}
pairs += count0*count1;
printf("%ld\n", pairs);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261305/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261305/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.S_DATA = type { i64, i64 }
@.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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmpAscVal(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 {
entry:
%0 = load i64, ptr %n1, align 8, !tbaa !5
%1 = load i64, ptr %n2, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
%cmp4 = icmp slt i64 %0, %1
%. = sext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !10
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !10
%mul = shl nsw i64 %2, 1
%vla1 = alloca %struct.S_DATA, i64 %mul, align 16
%cmp65 = icmp sgt i64 %2, 0
br i1 %cmp65, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%.pre = shl nsw i64 %6, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%mul15.pre-phi = phi i64 [ %.pre, %for.cond.cleanup.loopexit ], [ %mul, %entry ]
call void @qsort(ptr noundef nonnull %vla1, i64 noundef %mul15.pre-phi, i64 noundef 16, ptr noundef nonnull @cmpAscVal) #7
%3 = load i64, ptr %n, align 8, !tbaa !10
%cmp1967 = icmp sgt i64 %3, 0
br i1 %cmp1967, label %if.end.peel, label %for.cond.cleanup20
if.end.peel: ; preds = %for.cond.cleanup
%mul18 = shl nuw i64 %3, 1
%smax = call i64 @llvm.smax.i64(i64 %mul18, i64 1)
%type32.peel = getelementptr inbounds %struct.S_DATA, ptr %vla1, i64 0, i32 1
%4 = load i64, ptr %type32.peel, align 8, !tbaa !11
%cmp33.peel = icmp eq i64 %4, 0
%inc35.peel = zext i1 %cmp33.peel to i64
%not.cmp33.peel = xor i1 %cmp33.peel, true
%inc36.peel = zext i1 %not.cmp33.peel to i64
%exitcond.peel.not = icmp eq i64 %smax, 1
br i1 %exitcond.peel.not, label %for.cond.cleanup20.loopexit, label %land.lhs.true
for.body: ; preds = %entry, %for.body
%i.066 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.066
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%add = add nuw nsw i64 %i.066, 1
%5 = load i64, ptr %arrayidx, align 8, !tbaa !10
%add4 = add nsw i64 %5, %add
%arrayidx5 = getelementptr inbounds %struct.S_DATA, ptr %vla1, i64 %i.066
store i64 %add4, ptr %arrayidx5, align 16, !tbaa !5
%type = getelementptr inbounds %struct.S_DATA, ptr %vla1, i64 %i.066, i32 1
store i64 0, ptr %type, align 8, !tbaa !11
%sub = sub nsw i64 %add, %5
%6 = load i64, ptr %n, align 8, !tbaa !10
%arrayidx10 = getelementptr %struct.S_DATA, ptr %arrayidx5, i64 %6
store i64 %sub, ptr %arrayidx10, align 16, !tbaa !5
%type14 = getelementptr %struct.S_DATA, ptr %arrayidx5, i64 %6, i32 1
store i64 1, ptr %type14, align 8, !tbaa !11
%cmp = icmp slt i64 %add, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !12
for.cond.cleanup20.loopexit: ; preds = %land.lhs.true, %if.end.peel
%pairs.1.lcssa = phi i64 [ 0, %if.end.peel ], [ %pairs.1, %land.lhs.true ]
%count0.2.lcssa = phi i64 [ %inc35.peel, %if.end.peel ], [ %count0.2, %land.lhs.true ]
%count1.2.lcssa = phi i64 [ %inc36.peel, %if.end.peel ], [ %count1.2, %land.lhs.true ]
%7 = mul nsw i64 %count1.2.lcssa, %count0.2.lcssa
%8 = add nsw i64 %pairs.1.lcssa, %7
br label %for.cond.cleanup20
for.cond.cleanup20: ; preds = %for.cond.cleanup20.loopexit, %for.cond.cleanup
%add42 = phi i64 [ 0, %for.cond.cleanup ], [ %8, %for.cond.cleanup20.loopexit ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add42)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7
ret i32 0
land.lhs.true: ; preds = %if.end.peel, %land.lhs.true
%i16.071 = phi i64 [ %inc39, %land.lhs.true ], [ 1, %if.end.peel ]
%pairs.070 = phi i64 [ %pairs.1, %land.lhs.true ], [ 0, %if.end.peel ]
%count1.069 = phi i64 [ %count1.2, %land.lhs.true ], [ %inc36.peel, %if.end.peel ]
%count0.068 = phi i64 [ %count0.2, %land.lhs.true ], [ %inc35.peel, %if.end.peel ]
%arrayidx23 = getelementptr inbounds %struct.S_DATA, ptr %vla1, i64 %i16.071
%9 = load i64, ptr %arrayidx23, align 16, !tbaa !5
%arrayidx26 = getelementptr %struct.S_DATA, ptr %arrayidx23, i64 -1
%10 = load i64, ptr %arrayidx26, align 16, !tbaa !5
%cmp28.not = icmp eq i64 %9, %10
%mul29 = mul nsw i64 %count1.069, %count0.068
%count0.1 = select i1 %cmp28.not, i64 %count0.068, i64 0
%count1.1 = select i1 %cmp28.not, i64 %count1.069, i64 0
%add30 = select i1 %cmp28.not, i64 0, i64 %mul29
%pairs.1 = add nsw i64 %pairs.070, %add30
%type32 = getelementptr inbounds %struct.S_DATA, ptr %vla1, i64 %i16.071, i32 1
%11 = load i64, ptr %type32, align 8, !tbaa !11
%cmp33 = icmp eq i64 %11, 0
%inc35 = zext i1 %cmp33 to i64
%count0.2 = add nsw i64 %count0.1, %inc35
%not.cmp33 = xor i1 %cmp33, true
%inc36 = zext i1 %not.cmp33 to i64
%count1.2 = add nsw i64 %count1.1, %inc36
%inc39 = add nuw nsw i64 %i16.071, 1
%exitcond.not = icmp eq i64 %mul18, %inc39
br i1 %exitcond.not, label %for.cond.cleanup20.loopexit, label %land.lhs.true, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!6, !7, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13, !15}
!15 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
int main()
{
int i, N, l, r, sum = 0;
scanf("%d", &N);
for (i = 1; i <= N; i++) {
scanf("%d %d", &l, &r);
sum += r - l + 1;
}
printf("%d\n", sum);
fflush(stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not7 = icmp slt i32 %0, 1
br i1 %cmp.not7, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%sum.09 = phi i32 [ %add2, %for.body ], [ 0, %entry ]
%i.08 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %r, align 4, !tbaa !5
%2 = load i32, ptr %l, align 4, !tbaa !5
%sub = add i32 %sum.09, 1
%add = add i32 %sub, %1
%add2 = sub i32 %add, %2
%inc = add nuw nsw i32 %i.08, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.08, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
%4 = load ptr, ptr @stdout, align 8, !tbaa !11
%call4 = call i32 @fflush(ptr noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
|
#include<stdio.h>
int main()
{
int n,i=1,j=0;
scanf("%d",&n);
while(n!=0)
{
i=1;
while(i<=n)
{
i=i*2;
}
n=n-i/2;;
j++;
}
printf("%d",j);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2614/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2614/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp.not10 = icmp eq i32 %.pr, 0
br i1 %cmp.not10, label %while.end4, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %while.end
%j.011 = phi i32 [ %inc, %while.end ], [ 0, %entry ]
%0 = phi i32 [ %sub, %while.end ], [ %.pr, %entry ]
br label %while.cond1
while.cond1: ; preds = %while.cond1, %while.cond1.preheader
%i.0 = phi i32 [ %mul, %while.cond1 ], [ 1, %while.cond1.preheader ]
%cmp2.not = icmp sgt i32 %i.0, %0
%mul = shl nsw i32 %i.0, 1
br i1 %cmp2.not, label %while.end, label %while.cond1, !llvm.loop !9
while.end: ; preds = %while.cond1
%div9 = lshr i32 %i.0, 1
%sub = sub nsw i32 %0, %div9
%inc = add nuw nsw i32 %j.011, 1
%cmp.not = icmp eq i32 %sub, 0
br i1 %cmp.not, label %while.cond.while.end4_crit_edge, label %while.cond1.preheader, !llvm.loop !11
while.cond.while.end4_crit_edge: ; preds = %while.end
store i32 0, ptr %n, align 4, !tbaa !5
br label %while.end4
while.end4: ; preds = %while.cond.while.end4_crit_edge, %entry
%j.0.lcssa = phi i32 [ %inc, %while.cond.while.end4_crit_edge ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %j.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
int main(){
int n,soma=0,a,b;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%d %d",&a,&b);
soma=soma+(b-a);
}
soma+=n;
printf("%d\n",soma);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261442/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261442/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%soma.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%add2 = add nsw i32 %.lcssa, %soma.0.lcssa
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%soma.08 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
%sub = add i32 %1, %soma.08
%add = sub i32 %sub, %2
%inc = add nuw nsw i32 %i.09, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
# include <stdio.h>
int main(){
int n;
int num = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++){
int l, r;
scanf("%d %d",&l, &r);
num += r - l + 1;
}
printf("%d\n",num);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261493/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261493/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%num.0.lcssa = phi i32 [ 0, %entry ], [ %add2, %for.body ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %num.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.08 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%num.07 = phi i32 [ %add2, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r)
%1 = load i32, ptr %r, align 4, !tbaa !5
%2 = load i32, ptr %l, align 4, !tbaa !5
%sub = add i32 %num.07, 1
%add = add i32 %sub, %1
%add2 = sub i32 %add, %2
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
%inc = add nuw nsw i32 %i.08, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %3
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define 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))
const int mod=(int)1e09+7;
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
double din(void){
double i;scanf("%lf",&i);
return i;
}
void chin(char s[]){
scanf("%s",s);
}
void print(int a){
printf("%d\n",a);
}
void llprint(long long a){
printf("%lld\n",a);
}
void dprint(double a){
printf("%.10f\n",a);
}
void print2(int a,int b){
printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
return a>b?a:b;
}
long long min(long long a,long long b){
return a<b?a:b;
}
long long llabs(long long a){
return a>0?a:-a;
}
double dmax(double a,double b){
return a>b?a:b;
}
int cmp(const void *a,const void *b){
return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
int main(void){
int n=in(),i,l,r,ans=0;
rep(i,n){
l=in();
r=in();
ans+=r-l+1;
}
print(ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261536/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261536/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #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 nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llabs(i64 noundef %a) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #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 #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #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 #8 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i.i8 = alloca i32, align 4
%i.i6 = alloca i32, align 4
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #10
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #10
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%ans.013 = phi i32 [ %add3, %for.body ], [ 0, %entry ]
%i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i6) #10
%call.i7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i6)
%1 = load i32, ptr %i.i6, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i6) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i8) #10
%call.i9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i8)
%2 = load i32, ptr %i.i8, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i8) #10
%sub = add i32 %ans.013, 1
%add = sub i32 %sub, %1
%add3 = add i32 %add, %2
%inc = add nuw nsw i32 %i.012, 1
%exitcond.not = icmp eq i32 %inc, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %add3, %for.body ]
%call.i10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %ans.0.lcssa)
ret i32 0
}
; 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 i64 @llvm.abs.i64(i64, i1 immarg) #9
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { 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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int i;
int N;
int l[1001],r[1001];
int sum=0;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d %d",&l[i],&r[i]);
sum+=(r[i]-l[i]+1);
}
printf("%d\n",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261600/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261600/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%l = alloca [1001 x i32], align 16
%r = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.018 = phi i32 [ %add8, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %l, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1001 x i32], ptr %r, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub = add i32 %sum.018, 1
%add = add i32 %sub, %1
%add8 = sub i32 %add, %2
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add8, %for.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %l) #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"}
|
#include <stdio.h>
int main() {
int i,j;
char Masu[4][4];
for( i=0; i<3; i++ ){
for( j=0; j<3; j++ ){
if( i != 0 && j == 0 ){
scanf("%*c%c", &Masu[i][j]);
} else {
scanf("%c", &Masu[i][j]);
}
}
}
printf( "%c%c%c\n", Masu[0][0],Masu[1][1],Masu[2][2] );
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261644/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261644/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%*c%c\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\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 {
for.inc13.2:
%Masu = alloca [4 x [4 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %Masu) #3
%call12.us = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %Masu)
%arrayidx11.us.1 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 0, i64 1
%call12.us.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11.us.1)
%arrayidx11.us.2 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 0, i64 2
%call12.us.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11.us.2)
%arrayidx.1 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 1
%call.142 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx11.1.1 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 1, i64 1
%call12.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11.1.1)
%arrayidx11.2.1 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 1, i64 2
%call12.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11.2.1)
%arrayidx.2 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 2
%call.250 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx11.1.2 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 2, i64 1
%call12.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11.1.2)
%arrayidx11.2.2 = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 2, i64 2
%call12.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11.2.2)
%.pre.pre = load i8, ptr %Masu, align 16, !tbaa !5
%arrayidx19.phi.trans.insert.phi.trans.insert = getelementptr inbounds [4 x [4 x i8]], ptr %Masu, i64 0, i64 1, i64 1
%.pre55.pre = load i8, ptr %arrayidx19.phi.trans.insert.phi.trans.insert, align 1, !tbaa !5
%.pre56.pre = load i8, ptr %arrayidx11.2.2, align 2, !tbaa !5
%conv = sext i8 %.pre.pre to i32
%conv20 = sext i8 %.pre55.pre to i32
%conv23 = sext i8 %.pre56.pre to i32
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %conv20, i32 noundef %conv23)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %Masu) #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 str1[8],str2[8],str3[8];
fgets(str1,sizeof(str1),stdin);
fgets(str2,sizeof(str2),stdin);
fgets(str3,sizeof(str3),stdin);
printf("%c%c%c",str1[0],str2[1],str3[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261688/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261688/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [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:
%str1 = alloca [8 x i8], align 1
%str2 = alloca [8 x i8], align 1
%str3 = alloca [8 x i8], align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %str1) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %str2) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %str3) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str1, i32 noundef 8, ptr noundef %0)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = call ptr @fgets(ptr noundef nonnull %str2, i32 noundef 8, ptr noundef %1)
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call4 = call ptr @fgets(ptr noundef nonnull %str3, i32 noundef 8, ptr noundef %2)
%3 = load i8, ptr %str1, align 1, !tbaa !9
%conv = sext i8 %3 to i32
%arrayidx5 = getelementptr inbounds [8 x i8], ptr %str2, i64 0, i64 1
%4 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%conv6 = sext i8 %4 to i32
%arrayidx7 = getelementptr inbounds [8 x i8], ptr %str3, i64 0, i64 2
%5 = load i8, ptr %arrayidx7, align 1, !tbaa !9
%conv8 = sext i8 %5 to i32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv, i32 noundef %conv6, i32 noundef %conv8)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %str3) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %str2) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %str1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <stdio.h>
int main(void){
char a[4];
char b[4];
char c[4];
scanf("%s",&a);
scanf("%s",&b);
scanf("%s",&c);
printf("%c%c%c\n",a[0],b[1],c[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261730/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261730/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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 [4 x i8], align 1
%b = alloca [4 x i8], align 1
%c = alloca [4 x 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 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i8, ptr %a, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%arrayidx3 = getelementptr inbounds [4 x i8], ptr %b, i64 0, i64 1
%1 = load i8, ptr %arrayidx3, align 1, !tbaa !5
%conv4 = sext i8 %1 to i32
%arrayidx5 = getelementptr inbounds [4 x i8], ptr %c, i64 0, i64 2
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%conv6 = sext i8 %2 to i32
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv4, i32 noundef %conv6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
char str1[3], str2[3], str3[3];
scanf("%s", str1);
scanf("%s", str2);
scanf("%s", str3);
printf("%c%c%c", str1[0], str2[1], str3[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%str1 = alloca [3 x i8], align 1
%str2 = alloca [3 x i8], align 1
%str3 = alloca [3 x i8], align 1
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %str1) #3
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %str2) #3
call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %str3) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str1)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str2)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str3)
%0 = load i8, ptr %str1, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%arrayidx5 = getelementptr inbounds [3 x i8], ptr %str2, i64 0, i64 1
%1 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%conv6 = sext i8 %1 to i32
%arrayidx7 = getelementptr inbounds [3 x i8], ptr %str3, i64 0, i64 2
%2 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%conv8 = sext i8 %2 to i32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv6, i32 noundef %conv8)
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %str3) #3
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %str2) #3
call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %str1) #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 moji[4][4];
int i,j;
for(i=0;i<3;i++){
scanf("%s", moji[i]);
}
putchar(moji[0][0]);
putchar(moji[1][1]);
putchar(moji[2][2]);
puts("");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%moji = alloca [4 x [4 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %moji) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %moji)
%arrayidx.1 = getelementptr inbounds [4 x [4 x i8]], ptr %moji, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [4 x [4 x i8]], ptr %moji, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%0 = load i8, ptr %moji, align 16, !tbaa !5
%conv = sext i8 %0 to i32
%1 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i = call noundef i32 @putc(i32 noundef %conv, ptr noundef %1)
%arrayidx5 = getelementptr inbounds [4 x [4 x i8]], ptr %moji, i64 0, i64 1, i64 1
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%conv6 = sext i8 %2 to i32
%3 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i15 = call noundef i32 @putc(i32 noundef %conv6, ptr noundef %3)
%arrayidx9 = getelementptr inbounds [4 x [4 x i8]], ptr %moji, i64 0, i64 2, i64 2
%4 = load i8, ptr %arrayidx9, align 2, !tbaa !5
%conv10 = sext i8 %4 to i32
%5 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i16 = call noundef i32 @putc(i32 noundef %conv10, ptr noundef %5)
%6 = load ptr, ptr @stdout, align 8, !tbaa !8
%call.i17 = call noundef i32 @putc(i32 noundef 10, ptr noundef %6)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %moji) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
|
#include<stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
int main()
{
int N;
int i;
char s[3][3]={};
// int k=0;
for(i=0;i<3;i++){
scanf("%s", &s[i]);
// printf("%s\n", s[i]);
}
// printf("%s%s%s\n",s[0][0],s[1][1],s[2][2]);
printf("%c%c%c\n",s[0][0],s[1][1],s[2][2]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%c%c%c\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) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%s = alloca [3 x [3 x i8]], align 1
call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %s) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(9) %s, i8 0, i64 9, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx.1 = getelementptr inbounds [3 x [3 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 [3 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 1, !tbaa !9
%conv = sext i8 %0 to i32
%arrayidx4 = getelementptr inbounds [3 x [3 x i8]], ptr %s, i64 0, i64 1, i64 1
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !9
%conv5 = sext i8 %1 to i32
%arrayidx7 = getelementptr inbounds [3 x [3 x i8]], ptr %s, i64 0, i64 2, i64 2
%2 = load i8, ptr %arrayidx7, align 1, !tbaa !9
%conv8 = sext i8 %2 to i32
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv5, i32 noundef %conv8)
call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
#define M 1000000000
int MIN(int a,int b){return a<b?a:b;}
int zMIN(int a,int b){return a*b?MIN(a,b):a+b;}
int main(){
int n,m,i,j,a,b,v,min;
while(scanf("%d %d",&n,&m),n||m){
int d[110][110]={0};
while(m--){
scanf("%d",&a);
if(a){
scanf("%d %d %d",&a,&b,&v);
d[a][b]=d[b][a]=zMIN(v,d[a][b]);
}
else{
scanf("%d %d",&a,&b);
int f[110]={0};
int c[110]={0};
for(j=0;j<n;j++){
for(i=f[a]=1;i<=n;i++){
if(d[a][i])c[i]=zMIN(c[i],c[a]+d[a][i]);
}
min=M;
for(i=1;i<=n;i++){
if(f[i]==0&&c[i]&&min>c[i])min=c[a=i];
}
}
//for(i=0;i<n;i++)printf("%d ",c[i+1]);printf("\n");
if(c[b])printf("%d\n",c[b]);
else printf("-1\n");
}
/*for(i=0;i<n;i++){
for(j=0;j<n;j++)printf("%d ",d[i+1][j+1]);
printf("\n");
}//*/
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @MIN(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zMIN(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%mul = mul nsw i32 %b, %a
%tobool.not = icmp eq i32 %mul, 0
%cond.i = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%add = add nsw i32 %b, %a
%cond = select i1 %tobool.not, i32 %add, i32 %cond.i
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%v = alloca i32, align 4
%d = alloca [110 x [110 x i32]], align 16
%f = alloca [110 x i32], align 16
%c = alloca [110 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #7
%call110 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool111 = icmp ne i32 %0, 0
%1 = load i32, ptr %m, align 4
%tobool1112 = icmp ne i32 %1, 0
%2 = select i1 %tobool111, i1 true, i1 %tobool1112
br i1 %2, label %while.body, label %while.end76
while.body: ; preds = %entry, %while.end
%3 = phi i32 [ %29, %while.end ], [ %1, %entry ]
call void @llvm.lifetime.start.p0(i64 48400, ptr nonnull %d) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48400) %d, i8 0, i64 48400, i1 false)
%dec108 = add nsw i32 %3, -1
store i32 %dec108, ptr %m, align 4, !tbaa !5
%tobool3.not109 = icmp eq i32 %3, 0
br i1 %tobool3.not109, label %while.end, label %while.body4
while.body4: ; preds = %while.body, %if.end75
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%4 = load i32, ptr %a, align 4, !tbaa !5
%tobool6.not = icmp eq i32 %4, 0
br i1 %tobool6.not, label %if.else, label %if.then
if.then: ; preds = %while.body4
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %v)
%5 = load i32, ptr %v, align 4, !tbaa !5
%6 = load i32, ptr %a, align 4, !tbaa !5
%idxprom = sext i32 %6 to i64
%7 = load i32, ptr %b, align 4, !tbaa !5
%idxprom8 = sext i32 %7 to i64
%arrayidx9 = getelementptr inbounds [110 x [110 x i32]], ptr %d, i64 0, i64 %idxprom, i64 %idxprom8
%8 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%mul.i = mul nsw i32 %8, %5
%tobool.not.i = icmp eq i32 %mul.i, 0
%cond.i.i = call i32 @llvm.smin.i32(i32 %5, i32 %8)
%add.i = add nsw i32 %8, %5
%cond.i = select i1 %tobool.not.i, i32 %add.i, i32 %cond.i.i
%arrayidx14 = getelementptr inbounds [110 x [110 x i32]], ptr %d, i64 0, i64 %idxprom8, i64 %idxprom
store i32 %cond.i, ptr %arrayidx14, align 4, !tbaa !5
store i32 %cond.i, ptr %arrayidx9, align 4, !tbaa !5
br label %if.end75
if.else: ; preds = %while.body4
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %f) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) %f, i8 0, i64 440, i1 false)
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %c) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) %c, i8 0, i64 440, i1 false)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp105 = icmp sgt i32 %9, 0
br i1 %cmp105, label %for.body.preheader, label %for.end64
for.body.preheader: ; preds = %if.else
%a.promoted = load i32, ptr %a, align 4, !tbaa !5
%10 = add i32 %9, 1
%wide.trip.count = zext i32 %10 to i64
%11 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %11, 1
%12 = icmp eq i32 %10, 2
%unroll_iter = and i64 %11, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc62
%j.0107 = phi i32 [ %inc63, %for.inc62 ], [ 0, %for.body.preheader ]
%i.199104106 = phi i32 [ %i.199101.lcssa, %for.inc62 ], [ %a.promoted, %for.body.preheader ]
%idxprom20 = sext i32 %i.199104106 to i64
%arrayidx21 = getelementptr inbounds [110 x i32], ptr %f, i64 0, i64 %idxprom20
store i32 1, ptr %arrayidx21, align 4, !tbaa !5
%arrayidx34 = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %idxprom20
br label %for.body24
for.body24: ; preds = %for.body, %for.inc
%indvars.iv = phi i64 [ 1, %for.body ], [ %indvars.iv.next, %for.inc ]
%arrayidx28 = getelementptr inbounds [110 x [110 x i32]], ptr %d, i64 0, i64 %idxprom20, i64 %indvars.iv
%13 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%tobool29.not = icmp eq i32 %13, 0
br i1 %tobool29.not, label %for.inc, label %if.then30
if.then30: ; preds = %for.body24
%arrayidx32 = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %indvars.iv
%14 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%15 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%add = add nsw i32 %15, %13
%mul.i91 = mul nsw i32 %add, %14
%tobool.not.i92 = icmp eq i32 %mul.i91, 0
%cond.i.i93 = call i32 @llvm.smin.i32(i32 %14, i32 %add)
%add.i94 = add nsw i32 %add, %14
%cond.i95 = select i1 %tobool.not.i92, i32 %add.i94, i32 %cond.i.i93
store i32 %cond.i95, ptr %arrayidx32, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body24, %if.then30
%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.body44.preheader, label %for.body24, !llvm.loop !9
for.body44.preheader: ; preds = %for.inc
br i1 %12, label %for.inc62.unr-lcssa, label %for.body44
for.body44: ; preds = %for.body44.preheader, %for.inc59.1
%indvars.iv115 = phi i64 [ %indvars.iv.next116.1, %for.inc59.1 ], [ 1, %for.body44.preheader ]
%i.199102 = phi i32 [ %i.199101.1, %for.inc59.1 ], [ %i.199104106, %for.body44.preheader ]
%min.0100 = phi i32 [ %min.1.1, %for.inc59.1 ], [ 1000000000, %for.body44.preheader ]
%niter = phi i64 [ %niter.next.1, %for.inc59.1 ], [ 0, %for.body44.preheader ]
%arrayidx46 = getelementptr inbounds [110 x i32], ptr %f, i64 0, i64 %indvars.iv115
%16 = load i32, ptr %arrayidx46, align 4, !tbaa !5
%cmp47 = icmp eq i32 %16, 0
br i1 %cmp47, label %land.lhs.true, label %for.inc59
land.lhs.true: ; preds = %for.body44
%arrayidx49 = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %indvars.iv115
%17 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%tobool50.not = icmp ne i32 %17, 0
%cmp54 = icmp sgt i32 %min.0100, %17
%or.cond = select i1 %tobool50.not, i1 %cmp54, i1 false
br i1 %or.cond, label %if.then55, label %for.inc59
if.then55: ; preds = %land.lhs.true
%18 = trunc i64 %indvars.iv115 to i32
store i32 %18, ptr %a, align 4, !tbaa !5
br label %for.inc59
for.inc59: ; preds = %for.body44, %land.lhs.true, %if.then55
%i.199101 = phi i32 [ %18, %if.then55 ], [ %i.199102, %land.lhs.true ], [ %i.199102, %for.body44 ]
%min.1 = phi i32 [ %17, %if.then55 ], [ %min.0100, %land.lhs.true ], [ %min.0100, %for.body44 ]
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%arrayidx46.1 = getelementptr inbounds [110 x i32], ptr %f, i64 0, i64 %indvars.iv.next116
%19 = load i32, ptr %arrayidx46.1, align 4, !tbaa !5
%cmp47.1 = icmp eq i32 %19, 0
br i1 %cmp47.1, label %land.lhs.true.1, label %for.inc59.1
land.lhs.true.1: ; preds = %for.inc59
%arrayidx49.1 = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %indvars.iv.next116
%20 = load i32, ptr %arrayidx49.1, align 4, !tbaa !5
%tobool50.not.1 = icmp ne i32 %20, 0
%cmp54.1 = icmp sgt i32 %min.1, %20
%or.cond.1 = select i1 %tobool50.not.1, i1 %cmp54.1, i1 false
br i1 %or.cond.1, label %if.then55.1, label %for.inc59.1
if.then55.1: ; preds = %land.lhs.true.1
%21 = trunc i64 %indvars.iv.next116 to i32
store i32 %21, ptr %a, align 4, !tbaa !5
br label %for.inc59.1
for.inc59.1: ; preds = %if.then55.1, %land.lhs.true.1, %for.inc59
%i.199101.1 = phi i32 [ %21, %if.then55.1 ], [ %i.199101, %land.lhs.true.1 ], [ %i.199101, %for.inc59 ]
%min.1.1 = phi i32 [ %20, %if.then55.1 ], [ %min.1, %land.lhs.true.1 ], [ %min.1, %for.inc59 ]
%indvars.iv.next116.1 = add nuw nsw i64 %indvars.iv115, 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.inc62.unr-lcssa, label %for.body44, !llvm.loop !11
for.inc62.unr-lcssa: ; preds = %for.inc59.1, %for.body44.preheader
%i.199101.lcssa.ph = phi i32 [ undef, %for.body44.preheader ], [ %i.199101.1, %for.inc59.1 ]
%indvars.iv115.unr = phi i64 [ 1, %for.body44.preheader ], [ %indvars.iv.next116.1, %for.inc59.1 ]
%i.199102.unr = phi i32 [ %i.199104106, %for.body44.preheader ], [ %i.199101.1, %for.inc59.1 ]
%min.0100.unr = phi i32 [ 1000000000, %for.body44.preheader ], [ %min.1.1, %for.inc59.1 ]
br i1 %lcmp.mod.not, label %for.inc62, label %for.body44.epil
for.body44.epil: ; preds = %for.inc62.unr-lcssa
%arrayidx46.epil = getelementptr inbounds [110 x i32], ptr %f, i64 0, i64 %indvars.iv115.unr
%22 = load i32, ptr %arrayidx46.epil, align 4, !tbaa !5
%cmp47.epil = icmp eq i32 %22, 0
br i1 %cmp47.epil, label %land.lhs.true.epil, label %for.inc62
land.lhs.true.epil: ; preds = %for.body44.epil
%arrayidx49.epil = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %indvars.iv115.unr
%23 = load i32, ptr %arrayidx49.epil, align 4, !tbaa !5
%tobool50.not.epil = icmp ne i32 %23, 0
%cmp54.epil = icmp sgt i32 %min.0100.unr, %23
%or.cond.epil = select i1 %tobool50.not.epil, i1 %cmp54.epil, i1 false
br i1 %or.cond.epil, label %if.then55.epil, label %for.inc62
if.then55.epil: ; preds = %land.lhs.true.epil
%24 = trunc i64 %indvars.iv115.unr to i32
store i32 %24, ptr %a, align 4, !tbaa !5
br label %for.inc62
for.inc62: ; preds = %for.body44.epil, %land.lhs.true.epil, %if.then55.epil, %for.inc62.unr-lcssa
%i.199101.lcssa = phi i32 [ %i.199101.lcssa.ph, %for.inc62.unr-lcssa ], [ %24, %if.then55.epil ], [ %i.199102.unr, %land.lhs.true.epil ], [ %i.199102.unr, %for.body44.epil ]
%inc63 = add nuw nsw i32 %j.0107, 1
%exitcond120.not = icmp eq i32 %inc63, %9
br i1 %exitcond120.not, label %for.end64, label %for.body, !llvm.loop !12
for.end64: ; preds = %for.inc62, %if.else
%25 = load i32, ptr %b, align 4, !tbaa !5
%idxprom65 = sext i32 %25 to i64
%arrayidx66 = getelementptr inbounds [110 x i32], ptr %c, i64 0, i64 %idxprom65
%26 = load i32, ptr %arrayidx66, align 4, !tbaa !5
%tobool67.not = icmp eq i32 %26, 0
br i1 %tobool67.not, label %if.else72, label %if.then68
if.then68: ; preds = %for.end64
%call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %26)
br label %if.end74
if.else72: ; preds = %for.end64
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end74
if.end74: ; preds = %if.else72, %if.then68
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %c) #7
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %f) #7
br label %if.end75
if.end75: ; preds = %if.end74, %if.then
%27 = load i32, ptr %m, align 4, !tbaa !5
%dec = add nsw i32 %27, -1
store i32 %dec, ptr %m, align 4, !tbaa !5
%tobool3.not = icmp eq i32 %27, 0
br i1 %tobool3.not, label %while.end, label %while.body4, !llvm.loop !13
while.end: ; preds = %if.end75, %while.body
call void @llvm.lifetime.end.p0(i64 48400, ptr nonnull %d) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%28 = load i32, ptr %n, align 4, !tbaa !5
%tobool = icmp ne i32 %28, 0
%29 = load i32, ptr %m, align 4
%tobool1 = icmp ne i32 %29, 0
%30 = select i1 %tobool, i1 true, i1 %tobool1
br i1 %30, label %while.body, label %while.end76, !llvm.loop !14
while.end76: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define min(a,b)((a)<(b)?(a):(b))
int n,k;
int fares[101][101];
void kouro(int f,int t,int m){
int a,b,c,d;
if(fares[f][t]==-1 | fares[f][t]>m){
fares[f][t]=m;
fares[t][f]=m;
for(a=1;a<=n;a++){
for(b=1;b<=n;b++){
fares[a][b]=min(fares[a][b],fares[a][t]+fares[f][t]+fares[f][b]);
fares[b][a]=fares[a][b];
}
}
}
}
void kyaku(int f,int t){
if(fares[f][t]>=10000000)printf("-1\n");
else printf("%d\n",fares[f][t]);
}
int main(void){
int a,b;
int s,f,t,m;
while(1){
memset(fares,0,sizeof(fares));
scanf("%d %d",&n,&k);
if(n==0 && k==0)break;
for(a=1;a<=n;a++){
for(b=1;b<=n;b++){
if(a==b)fares[a][b]=0;else fares[a][b]=100000000;
}
}
for(a=0;a<k;a++){
scanf("%d %d %d",&s,&f,&t);
if(s==1){
scanf("%d",&m);
kouro(f,t,m);
}
if(s==0){
kyaku(f,t);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_261961/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_261961/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@fares = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@k = dso_local global i32 0, align 4
@.str.3 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @kouro(i32 noundef %f, i32 noundef %t, i32 noundef %m) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %f to i64
%idxprom1 = sext i32 %t to i64
%arrayidx2 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp = icmp eq i32 %0, -1
%cmp7 = icmp sgt i32 %0, %m
%or107 = or i1 %cmp, %cmp7
br i1 %or107, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %m, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom1, i64 %idxprom
store i32 %m, ptr %arrayidx16, align 4, !tbaa !5
%1 = load i32, ptr @n, align 4, !tbaa !5
%cmp17.not110 = icmp slt i32 %1, 1
br i1 %cmp17.not110, label %if.end, label %for.cond19.preheader.preheader
for.cond19.preheader.preheader: ; preds = %if.then
%2 = add i32 %1, 1
%wide.trip.count116 = zext i32 %2 to i64
%3 = shl nuw nsw i64 %wide.trip.count116, 2
%4 = mul nuw nsw i64 %wide.trip.count116, 404
%5 = shl nsw i64 %idxprom1, 2
%6 = mul nsw i64 %idxprom, 404
%7 = getelementptr i8, ptr @fares, i64 %6
%8 = getelementptr i8, ptr %7, i64 %5
%scevgep123 = getelementptr i8, ptr %8, i64 4
%9 = getelementptr i8, ptr @fares, i64 %6
%scevgep124 = getelementptr i8, ptr %9, i64 4
%10 = getelementptr i8, ptr @fares, i64 %6
%scevgep125 = getelementptr i8, ptr %10, i64 %3
%11 = add nsw i64 %wide.trip.count116, -1
%min.iters.check = icmp ult i64 %11, 28
%12 = getelementptr i8, ptr @fares, i64 %5
%13 = getelementptr i8, ptr %12, i64 408
%14 = getelementptr i8, ptr @fares, i64 %5
%15 = getelementptr i8, ptr %14, i64 404
%16 = getelementptr i8, ptr @fares, i64 %4
%17 = getelementptr i8, ptr %16, i64 -396
%18 = getelementptr i8, ptr @fares, i64 %3
%19 = getelementptr i8, ptr %18, i64 404
%bound1127 = icmp ult ptr %14, %18
%n.vec = and i64 %11, -4
%ind.end = or i64 %n.vec, 1
%cmp.n = icmp eq i64 %11, %n.vec
br label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.cond19.preheader.preheader, %for.cond19.for.inc72_crit_edge
%indvar = phi i64 [ 0, %for.cond19.preheader.preheader ], [ %indvar.next, %for.cond19.for.inc72_crit_edge ]
%indvars.iv113 = phi i64 [ 1, %for.cond19.preheader.preheader ], [ %indvars.iv.next114, %for.cond19.for.inc72_crit_edge ]
%arrayidx30 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv113, i64 %idxprom1
br i1 %min.iters.check, label %for.body22.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond19.preheader
%20 = mul nuw nsw i64 %indvar, 404
%scevgep122 = getelementptr i8, ptr %13, i64 %20
%scevgep121 = getelementptr i8, ptr %15, i64 %20
%21 = shl nuw nsw i64 %indvar, 2
%scevgep120 = getelementptr i8, ptr %17, i64 %21
%gep = getelementptr i8, ptr getelementptr (i8, ptr @fares, i64 408), i64 %21
%scevgep118 = getelementptr i8, ptr %19, i64 %20
%gep152 = getelementptr i8, ptr getelementptr (i8, ptr @fares, i64 408), i64 %20
%bound0 = icmp ult ptr %gep152, %scevgep120
%bound1 = icmp ult ptr %gep, %scevgep118
%found.conflict = and i1 %bound0, %bound1
%bound0126 = icmp ult ptr %gep152, %scevgep122
%found.conflict128 = and i1 %bound0126, %bound1127
%conflict.rdx = or i1 %found.conflict, %found.conflict128
%bound0129 = icmp ult ptr %gep152, %scevgep123
%bound1130 = icmp ult ptr %arrayidx2, %scevgep118
%found.conflict131 = and i1 %bound0129, %bound1130
%conflict.rdx132 = or i1 %conflict.rdx, %found.conflict131
%bound0133 = icmp ult ptr %gep152, %scevgep125
%bound1134 = icmp ult ptr %scevgep124, %scevgep118
%found.conflict135 = and i1 %bound0133, %bound1134
%conflict.rdx136 = or i1 %conflict.rdx132, %found.conflict135
%bound0137 = icmp ult ptr %gep, %scevgep122
%bound1138 = icmp ult ptr %scevgep121, %scevgep120
%found.conflict139 = and i1 %bound0137, %bound1138
%conflict.rdx140 = or i1 %conflict.rdx136, %found.conflict139
%bound0141 = icmp ult ptr %gep, %scevgep123
%bound1142 = icmp ult ptr %arrayidx2, %scevgep120
%found.conflict143 = and i1 %bound0141, %bound1142
%conflict.rdx144 = or i1 %conflict.rdx140, %found.conflict143
%bound0145 = icmp ult ptr %gep, %scevgep125
%bound1146 = icmp ult ptr %scevgep124, %scevgep120
%found.conflict147 = and i1 %bound0145, %bound1146
%conflict.rdx148 = or i1 %conflict.rdx144, %found.conflict147
br i1 %conflict.rdx148, label %for.body22.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%22 = load i32, ptr %arrayidx30, align 4, !tbaa !5, !alias.scope !9
%23 = load i32, ptr %arrayidx2, align 4, !tbaa !5, !alias.scope !12
%.scalar = add nsw i32 %23, %22
%24 = insertelement <4 x i32> poison, i32 %.scalar, i64 0
%25 = shufflevector <4 x i32> %24, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%26 = or i64 %index, 2
%27 = or i64 %index, 3
%28 = add i64 %index, 4
%29 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv113, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %29, align 4, !tbaa !5, !alias.scope !14, !noalias !16
%30 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom, i64 %offset.idx
%wide.load151 = load <4 x i32>, ptr %30, align 4, !tbaa !5, !alias.scope !19
%31 = add nsw <4 x i32> %25, %wide.load151
%32 = tail call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %31)
store <4 x i32> %32, ptr %29, align 4, !tbaa !5, !alias.scope !14, !noalias !16
%33 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %offset.idx, i64 %indvars.iv113
%34 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %26, i64 %indvars.iv113
%35 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %27, i64 %indvars.iv113
%36 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %28, i64 %indvars.iv113
%37 = extractelement <4 x i32> %32, i64 0
store i32 %37, ptr %33, align 4, !tbaa !5, !alias.scope !20, !noalias !21
%38 = extractelement <4 x i32> %32, i64 1
store i32 %38, ptr %34, align 4, !tbaa !5, !alias.scope !20, !noalias !21
%39 = extractelement <4 x i32> %32, i64 2
store i32 %39, ptr %35, align 4, !tbaa !5, !alias.scope !20, !noalias !21
%40 = extractelement <4 x i32> %32, i64 3
store i32 %40, ptr %36, align 4, !tbaa !5, !alias.scope !20, !noalias !21
%index.next = add nuw i64 %index, 4
%41 = icmp eq i64 %index.next, %n.vec
br i1 %41, label %middle.block, label %vector.body, !llvm.loop !22
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond19.for.inc72_crit_edge, label %for.body22.preheader
for.body22.preheader: ; preds = %vector.memcheck, %for.cond19.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %for.cond19.preheader ], [ %ind.end, %middle.block ]
br label %for.body22
for.body22: ; preds = %for.body22.preheader, %for.body22
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body22 ], [ %indvars.iv.ph, %for.body22.preheader ]
%arrayidx26 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv113, i64 %indvars.iv
%42 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%43 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%44 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%add = add nsw i32 %44, %43
%arrayidx38 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom, i64 %indvars.iv
%45 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%add39 = add nsw i32 %add, %45
%.add39 = tail call i32 @llvm.smin.i32(i32 %42, i32 %add39)
store i32 %.add39, ptr %arrayidx26, align 4, !tbaa !5
%arrayidx71 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv, i64 %indvars.iv113
store i32 %.add39, ptr %arrayidx71, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count116
br i1 %exitcond.not, label %for.cond19.for.inc72_crit_edge, label %for.body22, !llvm.loop !26
for.cond19.for.inc72_crit_edge: ; preds = %for.body22, %middle.block
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%exitcond117.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count116
%indvar.next = add i64 %indvar, 1
br i1 %exitcond117.not, label %if.end, label %for.cond19.preheader, !llvm.loop !27
if.end: ; preds = %for.cond19.for.inc72_crit_edge, %if.then, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @kyaku(i32 noundef %f, i32 noundef %t) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %f to i64
%idxprom1 = sext i32 %t to i64
%arrayidx2 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 9999999
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
br label %if.end
if.end: ; preds = %if.else, %if.then
ret void
}
; 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 #2 {
entry:
%s = alloca i32, align 4
%f = alloca i32, align 4
%t = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) @fares, i8 0, i64 40804, i1 false)
%call53 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @k)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp54 = icmp eq i32 %0, 0
%1 = load i32, ptr @k, align 4
%cmp155 = icmp eq i32 %1, 0
%or.cond56 = select i1 %cmp54, i1 %cmp155, i1 false
br i1 %or.cond56, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.inc29, %for.cond18.preheader
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40804) @fares, i8 0, i64 40804, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull @n, ptr noundef nonnull @k)
%2 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp eq i32 %2, 0
%3 = load i32, ptr @k, align 4
%cmp1 = icmp eq i32 %3, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%4 = phi i32 [ %3, %while.cond.loopexit ], [ %1, %entry ]
%5 = phi i32 [ %2, %while.cond.loopexit ], [ %0, %entry ]
%cmp2.not49 = icmp slt i32 %5, 1
br i1 %cmp2.not49, label %for.cond18.preheader, label %for.cond3.preheader.preheader
for.cond3.preheader.preheader: ; preds = %for.cond.preheader
%6 = add nuw i32 %5, 1
%wide.trip.count61 = zext i32 %6 to i64
%7 = add nsw i64 %wide.trip.count61, -1
%min.iters.check99 = icmp ult i32 %5, 8
%n.vec102 = and i64 %7, -8
%ind.end103 = or i64 %n.vec102, 1
%cmp.n105 = icmp eq i64 %7, %n.vec102
br label %for.cond3.preheader
for.cond18.preheader: ; preds = %for.cond3.for.inc15_crit_edge, %for.cond.preheader
%cmp1951 = icmp sgt i32 %4, 0
br i1 %cmp1951, label %for.body20, label %while.cond.loopexit
for.cond3.preheader: ; preds = %for.cond3.preheader.preheader, %for.cond3.for.inc15_crit_edge
%indvars.iv58 = phi i64 [ 1, %for.cond3.preheader.preheader ], [ %indvars.iv.next59, %for.cond3.for.inc15_crit_edge ]
br i1 %min.iters.check99, label %for.body5.preheader, label %vector.ph100
vector.ph100: ; preds = %for.cond3.preheader
%broadcast.splatinsert110 = insertelement <4 x i64> poison, i64 %indvars.iv58, i64 0
%broadcast.splat111 = shufflevector <4 x i64> %broadcast.splatinsert110, <4 x i64> poison, <4 x i32> zeroinitializer
br label %vector.body106
vector.body106: ; preds = %vector.body106, %vector.ph100
%index107 = phi i64 [ 0, %vector.ph100 ], [ %index.next112, %vector.body106 ]
%vec.ind = phi <4 x i64> [ <i64 1, i64 2, i64 3, i64 4>, %vector.ph100 ], [ %vec.ind.next, %vector.body106 ]
%step.add = add <4 x i64> %vec.ind, <i64 4, i64 4, i64 4, i64 4>
%offset.idx109 = or i64 %index107, 1
%8 = icmp eq <4 x i64> %broadcast.splat111, %vec.ind
%9 = icmp eq <4 x i64> %broadcast.splat111, %step.add
%10 = select <4 x i1> %8, <4 x i32> zeroinitializer, <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>
%11 = select <4 x i1> %9, <4 x i32> zeroinitializer, <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>
%12 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv58, i64 %offset.idx109
store <4 x i32> %10, ptr %12, align 4
%13 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> %11, ptr %13, align 4
%index.next112 = add nuw i64 %index107, 8
%vec.ind.next = add <4 x i64> %vec.ind, <i64 8, i64 8, i64 8, i64 8>
%14 = icmp eq i64 %index.next112, %n.vec102
br i1 %14, label %middle.block97, label %vector.body106, !llvm.loop !28
middle.block97: ; preds = %vector.body106
br i1 %cmp.n105, label %for.cond3.for.inc15_crit_edge, label %for.body5.preheader
for.body5.preheader: ; preds = %for.cond3.preheader, %middle.block97
%indvars.iv.ph = phi i64 [ 1, %for.cond3.preheader ], [ %ind.end103, %middle.block97 ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ %indvars.iv.ph, %for.body5.preheader ]
%cmp6 = icmp eq i64 %indvars.iv58, %indvars.iv
%spec.select = select i1 %cmp6, i32 0, i32 100000000
%15 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv58, i64 %indvars.iv
store i32 %spec.select, ptr %15, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count61
br i1 %exitcond.not, label %for.cond3.for.inc15_crit_edge, label %for.body5, !llvm.loop !29
for.cond3.for.inc15_crit_edge: ; preds = %for.body5, %middle.block97
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond62.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count61
br i1 %exitcond62.not, label %for.cond18.preheader, label %for.cond3.preheader, !llvm.loop !30
for.body20: ; preds = %for.cond18.preheader, %for.inc29
%a.152 = phi i32 [ %inc30, %for.inc29 ], [ 0, %for.cond18.preheader ]
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %s, ptr noundef nonnull %f, ptr noundef nonnull %t)
%16 = load i32, ptr %s, align 4, !tbaa !5
%cmp22 = icmp eq i32 %16, 1
br i1 %cmp22, label %if.then23, label %if.end25
if.then23: ; preds = %for.body20
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %m)
%17 = load i32, ptr %f, align 4, !tbaa !5
%18 = load i32, ptr %t, align 4, !tbaa !5
%19 = load i32, ptr %m, align 4, !tbaa !5
%idxprom.i = sext i32 %17 to i64
%idxprom1.i = sext i32 %18 to i64
%arrayidx2.i = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom.i, i64 %idxprom1.i
%20 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.i = icmp eq i32 %20, -1
%cmp7.i = icmp sgt i32 %20, %19
%or107.i = or i1 %cmp.i, %cmp7.i
br i1 %or107.i, label %if.then.i, label %if.end25thread-pre-split
if.then.i: ; preds = %if.then23
store i32 %19, ptr %arrayidx2.i, align 4, !tbaa !5
%arrayidx16.i = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom1.i, i64 %idxprom.i
store i32 %19, ptr %arrayidx16.i, align 4, !tbaa !5
%21 = load i32, ptr @n, align 4, !tbaa !5
%cmp17.not110.i = icmp slt i32 %21, 1
br i1 %cmp17.not110.i, label %if.end25thread-pre-split, label %for.cond19.preheader.preheader.i
for.cond19.preheader.preheader.i: ; preds = %if.then.i
%22 = add i32 %21, 1
%wide.trip.count116.i = zext i32 %22 to i64
%23 = shl nuw nsw i64 %wide.trip.count116.i, 2
%24 = mul nuw nsw i64 %wide.trip.count116.i, 404
%25 = shl nsw i64 %idxprom1.i, 2
%26 = mul nsw i64 %idxprom.i, 404
%27 = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @fares, i64 0, i64 0, i64 1), i64 %26
%scevgep68 = getelementptr i8, ptr %27, i64 %25
%scevgep69 = getelementptr i8, ptr getelementptr inbounds ([101 x [101 x i32]], ptr @fares, i64 0, i64 0, i64 1), i64 %26
%28 = getelementptr i8, ptr @fares, i64 %26
%scevgep70 = getelementptr i8, ptr %28, i64 %23
%29 = add nsw i64 %wide.trip.count116.i, -1
%min.iters.check = icmp ult i64 %29, 28
%gep114 = getelementptr i8, ptr getelementptr (i8, ptr @fares, i64 408), i64 %25
%30 = getelementptr i8, ptr @fares, i64 %25
%31 = getelementptr i8, ptr %30, i64 404
%gep115 = getelementptr i8, ptr getelementptr (i8, ptr @fares, i64 -396), i64 %24
%32 = getelementptr i8, ptr @fares, i64 %23
%33 = getelementptr i8, ptr %32, i64 404
%bound172 = icmp ult ptr %30, %32
%n.vec = and i64 %29, -4
%ind.end = or i64 %n.vec, 1
%cmp.n = icmp eq i64 %29, %n.vec
br label %for.cond19.preheader.i
for.cond19.preheader.i: ; preds = %for.cond19.for.inc72_crit_edge.i, %for.cond19.preheader.preheader.i
%indvar = phi i64 [ %indvar.next, %for.cond19.for.inc72_crit_edge.i ], [ 0, %for.cond19.preheader.preheader.i ]
%indvars.iv113.i = phi i64 [ %indvars.iv.next114.i, %for.cond19.for.inc72_crit_edge.i ], [ 1, %for.cond19.preheader.preheader.i ]
%arrayidx30.i = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv113.i, i64 %idxprom1.i
br i1 %min.iters.check, label %for.body22.i.preheader, label %vector.memcheck
vector.memcheck: ; preds = %for.cond19.preheader.i
%34 = mul nuw nsw i64 %indvar, 404
%scevgep67 = getelementptr i8, ptr %gep114, i64 %34
%scevgep66 = getelementptr i8, ptr %31, i64 %34
%35 = shl nuw nsw i64 %indvar, 2
%scevgep65 = getelementptr i8, ptr %gep115, i64 %35
%gep = getelementptr i8, ptr getelementptr (i8, ptr @fares, i64 408), i64 %35
%scevgep63 = getelementptr i8, ptr %33, i64 %34
%gep113 = getelementptr i8, ptr getelementptr (i8, ptr @fares, i64 408), i64 %34
%bound0 = icmp ult ptr %gep113, %scevgep65
%bound1 = icmp ult ptr %gep, %scevgep63
%found.conflict = and i1 %bound0, %bound1
%bound071 = icmp ult ptr %gep113, %scevgep67
%found.conflict73 = and i1 %bound071, %bound172
%conflict.rdx = or i1 %found.conflict, %found.conflict73
%bound074 = icmp ult ptr %gep113, %scevgep68
%bound175 = icmp ult ptr %arrayidx2.i, %scevgep63
%found.conflict76 = and i1 %bound074, %bound175
%conflict.rdx77 = or i1 %conflict.rdx, %found.conflict76
%bound078 = icmp ult ptr %gep113, %scevgep70
%bound179 = icmp ult ptr %scevgep69, %scevgep63
%found.conflict80 = and i1 %bound078, %bound179
%conflict.rdx81 = or i1 %conflict.rdx77, %found.conflict80
%bound082 = icmp ult ptr %gep, %scevgep67
%bound183 = icmp ult ptr %scevgep66, %scevgep65
%found.conflict84 = and i1 %bound082, %bound183
%conflict.rdx85 = or i1 %conflict.rdx81, %found.conflict84
%bound086 = icmp ult ptr %gep, %scevgep68
%bound187 = icmp ult ptr %arrayidx2.i, %scevgep65
%found.conflict88 = and i1 %bound086, %bound187
%conflict.rdx89 = or i1 %conflict.rdx85, %found.conflict88
%bound090 = icmp ult ptr %gep, %scevgep70
%bound191 = icmp ult ptr %scevgep69, %scevgep65
%found.conflict92 = and i1 %bound090, %bound191
%conflict.rdx93 = or i1 %conflict.rdx89, %found.conflict92
br i1 %conflict.rdx93, label %for.body22.i.preheader, label %vector.ph
vector.ph: ; preds = %vector.memcheck
%36 = load i32, ptr %arrayidx30.i, align 4, !tbaa !5, !alias.scope !31
%37 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5, !alias.scope !34
%.scalar = add nsw i32 %37, %36
%38 = insertelement <4 x i32> poison, i32 %.scalar, i64 0
%39 = shufflevector <4 x i32> %38, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%offset.idx = or i64 %index, 1
%40 = or i64 %index, 2
%41 = or i64 %index, 3
%42 = add i64 %index, 4
%43 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv113.i, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %43, align 4, !tbaa !5, !alias.scope !36, !noalias !38
%44 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom.i, i64 %offset.idx
%wide.load96 = load <4 x i32>, ptr %44, align 4, !tbaa !5, !alias.scope !41
%45 = add nsw <4 x i32> %39, %wide.load96
%46 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load, <4 x i32> %45)
store <4 x i32> %46, ptr %43, align 4, !tbaa !5, !alias.scope !36, !noalias !38
%47 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %offset.idx, i64 %indvars.iv113.i
%48 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %40, i64 %indvars.iv113.i
%49 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %41, i64 %indvars.iv113.i
%50 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %42, i64 %indvars.iv113.i
%51 = extractelement <4 x i32> %46, i64 0
store i32 %51, ptr %47, align 4, !tbaa !5, !alias.scope !42, !noalias !43
%52 = extractelement <4 x i32> %46, i64 1
store i32 %52, ptr %48, align 4, !tbaa !5, !alias.scope !42, !noalias !43
%53 = extractelement <4 x i32> %46, i64 2
store i32 %53, ptr %49, align 4, !tbaa !5, !alias.scope !42, !noalias !43
%54 = extractelement <4 x i32> %46, i64 3
store i32 %54, ptr %50, align 4, !tbaa !5, !alias.scope !42, !noalias !43
%index.next = add nuw i64 %index, 4
%55 = icmp eq i64 %index.next, %n.vec
br i1 %55, label %middle.block, label %vector.body, !llvm.loop !44
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond19.for.inc72_crit_edge.i, label %for.body22.i.preheader
for.body22.i.preheader: ; preds = %vector.memcheck, %for.cond19.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 1, %vector.memcheck ], [ 1, %for.cond19.preheader.i ], [ %ind.end, %middle.block ]
br label %for.body22.i
for.body22.i: ; preds = %for.body22.i.preheader, %for.body22.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body22.i ], [ %indvars.iv.i.ph, %for.body22.i.preheader ]
%arrayidx26.i = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv113.i, i64 %indvars.iv.i
%56 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%57 = load i32, ptr %arrayidx30.i, align 4, !tbaa !5
%58 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%add.i = add nsw i32 %58, %57
%arrayidx38.i = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom.i, i64 %indvars.iv.i
%59 = load i32, ptr %arrayidx38.i, align 4, !tbaa !5
%add39.i = add nsw i32 %add.i, %59
%.add39.i = call i32 @llvm.smin.i32(i32 %56, i32 %add39.i)
store i32 %.add39.i, ptr %arrayidx26.i, align 4, !tbaa !5
%arrayidx71.i = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %indvars.iv.i, i64 %indvars.iv113.i
store i32 %.add39.i, ptr %arrayidx71.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, %wide.trip.count116.i
br i1 %exitcond.not.i, label %for.cond19.for.inc72_crit_edge.i, label %for.body22.i, !llvm.loop !45
for.cond19.for.inc72_crit_edge.i: ; preds = %for.body22.i, %middle.block
%indvars.iv.next114.i = add nuw nsw i64 %indvars.iv113.i, 1
%exitcond117.not.i = icmp eq i64 %indvars.iv.next114.i, %wide.trip.count116.i
%indvar.next = add i64 %indvar, 1
br i1 %exitcond117.not.i, label %if.end25thread-pre-split, label %for.cond19.preheader.i, !llvm.loop !27
if.end25thread-pre-split: ; preds = %for.cond19.for.inc72_crit_edge.i, %if.then23, %if.then.i
%.pr = load i32, ptr %s, align 4, !tbaa !5
br label %if.end25
if.end25: ; preds = %if.end25thread-pre-split, %for.body20
%60 = phi i32 [ %.pr, %if.end25thread-pre-split ], [ %16, %for.body20 ]
%cmp26 = icmp eq i32 %60, 0
br i1 %cmp26, label %if.then27, label %for.inc29
if.then27: ; preds = %if.end25
%61 = load i32, ptr %f, align 4, !tbaa !5
%62 = load i32, ptr %t, align 4, !tbaa !5
%idxprom.i42 = sext i32 %61 to i64
%idxprom1.i43 = sext i32 %62 to i64
%arrayidx2.i44 = getelementptr inbounds [101 x [101 x i32]], ptr @fares, i64 0, i64 %idxprom.i42, i64 %idxprom1.i43
%63 = load i32, ptr %arrayidx2.i44, align 4, !tbaa !5
%cmp.i45 = icmp sgt i32 %63, 9999999
br i1 %cmp.i45, label %if.then.i46, label %if.else.i
if.then.i46: ; preds = %if.then27
%puts.i = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc29
if.else.i: ; preds = %if.then27
%call7.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %63)
br label %for.inc29
for.inc29: ; preds = %if.else.i, %if.then.i46, %if.end25
%inc30 = add nuw nsw i32 %a.152, 1
%64 = load i32, ptr @k, align 4, !tbaa !5
%cmp19 = icmp slt i32 %inc30, %64
br i1 %cmp19, label %for.body20, label %while.cond.loopexit, !llvm.loop !46
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #6
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10}
!10 = distinct !{!10, !11}
!11 = distinct !{!11, !"LVerDomain"}
!12 = !{!13}
!13 = distinct !{!13, !11}
!14 = !{!15}
!15 = distinct !{!15, !11}
!16 = !{!17, !10, !13, !18}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = !{!18}
!20 = !{!17}
!21 = !{!10, !13, !18}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !23, !24}
!27 = distinct !{!27, !23}
!28 = distinct !{!28, !23, !24, !25}
!29 = distinct !{!29, !23, !25, !24}
!30 = distinct !{!30, !23}
!31 = !{!32}
!32 = distinct !{!32, !33}
!33 = distinct !{!33, !"LVerDomain"}
!34 = !{!35}
!35 = distinct !{!35, !33}
!36 = !{!37}
!37 = distinct !{!37, !33}
!38 = !{!39, !32, !35, !40}
!39 = distinct !{!39, !33}
!40 = distinct !{!40, !33}
!41 = !{!40}
!42 = !{!39}
!43 = !{!32, !35, !40}
!44 = distinct !{!44, !23, !24, !25}
!45 = distinct !{!45, !23, !24}
!46 = distinct !{!46, !23}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
int i, j, k;
int N;
scanf("%d", &N);
int s[N][11];
for (i = 0; i < N; i++)
scanf("%s", s[i]);
int M;
scanf("%d", &M);
int t[M][11];
for (i = 0; i < M; i++)
scanf("%s", t[i]);
int max = 0, tmp = 1;
for (i = 0; i < N; i++, tmp = 1) {
for (j = i + 1; j < N; j++) {
if (strcmp(s[i], s[j]) == 0)
tmp += 1;
}
for (j = 0; j < M; j++) {
if (strcmp(s[i], t[j]) == 0)
tmp -= 1;
}
if (max < tmp)
max = tmp;
}
printf("%d\n", max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262010/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262010/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca [11 x i32], i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp76 = icmp sgt i32 %3, 0
br i1 %cmp76, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i32], ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #6
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M)
%6 = load i32, ptr %M, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca [11 x i32], i64 %7, align 16
%cmp578 = icmp sgt i32 %6, 0
br i1 %cmp578, label %for.body6, label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.body6, %for.end
%.lcssa = phi i32 [ %6, %for.end ], [ %10, %for.body6 ]
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp1588 = icmp sgt i32 %8, 0
br i1 %cmp1588, label %for.body16.lr.ph, label %for.end53
for.body16.lr.ph: ; preds = %for.cond14.preheader
%cmp3384 = icmp sgt i32 %.lcssa, 0
%9 = zext i32 %8 to i64
%wide.trip.count123 = zext i32 %8 to i64
br i1 %cmp3384, label %for.body16.us.preheader, label %for.body16
for.body16.us.preheader: ; preds = %for.body16.lr.ph
%wide.trip.count118 = zext i32 %.lcssa to i64
br label %for.body16.us
for.body16.us: ; preds = %for.body16.us.preheader, %for.cond32.for.end47_crit_edge.us
%indvars.iv120 = phi i64 [ 0, %for.body16.us.preheader ], [ %indvars.iv.next121, %for.cond32.for.end47_crit_edge.us ]
%indvars.iv108 = phi i64 [ 1, %for.body16.us.preheader ], [ %indvars.iv.next109, %for.cond32.for.end47_crit_edge.us ]
%max.090.us = phi i32 [ 0, %for.body16.us.preheader ], [ %spec.select75.us, %for.cond32.for.end47_crit_edge.us ]
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%cmp1880.us = icmp ult i64 %indvars.iv.next121, %9
br i1 %cmp1880.us, label %for.body19.lr.ph.us, label %for.cond32.preheader.us
for.body34.us: ; preds = %for.cond32.preheader.us, %for.body34.us
%indvars.iv115 = phi i64 [ 0, %for.cond32.preheader.us ], [ %indvars.iv.next116, %for.body34.us ]
%tmp.386.us = phi i32 [ %tmp.1.lcssa.us, %for.cond32.preheader.us ], [ %spec.select74.us, %for.body34.us ]
%arrayidx39.us = getelementptr inbounds [11 x i32], ptr %vla3, i64 %indvars.iv115
%call41.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx36.us, ptr noundef nonnull dereferenceable(1) %arrayidx39.us) #7
%cmp42.us = icmp eq i32 %call41.us, 0
%sub.us = sext i1 %cmp42.us to i32
%spec.select74.us = add nsw i32 %tmp.386.us, %sub.us
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%exitcond119.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count118
br i1 %exitcond119.not, label %for.cond32.for.end47_crit_edge.us, label %for.body34.us, !llvm.loop !11
for.body19.us: ; preds = %for.body19.lr.ph.us, %for.body19.us
%indvars.iv110 = phi i64 [ %indvars.iv108, %for.body19.lr.ph.us ], [ %indvars.iv.next111, %for.body19.us ]
%tmp.182.us = phi i32 [ 1, %for.body19.lr.ph.us ], [ %spec.select.us, %for.body19.us ]
%arrayidx24.us = getelementptr inbounds [11 x i32], ptr %vla, i64 %indvars.iv110
%call26.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx21.us, ptr noundef nonnull dereferenceable(1) %arrayidx24.us) #7
%cmp27.us = icmp eq i32 %call26.us, 0
%add28.us = zext i1 %cmp27.us to i32
%spec.select.us = add nuw nsw i32 %tmp.182.us, %add28.us
%indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
%exitcond114.not = icmp eq i64 %indvars.iv.next111, %wide.trip.count123
br i1 %exitcond114.not, label %for.cond32.preheader.us, label %for.body19.us, !llvm.loop !12
for.cond32.preheader.us: ; preds = %for.body19.us, %for.body16.us
%tmp.1.lcssa.us = phi i32 [ 1, %for.body16.us ], [ %spec.select.us, %for.body19.us ]
%arrayidx36.us = getelementptr inbounds [11 x i32], ptr %vla, i64 %indvars.iv120
br label %for.body34.us
for.body19.lr.ph.us: ; preds = %for.body16.us
%arrayidx21.us = getelementptr inbounds [11 x i32], ptr %vla, i64 %indvars.iv120
br label %for.body19.us
for.cond32.for.end47_crit_edge.us: ; preds = %for.body34.us
%spec.select75.us = call i32 @llvm.smax.i32(i32 %max.090.us, i32 %spec.select74.us)
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond124.not = icmp eq i64 %indvars.iv.next121, %wide.trip.count123
br i1 %exitcond124.not, label %for.end53, label %for.body16.us, !llvm.loop !13
for.body6: ; preds = %for.end, %for.body6
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds [11 x i32], ptr %vla3, i64 %indvars.iv95
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8)
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%10 = load i32, ptr %M, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp5 = icmp slt i64 %indvars.iv.next96, %11
br i1 %cmp5, label %for.body6, label %for.cond14.preheader, !llvm.loop !14
for.body16: ; preds = %for.body16.lr.ph, %for.cond32.preheader
%indvars.iv103 = phi i64 [ %indvars.iv.next104, %for.cond32.preheader ], [ 0, %for.body16.lr.ph ]
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.cond32.preheader ], [ 1, %for.body16.lr.ph ]
%max.090 = phi i32 [ %spec.select75, %for.cond32.preheader ], [ 0, %for.body16.lr.ph ]
%indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
%cmp1880 = icmp ult i64 %indvars.iv.next104, %9
br i1 %cmp1880, label %for.body19.lr.ph, label %for.cond32.preheader
for.body19.lr.ph: ; preds = %for.body16
%arrayidx21 = getelementptr inbounds [11 x i32], ptr %vla, i64 %indvars.iv103
br label %for.body19
for.cond32.preheader: ; preds = %for.body19, %for.body16
%tmp.1.lcssa = phi i32 [ 1, %for.body16 ], [ %spec.select, %for.body19 ]
%spec.select75 = call i32 @llvm.smax.i32(i32 %max.090, i32 %tmp.1.lcssa)
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond107.not = icmp eq i64 %indvars.iv.next104, %wide.trip.count123
br i1 %exitcond107.not, label %for.end53, label %for.body16, !llvm.loop !13
for.body19: ; preds = %for.body19.lr.ph, %for.body19
%indvars.iv100 = phi i64 [ %indvars.iv98, %for.body19.lr.ph ], [ %indvars.iv.next101, %for.body19 ]
%tmp.182 = phi i32 [ 1, %for.body19.lr.ph ], [ %spec.select, %for.body19 ]
%arrayidx24 = getelementptr inbounds [11 x i32], ptr %vla, i64 %indvars.iv100
%call26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx21, ptr noundef nonnull dereferenceable(1) %arrayidx24) #7
%cmp27 = icmp eq i32 %call26, 0
%add28 = zext i1 %cmp27 to i32
%spec.select = add nuw nsw i32 %tmp.182, %add28
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%exitcond.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count123
br i1 %exitcond.not, label %for.cond32.preheader, label %for.body19, !llvm.loop !12
for.end53: ; preds = %for.cond32.preheader, %for.cond32.for.end47_crit_edge.us, %for.cond14.preheader
%max.0.lcssa = phi i32 [ 0, %for.cond14.preheader ], [ %spec.select75.us, %for.cond32.for.end47_crit_edge.us ], [ %spec.select75, %for.cond32.preheader ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #6
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
char s[210][15];
ll a[210];
ll cnt;
int main(){
ll n;
scanf("%lld",&n);
rep(i,0,n){
char ss[15];
scanf("%s",ss);
ll idx=0;
while(idx<cnt&&strcmp(s[idx],ss))idx++;
strcpy(s[idx],ss);
cnt=max(cnt,idx+1);
a[idx]++;
}
ll m;
scanf("%lld",&m);
rep(i,0,m){
char ss[15];
scanf("%s",ss);
ll idx=0;
while(idx<cnt&&strcmp(s[idx],ss))idx++;
strcpy(s[idx],ss);
cnt=max(cnt,idx);
a[idx]--;
}
ll ans=0;
rep(i,0,cnt)ans=max(ans,a[i]);
printf("%lld",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262054/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262054/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@cnt = dso_local local_unnamed_addr global i64 0, align 8
@s = dso_local global [210 x [15 x i8]] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [210 x i64] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%ss = alloca [15 x i8], align 1
%m = alloca i64, align 8
%ss21 = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp91 = icmp sgt i64 %0, 0
br i1 %cmp91, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %while.end, %entry
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #6
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%1 = load i64, ptr %m, align 8, !tbaa !5
%cmp1899 = icmp sgt i64 %1, 0
br i1 %cmp1899, label %for.body20, label %for.cond.cleanup.for.cond51.preheader_crit_edge
for.cond.cleanup.for.cond51.preheader_crit_edge: ; preds = %for.cond.cleanup
%.pre = load i64, ptr @cnt, align 8, !tbaa !5
br label %for.cond51.preheader
for.body: ; preds = %entry, %while.end
%i.092 = phi i64 [ %inc14, %while.end ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %ss) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ss)
%2 = load i64, ptr @cnt, align 8
%cmp286 = icmp sgt i64 %2, 0
br i1 %cmp286, label %land.rhs, label %while.end
land.rhs: ; preds = %for.body, %while.body
%idx.087 = phi i64 [ %inc, %while.body ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [210 x [15 x i8]], ptr @s, i64 0, i64 %idx.087
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %ss) #7
%tobool.not = icmp eq i32 %call5, 0
br i1 %tobool.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%inc = add nuw nsw i64 %idx.087, 1
%exitcond.not = icmp eq i64 %inc, %2
br i1 %exitcond.not, label %while.end, label %land.rhs, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body, %for.body
%idx.0.lcssa = phi i64 [ 0, %for.body ], [ %2, %while.body ], [ %idx.087, %land.rhs ]
%arrayidx6 = getelementptr inbounds [210 x [15 x i8]], ptr @s, i64 0, i64 %idx.0.lcssa
%call9 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx6, ptr noundef nonnull dereferenceable(1) %ss) #6
%add = add nuw nsw i64 %idx.0.lcssa, 1
%cond = call i64 @llvm.smax.i64(i64 %2, i64 %add)
store i64 %cond, ptr @cnt, align 8, !tbaa !5
%arrayidx12 = getelementptr inbounds [210 x i64], ptr @a, i64 0, i64 %idx.0.lcssa
%3 = load i64, ptr %arrayidx12, align 8, !tbaa !5
%inc13 = add nsw i64 %3, 1
store i64 %inc13, ptr %arrayidx12, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %ss) #6
%inc14 = add nuw nsw i64 %i.092, 1
%4 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc14, %4
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
for.cond51.preheader: ; preds = %while.end36, %for.cond.cleanup.for.cond51.preheader_crit_edge
%5 = phi i64 [ %.pre, %for.cond.cleanup.for.cond51.preheader_crit_edge ], [ %cond45, %while.end36 ]
%cmp52101 = icmp sgt i64 %5, 0
br i1 %cmp52101, label %for.body54.preheader, label %for.cond.cleanup53
for.body54.preheader: ; preds = %for.cond51.preheader
%min.iters.check = icmp ult i64 %5, 4
br i1 %min.iters.check, label %for.body54.preheader109, label %vector.ph
vector.ph: ; preds = %for.body54.preheader
%n.vec = and i64 %5, -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> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi107 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%6 = getelementptr inbounds [210 x i64], ptr @a, i64 0, i64 %index
%wide.load = load <2 x i64>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i64, ptr %6, i64 2
%wide.load108 = load <2 x i64>, ptr %7, align 16, !tbaa !5
%8 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%9 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi107, <2 x i64> %wide.load108)
%index.next = add nuw i64 %index, 4
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %8, <2 x i64> %9)
%11 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %5, %n.vec
br i1 %cmp.n, label %for.cond.cleanup53, label %for.body54.preheader109
for.body54.preheader109: ; preds = %for.body54.preheader, %middle.block
%i50.0103.ph = phi i64 [ 0, %for.body54.preheader ], [ %n.vec, %middle.block ]
%ans.0102.ph = phi i64 [ 0, %for.body54.preheader ], [ %11, %middle.block ]
br label %for.body54
for.body20: ; preds = %for.cond.cleanup, %while.end36
%i16.0100 = phi i64 [ %inc48, %while.end36 ], [ 0, %for.cond.cleanup ]
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %ss21) #6
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ss21)
%12 = load i64, ptr @cnt, align 8
%cmp2693 = icmp sgt i64 %12, 0
br i1 %cmp2693, label %land.rhs27, label %while.end36
land.rhs27: ; preds = %for.body20, %while.body34
%idx24.094 = phi i64 [ %inc35, %while.body34 ], [ 0, %for.body20 ]
%arrayidx28 = getelementptr inbounds [210 x [15 x i8]], ptr @s, i64 0, i64 %idx24.094
%call31 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx28, ptr noundef nonnull dereferenceable(1) %ss21) #7
%tobool32.not = icmp eq i32 %call31, 0
br i1 %tobool32.not, label %while.end36, label %while.body34
while.body34: ; preds = %land.rhs27
%inc35 = add nuw nsw i64 %idx24.094, 1
%exitcond105.not = icmp eq i64 %inc35, %12
br i1 %exitcond105.not, label %while.end36, label %land.rhs27, !llvm.loop !15
while.end36: ; preds = %land.rhs27, %while.body34, %for.body20
%idx24.0.lcssa = phi i64 [ 0, %for.body20 ], [ %12, %while.body34 ], [ %idx24.094, %land.rhs27 ]
%arrayidx37 = getelementptr inbounds [210 x [15 x i8]], ptr @s, i64 0, i64 %idx24.0.lcssa
%call40 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %arrayidx37, ptr noundef nonnull dereferenceable(1) %ss21) #6
%cond45 = call i64 @llvm.smax.i64(i64 %12, i64 %idx24.0.lcssa)
store i64 %cond45, ptr @cnt, align 8, !tbaa !5
%arrayidx46 = getelementptr inbounds [210 x i64], ptr @a, i64 0, i64 %idx24.0.lcssa
%13 = load i64, ptr %arrayidx46, align 8, !tbaa !5
%dec = add nsw i64 %13, -1
store i64 %dec, ptr %arrayidx46, align 8, !tbaa !5
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %ss21) #6
%inc48 = add nuw nsw i64 %i16.0100, 1
%14 = load i64, ptr %m, align 8, !tbaa !5
%cmp18 = icmp slt i64 %inc48, %14
br i1 %cmp18, label %for.body20, label %for.cond51.preheader, !llvm.loop !16
for.cond.cleanup53: ; preds = %for.body54, %middle.block, %for.cond51.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond51.preheader ], [ %11, %middle.block ], [ %ans.0., %for.body54 ]
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
for.body54: ; preds = %for.body54.preheader109, %for.body54
%i50.0103 = phi i64 [ %inc63, %for.body54 ], [ %i50.0103.ph, %for.body54.preheader109 ]
%ans.0102 = phi i64 [ %ans.0., %for.body54 ], [ %ans.0102.ph, %for.body54.preheader109 ]
%arrayidx55 = getelementptr inbounds [210 x i64], ptr @a, i64 0, i64 %i50.0103
%15 = load i64, ptr %arrayidx55, align 8, !tbaa !5
%ans.0. = call i64 @llvm.smax.i64(i64 %ans.0102, i64 %15)
%inc63 = add nuw nsw i64 %i50.0103, 1
%exitcond106.not = icmp eq i64 %inc63, %5
br i1 %exitcond106.not, label %for.cond.cleanup53, label %for.body54, !llvm.loop !17
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !14, !13}
|
// 091-B
// hapdap
#include<stdio.h>
#include<string.h>
int main(void){
int N, i;
scanf("%d", &N);
char s[N][11];
for(i=0; i<N; i++){
scanf("%s", s[i]);
}
int M, j;
scanf("%d", &M);
char t[M][11];
for(j=0; j<M; j++){
scanf("%s", t[j]);
}
int score, highscore=0;
for(i=0; i<N; i++){
for(j=0; j<N; j++){
//sで一致したら+1点
if(strcmp(s[i],s[j])==0){
score+=1;
}
}
for(j=0; j<M; j++){
//tで一致したら-1点
if(strcmp(s[i],t[j])==0 && score>0){
score-=1;
}
}
if(score>highscore){
highscore=score;
}
score=0;
}
printf("%d\n", highscore);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262104/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262104/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca [11 x i8], i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp76 = icmp sgt i32 %3, 0
br i1 %cmp76, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #6
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %M)
%6 = load i32, ptr %M, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%vla3 = alloca [11 x i8], i64 %7, align 16
%cmp578 = icmp sgt i32 %6, 0
br i1 %cmp578, label %for.body6, label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.body6, %for.end
%.lcssa = phi i32 [ %6, %for.end ], [ %9, %for.body6 ]
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp1588 = icmp sgt i32 %8, 0
br i1 %cmp1588, label %for.cond17.preheader.lr.ph, label %for.end53
for.cond17.preheader.lr.ph: ; preds = %for.cond14.preheader
%cmp3284 = icmp sgt i32 %.lcssa, 0
%wide.trip.count148 = zext i32 %8 to i64
br i1 %cmp3284, label %for.cond17.preheader.us.us.preheader, label %for.cond17.preheader.us92
for.cond17.preheader.us.us.preheader: ; preds = %for.cond17.preheader.lr.ph
%wide.trip.count143 = zext i32 %.lcssa to i64
br label %for.cond17.preheader.us.us
for.cond17.preheader.us.us: ; preds = %for.cond17.preheader.us.us.preheader, %for.cond31.for.end47_crit_edge.us.us
%indvars.iv145 = phi i64 [ 0, %for.cond17.preheader.us.us.preheader ], [ %indvars.iv.next146, %for.cond31.for.end47_crit_edge.us.us ]
%highscore.090.us.us = phi i32 [ 0, %for.cond17.preheader.us.us.preheader ], [ %spec.select75.us.us, %for.cond31.for.end47_crit_edge.us.us ]
%arrayidx21.us.us = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv145
br label %for.body19.us.us
for.body33.us.us: ; preds = %for.body19.us.us, %for.body33.us.us
%indvars.iv140 = phi i64 [ %indvars.iv.next141, %for.body33.us.us ], [ 0, %for.body19.us.us ]
%score.386.us.us = phi i32 [ %spec.select74.us.us, %for.body33.us.us ], [ %spec.select.us.us, %for.body19.us.us ]
%arrayidx38.us.us = getelementptr inbounds [11 x i8], ptr %vla3, i64 %indvars.iv140
%call40.us.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx21.us.us, ptr noundef nonnull dereferenceable(1) %arrayidx38.us.us) #7
%cmp41.us.us = icmp eq i32 %call40.us.us, 0
%cmp42.us.us = icmp sgt i32 %score.386.us.us, 0
%or.cond.us.us = select i1 %cmp41.us.us, i1 %cmp42.us.us, i1 false
%sub.us.us = sext i1 %or.cond.us.us to i32
%spec.select74.us.us = add nsw i32 %score.386.us.us, %sub.us.us
%indvars.iv.next141 = add nuw nsw i64 %indvars.iv140, 1
%exitcond144.not = icmp eq i64 %indvars.iv.next141, %wide.trip.count143
br i1 %exitcond144.not, label %for.cond31.for.end47_crit_edge.us.us, label %for.body33.us.us, !llvm.loop !11
for.body19.us.us: ; preds = %for.cond17.preheader.us.us, %for.body19.us.us
%indvars.iv135 = phi i64 [ 0, %for.cond17.preheader.us.us ], [ %indvars.iv.next136, %for.body19.us.us ]
%score.182.us.us = phi i32 [ 0, %for.cond17.preheader.us.us ], [ %spec.select.us.us, %for.body19.us.us ]
%arrayidx24.us.us = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv135
%call26.us.us = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx21.us.us, ptr noundef nonnull dereferenceable(1) %arrayidx24.us.us) #7
%cmp27.us.us = icmp eq i32 %call26.us.us, 0
%add.us.us = zext i1 %cmp27.us.us to i32
%spec.select.us.us = add nuw nsw i32 %score.182.us.us, %add.us.us
%indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
%exitcond139.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count148
br i1 %exitcond139.not, label %for.body33.us.us, label %for.body19.us.us, !llvm.loop !12
for.cond31.for.end47_crit_edge.us.us: ; preds = %for.body33.us.us
%spec.select75.us.us = call i32 @llvm.smax.i32(i32 %spec.select74.us.us, i32 %highscore.090.us.us)
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
br i1 %exitcond149.not, label %for.end53, label %for.cond17.preheader.us.us, !llvm.loop !13
for.cond17.preheader.us92: ; preds = %for.cond17.preheader.lr.ph, %for.cond17.for.cond31.preheader_crit_edge.us114
%indvars.iv130 = phi i64 [ %indvars.iv.next131, %for.cond17.for.cond31.preheader_crit_edge.us114 ], [ 0, %for.cond17.preheader.lr.ph ]
%highscore.090.us93 = phi i32 [ %spec.select75.us108, %for.cond17.for.cond31.preheader_crit_edge.us114 ], [ 0, %for.cond17.preheader.lr.ph ]
%arrayidx21.us113 = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv130
br label %for.body19.us95
for.body19.us95: ; preds = %for.cond17.preheader.us92, %for.body19.us95
%indvars.iv127 = phi i64 [ 0, %for.cond17.preheader.us92 ], [ %indvars.iv.next128, %for.body19.us95 ]
%score.182.us96 = phi i32 [ 0, %for.cond17.preheader.us92 ], [ %spec.select.us103, %for.body19.us95 ]
%arrayidx24.us99 = getelementptr inbounds [11 x i8], ptr %vla, i64 %indvars.iv127
%call26.us100 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx21.us113, ptr noundef nonnull dereferenceable(1) %arrayidx24.us99) #7
%cmp27.us101 = icmp eq i32 %call26.us100, 0
%add.us102 = zext i1 %cmp27.us101 to i32
%spec.select.us103 = add nuw nsw i32 %score.182.us96, %add.us102
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%exitcond.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count148
br i1 %exitcond.not, label %for.cond17.for.cond31.preheader_crit_edge.us114, label %for.body19.us95, !llvm.loop !12
for.cond17.for.cond31.preheader_crit_edge.us114: ; preds = %for.body19.us95
%spec.select75.us108 = call i32 @llvm.smax.i32(i32 %spec.select.us103, i32 %highscore.090.us93)
%indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
%exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count148
br i1 %exitcond134.not, label %for.end53, label %for.cond17.preheader.us92, !llvm.loop !13
for.body6: ; preds = %for.end, %for.body6
%indvars.iv124 = phi i64 [ %indvars.iv.next125, %for.body6 ], [ 0, %for.end ]
%arrayidx8 = getelementptr inbounds [11 x i8], ptr %vla3, i64 %indvars.iv124
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8)
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%9 = load i32, ptr %M, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp5 = icmp slt i64 %indvars.iv.next125, %10
br i1 %cmp5, label %for.body6, label %for.cond14.preheader, !llvm.loop !14
for.end53: ; preds = %for.cond17.for.cond31.preheader_crit_edge.us114, %for.cond31.for.end47_crit_edge.us.us, %for.cond14.preheader
%highscore.0.lcssa = phi i32 [ 0, %for.cond14.preheader ], [ %spec.select75.us.us, %for.cond31.for.end47_crit_edge.us.us ], [ %spec.select75.us108, %for.cond17.for.cond31.preheader_crit_edge.us114 ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %highscore.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #6
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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}
|
/*
exit
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define BIG 2000000007
#define MOD 1000000007
typedef unsigned long long ull;
typedef signed long long sll;
#define N_MAX 200
#define M_MAX 200
typedef struct {
int a;
int b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
const hw vector8[8] = {
{-1, -1},
{-1, 0},
{-1, +1},
{ 0, -1},
{ 0, +1},
{+1, -1},
{+1, 0},
{+1, +1}
};
ull n, m;
ull h, w;
ull k;
ull va, vb, vc, vd, ve, vf;
ull a[N_MAX];
// sll a[N_MAX];
ull b[M_MAX];
// ull dp[N_MAX][M_MAX + 1];
// char s[N_MAX + 1];
// char t[N_MAX + 1];
// char s[N_MAX][M_MAX + 1];
// hw arr[N_MAX];
// hwll arr[N_MAX];
// hw brr[M_MAX];
// ull digitdp[102][ 2][ 2];
// pos less carry
void swap_adj(ull *a, ull *b){
ull tmp = *b;
*b = *a;
*a = tmp;
return;
}
ull divide(ull a, ull b){
ull x = MOD - 2;
ull ans = 1;
while (x) {
if (x & 1) ans = (ans * b) % MOD;
b = (b * b) % MOD;
x /= 2;
}
return (a * ans) % MOD;
}
int digits(ull x){
int i = 1;
while (x >= 10) {
x /= 10;
i++;
}
return i;
}
ull min(ull x, ull y){
return (x < y) ? x : y;
}
ull gcd(ull x, ull y){
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow(ull a, ull x){
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= MOD;
}
x /= 2;
a = (a * a) % MOD;
}
return result;
}
// int nextroute(int arr[]){
// int i = n - 1;
// int j, x;
// while (arr[i - 1] > arr[i]) i--;
// x = n;
// for (j = i; j < n; j++) {
// if (arr[j] < arr[i - 1]) continue;
// if (x == n || arr[x] > arr[j]) x = j;
// }
// arr[i - 1] ^= arr[x];
// arr[x] ^= arr[i - 1];
// arr[i - 1] ^= arr[x];
// qsort(&arr[i], n - i, sizeof(int), comp);
// return 0;
// }
int nibutan_target(ull target){
ull maxdist = (target * (target + 1) / 2); // 時刻targetまでに到着できる距離は[-maxdist, maxdist]
return (n <= maxdist);
}
int targetdig(ull x, int index /* 1-indexed */){
// static...?
int posmax = digits(x);
if (posmax < index) return -1;
while (posmax > index) {
posmax--;
x /= 10;
}
return x % 10;
}
int intcomp(const void *left, const void *right){
if ((*(int*)left) < (*(int*)right)) {
return -1;
} else if ((*(int*)left) > (*(int*)right)) {
return +1;
} else {
return 0;
}
}
int ullcomp(const void *left, const void *right){
if ((*(ull*)left) < (*(ull*)right)) {
return -1;
} else if ((*(ull*)left) > (*(ull*)right)) {
return +1;
} else {
return 0;
}
}
int sllcomp(const void *left, const void *right){
if ((*(sll*)left) < (*(sll*)right)) {
return -1;
} else if ((*(sll*)left) > (*(sll*)right)) {
return +1;
} else {
return 0;
}
}
int hwAcomp(const void *left, const void *right){
return intcomp(&(((hw*)left)->a), &(((hw*)right)->a));
}
int hwBcomp(const void *left, const void *right){
return intcomp(&(((hw*)left)->b), &(((hw*)right)->b));
}
int hwABcomp(const void *left, const void *right){
int x = hwAcomp(left, right);
if (x) return x;
return hwBcomp(left, right);
}
int hwllAcomp(const void *left, const void *right){
return sllcomp(&(((hw*)left)->a), &(((hw*)right)->a));
}
int hwllBcomp(const void *left, const void *right){
return sllcomp(&(((hw*)left)->b), &(((hw*)right)->b));
}
int hwllABcomp(const void *left, const void *right){
int x = hwllAcomp(left, right);
if (x) return x;
return hwllBcomp(left, right);
}
int ispalin(int x){
return (x == 0) || ((x & -x) == x);
}
int bitlet(char c){
return (1 << (c - 'a'));
}
ull solve(){
int i, j, ki;
// if (n == 1) {
// if (a[0] < b[0] * 2) {
// printf("%f\n", (double)(a[0] * a[0]) / 4);
// } else {
// printf("%llu\n", (a[0] - b[0]) * b[0]);
// }
// return 0;
// }
ull resultx8;
ull speeds[N_MAX];
for (i = 0; i < n; i++) {
ull physicalMaxSpeed = (i > 0 ? speeds[i - 1] : 0) + a[i];
ull currMaxSpeed = b[i];
ull nextMaxSpeed = (i < n - 1 ? b[i + 1] : 0);
ull endMaxSpeed = min(physicalMaxSpeed, min(currMaxSpeed, nextMaxSpeed));
ull maxSpeed = endMaxSpeed;
for (j = i; j >= 0; j--) {
if (j == i || speeds[j] > maxSpeed) {
speeds[j] = maxSpeed;
} else {
break;
}
maxSpeed += a[j];
}
}
// for (i = 0; i < n; i++) printf("%llu\n", speeds[i]);
resultx8 = 0;
for (i = 0; i < n; i++) {
ull left = (i > 0 ? speeds[i - 1] : 0);
ull right = speeds[i];
ull medx2 = (left + right + a[i]);
ull leftTrx8 = (left * 2 + medx2) * (medx2 - left * 2);
ull rightTrx8 = (right * 2 + medx2) * (medx2 - right * 2);
ull cutx4 = (medx2 > b[i] * 2 ? (medx2 - b[i] * 2) * (medx2 - b[i] * 2) : 0);
resultx8 += (leftTrx8 + rightTrx8 - cutx4 * 2);
}
printf("%f\n", (double)resultx8 / 8);
return 0;
}
int main(void){
int i, j;
int x, y;
// scanf("%llu", &n);
scanf("%llu", &n);
for (i = 0; i < n; i++) {
scanf("%llu", &a[i]);
}
for (i = 0; i < n; i++) {
scanf("%llu", &b[i]);
}
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262148/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262148/source.c"
target datalayout = "e-m:e-p270: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.hw = type { i32, i32 }
@vector8 = dso_local local_unnamed_addr constant [8 x %struct.hw] [%struct.hw { i32 -1, i32 -1 }, %struct.hw { i32 -1, i32 0 }, %struct.hw { i32 -1, i32 1 }, %struct.hw { i32 0, i32 -1 }, %struct.hw { i32 0, i32 1 }, %struct.hw { i32 1, i32 -1 }, %struct.hw { i32 1, i32 0 }, %struct.hw { i32 1, i32 1 }], align 16
@n = dso_local global i64 0, align 8
@a = dso_local global [200 x i64] zeroinitializer, align 16
@b = dso_local global [200 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@m = dso_local local_unnamed_addr global i64 0, align 8
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@k = dso_local local_unnamed_addr global i64 0, align 8
@va = dso_local local_unnamed_addr global i64 0, align 8
@vb = dso_local local_unnamed_addr global i64 0, align 8
@vc = dso_local local_unnamed_addr global i64 0, align 8
@vd = dso_local local_unnamed_addr global i64 0, align 8
@ve = dso_local local_unnamed_addr global i64 0, align 8
@vf = dso_local local_unnamed_addr global i64 0, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap_adj(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: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
br label %while.body
while.body: ; preds = %entry, %if.end
%ans.014 = phi i64 [ 1, %entry ], [ %ans.1, %if.end ]
%x.013 = phi i64 [ 1000000005, %entry ], [ %div11, %if.end ]
%b.addr.012 = phi i64 [ %b, %entry ], [ %rem3, %if.end ]
%and = and i64 %x.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %ans.014, %b.addr.012
%rem = urem i64 %mul, 1000000007
br label %if.end
if.end: ; preds = %if.then, %while.body
%ans.1 = phi i64 [ %rem, %if.then ], [ %ans.014, %while.body ]
%mul2 = mul i64 %b.addr.012, %b.addr.012
%rem3 = urem i64 %mul2, 1000000007
%div11 = lshr i64 %x.013, 1
%tobool.not = icmp ult i64 %x.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end
%mul4 = mul i64 %ans.1, %a
%rem5 = urem i64 %mul4, 1000000007
ret i64 %rem5
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @digits(i64 noundef %x) local_unnamed_addr #2 {
entry:
%cmp3 = icmp ugt i64 %x, 9
br i1 %cmp3, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%i.05 = phi i32 [ %inc, %while.body ], [ 1, %entry ]
%x.addr.04 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%div = udiv i64 %x.addr.04, 10
%inc = add nuw nsw i32 %i.05, 1
%cmp = icmp ugt i64 %x.addr.04, 99
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%i.0.lcssa = phi i32 [ 1, %entry ], [ %inc, %while.body ]
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not11 = icmp eq i64 %x, 0
br i1 %tobool.not11, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.014 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%x.addr.013 = phi i64 [ %div10, %if.end ], [ %x, %entry ]
%a.addr.012 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.014, %a.addr.012
%rem = urem i64 %mul, 1000000007
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.014, %while.body ]
%div10 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.012, %a.addr.012
%rem3 = urem i64 %mul2, 1000000007
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @nibutan_target(i64 noundef %target) local_unnamed_addr #4 {
entry:
%add = add i64 %target, 1
%mul = mul i64 %add, %target
%div2 = lshr i64 %mul, 1
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp = icmp ule i64 %0, %div2
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @targetdig(i64 noundef %x, i32 noundef %index) local_unnamed_addr #2 {
entry:
%cmp3.i = icmp ugt i64 %x, 9
br i1 %cmp3.i, label %while.body.i, label %digits.exit
while.body.i: ; preds = %entry, %while.body.i
%i.05.i = phi i32 [ %inc.i, %while.body.i ], [ 1, %entry ]
%x.addr.04.i = phi i64 [ %div.i, %while.body.i ], [ %x, %entry ]
%div.i = udiv i64 %x.addr.04.i, 10
%inc.i = add nuw nsw i32 %i.05.i, 1
%cmp.i = icmp ugt i64 %x.addr.04.i, 99
br i1 %cmp.i, label %while.body.i, label %digits.exit, !llvm.loop !11
digits.exit: ; preds = %while.body.i, %entry
%i.0.lcssa.i = phi i32 [ 1, %entry ], [ %inc.i, %while.body.i ]
%cmp = icmp slt i32 %i.0.lcssa.i, %index
br i1 %cmp, label %cleanup, label %while.cond.preheader
while.cond.preheader: ; preds = %digits.exit
%cmp17 = icmp sgt i32 %i.0.lcssa.i, %index
br i1 %cmp17, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %while.cond.preheader
%0 = sub i32 %i.0.lcssa.i, %index
%1 = xor i32 %index, -1
%2 = add i32 %i.0.lcssa.i, %1
%xtraiter = and i32 %0, 3
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.body.prol.loopexit, label %while.body.prol
while.body.prol: ; preds = %while.body.preheader, %while.body.prol
%posmax.09.prol = phi i32 [ %dec.prol, %while.body.prol ], [ %i.0.lcssa.i, %while.body.preheader ]
%x.addr.08.prol = phi i64 [ %div.prol, %while.body.prol ], [ %x, %while.body.preheader ]
%prol.iter = phi i32 [ %prol.iter.next, %while.body.prol ], [ 0, %while.body.preheader ]
%dec.prol = add nsw i32 %posmax.09.prol, -1
%div.prol = udiv i64 %x.addr.08.prol, 10
%prol.iter.next = add i32 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %while.body.prol.loopexit, label %while.body.prol, !llvm.loop !13
while.body.prol.loopexit: ; preds = %while.body.prol, %while.body.preheader
%posmax.09.unr = phi i32 [ %i.0.lcssa.i, %while.body.preheader ], [ %dec.prol, %while.body.prol ]
%x.addr.08.unr = phi i64 [ %x, %while.body.preheader ], [ %div.prol, %while.body.prol ]
%div.lcssa.unr = phi i64 [ undef, %while.body.preheader ], [ %div.prol, %while.body.prol ]
%3 = icmp ult i32 %2, 3
br i1 %3, label %while.end, label %while.body
while.body: ; preds = %while.body.prol.loopexit, %while.body
%posmax.09 = phi i32 [ %dec.3, %while.body ], [ %posmax.09.unr, %while.body.prol.loopexit ]
%x.addr.08 = phi i64 [ %div.3, %while.body ], [ %x.addr.08.unr, %while.body.prol.loopexit ]
%dec.3 = add nsw i32 %posmax.09, -4
%div.3 = udiv i64 %x.addr.08, 10000
%cmp1.3 = icmp sgt i32 %dec.3, %index
br i1 %cmp1.3, label %while.body, label %while.end, !llvm.loop !15
while.end: ; preds = %while.body.prol.loopexit, %while.body, %while.cond.preheader
%x.addr.0.lcssa = phi i64 [ %x, %while.cond.preheader ], [ %div.lcssa.unr, %while.body.prol.loopexit ], [ %div.3, %while.body ]
%rem = urem i64 %x.addr.0.lcssa, 10
%conv = trunc i64 %rem to i32
br label %cleanup
cleanup: ; preds = %digits.exit, %while.end
%retval.0 = phi i32 [ %conv, %while.end ], [ -1, %digits.exit ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @intcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %left, align 4, !tbaa !16
%1 = load i32, ptr %right, align 4, !tbaa !16
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !5
%1 = load i64, ptr %right, align 8, !tbaa !5
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !5
%1 = load i64, ptr %right, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hwAcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %left, align 4, !tbaa !16
%1 = load i32, ptr %right, align 4, !tbaa !16
%cmp.i = icmp slt i32 %0, %1
%cmp1.i = icmp sgt i32 %0, %1
%..i = zext i1 %cmp1.i to i32
%retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i
ret i32 %retval.0.i
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hwBcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%b = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1
%b1 = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1
%0 = load i32, ptr %b, align 4, !tbaa !16
%1 = load i32, ptr %b1, align 4, !tbaa !16
%cmp.i = icmp slt i32 %0, %1
%cmp1.i = icmp sgt i32 %0, %1
%..i = zext i1 %cmp1.i to i32
%retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i
ret i32 %retval.0.i
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hwABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %left, align 4, !tbaa !16
%1 = load i32, ptr %right, align 4, !tbaa !16
%cmp.i.i = icmp slt i32 %0, %1
%cmp1.i.i = icmp sgt i32 %0, %1
%..i.i = zext i1 %cmp1.i.i to i32
%retval.0.i.i = select i1 %cmp.i.i, i32 -1, i32 %..i.i
%tobool.not = icmp eq i32 %retval.0.i.i, 0
br i1 %tobool.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%b.i = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1
%b1.i = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1
%2 = load i32, ptr %b.i, align 4, !tbaa !16
%3 = load i32, ptr %b1.i, align 4, !tbaa !16
%cmp.i.i5 = icmp slt i32 %2, %3
%cmp1.i.i6 = icmp sgt i32 %2, %3
%..i.i7 = zext i1 %cmp1.i.i6 to i32
%retval.0.i.i8 = select i1 %cmp.i.i5, i32 -1, i32 %..i.i7
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %retval.0.i.i8, %if.end ], [ %retval.0.i.i, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hwllAcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !5
%1 = load i64, ptr %right, align 8, !tbaa !5
%cmp.i = icmp slt i64 %0, %1
%cmp1.i = icmp sgt i64 %0, %1
%..i = zext i1 %cmp1.i to i32
%retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i
ret i32 %retval.0.i
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hwllBcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%b = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1
%b1 = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %b1, align 8, !tbaa !5
%cmp.i = icmp slt i64 %0, %1
%cmp1.i = icmp sgt i64 %0, %1
%..i = zext i1 %cmp1.i to i32
%retval.0.i = select i1 %cmp.i, i32 -1, i32 %..i
ret i32 %retval.0.i
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @hwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !5
%1 = load i64, ptr %right, align 8, !tbaa !5
%cmp.i.i = icmp slt i64 %0, %1
%cmp1.i.i = icmp sgt i64 %0, %1
%..i.i = zext i1 %cmp1.i.i to i32
%retval.0.i.i = select i1 %cmp.i.i, i32 -1, i32 %..i.i
%tobool.not = icmp eq i32 %retval.0.i.i, 0
br i1 %tobool.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%b.i = getelementptr inbounds %struct.hw, ptr %left, i64 0, i32 1
%b1.i = getelementptr inbounds %struct.hw, ptr %right, i64 0, i32 1
%2 = load i64, ptr %b.i, align 8, !tbaa !5
%3 = load i64, ptr %b1.i, align 8, !tbaa !5
%cmp.i.i5 = icmp slt i64 %2, %3
%cmp1.i.i6 = icmp sgt i64 %2, %3
%..i.i7 = zext i1 %cmp1.i.i6 to i32
%retval.0.i.i8 = select i1 %cmp.i.i5, i32 -1, i32 %..i.i7
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %retval.0.i.i8, %if.end ], [ %retval.0.i.i, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ispalin(i32 noundef %x) local_unnamed_addr #3 {
entry:
%cmp = icmp eq i32 %x, 0
br i1 %cmp, label %lor.end, label %lor.rhs
lor.rhs: ; preds = %entry
%0 = tail call i32 @llvm.ctpop.i32(i32 %x), !range !18
%cmp1 = icmp ult i32 %0, 2
%1 = zext i1 %cmp1 to i32
br label %lor.end
lor.end: ; preds = %lor.rhs, %entry
%lor.ext = phi i32 [ 1, %entry ], [ %1, %lor.rhs ]
ret i32 %lor.ext
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @bitlet(i8 noundef signext %c) local_unnamed_addr #6 {
entry:
%conv = sext i8 %c to i32
%sub = add nsw i32 %conv, -97
%shl = shl nuw nsw i32 1, %sub
ret i32 %shl
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #7 {
entry:
%speeds = alloca [200 x i64], align 16
call void @llvm.lifetime.start.p0(i64 1600, ptr nonnull %speeds) #10
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp133.not = icmp eq i64 %0, 0
br i1 %cmp133.not, label %for.end90, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%sub9 = add i64 %0, -1
br label %for.body
for.cond37.preheader: ; preds = %for.end
br i1 %cmp133.not, label %for.end90, label %cond.end49.peel
cond.end49.peel: ; preds = %for.cond37.preheader
%1 = load i64, ptr %speeds, align 16, !tbaa !5
%2 = load i64, ptr @a, align 16, !tbaa !5
%add56.peel = add i64 %1, %2
%mul60.peel = mul i64 %add56.peel, %add56.peel
%mul61.peel = shl i64 %1, 1
%add62.peel = add i64 %add56.peel, %mul61.peel
%sub64.peel = sub i64 %add56.peel, %mul61.peel
%mul65.peel = mul i64 %add62.peel, %sub64.peel
%3 = load i64, ptr @b, align 16, !tbaa !5
%mul68.peel = shl i64 %3, 1
%cmp69.peel = icmp ugt i64 %add56.peel, %mul68.peel
%sub75.peel = sub i64 %add56.peel, %mul68.peel
%mul80.neg.peel = mul i64 %sub75.peel, -2
%.neg.peel = mul i64 %mul80.neg.peel, %sub75.peel
%mul85.neg141.peel = select i1 %cmp69.peel, i64 %.neg.peel, i64 0
%sub86.peel = add i64 %mul65.peel, %mul60.peel
%add87.peel = add i64 %sub86.peel, %mul85.neg141.peel
%exitcond153.peel.not = icmp eq i64 %0, 1
br i1 %exitcond153.peel.not, label %for.end90.loopexit, label %cond.end49.preheader
cond.end49.preheader: ; preds = %cond.end49.peel
%4 = add i64 %0, -1
%5 = add i64 %0, -4294967298
%or.cond = icmp ult i64 %5, -4294967293
br i1 %or.cond, label %cond.end49.preheader166, label %vector.ph
vector.ph: ; preds = %cond.end49.preheader
%n.vec = and i64 %4, -4
%ind.end = or i64 %n.vec, 1
%6 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %add87.peel, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %6, %vector.ph ], [ %52, %vector.body ]
%vec.phi157 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %53, %vector.body ]
%offset.idx = or i64 %index, 1
%7 = and i64 %index, 4294967292
%8 = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %7
%wide.load = load <2 x i64>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i64, ptr %8, i64 2
%wide.load158 = load <2 x i64>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %offset.idx
%wide.load159 = load <2 x i64>, ptr %10, align 8, !tbaa !5
%11 = getelementptr inbounds i64, ptr %10, i64 2
%wide.load160 = load <2 x i64>, ptr %11, align 8, !tbaa !5
%12 = add <2 x i64> %wide.load159, %wide.load
%13 = add <2 x i64> %wide.load160, %wide.load158
%14 = getelementptr inbounds [200 x i64], ptr @a, i64 0, i64 %offset.idx
%wide.load161 = load <2 x i64>, ptr %14, align 8, !tbaa !5
%15 = getelementptr inbounds i64, ptr %14, i64 2
%wide.load162 = load <2 x i64>, ptr %15, align 8, !tbaa !5
%16 = add <2 x i64> %12, %wide.load161
%17 = add <2 x i64> %13, %wide.load162
%18 = shl <2 x i64> %wide.load, <i64 1, i64 1>
%19 = shl <2 x i64> %wide.load158, <i64 1, i64 1>
%20 = add <2 x i64> %16, %18
%21 = add <2 x i64> %17, %19
%22 = sub <2 x i64> %16, %18
%23 = sub <2 x i64> %17, %19
%24 = mul <2 x i64> %20, %22
%25 = mul <2 x i64> %21, %23
%26 = shl <2 x i64> %wide.load159, <i64 1, i64 1>
%27 = shl <2 x i64> %wide.load160, <i64 1, i64 1>
%28 = add <2 x i64> %16, %26
%29 = add <2 x i64> %17, %27
%30 = sub <2 x i64> %16, %26
%31 = sub <2 x i64> %17, %27
%32 = mul <2 x i64> %28, %30
%33 = mul <2 x i64> %29, %31
%34 = getelementptr inbounds [200 x i64], ptr @b, i64 0, i64 %offset.idx
%wide.load163 = load <2 x i64>, ptr %34, align 8, !tbaa !5
%35 = getelementptr inbounds i64, ptr %34, i64 2
%wide.load164 = load <2 x i64>, ptr %35, align 8, !tbaa !5
%36 = shl <2 x i64> %wide.load163, <i64 1, i64 1>
%37 = shl <2 x i64> %wide.load164, <i64 1, i64 1>
%38 = icmp ugt <2 x i64> %16, %36
%39 = icmp ugt <2 x i64> %17, %37
%40 = sub <2 x i64> %16, %36
%41 = sub <2 x i64> %17, %37
%42 = mul <2 x i64> %40, <i64 -2, i64 -2>
%43 = mul <2 x i64> %41, <i64 -2, i64 -2>
%44 = mul <2 x i64> %42, %40
%45 = mul <2 x i64> %43, %41
%46 = select <2 x i1> %38, <2 x i64> %44, <2 x i64> zeroinitializer
%47 = select <2 x i1> %39, <2 x i64> %45, <2 x i64> zeroinitializer
%48 = add <2 x i64> %32, %vec.phi
%49 = add <2 x i64> %33, %vec.phi157
%50 = add <2 x i64> %48, %24
%51 = add <2 x i64> %49, %25
%52 = add <2 x i64> %50, %46
%53 = add <2 x i64> %51, %47
%index.next = add nuw i64 %index, 4
%54 = icmp eq i64 %index.next, %n.vec
br i1 %54, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %53, %52
%55 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.end90.loopexit, label %cond.end49.preheader166
cond.end49.preheader166: ; preds = %cond.end49.preheader, %middle.block
%indvars.iv149.ph = phi i64 [ 1, %cond.end49.preheader ], [ %ind.end, %middle.block ]
%resultx8.0137.ph = phi i64 [ %add87.peel, %cond.end49.preheader ], [ %55, %middle.block ]
br label %cond.end49
for.body: ; preds = %for.body.lr.ph, %for.end
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.end ]
%cmp2.not = icmp eq i64 %indvars.iv, 0
br i1 %cmp2.not, label %cond.end, label %cond.true
cond.true: ; preds = %for.body
%56 = add nuw i64 %indvars.iv, 4294967295
%idxprom = and i64 %56, 4294967295
%arrayidx = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %idxprom
%57 = load i64, ptr %arrayidx, align 8, !tbaa !5
br label %cond.end
cond.end: ; preds = %for.body, %cond.true
%cond = phi i64 [ %57, %cond.true ], [ 0, %for.body ]
%arrayidx5 = getelementptr inbounds [200 x i64], ptr @a, i64 0, i64 %indvars.iv
%58 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%add = add i64 %58, %cond
%arrayidx7 = getelementptr inbounds [200 x i64], ptr @b, i64 0, i64 %indvars.iv
%59 = load i64, ptr %arrayidx7, align 8, !tbaa !5
%cmp10 = icmp ugt i64 %sub9, %indvars.iv
br i1 %cmp10, label %cond.true12, label %if.then.peel
cond.true12: ; preds = %cond.end
%60 = add nuw nsw i64 %indvars.iv, 1
%arrayidx15 = getelementptr inbounds [200 x i64], ptr @b, i64 0, i64 %60
%61 = load i64, ptr %arrayidx15, align 8, !tbaa !5
br label %if.then.peel
if.then.peel: ; preds = %cond.end, %cond.true12
%cond18 = phi i64 [ %61, %cond.true12 ], [ 0, %cond.end ]
%cond.i = tail call i64 @llvm.umin.i64(i64 %59, i64 %cond18)
%cond.i129 = tail call i64 @llvm.umin.i64(i64 %add, i64 %cond.i)
%arrayidx31.peel = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %indvars.iv
store i64 %cond.i129, ptr %arrayidx31.peel, align 8, !tbaa !5
%.not = icmp eq i64 %indvars.iv, 0
br i1 %.not, label %for.end, label %for.body23.peel.next
for.body23.peel.next: ; preds = %if.then.peel
%add34.peel = add i64 %58, %cond.i129
br label %lor.lhs.false
lor.lhs.false: ; preds = %if.then, %for.body23.peel.next
%indvars.iv142.in = phi i64 [ %indvars.iv, %for.body23.peel.next ], [ %indvars.iv142, %if.then ]
%maxSpeed.0131 = phi i64 [ %add34.peel, %for.body23.peel.next ], [ %add34, %if.then ]
%indvars.iv142 = add nsw i64 %indvars.iv142.in, -1
%arrayidx27 = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %indvars.iv142
%62 = load i64, ptr %arrayidx27, align 8, !tbaa !5
%cmp28 = icmp ugt i64 %62, %maxSpeed.0131
br i1 %cmp28, label %if.then, label %for.end
if.then: ; preds = %lor.lhs.false
%arrayidx31 = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %indvars.iv142
store i64 %maxSpeed.0131, ptr %arrayidx31, align 8, !tbaa !5
%arrayidx33 = getelementptr inbounds [200 x i64], ptr @a, i64 0, i64 %indvars.iv142
%63 = load i64, ptr %arrayidx33, align 8, !tbaa !5
%add34 = add i64 %63, %maxSpeed.0131
%64 = icmp sgt i64 %indvars.iv142.in, 1
br i1 %64, label %lor.lhs.false, label %for.end, !llvm.loop !23
for.end: ; preds = %if.then, %lor.lhs.false, %if.then.peel
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %0
br i1 %exitcond.not, label %for.cond37.preheader, label %for.body, !llvm.loop !24
cond.end49: ; preds = %cond.end49.preheader166, %cond.end49
%indvars.iv149 = phi i64 [ %indvars.iv.next150, %cond.end49 ], [ %indvars.iv149.ph, %cond.end49.preheader166 ]
%resultx8.0137 = phi i64 [ %add87, %cond.end49 ], [ %resultx8.0137.ph, %cond.end49.preheader166 ]
%65 = add nuw i64 %indvars.iv149, 4294967295
%idxprom46 = and i64 %65, 4294967295
%arrayidx47 = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %idxprom46
%66 = load i64, ptr %arrayidx47, align 8, !tbaa !5
%arrayidx52 = getelementptr inbounds [200 x i64], ptr %speeds, i64 0, i64 %indvars.iv149
%67 = load i64, ptr %arrayidx52, align 8, !tbaa !5
%add53 = add i64 %67, %66
%arrayidx55 = getelementptr inbounds [200 x i64], ptr @a, i64 0, i64 %indvars.iv149
%68 = load i64, ptr %arrayidx55, align 8, !tbaa !5
%add56 = add i64 %add53, %68
%mul = shl i64 %66, 1
%add57 = add i64 %add56, %mul
%sub59 = sub i64 %add56, %mul
%mul60 = mul i64 %add57, %sub59
%mul61 = shl i64 %67, 1
%add62 = add i64 %add56, %mul61
%sub64 = sub i64 %add56, %mul61
%mul65 = mul i64 %add62, %sub64
%arrayidx67 = getelementptr inbounds [200 x i64], ptr @b, i64 0, i64 %indvars.iv149
%69 = load i64, ptr %arrayidx67, align 8, !tbaa !5
%mul68 = shl i64 %69, 1
%cmp69 = icmp ugt i64 %add56, %mul68
%sub75 = sub i64 %add56, %mul68
%mul80.neg = mul i64 %sub75, -2
%.neg = mul i64 %mul80.neg, %sub75
%mul85.neg141 = select i1 %cmp69, i64 %.neg, i64 0
%add84 = add i64 %mul65, %resultx8.0137
%sub86 = add i64 %add84, %mul60
%add87 = add i64 %sub86, %mul85.neg141
%indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1
%exitcond153.not = icmp eq i64 %indvars.iv.next150, %0
br i1 %exitcond153.not, label %for.end90.loopexit, label %cond.end49, !llvm.loop !25
for.end90.loopexit: ; preds = %cond.end49, %middle.block, %cond.end49.peel
%add87.lcssa = phi i64 [ %add87.peel, %cond.end49.peel ], [ %55, %middle.block ], [ %add87, %cond.end49 ]
%70 = uitofp i64 %add87.lcssa to double
%71 = fmul double %70, 1.250000e-01
br label %for.end90
for.end90: ; preds = %entry, %for.end90.loopexit, %for.cond37.preheader
%resultx8.0.lcssa = phi double [ 0.000000e+00, %for.cond37.preheader ], [ %71, %for.end90.loopexit ], [ 0.000000e+00, %entry ]
%call92 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %resultx8.0.lcssa)
call void @llvm.lifetime.end.p0(i64 1600, ptr nonnull %speeds) #10
ret i64 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n)
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp20.not = icmp eq i64 %0, 0
br i1 %cmp20.not, label %for.end13, label %for.body
for.cond3.preheader: ; preds = %for.body
%1 = icmp eq i64 %2, 0
br i1 %1, label %for.end13, label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200 x i64], ptr @a, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%2 = load i64, ptr @n, align 8, !tbaa !5
%cmp = icmp ugt i64 %2, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !26
for.body7: ; preds = %for.cond3.preheader, %for.body7
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ 0, %for.cond3.preheader ]
%arrayidx9 = getelementptr inbounds [200 x i64], ptr @b, i64 0, i64 %indvars.iv27
%call10 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9)
%indvars.iv.next28 = add nuw i64 %indvars.iv27, 1
%3 = load i64, ptr @n, align 8, !tbaa !5
%cmp5 = icmp ugt i64 %3, %indvars.iv.next28
br i1 %cmp5, label %for.body7, label %for.end13, !llvm.loop !27
for.end13: ; preds = %for.body7, %entry, %for.cond3.preheader
%call14 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #9
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree 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(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 #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree 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 #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-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 }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{i32 0, i32 33}
!19 = distinct !{!19, !10, !20, !21, !22}
!20 = !{!"llvm.loop.peeled.count", i32 1}
!21 = !{!"llvm.loop.isvectorized", i32 1}
!22 = !{!"llvm.loop.unroll.runtime.disable"}
!23 = distinct !{!23, !10, !20}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10, !20, !21}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
|
#include<stdio.h>
int main(void)
{
double r;
double l, s, PI = 3.141592653589;
scanf("%lf", &r);
l = 1.0 * 2 * r*PI;
s = 1.0*r*r*PI;
printf("%f %f\n", s,l);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 2.000000e+00
%mul1 = fmul double %mul, 0x400921FB5444261E
%mul3 = fmul double %0, %0
%mul4 = fmul double %mul3, 0x400921FB5444261E
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul4, double noundef %mul1)
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,f,e;
double n=3.141592653589;
scanf("%lf",&r);
f=(double)(r*r*n);
e=(double)(2*n*r);
printf("%lf ",f);
printf("%lf\n",e);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262256/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262256/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 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:
%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
%mul3 = fmul double %0, 0x401921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, 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){
unsigned int n,i;
int count=0;
scanf("%u",&n);
while(1)
{
for(i=2;i<=n;)
{
i*=2;
}
count++;
i=i/2;
if(i==n || n-i==1)
{
n-i==1?printf("%d",count+1):printf("%d",count);
break;
}
else
{
n=n-i;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%u\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%n.promoted = load i32, ptr %n, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %if.else, %entry
%sub17 = phi i32 [ %n.promoted, %entry ], [ %sub, %if.else ]
%count.0 = phi i32 [ 0, %entry ], [ %inc, %if.else ]
br label %for.cond
for.cond: ; preds = %for.cond, %while.cond
%i.0 = phi i32 [ 2, %while.cond ], [ %mul, %for.cond ]
%cmp.not = icmp ugt i32 %i.0, %sub17
%mul = shl i32 %i.0, 1
br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !9
for.end: ; preds = %for.cond
%inc = add nuw nsw i32 %count.0, 1
%div16 = lshr exact i32 %i.0, 1
%cmp1 = icmp eq i32 %div16, %sub17
br i1 %cmp1, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %for.end
%sub = sub i32 %sub17, %div16
%cmp2 = icmp eq i32 %sub, 1
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %lor.lhs.false, %for.end
%div16.lcssa = phi i32 [ %div16, %lor.lhs.false ], [ %sub17, %for.end ]
%sub3 = sub i32 %sub17, %div16.lcssa
%cmp4 = icmp eq i32 %sub3, 1
%add = add nuw nsw i32 %count.0, 2
%add.sink = select i1 %cmp4, i32 %add, i32 %inc
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
if.else: ; preds = %lor.lhs.false
store i32 %sub, ptr %n, align 4, !tbaa !5
br label %while.cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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()
{
double r,i,s,x;
scanf("%lf",&r);
s=3.141592653589*r*r;
x=2*3.141592653589*r;
printf("%.8lf %.8lf\n",s,x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262342/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%.8lf %.8lf\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>
int main(){
int n,k;
scanf("%d%d",&n,&k);
for(int i=1;i<=9;i++){
if((n*i)%10 == (k%10) || (n*i)%10 == 0){
printf("%d",i);
return 0;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%rem1 = srem i32 %1, 10
%rem = srem i32 %0, 10
%cmp2 = icmp eq i32 %rem, %rem1
%cmp5 = icmp eq i32 %rem, 0
%or.cond = or i1 %cmp2, %cmp5
br i1 %or.cond, label %if.then, label %for.inc
if.then: ; preds = %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%i.015.lcssa = phi i32 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ], [ 8, %for.inc.6 ], [ 9, %for.inc.7 ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.015.lcssa)
br label %cleanup
for.inc: ; preds = %entry
%mul.1 = shl nsw i32 %0, 1
%rem.1 = srem i32 %mul.1, 10
%cmp2.1 = icmp eq i32 %rem.1, %rem1
%cmp5.1 = icmp eq i32 %rem.1, 0
%or.cond.1 = or i1 %cmp2.1, %cmp5.1
br i1 %or.cond.1, label %if.then, label %for.inc.1
for.inc.1: ; preds = %for.inc
%mul.2 = mul nsw i32 %0, 3
%rem.2 = srem i32 %mul.2, 10
%cmp2.2 = icmp eq i32 %rem.2, %rem1
%cmp5.2 = icmp eq i32 %rem.2, 0
%or.cond.2 = or i1 %cmp2.2, %cmp5.2
br i1 %or.cond.2, label %if.then, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%mul.3 = shl nsw i32 %0, 2
%rem.3 = srem i32 %mul.3, 10
%cmp2.3 = icmp eq i32 %rem.3, %rem1
%cmp5.3 = icmp eq i32 %rem.3, 0
%or.cond.3 = or i1 %cmp2.3, %cmp5.3
br i1 %or.cond.3, label %if.then, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%mul.4 = mul nsw i32 %0, 5
%rem.4 = srem i32 %mul.4, 10
%cmp2.4 = icmp eq i32 %rem.4, %rem1
%cmp5.4 = icmp eq i32 %rem.4, 0
%or.cond.4 = or i1 %cmp2.4, %cmp5.4
br i1 %or.cond.4, label %if.then, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%mul.5 = mul nsw i32 %0, 6
%rem.5 = srem i32 %mul.5, 10
%cmp2.5 = icmp eq i32 %rem.5, %rem1
%cmp5.5 = icmp eq i32 %rem.5, 0
%or.cond.5 = or i1 %cmp2.5, %cmp5.5
br i1 %or.cond.5, label %if.then, label %for.inc.5
for.inc.5: ; preds = %for.inc.4
%mul.6 = mul nsw i32 %0, 7
%rem.6 = srem i32 %mul.6, 10
%cmp2.6 = icmp eq i32 %rem.6, %rem1
%cmp5.6 = icmp eq i32 %rem.6, 0
%or.cond.6 = or i1 %cmp2.6, %cmp5.6
br i1 %or.cond.6, label %if.then, label %for.inc.6
for.inc.6: ; preds = %for.inc.5
%mul.7 = shl nsw i32 %0, 3
%rem.7 = srem i32 %mul.7, 10
%cmp2.7 = icmp eq i32 %rem.7, %rem1
%cmp5.7 = icmp eq i32 %rem.7, 0
%or.cond.7 = or i1 %cmp2.7, %cmp5.7
br i1 %or.cond.7, label %if.then, label %for.inc.7
for.inc.7: ; preds = %for.inc.6
%mul.8 = mul nsw i32 %0, 9
%rem.8 = srem i32 %mul.8, 10
%cmp2.8 = icmp eq i32 %rem.8, %rem1
%cmp5.8 = icmp eq i32 %rem.8, 0
%or.cond.8 = or i1 %cmp2.8, %cmp5.8
br i1 %or.cond.8, label %if.then, label %cleanup
cleanup: ; preds = %for.inc.7, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define _USE_MATH_DEFINES
#include<math.h>
int main(void){
double r,a,b;
scanf("%lf",&r);
a = r*r*M_PI;
b =2*r*M_PI;
printf("%f %f\n",a,b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262443/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262443/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#define PI 3.141592653589
int main(void){
double r,area,cir;
scanf("%lf",&r);
area=r*r*PI;
cir=r*2*PI;
printf("%f %f\n",area,cir);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262487/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262487/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 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 a[502] = {0};
int b[502] = {0};
int main(){
int n, k, i = 0;
int o = 0;
scanf("%d %d", &n, &k);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (i = 1; i < n; i++){
int v = k-a[i]-a[i-1]-b[i-1];
if (v <= 0) {
continue;
}
b[i] = v;
o+=v;
}
printf("%d\n", o);
for (i = 0; i < n; i++) {
printf("%d ", b[i]+a[i]);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26253/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26253/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@a = dso_local global [502 x i32] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [502 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp58 = icmp sgt i32 %0, 0
br i1 %cmp58, label %for.body, label %for.end20
for.cond2.preheader: ; preds = %for.body
%cmp360 = icmp sgt i32 %2, 1
br i1 %cmp360, label %for.body4.lr.ph, label %for.end20
for.body4.lr.ph: ; preds = %for.cond2.preheader
%1 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %2 to i64
%.pre = load i32, ptr @a, align 16, !tbaa !5
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [502 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.lr.ph, %cleanup
%4 = phi i32 [ %.pre, %for.body4.lr.ph ], [ %5, %cleanup ]
%indvars.iv68 = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next69, %cleanup ]
%o.062 = phi i32 [ 0, %for.body4.lr.ph ], [ %o.1, %cleanup ]
%arrayidx6 = getelementptr inbounds [502 x i32], ptr @a, i64 0, i64 %indvars.iv68
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%6 = add nsw i64 %indvars.iv68, -1
%arrayidx13 = getelementptr inbounds [502 x i32], ptr @b, i64 0, i64 %6
%7 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%8 = add i32 %5, %4
%9 = add i32 %8, %7
%sub14 = sub i32 %1, %9
%cmp15 = icmp slt i32 %sub14, 1
br i1 %cmp15, label %cleanup, label %if.end
if.end: ; preds = %for.body4
%arrayidx17 = getelementptr inbounds [502 x i32], ptr @b, i64 0, i64 %indvars.iv68
store i32 %sub14, ptr %arrayidx17, align 4, !tbaa !5
%add = add nsw i32 %sub14, %o.062
br label %cleanup
cleanup: ; preds = %for.body4, %if.end
%o.1 = phi i32 [ %add, %if.end ], [ %o.062, %for.body4 ]
%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.end20, label %for.body4, !llvm.loop !11
for.end20: ; preds = %cleanup, %entry, %for.cond2.preheader
%o.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %o.1, %cleanup ]
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %o.0.lcssa)
%10 = load i32, ptr %n, align 4, !tbaa !5
%cmp2364 = icmp sgt i32 %10, 0
br i1 %cmp2364, label %for.body24, label %for.end33
for.body24: ; preds = %for.end20, %for.body24
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body24 ], [ 0, %for.end20 ]
%arrayidx26 = getelementptr inbounds [502 x i32], ptr @b, i64 0, i64 %indvars.iv72
%11 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%arrayidx28 = getelementptr inbounds [502 x i32], ptr @a, i64 0, i64 %indvars.iv72
%12 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add29 = add nsw i32 %12, %11
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add29)
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%13 = load i32, ptr %n, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp23 = icmp slt i64 %indvars.iv.next73, %14
br i1 %cmp23, label %for.body24, label %for.end33, !llvm.loop !12
for.end33: ; preds = %for.body24, %for.end20
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
double r,menseki,enshu;
double pai=3.141592653589;
scanf("%lf",&r);
menseki=pai*r*r;
enshu=2*pai*r;
printf("%f %f\n",menseki,enshu);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262573/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262573/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x400921FB5444261E
%mul1 = fmul double %0, %mul
%mul3 = fmul double %0, 0x401921FB5444261E
%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(){
double r, are, circ;
scanf("%lf", &r);
are = r*r*3.141592653589;
circ = 2*3.141592653589*r;
printf("%lf %lf", are, circ);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262616/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262616/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%lf %lf\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, 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>
int main()
{
int n,i,j,k,l,count=0,m;
scanf("%d %d",&n,&m);
int ara[n],ara1[n];
for(i=0; i<n; i++)
{
scanf("%d",&ara[i]);
}
ara1[0]=ara[0];
for(i=1; i<n; i++)
{
if(ara[i]+ara1[i-1]<m)
{
//printf("%d\n",ara1[i-1]+ara[i]);
count+=m-ara1[i-1]-ara[i];
j=m-ara1[i-1];
ara1[i]=j;
// printf("%d %d %d\n",j,count,ara1[i]);
}
else
ara1[i]=ara[i];
}
printf("%d\n",count);
for(i=0; i<n; i++)
printf("%d ",ara1[i]);
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26266/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26266/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp61 = icmp sgt i32 %3, 0
br i1 %cmp61, label %for.body, label %for.end33
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
%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
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
store i32 %.pre, ptr %vla1, align 16, !tbaa !5
%cmp663 = icmp sgt i32 %5, 1
br i1 %cmp663, label %for.body7.lr.ph, label %for.end33
for.body7.lr.ph: ; preds = %for.end
%7 = load i32, ptr %m, align 4, !tbaa !5
%wide.trip.count = zext i32 %5 to i64
%8 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %8, 1
%9 = icmp eq i32 %5, 2
br i1 %9, label %for.end33.loopexit.unr-lcssa, label %for.body7.lr.ph.new
for.body7.lr.ph.new: ; preds = %for.body7.lr.ph
%unroll_iter = and i64 %8, -2
br label %for.body7
for.body7: ; preds = %for.body7, %for.body7.lr.ph.new
%10 = phi i32 [ %.pre, %for.body7.lr.ph.new ], [ %.sink.1, %for.body7 ]
%indvars.iv71 = phi i64 [ 1, %for.body7.lr.ph.new ], [ %indvars.iv.next72.1, %for.body7 ]
%count.064 = phi i32 [ 0, %for.body7.lr.ph.new ], [ %count.1.1, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.lr.ph.new ], [ %niter.next.1, %for.body7 ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv71
%11 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%add = add nsw i32 %10, %11
%cmp12 = icmp slt i32 %add, %7
%sub16 = sub nsw i32 %7, %10
%sub19 = sub i32 %count.064, %11
%add20 = add i32 %sub19, %sub16
%.sink = select i1 %cmp12, i32 %sub16, i32 %11
%count.1 = select i1 %cmp12, i32 %add20, i32 %count.064
%12 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv71
store i32 %.sink, ptr %12, align 4
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%arrayidx9.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next72
%13 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%add.1 = add nsw i32 %.sink, %13
%cmp12.1 = icmp slt i32 %add.1, %7
%sub16.1 = sub nsw i32 %7, %.sink
%sub19.1 = sub i32 %count.1, %13
%add20.1 = add i32 %sub19.1, %sub16.1
%.sink.1 = select i1 %cmp12.1, i32 %sub16.1, i32 %13
%count.1.1 = select i1 %cmp12.1, i32 %add20.1, i32 %count.1
%14 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv.next72
store i32 %.sink.1, ptr %14, align 4
%indvars.iv.next72.1 = add nuw nsw i64 %indvars.iv71, 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.end33.loopexit.unr-lcssa, label %for.body7, !llvm.loop !11
for.end33.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.lr.ph
%count.1.lcssa.ph = phi i32 [ undef, %for.body7.lr.ph ], [ %count.1.1, %for.body7 ]
%.unr = phi i32 [ %.pre, %for.body7.lr.ph ], [ %.sink.1, %for.body7 ]
%indvars.iv71.unr = phi i64 [ 1, %for.body7.lr.ph ], [ %indvars.iv.next72.1, %for.body7 ]
%count.064.unr = phi i32 [ 0, %for.body7.lr.ph ], [ %count.1.1, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end33, label %for.body7.epil
for.body7.epil: ; preds = %for.end33.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv71.unr
%15 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %.unr, %15
%cmp12.epil = icmp slt i32 %add.epil, %7
%sub16.epil = sub nsw i32 %7, %.unr
%sub19.epil = sub i32 %count.064.unr, %15
%add20.epil = add i32 %sub19.epil, %sub16.epil
%.sink.epil = select i1 %cmp12.epil, i32 %sub16.epil, i32 %15
%count.1.epil = select i1 %cmp12.epil, i32 %add20.epil, i32 %count.064.unr
%16 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv71.unr
store i32 %.sink.epil, ptr %16, align 4
br label %for.end33
for.end33: ; preds = %for.body7.epil, %for.end33.loopexit.unr-lcssa, %entry, %for.end
%count.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %entry ], [ %count.1.lcssa.ph, %for.end33.loopexit.unr-lcssa ], [ %count.1.epil, %for.body7.epil ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa)
%17 = load i32, ptr %n, align 4, !tbaa !5
%cmp3667 = icmp sgt i32 %17, 0
br i1 %cmp3667, label %for.body37, label %for.end43
for.body37: ; preds = %for.end33, %for.body37
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body37 ], [ 0, %for.end33 ]
%arrayidx39 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv75
%18 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %18)
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp36 = icmp slt i64 %indvars.iv.next76, %20
br i1 %cmp36, label %for.body37, label %for.end43, !llvm.loop !12
for.end43: ; preds = %for.body37, %for.end33
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<math.h>
int main()
{
double r,distance,surface_area;
scanf("%lf",&r);
distance=2 * M_PI * r;
surface_area=r*r*M_PI;
printf("%lf %lf\n",surface_area,distance);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262702/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262702/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x401921FB54442D18
%mul1 = fmul double %0, %0
%mul2 = fmul double %mul1, 0x400921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul)
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(void){
double r;
int i;
double area, circumference;
scanf("%lf", &r);
area = M_PI * pow(r, 2);
circumference = 2 * M_PI * r;
printf("%f %f\n", area, circumference);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262746/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262746/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%square = fmul double %0, %0
%mul = fmul double %square, 0x400921FB54442D18
%mul2 = fmul double %0, 0x401921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul, 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>
#include<math.h>
int main(void){
double r;
scanf("%lf", &r);
printf("%f %f\n", M_PI*r*r, 2*M_PI*r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x400921FB54442D18
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 0x401921FB54442D18
%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>
int main()
{
int n, k, i, res = 0, temp_res;
scanf("%d %d", &n, &k);
int a[n];
for(i = 0; i < n; i++)
scanf("%d", &a[i]);
for(i = 0; i < n; i++){
if((a[i] + a[i + 1]) < k){
temp_res = k - (a[i] + a[i + 1]);
a[i + 1] += temp_res;
res += temp_res;
}
}
printf("%d\n",res);
for(i = 0; i < n; i++){
if(i != 0)
printf(" ");
printf("%d",a[i]);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26284/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp56 = icmp sgt i32 %3, 0
br i1 %cmp56, label %for.body, label %for.end24
for.cond2.preheader: ; preds = %for.body
%cmp358 = icmp sgt i32 %6, 0
br i1 %cmp358, label %for.body4.lr.ph, label %for.end24
for.body4.lr.ph: ; preds = %for.cond2.preheader
%4 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %6 to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %6, 1
br i1 %5, label %for.end24.loopexit.unr-lcssa, label %for.body4.lr.ph.new
for.body4.lr.ph.new: ; preds = %for.body4.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.inc22.1, %for.body4.lr.ph.new
%8 = phi i32 [ %.pre, %for.body4.lr.ph.new ], [ %12, %for.inc22.1 ]
%indvars.iv66 = phi i64 [ 0, %for.body4.lr.ph.new ], [ %indvars.iv.next67.1, %for.inc22.1 ]
%res.059 = phi i32 [ 0, %for.body4.lr.ph.new ], [ %res.1.1, %for.inc22.1 ]
%niter = phi i64 [ 0, %for.body4.lr.ph.new ], [ %niter.next.1, %for.inc22.1 ]
%indvars.iv.next67 = or i64 %indvars.iv66, 1
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next67
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%add9 = add nsw i32 %9, %8
%cmp10 = icmp slt i32 %add9, %4
br i1 %cmp10, label %if.then, label %for.inc22
if.then: ; preds = %for.body4
%sub = sub nsw i32 %4, %add9
%add20 = add nsw i32 %sub, %9
store i32 %add20, ptr %arrayidx8, align 4, !tbaa !5
%add21 = add nsw i32 %sub, %res.059
br label %for.inc22
for.inc22: ; preds = %for.body4, %if.then
%10 = phi i32 [ %add20, %if.then ], [ %9, %for.body4 ]
%res.1 = phi i32 [ %add21, %if.then ], [ %res.059, %for.body4 ]
%indvars.iv.next67.1 = add nuw nsw i64 %indvars.iv66, 2
%arrayidx8.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next67.1
%11 = load i32, ptr %arrayidx8.1, align 8, !tbaa !5
%add9.1 = add nsw i32 %11, %10
%cmp10.1 = icmp slt i32 %add9.1, %4
br i1 %cmp10.1, label %if.then.1, label %for.inc22.1
if.then.1: ; preds = %for.inc22
%sub.1 = sub nsw i32 %4, %add9.1
%add20.1 = add nsw i32 %sub.1, %11
store i32 %add20.1, ptr %arrayidx8.1, align 8, !tbaa !5
%add21.1 = add nsw i32 %sub.1, %res.1
br label %for.inc22.1
for.inc22.1: ; preds = %if.then.1, %for.inc22
%12 = phi i32 [ %add20.1, %if.then.1 ], [ %11, %for.inc22 ]
%res.1.1 = phi i32 [ %add21.1, %if.then.1 ], [ %res.1, %for.inc22 ]
%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.end24.loopexit.unr-lcssa.loopexit, label %for.body4, !llvm.loop !11
for.end24.loopexit.unr-lcssa.loopexit: ; preds = %for.inc22.1
%13 = add nuw nsw i64 %indvars.iv66, 3
br label %for.end24.loopexit.unr-lcssa
for.end24.loopexit.unr-lcssa: ; preds = %for.end24.loopexit.unr-lcssa.loopexit, %for.body4.lr.ph
%res.1.lcssa.ph = phi i32 [ undef, %for.body4.lr.ph ], [ %res.1.1, %for.end24.loopexit.unr-lcssa.loopexit ]
%.unr = phi i32 [ %.pre, %for.body4.lr.ph ], [ %12, %for.end24.loopexit.unr-lcssa.loopexit ]
%indvars.iv66.unr = phi i64 [ 1, %for.body4.lr.ph ], [ %13, %for.end24.loopexit.unr-lcssa.loopexit ]
%res.059.unr = phi i32 [ 0, %for.body4.lr.ph ], [ %res.1.1, %for.end24.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end24, label %for.body4.epil
for.body4.epil: ; preds = %for.end24.loopexit.unr-lcssa
%arrayidx8.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv66.unr
%14 = load i32, ptr %arrayidx8.epil, align 4, !tbaa !5
%add9.epil = add nsw i32 %14, %.unr
%cmp10.epil = icmp slt i32 %add9.epil, %4
br i1 %cmp10.epil, label %if.then.epil, label %for.end24
if.then.epil: ; preds = %for.body4.epil
%sub.epil = sub nsw i32 %4, %add9.epil
%add20.epil = add nsw i32 %sub.epil, %14
store i32 %add20.epil, ptr %arrayidx8.epil, align 4, !tbaa !5
%add21.epil = add nsw i32 %sub.epil, %res.059.unr
br label %for.end24
for.end24: ; preds = %for.end24.loopexit.unr-lcssa, %if.then.epil, %for.body4.epil, %entry, %for.cond2.preheader
%res.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %res.1.lcssa.ph, %for.end24.loopexit.unr-lcssa ], [ %add21.epil, %if.then.epil ], [ %res.059.unr, %for.body4.epil ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.0.lcssa)
%15 = load i32, ptr %n, align 4, !tbaa !5
%cmp2762 = icmp sgt i32 %15, 0
br i1 %cmp2762, label %if.end32.peel, label %for.end38
if.end32.peel: ; preds = %for.end24
%.pre73 = load i32, ptr %vla, align 16, !tbaa !5
%call35.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre73)
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp27.peel = icmp sgt i32 %16, 1
br i1 %cmp27.peel, label %if.end32, label %for.end38
if.end32: ; preds = %if.end32.peel, %if.end32
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %if.end32 ], [ 1, %if.end32.peel ]
%putchar55 = call i32 @putchar(i32 32)
%arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv69
%17 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp27 = icmp slt i64 %indvars.iv.next70, %19
br i1 %cmp27, label %if.end32, label %for.end38, !llvm.loop !12
for.end38: ; preds = %if.end32, %if.end32.peel, %for.end24
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main(){
double r,S,L;
scanf("%lf",&r);
S=r*r*3.14159265358979;
L=2*r*3.14159265358979;
printf("%f %f\n",S,L);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x400921FB54442D11
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D11
%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()
{
double r;
scanf("%lf",&r);
printf("%lf %lf\n",r * r * 3.141592653589,2 * r * 3.141592653589);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_262926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_262926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#include <stdint.h>
int main()
{
long int k,r;
long int res,tmp;
res=0;
tmp=0;
scanf("%ld",&k);
scanf("%ld",&r);
while(1){
res++;
tmp=tmp+k;
tmp=tmp%10;
if(tmp==r || tmp==0){
break;
}
}
printf("%ld\n",res);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26297/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26297/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i64, align 8
%r = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3
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 %k)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i64, ptr %k, align 8, !tbaa !5
%1 = load i64, ptr %r, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%res.0 = phi i64 [ 0, %entry ], [ %inc, %while.cond ]
%tmp.0 = phi i64 [ 0, %entry ], [ %rem, %while.cond ]
%inc = add nuw nsw i64 %res.0, 1
%add = add nsw i64 %0, %tmp.0
%rem = srem i64 %add, 10
%cmp = icmp eq i64 %rem, %1
%cmp2 = icmp eq i64 %rem, 0
%or.cond = or i1 %cmp, %cmp2
br i1 %or.cond, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %inc)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void)
{
double r;
double men;
double shu;
scanf("%lf", &r);
if( r<0 || r>10000 )
{
return 1;
}
men = r * r * M_PI;
shu = ( r + r ) * M_PI;
printf("%lf %lf \n", men, shu);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263011/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263011/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 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
%cmp = fcmp olt double %0, 0.000000e+00
%cmp1 = fcmp ogt double %0, 1.000000e+04
%or.cond = or i1 %cmp, %cmp1
br i1 %or.cond, label %cleanup, label %if.end
if.end: ; preds = %entry
%mul = fmul double %0, %0
%mul2 = fmul double %mul, 0x400921FB54442D18
%add = fadd double %0, %0
%mul3 = fmul double %add, 0x400921FB54442D18
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul3)
br label %cleanup
cleanup: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 0, %if.end ], [ 1, %entry ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #3
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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)"}
|
#include <stdio.h>
#include <math.h>
int main()
{
double r;
double S,l;
scanf("%lf",&r);
S=r*r*M_PI;
l=2*r*M_PI;
printf("%f %f\n",S,l);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263055/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263055/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
int main(void){
double r;
scanf("%lf",&r);
printf("%lf %lf\n",r*r*3.141592653589,2*r*3.141592653589);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263099/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263099/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#include<math.h>
int main(){
double r,length,menseki;
scanf("%lf",&r);
length = r*(2.0*M_PI);
menseki = r*r*M_PI;
printf("%f %f\n",menseki,length);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x401921FB54442D18
%mul1 = fmul double %0, %0
%mul2 = fmul double %mul1, 0x400921FB54442D18
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul)
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(void) {
double r;
scanf("%lf", &r);
double S = r * r * M_PI;
double L = 2 * r * M_PI;
printf("%.6f %.6f\n", S, L);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263192/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263192/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"}
|
#include <stdio.h>
int main()
{
double r,area,C;
scanf("%lf",&r);
if(r>0&&r<10000)
{
area =3.141592653589*r*r;
C=2*3.141592653589*r;
printf("%.6lf %.6lf",area,C);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263235/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263235/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%.6lf %.6lf\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
%cmp = fcmp ogt double %0, 0.000000e+00
%cmp1 = fcmp olt double %0, 1.000000e+04
%or.cond = and i1 %cmp, %cmp1
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %entry
%mul = fmul double %0, 0x400921FB5444261E
%mul2 = fmul double %0, %mul
%mul3 = fmul double %0, 0x401921FB5444261E
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul2, double noundef %mul3)
br label %if.end
if.end: ; preds = %if.then, %entry
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)"}
|
#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979
int main(void){
double r;
scanf("%lf",&r);
printf("%.6f %.6f\n",r*r*PI,2*r*PI);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x400921FB54442D11
%mul2 = fmul double %0, 2.000000e+00
%mul3 = fmul double %mul2, 0x400921FB54442D11
%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(){
double r,S,L,pi;
pi=3.141592653589;
scanf("%lf\n",&r);
S=pi*r*r;
L=2*pi*r;
printf("%lf %lf\n",S,L);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\0A\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
%mul3 = fmul double %0, 0x401921FB5444261E
%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(void){
double r;
double s;
double l;
scanf("%lf",&r);
s = r*r*M_PI;
l = 2*r*M_PI;
printf("%.30f\n %.30f\n",s,l);}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [14 x i8] c"%.30f\0A %.30f\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(void){
double r;
scanf("%lf",&r);
printf("%f %f\n",M_PI*r*r,2*M_PI*r);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263459/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263459/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x400921FB54442D18
%mul1 = fmul double %0, %mul
%mul2 = fmul double %0, 0x401921FB54442D18
%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>
#include <math.h>
int main(){
double r;
scanf ("%lf",&r);
printf("%f %f\n",r*r*M_PI,r*2*M_PI);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263523/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263523/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(void){
double r;
double s,fai;
scanf("%lf",&r);
s=r*r*M_PI;
fai=r*M_PI*2.00;
printf("%lf %lf\n",s,fai);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_263567/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_263567/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 0x400921FB54442D18
%mul2 = fmul double %0, 0x400921FB54442D18
%mul3 = fmul double %mul2, 2.000000e+00
%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()
{
int n,k,a[1000];
int i;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
int extra=0;
for(i=1;i<n;i++)
{
if(a[i]+a[i-1]<k)
{
extra+=k-(a[i]+a[i-1]);
a[i]+=k-(a[i]+a[i-1]);
}
}
printf("%d\n",extra);
for(i=0;i<n;i++)
printf("%d ",a[i]);
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_26361/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_26361/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp57 = icmp sgt i32 %0, 0
br i1 %cmp57, label %for.body, label %for.end30
for.cond2.preheader: ; preds = %for.body
%cmp359 = icmp sgt i32 %4, 1
br i1 %cmp359, label %for.body4.lr.ph, label %for.end30
for.body4.lr.ph: ; preds = %for.cond2.preheader
%1 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %4 to i64
%.pre = load i32, ptr %a, align 16, !tbaa !5
%2 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %2, 1
%3 = icmp eq i32 %4, 2
br i1 %3, label %for.end30.loopexit.unr-lcssa, label %for.body4.lr.ph.new
for.body4.lr.ph.new: ; preds = %for.body4.lr.ph
%unroll_iter = and i64 %2, -2
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.inc28.1, %for.body4.lr.ph.new
%6 = phi i32 [ %.pre, %for.body4.lr.ph.new ], [ %10, %for.inc28.1 ]
%indvars.iv67 = phi i64 [ 1, %for.body4.lr.ph.new ], [ %indvars.iv.next68.1, %for.inc28.1 ]
%extra.061 = phi i32 [ 0, %for.body4.lr.ph.new ], [ %extra.1.1, %for.inc28.1 ]
%niter = phi i64 [ 0, %for.body4.lr.ph.new ], [ %niter.next.1, %for.inc28.1 ]
%arrayidx6 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv67
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%add = add nsw i32 %6, %7
%cmp9 = icmp slt i32 %add, %1
br i1 %cmp9, label %if.then, label %for.inc28
if.then: ; preds = %for.body4
%sub16 = sub nsw i32 %1, %add
%add17 = add nsw i32 %sub16, %extra.061
%add27 = add nsw i32 %sub16, %7
store i32 %add27, ptr %arrayidx6, align 4, !tbaa !5
br label %for.inc28
for.inc28: ; preds = %for.body4, %if.then
%8 = phi i32 [ %add27, %if.then ], [ %7, %for.body4 ]
%extra.1 = phi i32 [ %add17, %if.then ], [ %extra.061, %for.body4 ]
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%arrayidx6.1 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next68
%9 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
%add.1 = add nsw i32 %8, %9
%cmp9.1 = icmp slt i32 %add.1, %1
br i1 %cmp9.1, label %if.then.1, label %for.inc28.1
if.then.1: ; preds = %for.inc28
%sub16.1 = sub nsw i32 %1, %add.1
%add17.1 = add nsw i32 %sub16.1, %extra.1
%add27.1 = add nsw i32 %sub16.1, %9
store i32 %add27.1, ptr %arrayidx6.1, align 4, !tbaa !5
br label %for.inc28.1
for.inc28.1: ; preds = %if.then.1, %for.inc28
%10 = phi i32 [ %add27.1, %if.then.1 ], [ %9, %for.inc28 ]
%extra.1.1 = phi i32 [ %add17.1, %if.then.1 ], [ %extra.1, %for.inc28 ]
%indvars.iv.next68.1 = add nuw nsw i64 %indvars.iv67, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end30.loopexit.unr-lcssa, label %for.body4, !llvm.loop !11
for.end30.loopexit.unr-lcssa: ; preds = %for.inc28.1, %for.body4.lr.ph
%extra.1.lcssa.ph = phi i32 [ undef, %for.body4.lr.ph ], [ %extra.1.1, %for.inc28.1 ]
%.unr = phi i32 [ %.pre, %for.body4.lr.ph ], [ %10, %for.inc28.1 ]
%indvars.iv67.unr = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next68.1, %for.inc28.1 ]
%extra.061.unr = phi i32 [ 0, %for.body4.lr.ph ], [ %extra.1.1, %for.inc28.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end30, label %for.body4.epil
for.body4.epil: ; preds = %for.end30.loopexit.unr-lcssa
%arrayidx6.epil = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv67.unr
%11 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %.unr, %11
%cmp9.epil = icmp slt i32 %add.epil, %1
br i1 %cmp9.epil, label %if.then.epil, label %for.end30
if.then.epil: ; preds = %for.body4.epil
%sub16.epil = sub nsw i32 %1, %add.epil
%add17.epil = add nsw i32 %sub16.epil, %extra.061.unr
%add27.epil = add nsw i32 %sub16.epil, %11
store i32 %add27.epil, ptr %arrayidx6.epil, align 4, !tbaa !5
br label %for.end30
for.end30: ; preds = %for.end30.loopexit.unr-lcssa, %if.then.epil, %for.body4.epil, %entry, %for.cond2.preheader
%extra.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %extra.1.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %add17.epil, %if.then.epil ], [ %extra.061.unr, %for.body4.epil ]
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %extra.0.lcssa)
%12 = load i32, ptr %n, align 4, !tbaa !5
%cmp3363 = icmp sgt i32 %12, 0
br i1 %cmp3363, label %for.body34, label %for.end40
for.body34: ; preds = %for.end30, %for.body34
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body34 ], [ 0, %for.end30 ]
%arrayidx36 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv71
%13 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %13)
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp33 = icmp slt i64 %indvars.iv.next72, %15
br i1 %cmp33, label %for.body34, label %for.end40, !llvm.loop !12
for.end40: ; preds = %for.body34, %for.end30
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.