Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main()
{
int r,c,a;
scanf("%d%d",&r,&c);
if(r>=2 && r<=100 && c>=2 && c<=100)
{
a=(r-1)*(c-1);
printf("%d\n",a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200126/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200126/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%r = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #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 %r, ptr noundef nonnull %c)
%0 = load i32, ptr %r, align 4
%1 = add i32 %0, -2
%or.cond = icmp ult i32 %1, 99
%2 = load i32, ptr %c, align 4
%cmp3 = icmp sgt i32 %2, 1
%or.cond8 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 101
%or.cond9 = select i1 %or.cond8, i1 %cmp5, i1 false
br i1 %or.cond9, label %if.then, label %if.end
if.then: ; preds = %entry
%sub = add nsw i32 %0, -1
%sub6 = add nsw i32 %2, -1
%mul = mul nuw nsw i32 %sub6, %sub
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
br label %if.end
if.end: ; preds = %if.then, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, 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 <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
typedef long long ll;
typedef unsigned int uint;
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%ld", &x)
#define sll(x) scanf("%lld", &x)
#define sc(x) scanf("%c", &x)
#define ss(x) scanf("%s", x)
#define f(i, a, b) for(i = a; i < b; i++)
int main() {
int n, p;
int arr[300];
si(p);
si(n);
int i;
f(i, 0, p)
arr[i] = -1;
int num;
f(i, 0, n) {
si(num);
if(arr[num % p] >= 0) {
printf("%d\n", (i + 1));
break;
}
arr[num % p] = num;
}
if(i == n)
printf("-1\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20017/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20017/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [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
%p = alloca i32, align 4
%arr = alloca [300 x i32], align 16
%num = 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 %p) #5
call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %arr) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %p, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %arr, i8 -1, i64 %2, i1 false), !tbaa !5
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp330 = icmp sgt i32 %3, 0
br i1 %cmp330, label %for.body4, label %for.end15
for.body4: ; preds = %for.end, %if.end
%i.131 = phi i32 [ %inc14, %if.end ], [ 0, %for.end ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%4 = load i32, ptr %num, align 4, !tbaa !5
%5 = load i32, ptr %p, align 4, !tbaa !5
%rem = srem i32 %4, %5
%idxprom6 = sext i32 %rem to i64
%arrayidx7 = getelementptr inbounds [300 x i32], ptr %arr, i64 0, i64 %idxprom6
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %6, -1
br i1 %cmp8, label %if.then, label %if.end
if.then: ; preds = %for.body4
%add = add nuw nsw i32 %i.131, 1
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end15
if.end: ; preds = %for.body4
store i32 %4, ptr %arrayidx7, align 4, !tbaa !5
%inc14 = add nuw nsw i32 %i.131, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc14, %7
br i1 %cmp3, label %for.body4, label %for.end15, !llvm.loop !9
for.end15: ; preds = %if.end, %for.end, %if.then
%8 = phi i32 [ %.pre, %if.then ], [ %3, %for.end ], [ %7, %if.end ]
%i.127 = phi i32 [ %i.131, %if.then ], [ 0, %for.end ], [ %inc14, %if.end ]
%cmp16 = icmp eq i32 %i.127, %8
br i1 %cmp16, label %if.then17, label %if.end19
if.then17: ; preds = %for.end15
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end19
if.end19: ; preds = %if.then17, %for.end15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5
call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %arr) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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 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 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int H,W;
scanf("%d%d",&H,&W);
int a[H+1][W+1];
int i,j;
for(i=1;i<=H;i++){
for(j=1;j<=W;j++){
scanf("%d", &a[i][j]);
a[i][j]=a[i][j]%2;
}
}
int ans[H*W][4];
int k=0;
for(i=1;i<=H;i++){
if(i%2==1){
for(j=1;j<=W;j++){
if(a[i][j]==1){
if(j==W && i!=H){
a[i+1][W]=(a[i+1][W]+1)%2;
ans[k][0]=i;ans[k][1]=W;ans[k][2]=i+1;ans[k][3]=W;
k=k+1;
}
if(j!=W){
a[i][j+1]=(a[i][j+1]+1)%2;
ans[k][0]=i;ans[k][1]=j;ans[k][2]=i;ans[k][3]=j+1;
k=k+1;
}
}
}
}
if(i%2==0){
for(j=W;1<=j;j--){
if(a[i][j]==1){
if(j==1 && i!=H){
a[i+1][1]=(a[i+1][1]+1)%2;
ans[k][0]=i;ans[k][1]=1;ans[k][2]=i+1;ans[k][3]=1;
k=k+1;
}
if(j!=1){
a[i][j-1]=(a[i][j-1]+1)%2;
ans[k][0]=i;ans[k][1]=j;ans[k][2]=i;ans[k][3]=j-1;
k=k+1;
}
}
}
}
}
printf("%d\n",k);
for(i=0;i<k;i++){
printf("%d %d %d %d\n",ans[i][0], ans[i][1],ans[i][2],ans[i][3]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = load i32, ptr %W, align 4, !tbaa !5
%add1 = add nsw i32 %2, 1
%3 = zext i32 %add1 to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i32, i64 %5, align 16
%6 = load i32, ptr %H, align 4
%cmp.not278 = icmp slt i32 %6, 1
%.pre323 = load i32, ptr %W, align 4, !tbaa !5
br i1 %cmp.not278, label %for.end172.thread, label %for.cond2.preheader.lr.ph
for.cond2.preheader.lr.ph: ; preds = %entry
%7 = icmp slt i32 %.pre323, 1
br i1 %7, label %for.end18.thread329, label %for.cond2.preheader
for.end18.thread329: ; preds = %for.cond2.preheader.lr.ph
%mul331 = mul nsw i32 %.pre323, %6
%8 = zext i32 %mul331 to i64
%vla19332 = alloca [4 x i32], i64 %8, align 16
br label %for.body22.lr.ph
for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.inc16
%9 = phi i32 [ %15, %for.inc16 ], [ %6, %for.cond2.preheader.lr.ph ]
%10 = phi i32 [ %16, %for.inc16 ], [ %.pre323, %for.cond2.preheader.lr.ph ]
%indvars.iv301 = phi i64 [ %indvars.iv.next302, %for.inc16 ], [ 1, %for.cond2.preheader.lr.ph ]
%cmp3.not276 = icmp slt i32 %10, 1
br i1 %cmp3.not276, label %for.inc16, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%11 = mul nuw nsw i64 %indvars.iv301, %3
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %11
br label %for.body4
for.body4: ; preds = %for.body4.lr.ph, %for.body4
%indvars.iv = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next, %for.body4 ]
%arrayidx6 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%12 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%rem = srem i32 %12, 2
store i32 %rem, ptr %arrayidx6, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr %W, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv, %14
br i1 %cmp3.not.not, label %for.body4, label %for.inc16.loopexit, !llvm.loop !9
for.inc16.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %H, align 4
br label %for.inc16
for.inc16: ; preds = %for.inc16.loopexit, %for.cond2.preheader
%15 = phi i32 [ %.pre, %for.inc16.loopexit ], [ %9, %for.cond2.preheader ]
%16 = phi i32 [ %13, %for.inc16.loopexit ], [ %10, %for.cond2.preheader ]
%indvars.iv.next302 = add nuw nsw i64 %indvars.iv301, 1
%17 = sext i32 %15 to i64
%cmp.not.not = icmp slt i64 %indvars.iv301, %17
br i1 %cmp.not.not, label %for.cond2.preheader, label %for.end18, !llvm.loop !11
for.end18: ; preds = %for.inc16
%mul = mul nsw i32 %16, %15
%18 = zext i32 %mul to i64
%vla19 = alloca [4 x i32], i64 %18, align 16
%cmp21.not288 = icmp slt i32 %15, 1
br i1 %cmp21.not288, label %for.end172.thread, label %for.body22.lr.ph
for.body22.lr.ph: ; preds = %for.end18.thread329, %for.end18
%vla19335 = phi ptr [ %vla19332, %for.end18.thread329 ], [ %vla19, %for.end18 ]
%.lcssa334 = phi i32 [ %6, %for.end18.thread329 ], [ %15, %for.end18 ]
%19 = phi i32 [ %.pre323, %for.end18.thread329 ], [ %16, %for.end18 ]
%cmp26.not280 = icmp slt i32 %19, 1
%idxprom40 = sext i32 %19 to i64
%invariant.gep293 = getelementptr i32, ptr %vla, i64 %idxprom40
%invariant.gep = getelementptr inbounds i32, ptr %vla, i64 1
%cmp101284 = icmp sgt i32 %19, 0
%20 = zext i32 %19 to i64
%21 = add i32 %19, 1
%22 = zext i32 %.lcssa334 to i64
%23 = add nuw i32 %.lcssa334, 1
%wide.trip.count316 = zext i32 %23 to i64
%wide.trip.count = zext i32 %21 to i64
br label %for.body22
for.body22: ; preds = %for.body22.lr.ph, %for.inc170
%indvars.iv311 = phi i64 [ 1, %for.body22.lr.ph ], [ %indvars.iv.next312, %for.inc170 ]
%k.0291 = phi i32 [ 0, %for.body22.lr.ph ], [ %k.8, %for.inc170 ]
%24 = trunc i64 %indvars.iv311 to i32
%rem23 = and i32 %24, 1
%cmp24.not = icmp eq i32 %rem23, 0
br i1 %cmp24.not, label %if.then99, label %for.cond25.preheader
for.cond25.preheader: ; preds = %for.body22
br i1 %cmp26.not280, label %for.inc170, label %for.body27.lr.ph
for.body27.lr.ph: ; preds = %for.cond25.preheader
%25 = mul nuw nsw i64 %indvars.iv311, %3
%arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %25
%cmp35.not = icmp eq i64 %indvars.iv311, %22
%26 = add nuw nsw i64 %indvars.iv311, 1
%27 = mul nuw nsw i64 %26, %3
%gep294 = getelementptr i32, ptr %invariant.gep293, i64 %27
%28 = trunc i64 %26 to i32
br label %for.body27
for.body27: ; preds = %for.body27.lr.ph, %for.inc93
%indvars.iv304 = phi i64 [ 1, %for.body27.lr.ph ], [ %indvars.iv.next305, %for.inc93 ]
%k.1282 = phi i32 [ %k.0291, %for.body27.lr.ph ], [ %k.3, %for.inc93 ]
%arrayidx31 = getelementptr inbounds i32, ptr %arrayidx29, i64 %indvars.iv304
%29 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp eq i32 %29, 1
br i1 %cmp32, label %if.then33, label %for.inc93
if.then33: ; preds = %for.body27
%cmp34 = icmp ne i64 %indvars.iv304, %20
%or.cond = or i1 %cmp35.not, %cmp34
br i1 %or.cond, label %if.end, label %if.then36
if.then36: ; preds = %if.then33
%30 = load i32, ptr %gep294, align 4, !tbaa !5
%add42 = add nsw i32 %30, 1
%rem43 = srem i32 %add42, 2
store i32 %rem43, ptr %gep294, align 4, !tbaa !5
%idxprom49 = sext i32 %k.1282 to i64
%arrayidx50 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom49
store i32 %24, ptr %arrayidx50, align 16, !tbaa !5
%arrayidx54 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom49, i64 1
store i32 %19, ptr %arrayidx54, align 4, !tbaa !5
%arrayidx58 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom49, i64 2
store i32 %28, ptr %arrayidx58, align 8, !tbaa !5
%arrayidx61 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom49, i64 3
store i32 %19, ptr %arrayidx61, align 4, !tbaa !5
%add62 = add nsw i32 %k.1282, 1
br label %if.end
if.end: ; preds = %if.then36, %if.then33
%k.2 = phi i32 [ %add62, %if.then36 ], [ %k.1282, %if.then33 ]
%cmp63.not = icmp eq i64 %indvars.iv304, %20
br i1 %cmp63.not, label %for.inc93, label %if.then64
if.then64: ; preds = %if.end
%31 = add nuw nsw i64 %indvars.iv304, 1
%arrayidx69 = getelementptr inbounds i32, ptr %arrayidx29, i64 %31
%32 = load i32, ptr %arrayidx69, align 4, !tbaa !5
%add70 = add nsw i32 %32, 1
%rem71 = srem i32 %add70, 2
store i32 %rem71, ptr %arrayidx69, align 4, !tbaa !5
%idxprom77 = sext i32 %k.2 to i64
%arrayidx78 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom77
store i32 %24, ptr %arrayidx78, align 16, !tbaa !5
%arrayidx82 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom77, i64 1
%33 = trunc i64 %indvars.iv304 to i32
store i32 %33, ptr %arrayidx82, align 4, !tbaa !5
%arrayidx85 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom77, i64 2
store i32 %24, ptr %arrayidx85, align 8, !tbaa !5
%arrayidx89 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom77, i64 3
%34 = trunc i64 %31 to i32
store i32 %34, ptr %arrayidx89, align 4, !tbaa !5
%add90 = add nsw i32 %k.2, 1
br label %for.inc93
for.inc93: ; preds = %for.body27, %if.then64, %if.end
%k.3 = phi i32 [ %add90, %if.then64 ], [ %k.2, %if.end ], [ %k.1282, %for.body27 ]
%indvars.iv.next305 = add nuw nsw i64 %indvars.iv304, 1
%exitcond.not = icmp eq i64 %indvars.iv.next305, %wide.trip.count
br i1 %exitcond.not, label %for.inc170, label %for.body27, !llvm.loop !13
if.then99: ; preds = %for.body22
br i1 %cmp101284, label %for.body102.lr.ph, label %for.inc170
for.body102.lr.ph: ; preds = %if.then99
%35 = mul nuw nsw i64 %indvars.iv311, %3
%arrayidx104 = getelementptr inbounds i32, ptr %vla, i64 %35
%cmp111.not = icmp eq i64 %indvars.iv311, %22
%36 = add nuw nsw i64 %indvars.iv311, 1
%37 = mul nuw nsw i64 %36, %3
%gep = getelementptr inbounds i32, ptr %invariant.gep, i64 %37
br label %for.body102
for.body102: ; preds = %for.body102.lr.ph, %for.inc167
%indvars.iv308 = phi i64 [ %20, %for.body102.lr.ph ], [ %indvars.iv.next309, %for.inc167 ]
%k.5286 = phi i32 [ %k.0291, %for.body102.lr.ph ], [ %k.7, %for.inc167 ]
%indvars310 = trunc i64 %indvars.iv308 to i32
%arrayidx106 = getelementptr inbounds i32, ptr %arrayidx104, i64 %indvars.iv308
%38 = load i32, ptr %arrayidx106, align 4, !tbaa !5
%cmp107 = icmp eq i32 %38, 1
br i1 %cmp107, label %if.then108, label %for.inc167
if.then108: ; preds = %for.body102
%cmp109 = icmp ne i64 %indvars.iv308, 1
%or.cond271 = or i1 %cmp111.not, %cmp109
br i1 %or.cond271, label %if.end137, label %if.end137.thread
if.end137.thread: ; preds = %if.then108
%39 = load i32, ptr %gep, align 4, !tbaa !5
%add117 = add nsw i32 %39, 1
%rem118 = srem i32 %add117, 2
store i32 %rem118, ptr %gep, align 4, !tbaa !5
%idxprom123 = sext i32 %k.5286 to i64
%arrayidx124 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom123
store i32 %24, ptr %arrayidx124, align 16, !tbaa !5
%arrayidx128 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom123, i64 1
store i32 1, ptr %arrayidx128, align 4, !tbaa !5
%arrayidx132 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom123, i64 2
%40 = trunc i64 %36 to i32
store i32 %40, ptr %arrayidx132, align 8, !tbaa !5
%arrayidx135 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom123, i64 3
store i32 1, ptr %arrayidx135, align 4, !tbaa !5
%add136 = add nsw i32 %k.5286, 1
br label %for.inc170
if.end137: ; preds = %if.then108
%cmp138.not = icmp eq i64 %indvars.iv308, 1
br i1 %cmp138.not, label %for.inc170, label %if.then139
if.then139: ; preds = %if.end137
%sub = add nsw i32 %indvars310, -1
%idxprom142 = zext i32 %sub to i64
%arrayidx143 = getelementptr inbounds i32, ptr %arrayidx104, i64 %idxprom142
%41 = load i32, ptr %arrayidx143, align 4, !tbaa !5
%add144 = add nsw i32 %41, 1
%rem145 = srem i32 %add144, 2
store i32 %rem145, ptr %arrayidx143, align 4, !tbaa !5
%idxprom151 = sext i32 %k.5286 to i64
%arrayidx152 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom151
store i32 %24, ptr %arrayidx152, align 16, !tbaa !5
%arrayidx156 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom151, i64 1
store i32 %indvars310, ptr %arrayidx156, align 4, !tbaa !5
%arrayidx159 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom151, i64 2
store i32 %24, ptr %arrayidx159, align 8, !tbaa !5
%arrayidx163 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %idxprom151, i64 3
store i32 %sub, ptr %arrayidx163, align 4, !tbaa !5
%add164 = add nsw i32 %k.5286, 1
br label %for.inc167
for.inc167: ; preds = %for.body102, %if.then139
%k.7 = phi i32 [ %add164, %if.then139 ], [ %k.5286, %for.body102 ]
%indvars.iv.next309 = add nsw i64 %indvars.iv308, -1
%cmp101 = icmp sgt i64 %indvars.iv308, 1
br i1 %cmp101, label %for.body102, label %for.inc170, !llvm.loop !14
for.inc170: ; preds = %for.inc93, %if.end137, %for.inc167, %if.end137.thread, %if.then99, %for.cond25.preheader
%k.8 = phi i32 [ %k.0291, %for.cond25.preheader ], [ %k.0291, %if.then99 ], [ %add136, %if.end137.thread ], [ %k.5286, %if.end137 ], [ %k.7, %for.inc167 ], [ %k.3, %for.inc93 ]
%indvars.iv.next312 = add nuw nsw i64 %indvars.iv311, 1
%exitcond317.not = icmp eq i64 %indvars.iv.next312, %wide.trip.count316
br i1 %exitcond317.not, label %for.end172, label %for.body22, !llvm.loop !15
for.end172.thread: ; preds = %for.end18, %entry
%call173342 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0)
br label %for.end192
for.end172: ; preds = %for.inc170
%call173 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %k.8)
%cmp175295 = icmp sgt i32 %k.8, 0
br i1 %cmp175295, label %for.body176.preheader, label %for.end192
for.body176.preheader: ; preds = %for.end172
%wide.trip.count321 = zext i32 %k.8 to i64
br label %for.body176
for.body176: ; preds = %for.body176.preheader, %for.body176
%indvars.iv318 = phi i64 [ 0, %for.body176.preheader ], [ %indvars.iv.next319, %for.body176 ]
%arrayidx178 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %indvars.iv318
%42 = load i32, ptr %arrayidx178, align 16, !tbaa !5
%arrayidx182 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %indvars.iv318, i64 1
%43 = load i32, ptr %arrayidx182, align 4, !tbaa !5
%arrayidx185 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %indvars.iv318, i64 2
%44 = load i32, ptr %arrayidx185, align 8, !tbaa !5
%arrayidx188 = getelementptr inbounds [4 x i32], ptr %vla19335, i64 %indvars.iv318, i64 3
%45 = load i32, ptr %arrayidx188, align 4, !tbaa !5
%call189 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %42, i32 noundef %43, i32 noundef %44, i32 noundef %45)
%indvars.iv.next319 = add nuw nsw i64 %indvars.iv318, 1
%exitcond322.not = icmp eq i64 %indvars.iv.next319, %wide.trip.count321
br i1 %exitcond322.not, label %for.end192, label %for.body176, !llvm.loop !16
for.end192: ; preds = %for.body176, %for.end172.thread, %for.end172
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
#include<stdlib.h>
#define POS(i,j) ((i)*w+(j))
void assign(int *way,int a,int b,int c,int d){
way[0]=a;
way[1]=b;
way[2]=c;
way[3]=d;
return;
}
void run(void){
int h,w;
scanf("%d%d",&h,&w);
int *a=(int *)malloc(sizeof(int)*h*w);
int i,j;
for(i=0;i<h*w;i++) scanf("%d",a+i);
int *way=(int *)malloc(sizeof(int)*4*h*w);
int wlen=0;
for(i=0;i<h;i++){
for(j=0;j<w-1;j++){
if(a[POS(i,j)]%2==0) continue;
a[POS(i,j)]--;
a[POS(i,j+1)]++;
assign(way+4*wlen,i,j,i,j+1);
wlen++;
}
}
j=w-1;
for(i=0;i<h-1;i++){
if(a[POS(i,j)]%2==0) continue;
a[POS(i+1,j)]++;
assign(way+4*wlen,i,j,i+1,j);
wlen++;
}
printf("%d\n",wlen);
for(i=0;i<wlen;i++){
printf("%d %d %d %d\n",way[4*i+0]+1,way[4*i+1]+1,way[4*i+2]+1,way[4*i+3]+1);
}
}
int main(void){
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200256/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200256/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%d %d %d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @assign(ptr nocapture noundef writeonly %way, i32 noundef %a, i32 noundef %b, i32 noundef %c, i32 noundef %d) local_unnamed_addr #0 {
entry:
store i32 %a, ptr %way, align 4, !tbaa !5
%arrayidx1 = getelementptr inbounds i32, ptr %way, i64 1
store i32 %b, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds i32, ptr %way, i64 2
store i32 %c, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds i32, ptr %way, i64 3
store i32 %d, ptr %arrayidx3, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @run() local_unnamed_addr #1 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%1 = load i32, ptr %w, align 4, !tbaa !5
%conv1 = sext i32 %1 to i64
%mul2 = mul i64 %mul, %conv1
%call3 = call noalias ptr @malloc(i64 noundef %mul2) #6
%mul4152 = mul nsw i32 %1, %0
%cmp153 = icmp sgt i32 %mul4152, 0
br i1 %cmp153, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %call3, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %h, align 4, !tbaa !5
%3 = load i32, ptr %w, align 4, !tbaa !5
%mul4 = mul nsw i32 %3, %2
%4 = sext i32 %mul4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = sext i32 %2 to i64
%.pre205 = sext i32 %3 to i64
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%conv9.pre-phi = phi i64 [ %.pre205, %for.end.loopexit ], [ %conv1, %entry ]
%conv7.pre-phi = phi i64 [ %.pre, %for.end.loopexit ], [ %conv, %entry ]
%.lcssa151 = phi i32 [ %2, %for.end.loopexit ], [ %0, %entry ]
%.lcssa = phi i32 [ %3, %for.end.loopexit ], [ %1, %entry ]
%mul8 = shl nsw i64 %conv7.pre-phi, 4
%mul10 = mul i64 %mul8, %conv9.pre-phi
%call11 = call noalias ptr @malloc(i64 noundef %mul10) #6
%cmp13160 = icmp sgt i32 %.lcssa151, 0
br i1 %cmp13160, label %for.cond16.preheader.lr.ph, label %for.end72.thread
for.end72.thread: ; preds = %for.end
%call73213 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0)
br label %for.end101
for.cond16.preheader.lr.ph: ; preds = %for.end
%sub = add i32 %.lcssa, -1
%cmp17156 = icmp sgt i32 %.lcssa, 1
br i1 %cmp17156, label %for.cond16.preheader.us.preheader, label %for.end43
for.cond16.preheader.us.preheader: ; preds = %for.cond16.preheader.lr.ph
%wide.trip.count184 = zext i32 %.lcssa151 to i64
%wide.trip.count = zext i32 %sub to i64
br label %for.cond16.preheader.us
for.cond16.preheader.us: ; preds = %for.cond16.preheader.us.preheader, %for.cond16.for.inc41_crit_edge.us
%indvars.iv180 = phi i64 [ 0, %for.cond16.preheader.us.preheader ], [ %indvars.iv.next181, %for.cond16.for.inc41_crit_edge.us ]
%wlen.0162.us = phi i32 [ 0, %for.cond16.preheader.us.preheader ], [ %wlen.2.us, %for.cond16.for.inc41_crit_edge.us ]
%5 = mul nsw i64 %indvars.iv180, %conv9.pre-phi
%invariant.gep = getelementptr i32, ptr %call3, i64 %5
%invariant.gep217 = getelementptr i32, ptr %call3, i64 %5
%6 = trunc i64 %indvars.iv180 to i32
br label %for.body19.us
for.body19.us: ; preds = %for.cond16.preheader.us, %for.inc38.us
%indvars.iv174 = phi i64 [ 0, %for.cond16.preheader.us ], [ %indvars.iv.next175.pre-phi, %for.inc38.us ]
%wlen.1158.us = phi i32 [ %wlen.0162.us, %for.cond16.preheader.us ], [ %wlen.2.us, %for.inc38.us ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv174
%7 = load i32, ptr %gep, align 4, !tbaa !5
%8 = and i32 %7, 1
%cmp21.us = icmp eq i32 %8, 0
br i1 %cmp21.us, label %for.body19.us.for.inc38.us_crit_edge, label %if.end.us
for.body19.us.for.inc38.us_crit_edge: ; preds = %for.body19.us
%.pre206 = add nuw nsw i64 %indvars.iv174, 1
br label %for.inc38.us
if.end.us: ; preds = %for.body19.us
%dec.us = add nsw i32 %7, -1
store i32 %dec.us, ptr %gep, align 4, !tbaa !5
%9 = add nuw nsw i64 %indvars.iv174, 1
%gep218 = getelementptr i32, ptr %invariant.gep217, i64 %9
%10 = load i32, ptr %gep218, align 4, !tbaa !5
%inc32.us = add nsw i32 %10, 1
store i32 %inc32.us, ptr %gep218, align 4, !tbaa !5
%mul33.us = shl nsw i32 %wlen.1158.us, 2
%idx.ext34.us = sext i32 %mul33.us to i64
%add.ptr35.us = getelementptr inbounds i32, ptr %call11, i64 %idx.ext34.us
store i32 %6, ptr %add.ptr35.us, align 4, !tbaa !5
%arrayidx1.i.us = getelementptr inbounds i32, ptr %add.ptr35.us, i64 1
%11 = trunc i64 %indvars.iv174 to i32
store i32 %11, ptr %arrayidx1.i.us, align 4, !tbaa !5
%arrayidx2.i.us = getelementptr inbounds i32, ptr %add.ptr35.us, i64 2
store i32 %6, ptr %arrayidx2.i.us, align 4, !tbaa !5
%arrayidx3.i.us = getelementptr inbounds i32, ptr %add.ptr35.us, i64 3
%12 = trunc i64 %9 to i32
store i32 %12, ptr %arrayidx3.i.us, align 4, !tbaa !5
%inc37.us = add nsw i32 %wlen.1158.us, 1
br label %for.inc38.us
for.inc38.us: ; preds = %for.body19.us.for.inc38.us_crit_edge, %if.end.us
%indvars.iv.next175.pre-phi = phi i64 [ %.pre206, %for.body19.us.for.inc38.us_crit_edge ], [ %9, %if.end.us ]
%wlen.2.us = phi i32 [ %wlen.1158.us, %for.body19.us.for.inc38.us_crit_edge ], [ %inc37.us, %if.end.us ]
%exitcond.not = icmp eq i64 %indvars.iv.next175.pre-phi, %wide.trip.count
br i1 %exitcond.not, label %for.cond16.for.inc41_crit_edge.us, label %for.body19.us, !llvm.loop !11
for.cond16.for.inc41_crit_edge.us: ; preds = %for.inc38.us
%indvars.iv.next181 = add nuw nsw i64 %indvars.iv180, 1
%exitcond185.not = icmp eq i64 %indvars.iv.next181, %wide.trip.count184
br i1 %exitcond185.not, label %for.end43, label %for.cond16.preheader.us, !llvm.loop !12
for.end43: ; preds = %for.cond16.for.inc41_crit_edge.us, %for.cond16.preheader.lr.ph
%wlen.0.lcssa = phi i32 [ 0, %for.cond16.preheader.lr.ph ], [ %wlen.2.us, %for.cond16.for.inc41_crit_edge.us ]
%cmp47164 = icmp sgt i32 %.lcssa151, 1
br i1 %cmp47164, label %for.body49.preheader, label %for.end72
for.body49.preheader: ; preds = %for.end43
%sub46 = add nsw i32 %.lcssa151, -1
%13 = sext i32 %sub to i64
%wide.trip.count194 = zext i32 %sub46 to i64
%invariant.gep219 = getelementptr i32, ptr %call3, i64 %13
%invariant.gep221 = getelementptr i32, ptr %call3, i64 %13
br label %for.body49
for.body49: ; preds = %for.body49.preheader, %for.inc70
%indvars.iv186 = phi i64 [ 0, %for.body49.preheader ], [ %.pre208, %for.inc70 ]
%wlen.3166 = phi i32 [ %wlen.0.lcssa, %for.body49.preheader ], [ %wlen.4, %for.inc70 ]
%14 = mul nsw i64 %indvars.iv186, %conv9.pre-phi
%gep220 = getelementptr i32, ptr %invariant.gep219, i64 %14
%15 = load i32, ptr %gep220, align 4, !tbaa !5
%16 = and i32 %15, 1
%cmp55 = icmp eq i32 %16, 0
%.pre208 = add nuw nsw i64 %indvars.iv186, 1
br i1 %cmp55, label %for.inc70, label %if.end58
if.end58: ; preds = %for.body49
%17 = mul nsw i64 %.pre208, %conv9.pre-phi
%gep222 = getelementptr i32, ptr %invariant.gep221, i64 %17
%18 = load i32, ptr %gep222, align 4, !tbaa !5
%inc64 = add nsw i32 %18, 1
store i32 %inc64, ptr %gep222, align 4, !tbaa !5
%mul65 = shl nsw i32 %wlen.3166, 2
%idx.ext66 = sext i32 %mul65 to i64
%add.ptr67 = getelementptr inbounds i32, ptr %call11, i64 %idx.ext66
%19 = trunc i64 %indvars.iv186 to i32
store i32 %19, ptr %add.ptr67, align 4, !tbaa !5
%arrayidx1.i148 = getelementptr inbounds i32, ptr %add.ptr67, i64 1
store i32 %sub, ptr %arrayidx1.i148, align 4, !tbaa !5
%arrayidx2.i149 = getelementptr inbounds i32, ptr %add.ptr67, i64 2
%20 = trunc i64 %.pre208 to i32
store i32 %20, ptr %arrayidx2.i149, align 4, !tbaa !5
%arrayidx3.i150 = getelementptr inbounds i32, ptr %add.ptr67, i64 3
store i32 %sub, ptr %arrayidx3.i150, align 4, !tbaa !5
%inc69 = add nsw i32 %wlen.3166, 1
br label %for.inc70
for.inc70: ; preds = %for.body49, %if.end58
%wlen.4 = phi i32 [ %inc69, %if.end58 ], [ %wlen.3166, %for.body49 ]
%exitcond195.not = icmp eq i64 %.pre208, %wide.trip.count194
br i1 %exitcond195.not, label %for.end72, label %for.body49, !llvm.loop !13
for.end72: ; preds = %for.inc70, %for.end43
%wlen.3.lcssa = phi i32 [ %wlen.0.lcssa, %for.end43 ], [ %wlen.4, %for.inc70 ]
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %wlen.3.lcssa)
%cmp75168 = icmp sgt i32 %wlen.3.lcssa, 0
br i1 %cmp75168, label %for.body77.preheader, label %for.end101
for.body77.preheader: ; preds = %for.end72
%wide.trip.count203 = zext i32 %wlen.3.lcssa to i64
br label %for.body77
for.body77: ; preds = %for.body77.preheader, %for.body77
%indvars.iv196 = phi i64 [ 0, %for.body77.preheader ], [ %indvars.iv.next197, %for.body77 ]
%21 = shl nsw i64 %indvars.iv196, 2
%arrayidx81 = getelementptr inbounds i32, ptr %call11, i64 %21
%22 = load i32, ptr %arrayidx81, align 4, !tbaa !5
%add82 = add nsw i32 %22, 1
%23 = or i64 %21, 1
%arrayidx86 = getelementptr inbounds i32, ptr %call11, i64 %23
%24 = load i32, ptr %arrayidx86, align 4, !tbaa !5
%add87 = add nsw i32 %24, 1
%25 = or i64 %21, 2
%arrayidx91 = getelementptr inbounds i32, ptr %call11, i64 %25
%26 = load i32, ptr %arrayidx91, align 4, !tbaa !5
%add92 = add nsw i32 %26, 1
%27 = or i64 %21, 3
%arrayidx96 = getelementptr inbounds i32, ptr %call11, i64 %27
%28 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%add97 = add nsw i32 %28, 1
%call98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add82, i32 noundef %add87, i32 noundef %add92, i32 noundef %add97)
%indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
%exitcond204.not = icmp eq i64 %indvars.iv.next197, %wide.trip.count203
br i1 %exitcond204.not, label %for.end101, label %for.body77, !llvm.loop !14
for.end101: ; preds = %for.body77, %for.end72.thread, %for.end72
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
tail call void @run()
ret i32 0
}
attributes #0 = { mustprogress nofree norecurse 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 #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
int compare_int(const void *a, const void *b){
if(*(int*)a > *(int*)b) return 1;
return -1;
}
int main(){
int n;
scanf("%d",&n);
int a[n];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
int zero_count=0;
for(int i=0;i<n;i++){
if(a[i]==0){zero_count++;}
}
if(zero_count==n){
printf("Yes\n");
return 0;
}
qsort(a,n,sizeof(int),compare_int);
if(zero_count!=0 && n/3==zero_count){
int p=a[n/3];
for(int i=n/3;i<n;i++){
if(p!=a[i]){
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
}
int p=a[0];
int count=0;
for(int i=0;i<n;i++){
if(p==a[i]){
count++;
}else{
if(count!=n/3){
printf("No\n");
return 0;
}else{
count=1;
p=a[i];
}
}
}
if(((a[0]^a[n/3])^a[n-1])==0){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200306/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200306/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.5 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.7 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%. = select i1 %cmp, i32 1, i32 -1
ret i32 %.
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !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
%cmp116 = icmp sgt i32 %3, 0
br i1 %cmp116, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp4118 = icmp sgt i32 %14, 0
br i1 %cmp4118, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %14 to i64
%min.iters.check = icmp ult i32 %14, 8
br i1 %min.iters.check, label %for.body6.preheader153, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi150 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load151 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = icmp eq <4 x i32> %wide.load, zeroinitializer
%7 = icmp eq <4 x i32> %wide.load151, zeroinitializer
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi, %8
%11 = add <4 x i32> %vec.phi150, %9
%index.next = add nuw i64 %index, 8
%12 = icmp eq i64 %index.next, %n.vec
br i1 %12, label %middle.block, label %vector.body, !llvm.loop !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 i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader153
for.body6.preheader153: ; preds = %for.body6.preheader, %middle.block
%indvars.iv130.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
%zero_count.0119.ph = phi i32 [ 0, %for.body6.preheader ], [ %13, %middle.block ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp = icmp slt i64 %indvars.iv.next, %15
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.cond.cleanup5: ; preds = %for.body6, %middle.block, %entry, %for.cond3.preheader
%.lcssa146 = phi i32 [ %14, %for.cond3.preheader ], [ %3, %entry ], [ %14, %middle.block ], [ %14, %for.body6 ]
%zero_count.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %13, %middle.block ], [ %spec.select, %for.body6 ]
%cmp14 = icmp eq i32 %zero_count.0.lcssa, %.lcssa146
br i1 %cmp14, label %cleanup91, label %if.end17
for.body6: ; preds = %for.body6.preheader153, %for.body6
%indvars.iv130 = phi i64 [ %indvars.iv.next131, %for.body6 ], [ %indvars.iv130.ph, %for.body6.preheader153 ]
%zero_count.0119 = phi i32 [ %spec.select, %for.body6 ], [ %zero_count.0119.ph, %for.body6.preheader153 ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv130
%16 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %16, 0
%inc10 = zext i1 %cmp9 to i32
%spec.select = add nuw nsw i32 %zero_count.0119, %inc10
%indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
%exitcond.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14
if.end17: ; preds = %for.cond.cleanup5
%conv = sext i32 %.lcssa146 to i64
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compare_int) #8
%cmp18.not = icmp ne i32 %zero_count.0.lcssa, 0
%.pre = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %.pre, 3
%cmp20 = icmp eq i32 %div, %zero_count.0.lcssa
%or.cond = select i1 %cmp18.not, i1 %cmp20, i1 false
br i1 %or.cond, label %if.then22, label %if.end45
if.then22: ; preds = %if.end17
%idxprom24 = sext i32 %zero_count.0.lcssa to i64
%arrayidx25 = getelementptr inbounds i32, ptr %vla, i64 %idxprom24
%17 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp29.not122 = icmp slt i32 %zero_count.0.lcssa, %.pre
br i1 %cmp29.not122, label %for.body32, label %cleanup91
for.cond28: ; preds = %for.body32
%indvars.iv.next134 = add nsw i64 %indvars.iv133, 1
%lftr.wideiv = trunc i64 %indvars.iv.next134 to i32
%exitcond136.not = icmp eq i32 %.pre, %lftr.wideiv
br i1 %exitcond136.not, label %cleanup91, label %for.body32, !llvm.loop !15
for.body32: ; preds = %if.then22, %for.cond28
%indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.cond28 ], [ %idxprom24, %if.then22 ]
%arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv133
%18 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35.not = icmp eq i32 %17, %18
br i1 %cmp35.not, label %for.cond28, label %cleanup91
if.end45: ; preds = %if.end17
%cmp50.not124 = icmp sgt i32 %.pre, 0
%.pre142 = load i32, ptr %vla, align 16, !tbaa !5
br i1 %cmp50.not124, label %for.body53.lr.ph, label %if.end45.for.end74_crit_edge
if.end45.for.end74_crit_edge: ; preds = %if.end45
%.pre.nonneg = sub i32 0, %.pre
%.pre143148 = udiv i32 %.pre.nonneg, 3
%.pre143148.neg = sub nsw i32 0, %.pre143148
br label %for.end74
for.body53.lr.ph: ; preds = %if.end45
%div60147 = udiv i32 %.pre, 3
%wide.trip.count140 = zext i32 %.pre to i64
br label %for.body53
for.body53: ; preds = %for.body53.lr.ph, %for.inc70
%indvars.iv137 = phi i64 [ 0, %for.body53.lr.ph ], [ %indvars.iv.next138, %for.inc70 ]
%count.0126 = phi i32 [ 0, %for.body53.lr.ph ], [ %count.1, %for.inc70 ]
%p46.0125 = phi i32 [ %.pre142, %for.body53.lr.ph ], [ %p46.1, %for.inc70 ]
%arrayidx55 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv137
%19 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%cmp56 = icmp eq i32 %p46.0125, %19
br i1 %cmp56, label %if.then58, label %if.else
if.then58: ; preds = %for.body53
%inc59 = add nsw i32 %count.0126, 1
br label %for.inc70
if.else: ; preds = %for.body53
%cmp61.not = icmp eq i32 %count.0126, %div60147
br i1 %cmp61.not, label %for.inc70, label %cleanup91
for.inc70: ; preds = %if.else, %if.then58
%p46.1 = phi i32 [ %p46.0125, %if.then58 ], [ %19, %if.else ]
%count.1 = phi i32 [ %inc59, %if.then58 ], [ 1, %if.else ]
%indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
%exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
br i1 %exitcond141.not, label %for.end74, label %for.body53, !llvm.loop !16
for.end74: ; preds = %for.inc70, %if.end45.for.end74_crit_edge
%div76.pre-phi = phi i32 [ %.pre143148.neg, %if.end45.for.end74_crit_edge ], [ %div60147, %for.inc70 ]
%idxprom77 = sext i32 %div76.pre-phi to i64
%arrayidx78 = getelementptr inbounds i32, ptr %vla, i64 %idxprom77
%20 = load i32, ptr %arrayidx78, align 4, !tbaa !5
%xor = xor i32 %20, %.pre142
%sub = add nsw i32 %.pre, -1
%idxprom79 = sext i32 %sub to i64
%arrayidx80 = getelementptr inbounds i32, ptr %vla, i64 %idxprom79
%21 = load i32, ptr %arrayidx80, align 4, !tbaa !5
%cmp82 = icmp eq i32 %xor, %21
%str.4.str.3 = select i1 %cmp82, ptr @str.7, ptr @str.5
br label %cleanup91
cleanup91: ; preds = %if.else, %for.cond28, %for.body32, %for.end74, %if.then22, %for.cond.cleanup5
%str.sink = phi ptr [ @str.7, %for.cond.cleanup5 ], [ @str.7, %if.then22 ], [ %str.4.str.3, %for.end74 ], [ @str.5, %for.body32 ], [ @str.7, %for.cond28 ], [ @str.5, %if.else ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int l,n,p,i,j,k, max = 0;
long long ans = 0;
char s[2000];
int w[26];
scanf("%s", s);
scanf("%d", &k);
for (i = 0; i < 26; i++)
{
scanf("%d", &w[i]);
}
for (i = 0; i < 26; i++)
{
if (w[i] > max)
{
max = w[i];
}
}
l = strlen(s);
for (i = 0; i < l; i++)
{
ans += w[s[i] - 'a'] * (i+1);
}
for (i = 0; i < k; i++)
{
ans += max * (i + l + 1);
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20035/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20035/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%s = alloca [2000 x i8], align 16
%w = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %w) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w)
%arrayidx.1 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 1
%call2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 2
%call2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 3
%call2.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 4
%call2.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 5
%call2.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.5)
%arrayidx.6 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 6
%call2.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.6)
%arrayidx.7 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 7
%call2.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.7)
%arrayidx.8 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 8
%call2.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.8)
%arrayidx.9 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 9
%call2.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.9)
%arrayidx.10 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 10
%call2.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.10)
%arrayidx.11 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 11
%call2.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.11)
%arrayidx.12 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 12
%call2.12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.12)
%arrayidx.13 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 13
%call2.13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.13)
%arrayidx.14 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 14
%call2.14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.14)
%arrayidx.15 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 15
%call2.15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.15)
%arrayidx.16 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 16
%call2.16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.16)
%arrayidx.17 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 17
%call2.17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.17)
%arrayidx.18 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 18
%call2.18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.18)
%arrayidx.19 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 19
%call2.19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.19)
%arrayidx.20 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 20
%call2.20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.20)
%arrayidx.21 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 21
%call2.21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.21)
%arrayidx.22 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 22
%call2.22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.22)
%arrayidx.23 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 23
%call2.23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.23)
%arrayidx.24 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 24
%call2.24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.24)
%arrayidx.25 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 25
%call2.25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.25)
%0 = load i32, ptr %w, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %3)
%4 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %4)
%5 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%spec.select.4 = call i32 @llvm.smax.i32(i32 %spec.select.3, i32 %5)
%6 = load i32, ptr %arrayidx.6, align 8, !tbaa !5
%spec.select.5 = call i32 @llvm.smax.i32(i32 %spec.select.4, i32 %6)
%7 = load i32, ptr %arrayidx.7, align 4, !tbaa !5
%spec.select.6 = call i32 @llvm.smax.i32(i32 %spec.select.5, i32 %7)
%8 = load i32, ptr %arrayidx.8, align 16, !tbaa !5
%spec.select.7 = call i32 @llvm.smax.i32(i32 %spec.select.6, i32 %8)
%9 = load i32, ptr %arrayidx.9, align 4, !tbaa !5
%spec.select.8 = call i32 @llvm.smax.i32(i32 %spec.select.7, i32 %9)
%10 = load i32, ptr %arrayidx.10, align 8, !tbaa !5
%spec.select.9 = call i32 @llvm.smax.i32(i32 %spec.select.8, i32 %10)
%11 = load i32, ptr %arrayidx.11, align 4, !tbaa !5
%spec.select.10 = call i32 @llvm.smax.i32(i32 %spec.select.9, i32 %11)
%12 = load i32, ptr %arrayidx.12, align 16, !tbaa !5
%spec.select.11 = call i32 @llvm.smax.i32(i32 %spec.select.10, i32 %12)
%13 = load i32, ptr %arrayidx.13, align 4, !tbaa !5
%spec.select.12 = call i32 @llvm.smax.i32(i32 %spec.select.11, i32 %13)
%14 = load i32, ptr %arrayidx.14, align 8, !tbaa !5
%spec.select.13 = call i32 @llvm.smax.i32(i32 %spec.select.12, i32 %14)
%15 = load i32, ptr %arrayidx.15, align 4, !tbaa !5
%spec.select.14 = call i32 @llvm.smax.i32(i32 %spec.select.13, i32 %15)
%16 = load i32, ptr %arrayidx.16, align 16, !tbaa !5
%spec.select.15 = call i32 @llvm.smax.i32(i32 %spec.select.14, i32 %16)
%17 = load i32, ptr %arrayidx.17, align 4, !tbaa !5
%spec.select.16 = call i32 @llvm.smax.i32(i32 %spec.select.15, i32 %17)
%18 = load i32, ptr %arrayidx.18, align 8, !tbaa !5
%spec.select.17 = call i32 @llvm.smax.i32(i32 %spec.select.16, i32 %18)
%19 = load i32, ptr %arrayidx.19, align 4, !tbaa !5
%spec.select.18 = call i32 @llvm.smax.i32(i32 %spec.select.17, i32 %19)
%20 = load i32, ptr %arrayidx.20, align 16, !tbaa !5
%spec.select.19 = call i32 @llvm.smax.i32(i32 %spec.select.18, i32 %20)
%21 = load i32, ptr %arrayidx.21, align 4, !tbaa !5
%spec.select.20 = call i32 @llvm.smax.i32(i32 %spec.select.19, i32 %21)
%22 = load i32, ptr %arrayidx.22, align 8, !tbaa !5
%spec.select.21 = call i32 @llvm.smax.i32(i32 %spec.select.20, i32 %22)
%23 = load i32, ptr %arrayidx.23, align 4, !tbaa !5
%spec.select.22 = call i32 @llvm.smax.i32(i32 %spec.select.21, i32 %23)
%24 = load i32, ptr %arrayidx.24, align 16, !tbaa !5
%spec.select.23 = call i32 @llvm.smax.i32(i32 %spec.select.22, i32 %24)
%25 = load i32, ptr %arrayidx.25, align 4, !tbaa !5
%spec.select.24 = call i32 @llvm.smax.i32(i32 %spec.select.23, i32 %25)
%spec.select.25 = call i32 @llvm.smax.i32(i32 %spec.select.24, i32 0)
%call15 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call15 to i32
%cmp1763 = icmp sgt i32 %conv, 0
br i1 %cmp1763, label %for.body19.preheader, label %for.cond30.preheader
for.body19.preheader: ; preds = %entry
%wide.trip.count = and i64 %call15, 4294967295
%xtraiter = and i64 %call15, 1
%26 = icmp eq i64 %wide.trip.count, 1
br i1 %26, label %for.cond30.preheader.loopexit.unr-lcssa, label %for.body19.preheader.new
for.body19.preheader.new: ; preds = %for.body19.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body19
for.cond30.preheader.loopexit.unr-lcssa: ; preds = %for.body19, %for.body19.preheader
%add26.lcssa.ph = phi i64 [ undef, %for.body19.preheader ], [ %add26.1, %for.body19 ]
%indvars.iv.unr = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next.1, %for.body19 ]
%ans.065.unr = phi i64 [ 0, %for.body19.preheader ], [ %add26.1, %for.body19 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond30.preheader, label %for.body19.epil
for.body19.epil: ; preds = %for.cond30.preheader.loopexit.unr-lcssa
%arrayidx21.epil = getelementptr inbounds [2000 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%27 = load i8, ptr %arrayidx21.epil, align 1, !tbaa !9
%conv22.epil = sext i8 %27 to i64
%sub.epil = add nsw i64 %conv22.epil, -97
%arrayidx24.epil = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 %sub.epil
%28 = load i32, ptr %arrayidx24.epil, align 4, !tbaa !5
%29 = trunc i64 %indvars.iv.unr to i32
%30 = add i32 %29, 1
%mul.epil = mul nsw i32 %28, %30
%conv25.epil = sext i32 %mul.epil to i64
%add26.epil = add nsw i64 %ans.065.unr, %conv25.epil
br label %for.cond30.preheader
for.cond30.preheader: ; preds = %for.body19.epil, %for.cond30.preheader.loopexit.unr-lcssa, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %add26.lcssa.ph, %for.cond30.preheader.loopexit.unr-lcssa ], [ %add26.epil, %for.body19.epil ]
%31 = load i32, ptr %k, align 4, !tbaa !5
%cmp3166 = icmp sgt i32 %31, 0
br i1 %cmp3166, label %for.body33.lr.ph, label %for.end41
for.body33.lr.ph: ; preds = %for.cond30.preheader
%add34 = add i32 %conv, 1
%wide.trip.count76 = zext i32 %31 to i64
%xtraiter79 = and i64 %wide.trip.count76, 3
%32 = icmp ult i32 %31, 4
br i1 %32, label %for.end41.loopexit.unr-lcssa, label %for.body33.lr.ph.new
for.body33.lr.ph.new: ; preds = %for.body33.lr.ph
%unroll_iter82 = and i64 %wide.trip.count76, 4294967292
br label %for.body33
for.body19: ; preds = %for.body19, %for.body19.preheader.new
%indvars.iv = phi i64 [ 0, %for.body19.preheader.new ], [ %indvars.iv.next.1, %for.body19 ]
%ans.065 = phi i64 [ 0, %for.body19.preheader.new ], [ %add26.1, %for.body19 ]
%niter = phi i64 [ 0, %for.body19.preheader.new ], [ %niter.next.1, %for.body19 ]
%arrayidx21 = getelementptr inbounds [2000 x i8], ptr %s, i64 0, i64 %indvars.iv
%33 = load i8, ptr %arrayidx21, align 2, !tbaa !9
%conv22 = sext i8 %33 to i64
%sub = add nsw i64 %conv22, -97
%arrayidx24 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 %sub
%34 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%35 = trunc i64 %indvars.iv.next to i32
%mul = mul nsw i32 %34, %35
%conv25 = sext i32 %mul to i64
%add26 = add nsw i64 %ans.065, %conv25
%arrayidx21.1 = getelementptr inbounds [2000 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%36 = load i8, ptr %arrayidx21.1, align 1, !tbaa !9
%conv22.1 = sext i8 %36 to i64
%sub.1 = add nsw i64 %conv22.1, -97
%arrayidx24.1 = getelementptr inbounds [26 x i32], ptr %w, i64 0, i64 %sub.1
%37 = load i32, ptr %arrayidx24.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%38 = trunc i64 %indvars.iv.next.1 to i32
%mul.1 = mul nsw i32 %37, %38
%conv25.1 = sext i32 %mul.1 to i64
%add26.1 = add nsw i64 %add26, %conv25.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond30.preheader.loopexit.unr-lcssa, label %for.body19, !llvm.loop !10
for.body33: ; preds = %for.body33, %for.body33.lr.ph.new
%indvars.iv73 = phi i64 [ 0, %for.body33.lr.ph.new ], [ %indvars.iv.next74.3, %for.body33 ]
%ans.168 = phi i64 [ %ans.0.lcssa, %for.body33.lr.ph.new ], [ %add38.3, %for.body33 ]
%niter83 = phi i64 [ 0, %for.body33.lr.ph.new ], [ %niter83.next.3, %for.body33 ]
%39 = trunc i64 %indvars.iv73 to i32
%add35 = add i32 %add34, %39
%mul36 = mul nsw i32 %add35, %spec.select.25
%conv37 = sext i32 %mul36 to i64
%add38 = add nsw i64 %ans.168, %conv37
%40 = trunc i64 %indvars.iv73 to i32
%41 = or i32 %40, 1
%add35.1 = add i32 %add34, %41
%mul36.1 = mul nsw i32 %add35.1, %spec.select.25
%conv37.1 = sext i32 %mul36.1 to i64
%add38.1 = add nsw i64 %add38, %conv37.1
%42 = trunc i64 %indvars.iv73 to i32
%43 = or i32 %42, 2
%add35.2 = add i32 %add34, %43
%mul36.2 = mul nsw i32 %add35.2, %spec.select.25
%conv37.2 = sext i32 %mul36.2 to i64
%add38.2 = add nsw i64 %add38.1, %conv37.2
%44 = trunc i64 %indvars.iv73 to i32
%45 = or i32 %44, 3
%add35.3 = add i32 %add34, %45
%mul36.3 = mul nsw i32 %add35.3, %spec.select.25
%conv37.3 = sext i32 %mul36.3 to i64
%add38.3 = add nsw i64 %add38.2, %conv37.3
%indvars.iv.next74.3 = add nuw nsw i64 %indvars.iv73, 4
%niter83.next.3 = add i64 %niter83, 4
%niter83.ncmp.3 = icmp eq i64 %niter83.next.3, %unroll_iter82
br i1 %niter83.ncmp.3, label %for.end41.loopexit.unr-lcssa, label %for.body33, !llvm.loop !12
for.end41.loopexit.unr-lcssa: ; preds = %for.body33, %for.body33.lr.ph
%add38.lcssa.ph = phi i64 [ undef, %for.body33.lr.ph ], [ %add38.3, %for.body33 ]
%indvars.iv73.unr = phi i64 [ 0, %for.body33.lr.ph ], [ %indvars.iv.next74.3, %for.body33 ]
%ans.168.unr = phi i64 [ %ans.0.lcssa, %for.body33.lr.ph ], [ %add38.3, %for.body33 ]
%lcmp.mod80.not = icmp eq i64 %xtraiter79, 0
br i1 %lcmp.mod80.not, label %for.end41, label %for.body33.epil
for.body33.epil: ; preds = %for.end41.loopexit.unr-lcssa, %for.body33.epil
%indvars.iv73.epil = phi i64 [ %indvars.iv.next74.epil, %for.body33.epil ], [ %indvars.iv73.unr, %for.end41.loopexit.unr-lcssa ]
%ans.168.epil = phi i64 [ %add38.epil, %for.body33.epil ], [ %ans.168.unr, %for.end41.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body33.epil ], [ 0, %for.end41.loopexit.unr-lcssa ]
%46 = trunc i64 %indvars.iv73.epil to i32
%add35.epil = add i32 %add34, %46
%mul36.epil = mul nsw i32 %add35.epil, %spec.select.25
%conv37.epil = sext i32 %mul36.epil to i64
%add38.epil = add nsw i64 %ans.168.epil, %conv37.epil
%indvars.iv.next74.epil = add nuw nsw i64 %indvars.iv73.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter79
br i1 %epil.iter.cmp.not, label %for.end41, label %for.body33.epil, !llvm.loop !13
for.end41: ; preds = %for.end41.loopexit.unr-lcssa, %for.body33.epil, %for.cond30.preheader
%ans.1.lcssa = phi i64 [ %ans.0.lcssa, %for.cond30.preheader ], [ %add38.lcssa.ph, %for.end41.loopexit.unr-lcssa ], [ %add38.epil, %for.body33.epil ]
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.1.lcssa)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = !{!"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, !14}
!14 = !{!"llvm.loop.unroll.disable"}
|
// abc134c: Exception Handling
#include <stdio.h>
#define upto(i,s,e,d) for(int i=(s);i<=(e);i+=(d))
#define downto(i,s,e,d) for(int i=(s);i>=(e);i-=(d))
#define in(n) scanf("%d",n)
#define out(d) printf("%d\n",d)
int search(int k, int *a, int n){
int l=0,r=n,m;
while(l<r){ m=(l+r)/2; if(a[m]<k) r=m; else l=m+1; }
return l;
}
int main(){
int n;in(&n);
int gn = 1, g[n];in(g);
upto(i,1,n-1,1){
int a;in(&a);
int j = search(a,g,gn);
g[ j<gn? j: gn++ ] = a;
}
out(gn);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200407/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200407/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %k, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %n, 0
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%l.010 = phi i32 [ %l.1, %while.body ], [ 0, %entry ]
%r.09 = phi i32 [ %r.1, %while.body ], [ %n, %entry ]
%add = add nsw i32 %l.010, %r.09
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1 = icmp slt i32 %0, %k
%add2 = add nsw i32 %div, 1
%r.1 = select i1 %cmp1, i32 %div, i32 %r.09
%l.1 = select i1 %cmp1, i32 %l.010, i32 %add2
%cmp = icmp slt i32 %l.1, %r.1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%l.0.lcssa = phi i32 [ 0, %entry ], [ %l.1, %while.body ]
ret i32 %l.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%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
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vla)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not11 = icmp sgt i32 %3, 1
br i1 %cmp.not.not11, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %search.exit.loopexit, %entry
%gn.0.lcssa = phi i32 [ 1, %entry ], [ %gn.1, %search.exit.loopexit ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %gn.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.body: ; preds = %entry, %search.exit.loopexit
%i.013 = phi i32 [ %add, %search.exit.loopexit ], [ 1, %entry ]
%gn.012 = phi i32 [ %gn.1, %search.exit.loopexit ], [ 1, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%4 = load i32, ptr %a, align 4, !tbaa !5
br label %while.body.i
while.body.i: ; preds = %for.body, %while.body.i
%l.010.i = phi i32 [ %l.1.i, %while.body.i ], [ 0, %for.body ]
%r.09.i = phi i32 [ %r.1.i, %while.body.i ], [ %gn.012, %for.body ]
%add.i = add nsw i32 %r.09.i, %l.010.i
%div.i = sdiv i32 %add.i, 2
%idxprom.i = sext i32 %div.i to i64
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1.i = icmp slt i32 %5, %4
%add2.i = add nsw i32 %div.i, 1
%r.1.i = select i1 %cmp1.i, i32 %div.i, i32 %r.09.i
%l.1.i = select i1 %cmp1.i, i32 %l.010.i, i32 %add2.i
%cmp.i = icmp slt i32 %l.1.i, %r.1.i
br i1 %cmp.i, label %while.body.i, label %search.exit.loopexit, !llvm.loop !9
search.exit.loopexit: ; preds = %while.body.i
%cmp4 = icmp sge i32 %l.1.i, %gn.012
%inc = zext i1 %cmp4 to i32
%gn.1 = add nuw nsw i32 %gn.012, %inc
%cond = call i32 @llvm.smin.i32(i32 %l.1.i, i32 %gn.012)
%idxprom = sext i32 %cond to i64
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %idxprom
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #6
%add = add nuw nsw i32 %i.013, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %add, %6
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree 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 i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
#define pi acos(-1)
int main(void)
{
double a, b, x;
double s, ans;
scanf("%lf%lf%lf", &a, &b, &x);
s = x / a;
if (s >= a * b / 2)
ans = atan2((a * b - s) * 2 / a, a);
else
ans = atan2(b, 2 * s / b);
printf("%.10f\n", ans * 360 / 2 / pi);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200450/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200450/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf%lf%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
%x = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load double, ptr %x, align 8, !tbaa !5
%1 = load double, ptr %a, align 8, !tbaa !5
%div = fdiv double %0, %1
%2 = load double, ptr %b, align 8, !tbaa !5
%mul = fmul double %1, %2
%div1 = fmul double %mul, 5.000000e-01
%cmp = fcmp ult double %div, %div1
br i1 %cmp, label %if.else, label %if.then
if.then: ; preds = %entry
%neg = fneg double %div
%3 = call double @llvm.fmuladd.f64(double %1, double %2, double %neg)
%mul3 = fmul double %3, 2.000000e+00
%div4 = fdiv double %mul3, %1
br label %if.end
if.else: ; preds = %entry
%mul6 = fmul double %div, 2.000000e+00
%div7 = fdiv double %mul6, %2
br label %if.end
if.end: ; preds = %if.else, %if.then
%div7.sink = phi double [ %div7, %if.else ], [ %1, %if.then ]
%.sink = phi double [ %2, %if.else ], [ %div4, %if.then ]
%call8 = call double @atan2(double noundef %.sink, double noundef %div7.sink) #5
%mul9 = fmul double %call8, 3.600000e+02
%div10 = fmul double %mul9, 5.000000e-01
%div12 = fdiv double %div10, 0x400921FB54442D18
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div12)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 a,b,x;
double theta,tangent;
scanf("%lf%lf%lf",&a,&b,&x);
if(x>=((a*a*b)/2)){
tangent = (2*b/a - 2*x/a/a/a);
theta = atan(tangent)*(180/M_PI);
}
else{
tangent = (2*x/a/b/b);
theta = 90 - atan(tangent)*(180/M_PI);
}
printf("%lf",theta);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200494/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200494/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf%lf%lf\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
%x = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load double, ptr %x, align 8, !tbaa !5
%1 = load double, ptr %a, align 8, !tbaa !5
%mul = fmul double %1, %1
%2 = load double, ptr %b, align 8, !tbaa !5
%mul1 = fmul double %mul, %2
%div = fmul double %mul1, 5.000000e-01
%cmp = fcmp ult double %0, %div
br i1 %cmp, label %if.else, label %if.then
if.then: ; preds = %entry
%mul2 = fmul double %2, 2.000000e+00
%div3 = fdiv double %mul2, %1
%mul4 = fmul double %0, 2.000000e+00
%div5 = fdiv double %mul4, %1
%div6 = fdiv double %div5, %1
%div7 = fdiv double %div6, %1
%sub = fsub double %div3, %div7
%call8 = call double @atan(double noundef %sub) #5
%mul9 = fmul double %call8, 0x404CA5DC1A63C1F8
br label %if.end
if.else: ; preds = %entry
%mul10 = fmul double %0, 2.000000e+00
%div11 = fdiv double %mul10, %1
%div12 = fdiv double %div11, %2
%div13 = fdiv double %div12, %2
%call14 = call double @atan(double noundef %div13) #5
%neg = fneg double %call14
%3 = call double @llvm.fmuladd.f64(double %neg, double 0x404CA5DC1A63C1F8, double 9.000000e+01)
br label %if.end
if.end: ; preds = %if.else, %if.then
%theta.0 = phi double [ %mul9, %if.then ], [ %3, %if.else ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %theta.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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(write)
declare double @atan(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(){
double a,b,x,v,h,w;
scanf("%lf %lf %lf",&a,&b,&x);
v=a*a*b;
if(x/v>=0.5){
h=(1-x/v)*b*2.0;
printf("%.10lf",atan(h/a)*180/M_PI);
}else{
w=2.0*x*a/v;
printf("%.10lf",atan(b/w)*180/M_PI);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200537/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200537/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.10lf\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
%x = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %x)
%0 = load double, ptr %a, align 8, !tbaa !5
%mul = fmul double %0, %0
%1 = load double, ptr %b, align 8, !tbaa !5
%mul1 = fmul double %mul, %1
%2 = load double, ptr %x, align 8, !tbaa !5
%div = fdiv double %2, %mul1
%cmp = fcmp ult double %div, 5.000000e-01
br i1 %cmp, label %if.else, label %if.then
if.then: ; preds = %entry
%sub = fsub double 1.000000e+00, %div
%mul3 = fmul double %1, %sub
%mul4 = fmul double %mul3, 2.000000e+00
%div5 = fdiv double %mul4, %0
br label %if.end
if.else: ; preds = %entry
%mul10 = fmul double %2, 2.000000e+00
%mul11 = fmul double %0, %mul10
%div12 = fdiv double %mul11, %mul1
%div13 = fdiv double %1, %div12
br label %if.end
if.end: ; preds = %if.else, %if.then
%div13.sink = phi double [ %div13, %if.else ], [ %div5, %if.then ]
%call14 = call double @atan(double noundef %div13.sink) #4
%mul15 = fmul double %call14, 1.800000e+02
%div16 = fdiv double %mul15, 0x400921FB54442D18
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div16)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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){
char g[9][9];
int i , j;
for(i=0;i<8;i++){
scanf("%s" , g[i]);
}
printf("%d\n", 90);
for(i=0;i<8;i++){
for(j=7;j>=0;j--){
printf("%c" , g[j][i]);
}
printf("\n");
}
printf("%d\n", 180);
for(i=7;i>=0;i--){
for(j=7;j>=0;j--){
printf("%c" , g[i][j]);
}
printf("\n");
}
printf("%d\n", 270);
for(i=7;i>=0;i--){
for(j=0;j<8;j++){
printf("%c" , g[j][i]);
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200588/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200588/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%g = alloca [9 x [9 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 81, ptr nonnull %g) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %g)
%arrayidx.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%arrayidx.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6
%call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6)
%arrayidx.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7
%call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.7)
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 90)
%0 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%putchar86 = call i32 @putchar(i32 %conv)
%1 = load i8, ptr %arrayidx.6, align 2, !tbaa !5
%conv.1 = sext i8 %1 to i32
%putchar86.1 = call i32 @putchar(i32 %conv.1)
%2 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%conv.2 = sext i8 %2 to i32
%putchar86.2 = call i32 @putchar(i32 %conv.2)
%3 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%conv.3 = sext i8 %3 to i32
%putchar86.3 = call i32 @putchar(i32 %conv.3)
%4 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv.4 = sext i8 %4 to i32
%putchar86.4 = call i32 @putchar(i32 %conv.4)
%5 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%conv.5 = sext i8 %5 to i32
%putchar86.5 = call i32 @putchar(i32 %conv.5)
%6 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.6 = sext i8 %6 to i32
%putchar86.6 = call i32 @putchar(i32 %conv.6)
%7 = load i8, ptr %g, align 16, !tbaa !5
%conv.7 = sext i8 %7 to i32
%putchar86.7 = call i32 @putchar(i32 %conv.7)
%putchar85 = call i32 @putchar(i32 10)
%arrayidx11.197 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 1
%8 = load i8, ptr %arrayidx11.197, align 16, !tbaa !5
%conv.198 = sext i8 %8 to i32
%putchar86.199 = call i32 @putchar(i32 %conv.198)
%arrayidx11.1.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 1
%9 = load i8, ptr %arrayidx11.1.1, align 1, !tbaa !5
%conv.1.1 = sext i8 %9 to i32
%putchar86.1.1 = call i32 @putchar(i32 %conv.1.1)
%arrayidx11.2.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 1
%10 = load i8, ptr %arrayidx11.2.1, align 2, !tbaa !5
%conv.2.1 = sext i8 %10 to i32
%putchar86.2.1 = call i32 @putchar(i32 %conv.2.1)
%arrayidx11.3.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 1
%11 = load i8, ptr %arrayidx11.3.1, align 1, !tbaa !5
%conv.3.1 = sext i8 %11 to i32
%putchar86.3.1 = call i32 @putchar(i32 %conv.3.1)
%arrayidx11.4.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 1
%12 = load i8, ptr %arrayidx11.4.1, align 4, !tbaa !5
%conv.4.1 = sext i8 %12 to i32
%putchar86.4.1 = call i32 @putchar(i32 %conv.4.1)
%arrayidx11.5.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 1
%13 = load i8, ptr %arrayidx11.5.1, align 1, !tbaa !5
%conv.5.1 = sext i8 %13 to i32
%putchar86.5.1 = call i32 @putchar(i32 %conv.5.1)
%arrayidx11.6.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 1
%14 = load i8, ptr %arrayidx11.6.1, align 2, !tbaa !5
%conv.6.1 = sext i8 %14 to i32
%putchar86.6.1 = call i32 @putchar(i32 %conv.6.1)
%arrayidx11.7.1 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 1
%15 = load i8, ptr %arrayidx11.7.1, align 1, !tbaa !5
%conv.7.1 = sext i8 %15 to i32
%putchar86.7.1 = call i32 @putchar(i32 %conv.7.1)
%putchar85.1 = call i32 @putchar(i32 10)
%arrayidx11.2100 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 2
%16 = load i8, ptr %arrayidx11.2100, align 1, !tbaa !5
%conv.2101 = sext i8 %16 to i32
%putchar86.2102 = call i32 @putchar(i32 %conv.2101)
%arrayidx11.1.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 2
%17 = load i8, ptr %arrayidx11.1.2, align 8, !tbaa !5
%conv.1.2 = sext i8 %17 to i32
%putchar86.1.2 = call i32 @putchar(i32 %conv.1.2)
%arrayidx11.2.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 2
%18 = load i8, ptr %arrayidx11.2.2, align 1, !tbaa !5
%conv.2.2 = sext i8 %18 to i32
%putchar86.2.2 = call i32 @putchar(i32 %conv.2.2)
%arrayidx11.3.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 2
%19 = load i8, ptr %arrayidx11.3.2, align 2, !tbaa !5
%conv.3.2 = sext i8 %19 to i32
%putchar86.3.2 = call i32 @putchar(i32 %conv.3.2)
%arrayidx11.4.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 2
%20 = load i8, ptr %arrayidx11.4.2, align 1, !tbaa !5
%conv.4.2 = sext i8 %20 to i32
%putchar86.4.2 = call i32 @putchar(i32 %conv.4.2)
%arrayidx11.5.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 2
%21 = load i8, ptr %arrayidx11.5.2, align 4, !tbaa !5
%conv.5.2 = sext i8 %21 to i32
%putchar86.5.2 = call i32 @putchar(i32 %conv.5.2)
%arrayidx11.6.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 2
%22 = load i8, ptr %arrayidx11.6.2, align 1, !tbaa !5
%conv.6.2 = sext i8 %22 to i32
%putchar86.6.2 = call i32 @putchar(i32 %conv.6.2)
%arrayidx11.7.2 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 2
%23 = load i8, ptr %arrayidx11.7.2, align 2, !tbaa !5
%conv.7.2 = sext i8 %23 to i32
%putchar86.7.2 = call i32 @putchar(i32 %conv.7.2)
%putchar85.2 = call i32 @putchar(i32 10)
%arrayidx11.3103 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 3
%24 = load i8, ptr %arrayidx11.3103, align 2, !tbaa !5
%conv.3104 = sext i8 %24 to i32
%putchar86.3105 = call i32 @putchar(i32 %conv.3104)
%arrayidx11.1.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 3
%25 = load i8, ptr %arrayidx11.1.3, align 1, !tbaa !5
%conv.1.3 = sext i8 %25 to i32
%putchar86.1.3 = call i32 @putchar(i32 %conv.1.3)
%arrayidx11.2.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 3
%26 = load i8, ptr %arrayidx11.2.3, align 16, !tbaa !5
%conv.2.3 = sext i8 %26 to i32
%putchar86.2.3 = call i32 @putchar(i32 %conv.2.3)
%arrayidx11.3.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 3
%27 = load i8, ptr %arrayidx11.3.3, align 1, !tbaa !5
%conv.3.3 = sext i8 %27 to i32
%putchar86.3.3 = call i32 @putchar(i32 %conv.3.3)
%arrayidx11.4.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 3
%28 = load i8, ptr %arrayidx11.4.3, align 2, !tbaa !5
%conv.4.3 = sext i8 %28 to i32
%putchar86.4.3 = call i32 @putchar(i32 %conv.4.3)
%arrayidx11.5.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 3
%29 = load i8, ptr %arrayidx11.5.3, align 1, !tbaa !5
%conv.5.3 = sext i8 %29 to i32
%putchar86.5.3 = call i32 @putchar(i32 %conv.5.3)
%arrayidx11.6.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 3
%30 = load i8, ptr %arrayidx11.6.3, align 4, !tbaa !5
%conv.6.3 = sext i8 %30 to i32
%putchar86.6.3 = call i32 @putchar(i32 %conv.6.3)
%arrayidx11.7.3 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 3
%31 = load i8, ptr %arrayidx11.7.3, align 1, !tbaa !5
%conv.7.3 = sext i8 %31 to i32
%putchar86.7.3 = call i32 @putchar(i32 %conv.7.3)
%putchar85.3 = call i32 @putchar(i32 10)
%arrayidx11.4106 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 4
%32 = load i8, ptr %arrayidx11.4106, align 1, !tbaa !5
%conv.4107 = sext i8 %32 to i32
%putchar86.4108 = call i32 @putchar(i32 %conv.4107)
%arrayidx11.1.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 4
%33 = load i8, ptr %arrayidx11.1.4, align 2, !tbaa !5
%conv.1.4 = sext i8 %33 to i32
%putchar86.1.4 = call i32 @putchar(i32 %conv.1.4)
%arrayidx11.2.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 4
%34 = load i8, ptr %arrayidx11.2.4, align 1, !tbaa !5
%conv.2.4 = sext i8 %34 to i32
%putchar86.2.4 = call i32 @putchar(i32 %conv.2.4)
%arrayidx11.3.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 4
%35 = load i8, ptr %arrayidx11.3.4, align 8, !tbaa !5
%conv.3.4 = sext i8 %35 to i32
%putchar86.3.4 = call i32 @putchar(i32 %conv.3.4)
%arrayidx11.4.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 4
%36 = load i8, ptr %arrayidx11.4.4, align 1, !tbaa !5
%conv.4.4 = sext i8 %36 to i32
%putchar86.4.4 = call i32 @putchar(i32 %conv.4.4)
%arrayidx11.5.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 4
%37 = load i8, ptr %arrayidx11.5.4, align 2, !tbaa !5
%conv.5.4 = sext i8 %37 to i32
%putchar86.5.4 = call i32 @putchar(i32 %conv.5.4)
%arrayidx11.6.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 4
%38 = load i8, ptr %arrayidx11.6.4, align 1, !tbaa !5
%conv.6.4 = sext i8 %38 to i32
%putchar86.6.4 = call i32 @putchar(i32 %conv.6.4)
%arrayidx11.7.4 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 4
%39 = load i8, ptr %arrayidx11.7.4, align 4, !tbaa !5
%conv.7.4 = sext i8 %39 to i32
%putchar86.7.4 = call i32 @putchar(i32 %conv.7.4)
%putchar85.4 = call i32 @putchar(i32 10)
%arrayidx11.5109 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 5
%40 = load i8, ptr %arrayidx11.5109, align 4, !tbaa !5
%conv.5110 = sext i8 %40 to i32
%putchar86.5111 = call i32 @putchar(i32 %conv.5110)
%arrayidx11.1.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 5
%41 = load i8, ptr %arrayidx11.1.5, align 1, !tbaa !5
%conv.1.5 = sext i8 %41 to i32
%putchar86.1.5 = call i32 @putchar(i32 %conv.1.5)
%arrayidx11.2.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 5
%42 = load i8, ptr %arrayidx11.2.5, align 2, !tbaa !5
%conv.2.5 = sext i8 %42 to i32
%putchar86.2.5 = call i32 @putchar(i32 %conv.2.5)
%arrayidx11.3.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 5
%43 = load i8, ptr %arrayidx11.3.5, align 1, !tbaa !5
%conv.3.5 = sext i8 %43 to i32
%putchar86.3.5 = call i32 @putchar(i32 %conv.3.5)
%arrayidx11.4.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 5
%44 = load i8, ptr %arrayidx11.4.5, align 16, !tbaa !5
%conv.4.5 = sext i8 %44 to i32
%putchar86.4.5 = call i32 @putchar(i32 %conv.4.5)
%arrayidx11.5.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 5
%45 = load i8, ptr %arrayidx11.5.5, align 1, !tbaa !5
%conv.5.5 = sext i8 %45 to i32
%putchar86.5.5 = call i32 @putchar(i32 %conv.5.5)
%arrayidx11.6.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 5
%46 = load i8, ptr %arrayidx11.6.5, align 2, !tbaa !5
%conv.6.5 = sext i8 %46 to i32
%putchar86.6.5 = call i32 @putchar(i32 %conv.6.5)
%arrayidx11.7.5 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 5
%47 = load i8, ptr %arrayidx11.7.5, align 1, !tbaa !5
%conv.7.5 = sext i8 %47 to i32
%putchar86.7.5 = call i32 @putchar(i32 %conv.7.5)
%putchar85.5 = call i32 @putchar(i32 10)
%arrayidx11.6112 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 6
%48 = load i8, ptr %arrayidx11.6112, align 1, !tbaa !5
%conv.6113 = sext i8 %48 to i32
%putchar86.6114 = call i32 @putchar(i32 %conv.6113)
%arrayidx11.1.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 6
%49 = load i8, ptr %arrayidx11.1.6, align 4, !tbaa !5
%conv.1.6 = sext i8 %49 to i32
%putchar86.1.6 = call i32 @putchar(i32 %conv.1.6)
%arrayidx11.2.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 6
%50 = load i8, ptr %arrayidx11.2.6, align 1, !tbaa !5
%conv.2.6 = sext i8 %50 to i32
%putchar86.2.6 = call i32 @putchar(i32 %conv.2.6)
%arrayidx11.3.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 6
%51 = load i8, ptr %arrayidx11.3.6, align 2, !tbaa !5
%conv.3.6 = sext i8 %51 to i32
%putchar86.3.6 = call i32 @putchar(i32 %conv.3.6)
%arrayidx11.4.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 6
%52 = load i8, ptr %arrayidx11.4.6, align 1, !tbaa !5
%conv.4.6 = sext i8 %52 to i32
%putchar86.4.6 = call i32 @putchar(i32 %conv.4.6)
%arrayidx11.5.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 6
%53 = load i8, ptr %arrayidx11.5.6, align 8, !tbaa !5
%conv.5.6 = sext i8 %53 to i32
%putchar86.5.6 = call i32 @putchar(i32 %conv.5.6)
%arrayidx11.6.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 6
%54 = load i8, ptr %arrayidx11.6.6, align 1, !tbaa !5
%conv.6.6 = sext i8 %54 to i32
%putchar86.6.6 = call i32 @putchar(i32 %conv.6.6)
%arrayidx11.7.6 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 6
%55 = load i8, ptr %arrayidx11.7.6, align 2, !tbaa !5
%conv.7.6 = sext i8 %55 to i32
%putchar86.7.6 = call i32 @putchar(i32 %conv.7.6)
%putchar85.6 = call i32 @putchar(i32 10)
%arrayidx11.7115 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 7, i64 7
%56 = load i8, ptr %arrayidx11.7115, align 2, !tbaa !5
%conv.7116 = sext i8 %56 to i32
%putchar86.7117 = call i32 @putchar(i32 %conv.7116)
%arrayidx11.1.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 6, i64 7
%57 = load i8, ptr %arrayidx11.1.7, align 1, !tbaa !5
%conv.1.7 = sext i8 %57 to i32
%putchar86.1.7 = call i32 @putchar(i32 %conv.1.7)
%arrayidx11.2.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 5, i64 7
%58 = load i8, ptr %arrayidx11.2.7, align 4, !tbaa !5
%conv.2.7 = sext i8 %58 to i32
%putchar86.2.7 = call i32 @putchar(i32 %conv.2.7)
%arrayidx11.3.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 4, i64 7
%59 = load i8, ptr %arrayidx11.3.7, align 1, !tbaa !5
%conv.3.7 = sext i8 %59 to i32
%putchar86.3.7 = call i32 @putchar(i32 %conv.3.7)
%arrayidx11.4.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 3, i64 7
%60 = load i8, ptr %arrayidx11.4.7, align 2, !tbaa !5
%conv.4.7 = sext i8 %60 to i32
%putchar86.4.7 = call i32 @putchar(i32 %conv.4.7)
%arrayidx11.5.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 2, i64 7
%61 = load i8, ptr %arrayidx11.5.7, align 1, !tbaa !5
%conv.5.7 = sext i8 %61 to i32
%putchar86.5.7 = call i32 @putchar(i32 %conv.5.7)
%arrayidx11.6.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 1, i64 7
%62 = load i8, ptr %arrayidx11.6.7, align 16, !tbaa !5
%conv.6.7 = sext i8 %62 to i32
%putchar86.6.7 = call i32 @putchar(i32 %conv.6.7)
%arrayidx11.7.7 = getelementptr inbounds [9 x [9 x i8]], ptr %g, i64 0, i64 0, i64 7
%63 = load i8, ptr %arrayidx11.7.7, align 1, !tbaa !5
%conv.7.7 = sext i8 %63 to i32
%putchar86.7.7 = call i32 @putchar(i32 %conv.7.7)
%putchar85.7 = call i32 @putchar(i32 10)
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 180)
%64 = load i8, ptr %arrayidx11.7115, align 2, !tbaa !5
%conv32 = sext i8 %64 to i32
%putchar84 = call i32 @putchar(i32 %conv32)
%65 = load i8, ptr %arrayidx11.6112, align 1, !tbaa !5
%conv32.1 = sext i8 %65 to i32
%putchar84.1 = call i32 @putchar(i32 %conv32.1)
%66 = load i8, ptr %arrayidx11.5109, align 4, !tbaa !5
%conv32.2 = sext i8 %66 to i32
%putchar84.2 = call i32 @putchar(i32 %conv32.2)
%67 = load i8, ptr %arrayidx11.4106, align 1, !tbaa !5
%conv32.3 = sext i8 %67 to i32
%putchar84.3 = call i32 @putchar(i32 %conv32.3)
%68 = load i8, ptr %arrayidx11.3103, align 2, !tbaa !5
%conv32.4 = sext i8 %68 to i32
%putchar84.4 = call i32 @putchar(i32 %conv32.4)
%69 = load i8, ptr %arrayidx11.2100, align 1, !tbaa !5
%conv32.5 = sext i8 %69 to i32
%putchar84.5 = call i32 @putchar(i32 %conv32.5)
%70 = load i8, ptr %arrayidx11.197, align 16, !tbaa !5
%conv32.6 = sext i8 %70 to i32
%putchar84.6 = call i32 @putchar(i32 %conv32.6)
%71 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%conv32.7 = sext i8 %71 to i32
%putchar84.7 = call i32 @putchar(i32 %conv32.7)
%putchar83 = call i32 @putchar(i32 10)
%72 = load i8, ptr %arrayidx11.1.7, align 1, !tbaa !5
%conv32.1121 = sext i8 %72 to i32
%putchar84.1122 = call i32 @putchar(i32 %conv32.1121)
%73 = load i8, ptr %arrayidx11.1.6, align 4, !tbaa !5
%conv32.1.1 = sext i8 %73 to i32
%putchar84.1.1 = call i32 @putchar(i32 %conv32.1.1)
%74 = load i8, ptr %arrayidx11.1.5, align 1, !tbaa !5
%conv32.2.1 = sext i8 %74 to i32
%putchar84.2.1 = call i32 @putchar(i32 %conv32.2.1)
%75 = load i8, ptr %arrayidx11.1.4, align 2, !tbaa !5
%conv32.3.1 = sext i8 %75 to i32
%putchar84.3.1 = call i32 @putchar(i32 %conv32.3.1)
%76 = load i8, ptr %arrayidx11.1.3, align 1, !tbaa !5
%conv32.4.1 = sext i8 %76 to i32
%putchar84.4.1 = call i32 @putchar(i32 %conv32.4.1)
%77 = load i8, ptr %arrayidx11.1.2, align 8, !tbaa !5
%conv32.5.1 = sext i8 %77 to i32
%putchar84.5.1 = call i32 @putchar(i32 %conv32.5.1)
%78 = load i8, ptr %arrayidx11.1.1, align 1, !tbaa !5
%conv32.6.1 = sext i8 %78 to i32
%putchar84.6.1 = call i32 @putchar(i32 %conv32.6.1)
%79 = load i8, ptr %arrayidx.6, align 2, !tbaa !5
%conv32.7.1 = sext i8 %79 to i32
%putchar84.7.1 = call i32 @putchar(i32 %conv32.7.1)
%putchar83.1 = call i32 @putchar(i32 10)
%80 = load i8, ptr %arrayidx11.2.7, align 4, !tbaa !5
%conv32.2124 = sext i8 %80 to i32
%putchar84.2125 = call i32 @putchar(i32 %conv32.2124)
%81 = load i8, ptr %arrayidx11.2.6, align 1, !tbaa !5
%conv32.1.2 = sext i8 %81 to i32
%putchar84.1.2 = call i32 @putchar(i32 %conv32.1.2)
%82 = load i8, ptr %arrayidx11.2.5, align 2, !tbaa !5
%conv32.2.2 = sext i8 %82 to i32
%putchar84.2.2 = call i32 @putchar(i32 %conv32.2.2)
%83 = load i8, ptr %arrayidx11.2.4, align 1, !tbaa !5
%conv32.3.2 = sext i8 %83 to i32
%putchar84.3.2 = call i32 @putchar(i32 %conv32.3.2)
%84 = load i8, ptr %arrayidx11.2.3, align 16, !tbaa !5
%conv32.4.2 = sext i8 %84 to i32
%putchar84.4.2 = call i32 @putchar(i32 %conv32.4.2)
%85 = load i8, ptr %arrayidx11.2.2, align 1, !tbaa !5
%conv32.5.2 = sext i8 %85 to i32
%putchar84.5.2 = call i32 @putchar(i32 %conv32.5.2)
%86 = load i8, ptr %arrayidx11.2.1, align 2, !tbaa !5
%conv32.6.2 = sext i8 %86 to i32
%putchar84.6.2 = call i32 @putchar(i32 %conv32.6.2)
%87 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%conv32.7.2 = sext i8 %87 to i32
%putchar84.7.2 = call i32 @putchar(i32 %conv32.7.2)
%putchar83.2 = call i32 @putchar(i32 10)
%88 = load i8, ptr %arrayidx11.3.7, align 1, !tbaa !5
%conv32.3127 = sext i8 %88 to i32
%putchar84.3128 = call i32 @putchar(i32 %conv32.3127)
%89 = load i8, ptr %arrayidx11.3.6, align 2, !tbaa !5
%conv32.1.3 = sext i8 %89 to i32
%putchar84.1.3 = call i32 @putchar(i32 %conv32.1.3)
%90 = load i8, ptr %arrayidx11.3.5, align 1, !tbaa !5
%conv32.2.3 = sext i8 %90 to i32
%putchar84.2.3 = call i32 @putchar(i32 %conv32.2.3)
%91 = load i8, ptr %arrayidx11.3.4, align 8, !tbaa !5
%conv32.3.3 = sext i8 %91 to i32
%putchar84.3.3 = call i32 @putchar(i32 %conv32.3.3)
%92 = load i8, ptr %arrayidx11.3.3, align 1, !tbaa !5
%conv32.4.3 = sext i8 %92 to i32
%putchar84.4.3 = call i32 @putchar(i32 %conv32.4.3)
%93 = load i8, ptr %arrayidx11.3.2, align 2, !tbaa !5
%conv32.5.3 = sext i8 %93 to i32
%putchar84.5.3 = call i32 @putchar(i32 %conv32.5.3)
%94 = load i8, ptr %arrayidx11.3.1, align 1, !tbaa !5
%conv32.6.3 = sext i8 %94 to i32
%putchar84.6.3 = call i32 @putchar(i32 %conv32.6.3)
%95 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%conv32.7.3 = sext i8 %95 to i32
%putchar84.7.3 = call i32 @putchar(i32 %conv32.7.3)
%putchar83.3 = call i32 @putchar(i32 10)
%96 = load i8, ptr %arrayidx11.4.7, align 2, !tbaa !5
%conv32.4130 = sext i8 %96 to i32
%putchar84.4131 = call i32 @putchar(i32 %conv32.4130)
%97 = load i8, ptr %arrayidx11.4.6, align 1, !tbaa !5
%conv32.1.4 = sext i8 %97 to i32
%putchar84.1.4 = call i32 @putchar(i32 %conv32.1.4)
%98 = load i8, ptr %arrayidx11.4.5, align 16, !tbaa !5
%conv32.2.4 = sext i8 %98 to i32
%putchar84.2.4 = call i32 @putchar(i32 %conv32.2.4)
%99 = load i8, ptr %arrayidx11.4.4, align 1, !tbaa !5
%conv32.3.4 = sext i8 %99 to i32
%putchar84.3.4 = call i32 @putchar(i32 %conv32.3.4)
%100 = load i8, ptr %arrayidx11.4.3, align 2, !tbaa !5
%conv32.4.4 = sext i8 %100 to i32
%putchar84.4.4 = call i32 @putchar(i32 %conv32.4.4)
%101 = load i8, ptr %arrayidx11.4.2, align 1, !tbaa !5
%conv32.5.4 = sext i8 %101 to i32
%putchar84.5.4 = call i32 @putchar(i32 %conv32.5.4)
%102 = load i8, ptr %arrayidx11.4.1, align 4, !tbaa !5
%conv32.6.4 = sext i8 %102 to i32
%putchar84.6.4 = call i32 @putchar(i32 %conv32.6.4)
%103 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv32.7.4 = sext i8 %103 to i32
%putchar84.7.4 = call i32 @putchar(i32 %conv32.7.4)
%putchar83.4 = call i32 @putchar(i32 10)
%104 = load i8, ptr %arrayidx11.5.7, align 1, !tbaa !5
%conv32.5133 = sext i8 %104 to i32
%putchar84.5134 = call i32 @putchar(i32 %conv32.5133)
%105 = load i8, ptr %arrayidx11.5.6, align 8, !tbaa !5
%conv32.1.5 = sext i8 %105 to i32
%putchar84.1.5 = call i32 @putchar(i32 %conv32.1.5)
%106 = load i8, ptr %arrayidx11.5.5, align 1, !tbaa !5
%conv32.2.5 = sext i8 %106 to i32
%putchar84.2.5 = call i32 @putchar(i32 %conv32.2.5)
%107 = load i8, ptr %arrayidx11.5.4, align 2, !tbaa !5
%conv32.3.5 = sext i8 %107 to i32
%putchar84.3.5 = call i32 @putchar(i32 %conv32.3.5)
%108 = load i8, ptr %arrayidx11.5.3, align 1, !tbaa !5
%conv32.4.5 = sext i8 %108 to i32
%putchar84.4.5 = call i32 @putchar(i32 %conv32.4.5)
%109 = load i8, ptr %arrayidx11.5.2, align 4, !tbaa !5
%conv32.5.5 = sext i8 %109 to i32
%putchar84.5.5 = call i32 @putchar(i32 %conv32.5.5)
%110 = load i8, ptr %arrayidx11.5.1, align 1, !tbaa !5
%conv32.6.5 = sext i8 %110 to i32
%putchar84.6.5 = call i32 @putchar(i32 %conv32.6.5)
%111 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%conv32.7.5 = sext i8 %111 to i32
%putchar84.7.5 = call i32 @putchar(i32 %conv32.7.5)
%putchar83.5 = call i32 @putchar(i32 10)
%112 = load i8, ptr %arrayidx11.6.7, align 16, !tbaa !5
%conv32.6136 = sext i8 %112 to i32
%putchar84.6137 = call i32 @putchar(i32 %conv32.6136)
%113 = load i8, ptr %arrayidx11.6.6, align 1, !tbaa !5
%conv32.1.6 = sext i8 %113 to i32
%putchar84.1.6 = call i32 @putchar(i32 %conv32.1.6)
%114 = load i8, ptr %arrayidx11.6.5, align 2, !tbaa !5
%conv32.2.6 = sext i8 %114 to i32
%putchar84.2.6 = call i32 @putchar(i32 %conv32.2.6)
%115 = load i8, ptr %arrayidx11.6.4, align 1, !tbaa !5
%conv32.3.6 = sext i8 %115 to i32
%putchar84.3.6 = call i32 @putchar(i32 %conv32.3.6)
%116 = load i8, ptr %arrayidx11.6.3, align 4, !tbaa !5
%conv32.4.6 = sext i8 %116 to i32
%putchar84.4.6 = call i32 @putchar(i32 %conv32.4.6)
%117 = load i8, ptr %arrayidx11.6.2, align 1, !tbaa !5
%conv32.5.6 = sext i8 %117 to i32
%putchar84.5.6 = call i32 @putchar(i32 %conv32.5.6)
%118 = load i8, ptr %arrayidx11.6.1, align 2, !tbaa !5
%conv32.6.6 = sext i8 %118 to i32
%putchar84.6.6 = call i32 @putchar(i32 %conv32.6.6)
%119 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv32.7.6 = sext i8 %119 to i32
%putchar84.7.6 = call i32 @putchar(i32 %conv32.7.6)
%putchar83.6 = call i32 @putchar(i32 10)
%120 = load i8, ptr %arrayidx11.7.7, align 1, !tbaa !5
%conv32.7139 = sext i8 %120 to i32
%putchar84.7140 = call i32 @putchar(i32 %conv32.7139)
%121 = load i8, ptr %arrayidx11.7.6, align 2, !tbaa !5
%conv32.1.7 = sext i8 %121 to i32
%putchar84.1.7 = call i32 @putchar(i32 %conv32.1.7)
%122 = load i8, ptr %arrayidx11.7.5, align 1, !tbaa !5
%conv32.2.7 = sext i8 %122 to i32
%putchar84.2.7 = call i32 @putchar(i32 %conv32.2.7)
%123 = load i8, ptr %arrayidx11.7.4, align 4, !tbaa !5
%conv32.3.7 = sext i8 %123 to i32
%putchar84.3.7 = call i32 @putchar(i32 %conv32.3.7)
%124 = load i8, ptr %arrayidx11.7.3, align 1, !tbaa !5
%conv32.4.7 = sext i8 %124 to i32
%putchar84.4.7 = call i32 @putchar(i32 %conv32.4.7)
%125 = load i8, ptr %arrayidx11.7.2, align 2, !tbaa !5
%conv32.5.7 = sext i8 %125 to i32
%putchar84.5.7 = call i32 @putchar(i32 %conv32.5.7)
%126 = load i8, ptr %arrayidx11.7.1, align 1, !tbaa !5
%conv32.6.7 = sext i8 %126 to i32
%putchar84.6.7 = call i32 @putchar(i32 %conv32.6.7)
%127 = load i8, ptr %g, align 16, !tbaa !5
%conv32.7.7 = sext i8 %127 to i32
%putchar84.7.7 = call i32 @putchar(i32 %conv32.7.7)
%putchar83.7 = call i32 @putchar(i32 10)
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 270)
%128 = load i8, ptr %arrayidx11.7.7, align 1, !tbaa !5
%conv54 = sext i8 %128 to i32
%putchar82 = call i32 @putchar(i32 %conv54)
%129 = load i8, ptr %arrayidx11.6.7, align 16, !tbaa !5
%conv54.1 = sext i8 %129 to i32
%putchar82.1 = call i32 @putchar(i32 %conv54.1)
%130 = load i8, ptr %arrayidx11.5.7, align 1, !tbaa !5
%conv54.2 = sext i8 %130 to i32
%putchar82.2 = call i32 @putchar(i32 %conv54.2)
%131 = load i8, ptr %arrayidx11.4.7, align 2, !tbaa !5
%conv54.3 = sext i8 %131 to i32
%putchar82.3 = call i32 @putchar(i32 %conv54.3)
%132 = load i8, ptr %arrayidx11.3.7, align 1, !tbaa !5
%conv54.4 = sext i8 %132 to i32
%putchar82.4 = call i32 @putchar(i32 %conv54.4)
%133 = load i8, ptr %arrayidx11.2.7, align 4, !tbaa !5
%conv54.5 = sext i8 %133 to i32
%putchar82.5 = call i32 @putchar(i32 %conv54.5)
%134 = load i8, ptr %arrayidx11.1.7, align 1, !tbaa !5
%conv54.6 = sext i8 %134 to i32
%putchar82.6 = call i32 @putchar(i32 %conv54.6)
%135 = load i8, ptr %arrayidx11.7115, align 2, !tbaa !5
%conv54.7 = sext i8 %135 to i32
%putchar82.7 = call i32 @putchar(i32 %conv54.7)
%putchar = call i32 @putchar(i32 10)
%136 = load i8, ptr %arrayidx11.7.6, align 2, !tbaa !5
%conv54.1144 = sext i8 %136 to i32
%putchar82.1145 = call i32 @putchar(i32 %conv54.1144)
%137 = load i8, ptr %arrayidx11.6.6, align 1, !tbaa !5
%conv54.1.1 = sext i8 %137 to i32
%putchar82.1.1 = call i32 @putchar(i32 %conv54.1.1)
%138 = load i8, ptr %arrayidx11.5.6, align 8, !tbaa !5
%conv54.2.1 = sext i8 %138 to i32
%putchar82.2.1 = call i32 @putchar(i32 %conv54.2.1)
%139 = load i8, ptr %arrayidx11.4.6, align 1, !tbaa !5
%conv54.3.1 = sext i8 %139 to i32
%putchar82.3.1 = call i32 @putchar(i32 %conv54.3.1)
%140 = load i8, ptr %arrayidx11.3.6, align 2, !tbaa !5
%conv54.4.1 = sext i8 %140 to i32
%putchar82.4.1 = call i32 @putchar(i32 %conv54.4.1)
%141 = load i8, ptr %arrayidx11.2.6, align 1, !tbaa !5
%conv54.5.1 = sext i8 %141 to i32
%putchar82.5.1 = call i32 @putchar(i32 %conv54.5.1)
%142 = load i8, ptr %arrayidx11.1.6, align 4, !tbaa !5
%conv54.6.1 = sext i8 %142 to i32
%putchar82.6.1 = call i32 @putchar(i32 %conv54.6.1)
%143 = load i8, ptr %arrayidx11.6112, align 1, !tbaa !5
%conv54.7.1 = sext i8 %143 to i32
%putchar82.7.1 = call i32 @putchar(i32 %conv54.7.1)
%putchar.1 = call i32 @putchar(i32 10)
%144 = load i8, ptr %arrayidx11.7.5, align 1, !tbaa !5
%conv54.2147 = sext i8 %144 to i32
%putchar82.2148 = call i32 @putchar(i32 %conv54.2147)
%145 = load i8, ptr %arrayidx11.6.5, align 2, !tbaa !5
%conv54.1.2 = sext i8 %145 to i32
%putchar82.1.2 = call i32 @putchar(i32 %conv54.1.2)
%146 = load i8, ptr %arrayidx11.5.5, align 1, !tbaa !5
%conv54.2.2 = sext i8 %146 to i32
%putchar82.2.2 = call i32 @putchar(i32 %conv54.2.2)
%147 = load i8, ptr %arrayidx11.4.5, align 16, !tbaa !5
%conv54.3.2 = sext i8 %147 to i32
%putchar82.3.2 = call i32 @putchar(i32 %conv54.3.2)
%148 = load i8, ptr %arrayidx11.3.5, align 1, !tbaa !5
%conv54.4.2 = sext i8 %148 to i32
%putchar82.4.2 = call i32 @putchar(i32 %conv54.4.2)
%149 = load i8, ptr %arrayidx11.2.5, align 2, !tbaa !5
%conv54.5.2 = sext i8 %149 to i32
%putchar82.5.2 = call i32 @putchar(i32 %conv54.5.2)
%150 = load i8, ptr %arrayidx11.1.5, align 1, !tbaa !5
%conv54.6.2 = sext i8 %150 to i32
%putchar82.6.2 = call i32 @putchar(i32 %conv54.6.2)
%151 = load i8, ptr %arrayidx11.5109, align 4, !tbaa !5
%conv54.7.2 = sext i8 %151 to i32
%putchar82.7.2 = call i32 @putchar(i32 %conv54.7.2)
%putchar.2 = call i32 @putchar(i32 10)
%152 = load i8, ptr %arrayidx11.7.4, align 4, !tbaa !5
%conv54.3150 = sext i8 %152 to i32
%putchar82.3151 = call i32 @putchar(i32 %conv54.3150)
%153 = load i8, ptr %arrayidx11.6.4, align 1, !tbaa !5
%conv54.1.3 = sext i8 %153 to i32
%putchar82.1.3 = call i32 @putchar(i32 %conv54.1.3)
%154 = load i8, ptr %arrayidx11.5.4, align 2, !tbaa !5
%conv54.2.3 = sext i8 %154 to i32
%putchar82.2.3 = call i32 @putchar(i32 %conv54.2.3)
%155 = load i8, ptr %arrayidx11.4.4, align 1, !tbaa !5
%conv54.3.3 = sext i8 %155 to i32
%putchar82.3.3 = call i32 @putchar(i32 %conv54.3.3)
%156 = load i8, ptr %arrayidx11.3.4, align 8, !tbaa !5
%conv54.4.3 = sext i8 %156 to i32
%putchar82.4.3 = call i32 @putchar(i32 %conv54.4.3)
%157 = load i8, ptr %arrayidx11.2.4, align 1, !tbaa !5
%conv54.5.3 = sext i8 %157 to i32
%putchar82.5.3 = call i32 @putchar(i32 %conv54.5.3)
%158 = load i8, ptr %arrayidx11.1.4, align 2, !tbaa !5
%conv54.6.3 = sext i8 %158 to i32
%putchar82.6.3 = call i32 @putchar(i32 %conv54.6.3)
%159 = load i8, ptr %arrayidx11.4106, align 1, !tbaa !5
%conv54.7.3 = sext i8 %159 to i32
%putchar82.7.3 = call i32 @putchar(i32 %conv54.7.3)
%putchar.3 = call i32 @putchar(i32 10)
%160 = load i8, ptr %arrayidx11.7.3, align 1, !tbaa !5
%conv54.4153 = sext i8 %160 to i32
%putchar82.4154 = call i32 @putchar(i32 %conv54.4153)
%161 = load i8, ptr %arrayidx11.6.3, align 4, !tbaa !5
%conv54.1.4 = sext i8 %161 to i32
%putchar82.1.4 = call i32 @putchar(i32 %conv54.1.4)
%162 = load i8, ptr %arrayidx11.5.3, align 1, !tbaa !5
%conv54.2.4 = sext i8 %162 to i32
%putchar82.2.4 = call i32 @putchar(i32 %conv54.2.4)
%163 = load i8, ptr %arrayidx11.4.3, align 2, !tbaa !5
%conv54.3.4 = sext i8 %163 to i32
%putchar82.3.4 = call i32 @putchar(i32 %conv54.3.4)
%164 = load i8, ptr %arrayidx11.3.3, align 1, !tbaa !5
%conv54.4.4 = sext i8 %164 to i32
%putchar82.4.4 = call i32 @putchar(i32 %conv54.4.4)
%165 = load i8, ptr %arrayidx11.2.3, align 16, !tbaa !5
%conv54.5.4 = sext i8 %165 to i32
%putchar82.5.4 = call i32 @putchar(i32 %conv54.5.4)
%166 = load i8, ptr %arrayidx11.1.3, align 1, !tbaa !5
%conv54.6.4 = sext i8 %166 to i32
%putchar82.6.4 = call i32 @putchar(i32 %conv54.6.4)
%167 = load i8, ptr %arrayidx11.3103, align 2, !tbaa !5
%conv54.7.4 = sext i8 %167 to i32
%putchar82.7.4 = call i32 @putchar(i32 %conv54.7.4)
%putchar.4 = call i32 @putchar(i32 10)
%168 = load i8, ptr %arrayidx11.7.2, align 2, !tbaa !5
%conv54.5156 = sext i8 %168 to i32
%putchar82.5157 = call i32 @putchar(i32 %conv54.5156)
%169 = load i8, ptr %arrayidx11.6.2, align 1, !tbaa !5
%conv54.1.5 = sext i8 %169 to i32
%putchar82.1.5 = call i32 @putchar(i32 %conv54.1.5)
%170 = load i8, ptr %arrayidx11.5.2, align 4, !tbaa !5
%conv54.2.5 = sext i8 %170 to i32
%putchar82.2.5 = call i32 @putchar(i32 %conv54.2.5)
%171 = load i8, ptr %arrayidx11.4.2, align 1, !tbaa !5
%conv54.3.5 = sext i8 %171 to i32
%putchar82.3.5 = call i32 @putchar(i32 %conv54.3.5)
%172 = load i8, ptr %arrayidx11.3.2, align 2, !tbaa !5
%conv54.4.5 = sext i8 %172 to i32
%putchar82.4.5 = call i32 @putchar(i32 %conv54.4.5)
%173 = load i8, ptr %arrayidx11.2.2, align 1, !tbaa !5
%conv54.5.5 = sext i8 %173 to i32
%putchar82.5.5 = call i32 @putchar(i32 %conv54.5.5)
%174 = load i8, ptr %arrayidx11.1.2, align 8, !tbaa !5
%conv54.6.5 = sext i8 %174 to i32
%putchar82.6.5 = call i32 @putchar(i32 %conv54.6.5)
%175 = load i8, ptr %arrayidx11.2100, align 1, !tbaa !5
%conv54.7.5 = sext i8 %175 to i32
%putchar82.7.5 = call i32 @putchar(i32 %conv54.7.5)
%putchar.5 = call i32 @putchar(i32 10)
%176 = load i8, ptr %arrayidx11.7.1, align 1, !tbaa !5
%conv54.6159 = sext i8 %176 to i32
%putchar82.6160 = call i32 @putchar(i32 %conv54.6159)
%177 = load i8, ptr %arrayidx11.6.1, align 2, !tbaa !5
%conv54.1.6 = sext i8 %177 to i32
%putchar82.1.6 = call i32 @putchar(i32 %conv54.1.6)
%178 = load i8, ptr %arrayidx11.5.1, align 1, !tbaa !5
%conv54.2.6 = sext i8 %178 to i32
%putchar82.2.6 = call i32 @putchar(i32 %conv54.2.6)
%179 = load i8, ptr %arrayidx11.4.1, align 4, !tbaa !5
%conv54.3.6 = sext i8 %179 to i32
%putchar82.3.6 = call i32 @putchar(i32 %conv54.3.6)
%180 = load i8, ptr %arrayidx11.3.1, align 1, !tbaa !5
%conv54.4.6 = sext i8 %180 to i32
%putchar82.4.6 = call i32 @putchar(i32 %conv54.4.6)
%181 = load i8, ptr %arrayidx11.2.1, align 2, !tbaa !5
%conv54.5.6 = sext i8 %181 to i32
%putchar82.5.6 = call i32 @putchar(i32 %conv54.5.6)
%182 = load i8, ptr %arrayidx11.1.1, align 1, !tbaa !5
%conv54.6.6 = sext i8 %182 to i32
%putchar82.6.6 = call i32 @putchar(i32 %conv54.6.6)
%183 = load i8, ptr %arrayidx11.197, align 16, !tbaa !5
%conv54.7.6 = sext i8 %183 to i32
%putchar82.7.6 = call i32 @putchar(i32 %conv54.7.6)
%putchar.6 = call i32 @putchar(i32 10)
%184 = load i8, ptr %g, align 16, !tbaa !5
%conv54.7162 = sext i8 %184 to i32
%putchar82.7163 = call i32 @putchar(i32 %conv54.7162)
%185 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv54.1.7 = sext i8 %185 to i32
%putchar82.1.7 = call i32 @putchar(i32 %conv54.1.7)
%186 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%conv54.2.7 = sext i8 %186 to i32
%putchar82.2.7 = call i32 @putchar(i32 %conv54.2.7)
%187 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv54.3.7 = sext i8 %187 to i32
%putchar82.3.7 = call i32 @putchar(i32 %conv54.3.7)
%188 = load i8, ptr %arrayidx.4, align 4, !tbaa !5
%conv54.4.7 = sext i8 %188 to i32
%putchar82.4.7 = call i32 @putchar(i32 %conv54.4.7)
%189 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%conv54.5.7 = sext i8 %189 to i32
%putchar82.5.7 = call i32 @putchar(i32 %conv54.5.7)
%190 = load i8, ptr %arrayidx.6, align 2, !tbaa !5
%conv54.6.7 = sext i8 %190 to i32
%putchar82.6.7 = call i32 @putchar(i32 %conv54.6.7)
%191 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%conv54.7.7 = sext i8 %191 to i32
%putchar82.7.7 = call i32 @putchar(i32 %conv54.7.7)
%putchar.7 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 81, ptr nonnull %g) #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
char t1[1510];
char t2[1510];
int main(){
int n;
int a=0,b=0;
int i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s %s",&t1,&t2);
if(strcmp(t1,t2)==0) a++,b++;
if(strcmp(t1,t2)>0) a+=3;
if(strcmp(t1,t2)<0) b+=3;
}
printf("%d %d\n",a,b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200652/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200652/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@t1 = dso_local global [1510 x i8] zeroinitializer, align 16
@t2 = dso_local global [1510 x i8] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.024 = phi i32 [ %inc14, %for.body ], [ 0, %entry ]
%b.023 = phi i32 [ %b.2, %for.body ], [ 0, %entry ]
%a.022 = phi i32 [ %a.2, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @t1, ptr noundef nonnull @t2)
%call2 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @t1, ptr noundef nonnull dereferenceable(1) @t2) #5
%cmp3 = icmp eq i32 %call2, 0
%inc = zext i1 %cmp3 to i32
%a.1 = add nsw i32 %a.022, %inc
%b.1 = add nsw i32 %b.023, %inc
%cmp6 = icmp sgt i32 %call2, 0
%add = add nsw i32 %a.1, 3
%a.2 = select i1 %cmp6, i32 %add, i32 %a.1
%cmp10 = icmp slt i32 %call2, 0
%add12 = add nsw i32 %b.1, 3
%b.2 = select i1 %cmp10, i32 %add12, i32 %b.1
%inc14 = add nuw nsw i32 %i.024, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc14, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%a.0.lcssa = phi i32 [ 0, %entry ], [ %a.2, %for.body ]
%b.0.lcssa = phi i32 [ 0, %entry ], [ %b.2, %for.body ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %a.0.lcssa, i32 noundef %b.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main( void )
{
char Tarou[101];
char Hanako[101];
int n;
int Tscore=0,Hscore=0;
scanf( "%d", &n );
while( n-- ) {
scanf( "%s", Tarou );
scanf( "%s", Hanako );
if( 0 == strcmp( Tarou, Hanako ) ) {
Tscore+=1;
Hscore+=1;
} else if( 0 < strcmp( Tarou, Hanako ) ) {
Tscore+=3;
} else {
Hscore+=3;
}
}
printf( "%d %d\n", Tscore, Hscore );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200696/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200696/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Tarou = alloca [101 x i8], align 16
%Hanako = alloca [101 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %Tarou) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %Hanako) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec22 = add nsw i32 %0, -1
store i32 %dec22, ptr %n, align 4, !tbaa !5
%tobool.not23 = icmp eq i32 %0, 0
br i1 %tobool.not23, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end16
%Hscore.025 = phi i32 [ %Hscore.1, %if.end16 ], [ 0, %entry ]
%Tscore.024 = phi i32 [ %Tscore.1, %if.end16 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %Tarou)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %Hanako)
%call6 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %Tarou, ptr noundef nonnull dereferenceable(1) %Hanako) #5
%cmp = icmp eq i32 %call6, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %while.body
%add = add nsw i32 %Tscore.024, 1
%add7 = add nsw i32 %Hscore.025, 1
br label %if.end16
if.else: ; preds = %while.body
%cmp11 = icmp sgt i32 %call6, 0
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else
%add13 = add nsw i32 %Tscore.024, 3
br label %if.end16
if.else14: ; preds = %if.else
%add15 = add nsw i32 %Hscore.025, 3
br label %if.end16
if.end16: ; preds = %if.then12, %if.else14, %if.then
%Tscore.1 = phi i32 [ %add, %if.then ], [ %add13, %if.then12 ], [ %Tscore.024, %if.else14 ]
%Hscore.1 = phi i32 [ %add7, %if.then ], [ %Hscore.025, %if.then12 ], [ %add15, %if.else14 ]
%1 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end16, %entry
%Tscore.0.lcssa = phi i32 [ 0, %entry ], [ %Tscore.1, %if.end16 ]
%Hscore.0.lcssa = phi i32 [ 0, %entry ], [ %Hscore.1, %if.end16 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %Tscore.0.lcssa, i32 noundef %Hscore.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %Hanako) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %Tarou) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#define MAX 101
int main(void) {
int n, v, t = 0, h = 0;
char tc[MAX], hc[MAX];
for(scanf("%d", &n); n--; v || (t++, h++)) {
scanf("%s %s", tc, hc);
v = strcmp(tc, hc);
v && (*(v > 0 ? &t : &h) += 3);
}
printf("%d %d\n", t, h);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%tc = alloca [101 x i8], align 16
%hc = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %tc) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %hc) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec19 = add nsw i32 %0, -1
store i32 %dec19, ptr %n, align 4, !tbaa !5
%tobool.not20 = icmp eq i32 %0, 0
br i1 %tobool.not20, label %for.end, label %for.body
for.body: ; preds = %entry, %land.end
%h.022 = phi i32 [ %h.3, %land.end ], [ 0, %entry ]
%t.021 = phi i32 [ %t.3, %land.end ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tc, ptr noundef nonnull %hc)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %tc, ptr noundef nonnull dereferenceable(1) %hc) #5
%tobool6.not = icmp eq i32 %call5, 0
br i1 %tobool6.not, label %land.end, label %land.rhs
land.rhs: ; preds = %for.body
%cmp = icmp sgt i32 %call5, 0
%.sroa.speculated = select i1 %cmp, i32 %t.021, i32 %h.022
%add = add nsw i32 %.sroa.speculated, 3
%add.t.0 = select i1 %cmp, i32 %add, i32 %t.021
%h.0.add = select i1 %cmp, i32 %h.022, i32 %add
br label %land.end
land.end: ; preds = %land.rhs, %for.body
%t.2 = phi i32 [ %add.t.0, %land.rhs ], [ %t.021, %for.body ]
%h.2 = phi i32 [ %h.0.add, %land.rhs ], [ %h.022, %for.body ]
%inc = zext i1 %tobool6.not to i32
%t.3 = add nsw i32 %t.2, %inc
%h.3 = add nsw i32 %h.2, %inc
%1 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %land.end, %entry
%t.0.lcssa = phi i32 [ 0, %entry ], [ %t.3, %land.end ]
%h.0.lcssa = phi i32 [ 0, %entry ], [ %h.3, %land.end ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t.0.lcssa, i32 noundef %h.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %hc) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %tc) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int n, i;
char t[101], h[101];
int t_p = 0, h_p = 0;
int v; //??????????????¨.
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s %s", t, h);
v = strcmp(t, h);
if (v > 0)
t_p += 3;
else if (v < 0)
h_p += 3;
else {
t_p++;
h_p++;
}
}
printf("%d %d\n", t_p, h_p);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200782/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200782/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca [101 x i8], align 16
%h = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %h) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.024 = phi i32 [ %inc13, %for.inc ], [ 0, %entry ]
%h_p.023 = phi i32 [ %h_p.1, %for.inc ], [ 0, %entry ]
%t_p.022 = phi i32 [ %t_p.1, %for.inc ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %h)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %h) #5
%cmp6 = icmp sgt i32 %call5, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = add nsw i32 %t_p.022, 3
br label %for.inc
if.else: ; preds = %for.body
%cmp7 = icmp slt i32 %call5, 0
br i1 %cmp7, label %if.then8, label %if.else10
if.then8: ; preds = %if.else
%add9 = add nsw i32 %h_p.023, 3
br label %for.inc
if.else10: ; preds = %if.else
%inc = add nsw i32 %t_p.022, 1
%inc11 = add nsw i32 %h_p.023, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.else10, %if.then8
%t_p.1 = phi i32 [ %add, %if.then ], [ %t_p.022, %if.then8 ], [ %inc, %if.else10 ]
%h_p.1 = phi i32 [ %h_p.023, %if.then ], [ %add9, %if.then8 ], [ %inc11, %if.else10 ]
%inc13 = add nuw nsw i32 %i.024, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc13, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%t_p.0.lcssa = phi i32 [ 0, %entry ], [ %t_p.1, %for.inc ]
%h_p.0.lcssa = phi i32 [ 0, %entry ], [ %h_p.1, %for.inc ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %t_p.0.lcssa, i32 noundef %h_p.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 101, 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main()
{
int n, i;
int Tp = 0, Hp = 0;
scanf("%d", &n);
for(i=0; i<n; i++){
char Tw[1001] = {0};
char Hw[1001] = {0};
scanf("%s%s", Tw, Hw);
if(strcmp(Tw, Hw)==0){
Tp++; Hp++;
} else if(strcmp(Tw, Hw) > 0){
Tp+=3;
} else Hp+=3;
}
printf("%d %d\n", Tp, Hp);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200825/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200825/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%Tw = alloca [1001 x i8], align 16
%Hw = alloca [1001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end15
%Hp.026 = phi i32 [ %Hp.1, %if.end15 ], [ 0, %entry ]
%Tp.025 = phi i32 [ %Tp.1, %if.end15 ], [ 0, %entry ]
%i.024 = phi i32 [ %inc16, %if.end15 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %Tw) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %Tw, i8 0, i64 1001, i1 false)
call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %Hw) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1001) %Hw, i8 0, i64 1001, i1 false)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %Tw, ptr noundef nonnull %Hw)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %Tw, ptr noundef nonnull dereferenceable(1) %Hw) #6
%cmp6 = icmp eq i32 %call5, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %Tp.025, 1
%inc7 = add nsw i32 %Hp.026, 1
br label %if.end15
if.else: ; preds = %for.body
%cmp11 = icmp sgt i32 %call5, 0
br i1 %cmp11, label %if.then12, label %if.else13
if.then12: ; preds = %if.else
%add = add nsw i32 %Tp.025, 3
br label %if.end15
if.else13: ; preds = %if.else
%add14 = add nsw i32 %Hp.026, 3
br label %if.end15
if.end15: ; preds = %if.then12, %if.else13, %if.then
%Tp.1 = phi i32 [ %inc, %if.then ], [ %add, %if.then12 ], [ %Tp.025, %if.else13 ]
%Hp.1 = phi i32 [ %inc7, %if.then ], [ %Hp.026, %if.then12 ], [ %add14, %if.else13 ]
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %Hw) #5
call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %Tw) #5
%inc16 = add nuw nsw i32 %i.024, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc16, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end15, %entry
%Tp.0.lcssa = phi i32 [ 0, %entry ], [ %Tp.1, %if.end15 ]
%Hp.0.lcssa = phi i32 [ 0, %entry ], [ %Hp.1, %if.end15 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %Tp.0.lcssa, i32 noundef %Hp.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 T[100 + 1];
char H[100 + 1];
int n,tc,hc,i,j;
scanf("%d",&n);
tc = hc = 0;
for (i = 0; i < n; i++)
{
scanf("%100s",T);
scanf("%100s",H);
j = 0;
while (T[j] != '\0' && H[j] != '\0' && T[j] == H[j]) j++;
if (T[j] == '\0' && H[j] == '\0')
{
tc++; hc++;
}
else
{
if ((T[j] - H[j]) > 0) tc += 3;
else hc += 3;
}
}
printf("%d %d\n",tc,hc);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%100s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%T = alloca [101 x i8], align 16
%H = alloca [101 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %T) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.069 = phi i32 [ %inc44, %for.inc ], [ 0, %entry ]
%hc.068 = phi i32 [ %hc.1, %for.inc ], [ 0, %entry ]
%tc.067 = phi i32 [ %tc.1, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %T)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %H)
%1 = load i8, ptr %T, align 16, !tbaa !9
%cmp4.not62 = icmp eq i8 %1, 0
br i1 %cmp4.not62, label %land.lhs.true24, label %land.lhs.true
while.cond: ; preds = %land.lhs.true
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %T, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp4.not = icmp eq i8 %2, 0
br i1 %cmp4.not, label %land.lhs.true24, label %land.lhs.true, !llvm.loop !10
land.lhs.true: ; preds = %for.body, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %for.body ]
%3 = phi i8 [ %2, %while.cond ], [ %1, %for.body ]
%arrayidx7 = getelementptr inbounds [101 x i8], ptr %H, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx7, align 1, !tbaa !9
%cmp9.not = icmp ne i8 %4, 0
%cmp17 = icmp eq i8 %3, %4
%or.cond = and i1 %cmp9.not, %cmp17
br i1 %or.cond, label %while.cond, label %if.else
land.lhs.true24: ; preds = %while.cond, %for.body
%idxprom.lcssa = phi i64 [ 0, %for.body ], [ %indvars.iv.next, %while.cond ]
%arrayidx26 = getelementptr inbounds [101 x i8], ptr %H, i64 0, i64 %idxprom.lcssa
%5 = load i8, ptr %arrayidx26, align 1, !tbaa !9
%cmp28 = icmp eq i8 %5, 0
br i1 %cmp28, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true24
%inc30 = add nsw i32 %tc.067, 1
%inc31 = add nsw i32 %hc.068, 1
br label %for.inc
if.else: ; preds = %land.lhs.true, %land.lhs.true24
%6 = phi i8 [ %5, %land.lhs.true24 ], [ %4, %land.lhs.true ]
%7 = phi i8 [ 0, %land.lhs.true24 ], [ %3, %land.lhs.true ]
%cmp38 = icmp sgt i8 %7, %6
br i1 %cmp38, label %if.then40, label %if.else41
if.then40: ; preds = %if.else
%add = add nsw i32 %tc.067, 3
br label %for.inc
if.else41: ; preds = %if.else
%add42 = add nsw i32 %hc.068, 3
br label %for.inc
for.inc: ; preds = %if.then, %if.else41, %if.then40
%tc.1 = phi i32 [ %inc30, %if.then ], [ %add, %if.then40 ], [ %tc.067, %if.else41 ]
%hc.1 = phi i32 [ %inc31, %if.then ], [ %hc.068, %if.then40 ], [ %add42, %if.else41 ]
%inc44 = add nuw nsw i32 %i.069, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc44, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.inc, %entry
%tc.0.lcssa = phi i32 [ 0, %entry ], [ %tc.1, %for.inc ]
%hc.0.lcssa = phi i32 [ 0, %entry ], [ %hc.1, %for.inc ]
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %tc.0.lcssa, i32 noundef %hc.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %H) #3
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %T) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[]) {
char a[101],b[101];
int n,i;
int x=0,y=0;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%s %s", a, b);
if(strcmp(a,b) == 0) x++, y++;
if(strcmp(a,b) > 0) x+=3;
if(strcmp(a,b) < 0) y+=3;
}
printf("%d %d\n",x,y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca [101 x i8], align 16
%b = alloca [101 x i8], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%y.031 = phi i32 [ %y.2, %for.body ], [ 0, %entry ]
%x.030 = phi i32 [ %x.2, %for.body ], [ 0, %entry ]
%i.029 = phi i32 [ %inc21, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #5
%cmp6 = icmp eq i32 %call5, 0
%inc = zext i1 %cmp6 to i32
%x.1 = add nsw i32 %x.030, %inc
%y.1 = add nsw i32 %y.031, %inc
%cmp11 = icmp sgt i32 %call5, 0
%add = add nsw i32 %x.1, 3
%x.2 = select i1 %cmp11, i32 %add, i32 %x.1
%cmp17 = icmp slt i32 %call5, 0
%add19 = add nsw i32 %y.1, 3
%y.2 = select i1 %cmp17, i32 %add19, i32 %y.1
%inc21 = add nuw nsw i32 %i.029, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc21, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%x.0.lcssa = phi i32 [ 0, %entry ], [ %x.2, %for.body ]
%y.0.lcssa = phi i32 [ 0, %entry ], [ %y.2, %for.body ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %x.0.lcssa, i32 noundef %y.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 101, 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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 p, c, n, i, a[301], k = -1;
long long x;
for(i = 0; i < 301; i++)
a[i] = 0;
scanf("%d%d", &p, &n);
i = 1;
while(n--){
scanf("%ld", &x);
c = x % p;
if(a[c] != 0 && k == -1) {
k = i;
}
else{
a[c]++;
}
i++;
}
if(k == -1) printf("-1\n");
else printf("%d", k);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20097/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20097/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
@.str.3 = 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 nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%p = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [301 x i32], align 16
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 1204, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1204) %a, i8 0, i64 1204, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec28 = add nsw i32 %0, -1
store i32 %dec28, ptr %n, align 4, !tbaa !5
%tobool.not29 = icmp eq i32 %0, 0
br i1 %tobool.not29, label %if.then15, label %while.body
while.body: ; preds = %entry, %if.end
%k.031 = phi i32 [ %k.1, %if.end ], [ -1, %entry ]
%i.130 = phi i32 [ %inc12, %if.end ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i64, ptr %x, align 8, !tbaa !9
%2 = load i32, ptr %p, align 4, !tbaa !5
%conv = sext i32 %2 to i64
%rem = srem i64 %1, %conv
%arrayidx4 = getelementptr inbounds [301 x i32], ptr %a, i64 0, i64 %rem
%3 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp ne i32 %3, 0
%cmp7 = icmp eq i32 %k.031, -1
%or.cond = select i1 %cmp5, i1 %cmp7, i1 false
br i1 %or.cond, label %if.end, label %if.else
if.else: ; preds = %while.body
%inc11 = add nsw i32 %3, 1
store i32 %inc11, ptr %arrayidx4, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %while.body, %if.else
%k.1 = phi i32 [ %k.031, %if.else ], [ %i.130, %while.body ]
%inc12 = add nuw nsw i32 %i.130, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %4, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %if.end
%cmp13 = icmp eq i32 %k.1, -1
br i1 %cmp13, label %if.then15, label %if.else17
if.then15: ; preds = %entry, %while.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end19
if.else17: ; preds = %while.end
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %k.1)
br label %if.end19
if.end19: ; preds = %if.else17, %if.then15
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 1204, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #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 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 = { nofree nounwind }
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, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main() {
int n,taro=0,hanako=0,i;
char t[101] = { 0 }, h[101] = {0};
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s %s", t, h);
if (strcmp(t, h) > 0) {
taro += 3;
}
else if (strcmp(t, h) < 0) {
hanako += 3;
}
else {
taro++; hanako++;
}
}
printf("%d %d\n", taro, hanako);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201019/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201019/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca [101 x i8], align 16
%h = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %t, i8 0, i64 101, i1 false)
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %h) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %h, i8 0, i64 101, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %0, 0
br i1 %cmp23, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.026 = phi i32 [ %inc16, %for.inc ], [ 0, %entry ]
%hanako.025 = phi i32 [ %hanako.1, %for.inc ], [ 0, %entry ]
%taro.024 = phi i32 [ %taro.1, %for.inc ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %h)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %t, ptr noundef nonnull dereferenceable(1) %h) #6
%cmp6 = icmp sgt i32 %call5, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = add nsw i32 %taro.024, 3
br label %for.inc
if.else: ; preds = %for.body
%cmp10 = icmp slt i32 %call5, 0
br i1 %cmp10, label %if.then11, label %if.else13
if.then11: ; preds = %if.else
%add12 = add nsw i32 %hanako.025, 3
br label %for.inc
if.else13: ; preds = %if.else
%inc = add nsw i32 %taro.024, 1
%inc14 = add nsw i32 %hanako.025, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.else13, %if.then11
%taro.1 = phi i32 [ %add, %if.then ], [ %taro.024, %if.then11 ], [ %inc, %if.else13 ]
%hanako.1 = phi i32 [ %hanako.025, %if.then ], [ %add12, %if.then11 ], [ %inc14, %if.else13 ]
%inc16 = add nuw nsw i32 %i.026, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc16, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%taro.0.lcssa = phi i32 [ 0, %entry ], [ %taro.1, %for.inc ]
%hanako.0.lcssa = phi i32 [ 0, %entry ], [ %hanako.1, %for.inc ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %taro.0.lcssa, i32 noundef %hanako.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %h) #5
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare 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 #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main(){
int n, i, taro = 0, hana = 0;
char s1[101], s2[101];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s %s", s1, s2);
if ( strcmp(s1, s2) == 0 ) {taro++; hana++;}
else if ( strcmp(s1, s2) > 0 ) taro += 3;
else if ( strcmp(s1, s2) < 0 ) hana += 3;
}
printf("%d %d\n", taro, hana);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s1 = alloca [101 x i8], align 16
%s2 = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s1) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%hana.032 = phi i32 [ %hana.1, %for.inc ], [ 0, %entry ]
%taro.031 = phi i32 [ %taro.1, %for.inc ], [ 0, %entry ]
%i.030 = phi i32 [ %inc22, %for.inc ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s1, ptr noundef nonnull %s2)
%call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s1, ptr noundef nonnull dereferenceable(1) %s2) #5
%cmp6 = icmp eq i32 %call5, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %taro.031, 1
%inc7 = add nsw i32 %hana.032, 1
br label %for.inc
if.else: ; preds = %for.body
%cmp11 = icmp sgt i32 %call5, 0
br i1 %cmp11, label %if.then12, label %if.then18
if.then12: ; preds = %if.else
%add = add nsw i32 %taro.031, 3
br label %for.inc
if.then18: ; preds = %if.else
%add19 = add nsw i32 %hana.032, 3
br label %for.inc
for.inc: ; preds = %if.then, %if.then18, %if.then12
%taro.1 = phi i32 [ %inc, %if.then ], [ %add, %if.then12 ], [ %taro.031, %if.then18 ]
%hana.1 = phi i32 [ %inc7, %if.then ], [ %hana.032, %if.then12 ], [ %add19, %if.then18 ]
%inc22 = add nuw nsw i32 %i.030, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc22, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%taro.0.lcssa = phi i32 [ 0, %entry ], [ %taro.1, %for.inc ]
%hana.0.lcssa = phi i32 [ 0, %entry ], [ %hana.1, %for.inc ]
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %taro.0.lcssa, i32 noundef %hana.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s2) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 i, j, n, taro_p = 0, hanako_p = 0;
char taro[101], hanako[101];
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%s %s", taro, hanako);
for (j = 0;; j++){
if (taro[j] > hanako[j]){
taro_p += 3;
break;
}
else if (taro[j] < hanako[j]){
hanako_p += 3;
break;
}
else if (taro[j] + hanako[j] == 0){
hanako_p++;
taro_p++;
break;
}
}
}
printf("%d %d\n", taro_p, hanako_p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201105/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201105/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%taro = alloca [101 x i8], align 16
%hanako = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %taro) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %hanako) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %for.end36
for.body: ; preds = %entry, %for.inc34
%hanako_p.058 = phi i32 [ %hanako_p.1, %for.inc34 ], [ 0, %entry ]
%taro_p.057 = phi i32 [ %taro_p.1, %for.inc34 ], [ 0, %entry ]
%i.056 = phi i32 [ %inc35, %for.inc34 ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %taro, ptr noundef nonnull %hanako)
%1 = load i8, ptr %taro, align 16, !tbaa !9
%2 = load i8, ptr %hanako, align 16, !tbaa !9
%cmp751 = icmp sgt i8 %1, %2
br i1 %cmp751, label %if.then, label %if.else
for.cond3: ; preds = %if.else19
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %taro, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !9
%arrayidx5 = getelementptr inbounds [101 x i8], ptr %hanako, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp7 = icmp sgt i8 %3, %4
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.cond3, %for.body
%add = add nsw i32 %taro_p.057, 3
br label %for.inc34
if.else: ; preds = %for.body, %for.cond3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond3 ], [ 0, %for.body ]
%5 = phi i8 [ %4, %for.cond3 ], [ %2, %for.body ]
%6 = phi i8 [ %3, %for.cond3 ], [ %1, %for.body ]
%cmp15 = icmp slt i8 %6, %5
br i1 %cmp15, label %if.then17, label %if.else19
if.then17: ; preds = %if.else
%add18 = add nsw i32 %hanako_p.058, 3
br label %for.inc34
if.else19: ; preds = %if.else
%conv53 = sext i8 %6 to i32
%conv654 = sext i8 %5 to i32
%add26 = sub nsw i32 0, %conv654
%cmp27 = icmp eq i32 %conv53, %add26
br i1 %cmp27, label %if.then29, label %for.cond3
if.then29: ; preds = %if.else19
%inc = add nsw i32 %hanako_p.058, 1
%inc30 = add nsw i32 %taro_p.057, 1
br label %for.inc34
for.inc34: ; preds = %if.then, %if.then17, %if.then29
%taro_p.1 = phi i32 [ %add, %if.then ], [ %taro_p.057, %if.then17 ], [ %inc30, %if.then29 ]
%hanako_p.1 = phi i32 [ %hanako_p.058, %if.then ], [ %add18, %if.then17 ], [ %inc, %if.then29 ]
%inc35 = add nuw nsw i32 %i.056, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc35, %7
br i1 %cmp, label %for.body, label %for.end36, !llvm.loop !10
for.end36: ; preds = %for.inc34, %entry
%taro_p.0.lcssa = phi i32 [ 0, %entry ], [ %taro_p.1, %for.inc34 ]
%hanako_p.0.lcssa = phi i32 [ 0, %entry ], [ %hanako_p.1, %for.inc34 ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %taro_p.0.lcssa, i32 noundef %hanako_p.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %hanako) #3
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %taro) #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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main(void){
int p1=0,p2=0,i,n;
char word1[101],word2[101];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s %s",&word1,&word2);
if(strcmp(word1,word2)==0){
p1++;
p2++;
}
if(strcmp(word1,word2)>0){
p1+=3;
}
if(strcmp(word1,word2)<0){
p2+=3;
}
}
printf("%d %d\n",p1,p2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%word1 = alloca [101 x i8], align 16
%word2 = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %word1) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %word2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %0, 0
br i1 %cmp26, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.029 = phi i32 [ %inc19, %for.body ], [ 0, %entry ]
%p2.028 = phi i32 [ %p2.2, %for.body ], [ 0, %entry ]
%p1.027 = phi i32 [ %p1.2, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %word1, ptr noundef nonnull %word2)
%call3 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %word1, ptr noundef nonnull dereferenceable(1) %word2) #5
%cmp4 = icmp eq i32 %call3, 0
%inc = zext i1 %cmp4 to i32
%p1.1 = add nsw i32 %p1.027, %inc
%p2.1 = add nsw i32 %p2.028, %inc
%cmp9 = icmp sgt i32 %call3, 0
%add = add nsw i32 %p1.1, 3
%p1.2 = select i1 %cmp9, i32 %add, i32 %p1.1
%cmp15 = icmp slt i32 %call3, 0
%add17 = add nsw i32 %p2.1, 3
%p2.2 = select i1 %cmp15, i32 %add17, i32 %p2.1
%inc19 = add nuw nsw i32 %i.029, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc19, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%p1.0.lcssa = phi i32 [ 0, %entry ], [ %p1.2, %for.body ]
%p2.0.lcssa = phi i32 [ 0, %entry ], [ %p2.2, %for.body ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %p1.0.lcssa, i32 noundef %p2.0.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %word2) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %word1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
int main()
{
int i,n,k;
scanf("%d%d",&n,&k);
for(i=1;i<n-k;i++)
printf("%d ",i);
for(i=n;i>=n-k;i--)
(i!=n-k)?printf("%d ",i):printf("%d\n",i);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2012/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2012/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \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) #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
%sub19 = sub nsw i32 %0, %1
%cmp20 = icmp sgt i32 %sub19, 1
br i1 %cmp20, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%sub322.pre-phi = phi i32 [ %sub19, %entry ], [ %sub, %for.body ]
%2 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%cmp4.not23 = icmp slt i32 %2, %sub322.pre-phi
br i1 %cmp4.not23, label %for.end11, label %for.body5
for.body: ; preds = %entry, %for.body
%i.021 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.021)
%inc = add nuw nsw i32 %i.021, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %3, %4
%cmp = icmp slt i32 %inc, %sub
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body5: ; preds = %for.cond2.preheader, %for.inc10
%sub325 = phi i32 [ %sub3, %for.inc10 ], [ %sub322.pre-phi, %for.cond2.preheader ]
%i.124 = phi i32 [ %dec, %for.inc10 ], [ %2, %for.cond2.preheader ]
%cmp7.not = icmp eq i32 %i.124, %sub325
br i1 %cmp7.not, label %cond.false, label %cond.true
cond.true: ; preds = %for.body5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.124)
br label %for.inc10
cond.false: ; preds = %for.body5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub325)
br label %for.inc10
for.inc10: ; preds = %cond.true, %cond.false
%dec = add nsw i32 %i.124, -1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = load i32, ptr %k, align 4, !tbaa !5
%sub3 = sub nsw i32 %5, %6
%cmp4.not.not = icmp sgt i32 %i.124, %sub3
br i1 %cmp4.not.not, label %for.body5, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.inc10, %for.cond2.preheader
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <inttypes.h>
int H, W;
char S[512][512];
int group[512][512];
int count[512 * 512][2];
void dfs(int y, int x, int mikisinn) {
static const int d[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
int i;
if (group[y][x] == mikisinn) return;
group[y][x] = mikisinn;
for (i = 0; i < 4; i++) {
int ny = y + d[i][0], nx = x + d[i][1];
if (0 <= ny && ny < H && 0 <= nx && nx < W && S[y][x] != S[ny][nx]) {
dfs(ny, nx, mikisinn);
}
}
}
int main(void) {
int i, j;
int asumisu = 0;
uint64_t mizuhasu = 0;
if (scanf("%d%d", &H, &W) != 2) return 1;
for (i = 0; i < H; i++) {
if (scanf("%511s", S[i]) != 1) return 1;
}
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
if (group[i][j] == 0) {
dfs(i, j, ++asumisu);
}
}
}
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
count[group[i][j]][S[i][j] == '.']++;
}
}
for (i = 1; i <= asumisu; i++) {
mizuhasu += (uint64_t)count[i][0] * (uint64_t)count[i][1];
}
printf("%" PRIu64 "\n", mizuhasu);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201271/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201271/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@group = dso_local local_unnamed_addr global [512 x [512 x i32]] zeroinitializer, align 16
@H = dso_local global i32 0, align 4
@W = dso_local global i32 0, align 4
@S = dso_local global [512 x [512 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%511s\00", align 1
@count = dso_local local_unnamed_addr global [262144 x [2 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [5 x i8] c"%lu\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @dfs(i32 noundef %y, i32 noundef %x, i32 noundef %mikisinn) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %land.lhs.true21.3, %entry
%y.tr = phi i32 [ %y, %entry ], [ %add.3, %land.lhs.true21.3 ]
%idxprom = sext i32 %y.tr to i64
%idxprom1 = sext i32 %x to i64
%arrayidx2 = getelementptr inbounds [512 x [512 x i32]], ptr @group, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %mikisinn
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %tailrecurse
store i32 %mikisinn, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx25 = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %idxprom, i64 %idxprom1
%add14 = add nsw i32 %x, 1
%cmp15 = icmp sgt i32 %y.tr, -1
br i1 %cmp15, label %land.lhs.true, label %if.end34.1
land.lhs.true: ; preds = %if.end
%1 = load i32, ptr @H, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %1, %y.tr
%cmp18 = icmp sgt i32 %x, -2
%or.cond = and i1 %cmp16, %cmp18
%2 = load i32, ptr @W, align 4
%cmp20 = icmp slt i32 %add14, %2
%or.cond52 = select i1 %or.cond, i1 %cmp20, i1 false
br i1 %or.cond52, label %land.lhs.true21, label %land.lhs.true.1
land.lhs.true21: ; preds = %land.lhs.true
%3 = load i8, ptr %arrayidx25, align 1, !tbaa !9
%idxprom26 = zext i32 %y.tr to i64
%idxprom28 = zext i32 %add14 to i64
%arrayidx29 = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %idxprom26, i64 %idxprom28
%4 = load i8, ptr %arrayidx29, align 1, !tbaa !9
%cmp31.not = icmp eq i8 %3, %4
br i1 %cmp31.not, label %land.lhs.true.1, label %if.then33
if.then33: ; preds = %land.lhs.true21
tail call void @dfs(i32 noundef %y.tr, i32 noundef %add14, i32 noundef %mikisinn)
br label %land.lhs.true.1
land.lhs.true.1: ; preds = %if.then33, %land.lhs.true21, %land.lhs.true
%add14.155 = add nsw i32 %x, -1
%5 = load i32, ptr @H, align 4, !tbaa !5
%cmp16.1 = icmp sgt i32 %5, %y.tr
%cmp18.1 = icmp sgt i32 %x, 0
%or.cond.1 = and i1 %cmp16.1, %cmp18.1
%6 = load i32, ptr @W, align 4
%cmp20.1 = icmp sge i32 %6, %x
%or.cond52.1 = select i1 %or.cond.1, i1 %cmp20.1, i1 false
br i1 %or.cond52.1, label %land.lhs.true21.1, label %if.end34.1.thread
land.lhs.true21.1: ; preds = %land.lhs.true.1
%7 = load i8, ptr %arrayidx25, align 1, !tbaa !9
%idxprom26.1 = zext i32 %y.tr to i64
%idxprom28.1 = zext i32 %add14.155 to i64
%arrayidx29.1 = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %idxprom26.1, i64 %idxprom28.1
%8 = load i8, ptr %arrayidx29.1, align 1, !tbaa !9
%cmp31.not.1 = icmp eq i8 %7, %8
br i1 %cmp31.not.1, label %if.end34.1.thread, label %if.then33.1
if.then33.1: ; preds = %land.lhs.true21.1
tail call void @dfs(i32 noundef %y.tr, i32 noundef %add14.155, i32 noundef %mikisinn)
br label %if.end34.1.thread
if.end34.1.thread: ; preds = %if.then33.1, %land.lhs.true21.1, %land.lhs.true.1
%add.257 = add nuw nsw i32 %y.tr, 1
br label %land.lhs.true.2
if.end34.1: ; preds = %if.end
%cmp15.2 = icmp eq i32 %y.tr, -1
br i1 %cmp15.2, label %land.lhs.true.2, label %cleanup
land.lhs.true.2: ; preds = %if.end34.1.thread, %if.end34.1
%add.259 = phi i32 [ %add.257, %if.end34.1.thread ], [ 0, %if.end34.1 ]
%9 = load i32, ptr @H, align 4, !tbaa !5
%cmp16.2 = icmp slt i32 %add.259, %9
%cmp18.2 = icmp sgt i32 %x, -1
%or.cond.2 = and i1 %cmp16.2, %cmp18.2
%10 = load i32, ptr @W, align 4
%cmp20.2 = icmp sgt i32 %10, %x
%or.cond52.2 = select i1 %or.cond.2, i1 %cmp20.2, i1 false
br i1 %or.cond52.2, label %land.lhs.true21.2, label %if.end34.2
land.lhs.true21.2: ; preds = %land.lhs.true.2
%11 = load i8, ptr %arrayidx25, align 1, !tbaa !9
%idxprom26.2 = zext i32 %add.259 to i64
%idxprom28.2 = zext i32 %x to i64
%arrayidx29.2 = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %idxprom26.2, i64 %idxprom28.2
%12 = load i8, ptr %arrayidx29.2, align 1, !tbaa !9
%cmp31.not.2 = icmp eq i8 %11, %12
br i1 %cmp31.not.2, label %if.end34.2, label %if.then33.2
if.then33.2: ; preds = %land.lhs.true21.2
tail call void @dfs(i32 noundef %add.259, i32 noundef %x, i32 noundef %mikisinn)
br label %if.end34.2
if.end34.2: ; preds = %if.then33.2, %land.lhs.true21.2, %land.lhs.true.2
%add.3 = add nsw i32 %y.tr, -1
%cmp15.3 = icmp sgt i32 %y.tr, 0
br i1 %cmp15.3, label %land.lhs.true.3, label %cleanup
land.lhs.true.3: ; preds = %if.end34.2
%13 = load i32, ptr @H, align 4, !tbaa !5
%cmp16.3 = icmp sge i32 %13, %y.tr
%cmp18.3 = icmp sgt i32 %x, -1
%or.cond.3 = and i1 %cmp16.3, %cmp18.3
%14 = load i32, ptr @W, align 4
%cmp20.3 = icmp sgt i32 %14, %x
%or.cond52.3 = select i1 %or.cond.3, i1 %cmp20.3, i1 false
br i1 %or.cond52.3, label %land.lhs.true21.3, label %cleanup
land.lhs.true21.3: ; preds = %land.lhs.true.3
%15 = load i8, ptr %arrayidx25, align 1, !tbaa !9
%idxprom26.3 = zext i32 %add.3 to i64
%idxprom28.3 = zext i32 %x to i64
%arrayidx29.3 = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %idxprom26.3, i64 %idxprom28.3
%16 = load i8, ptr %arrayidx29.3, align 1, !tbaa !9
%cmp31.not.3 = icmp eq i8 %15, %16
br i1 %cmp31.not.3, label %cleanup, label %tailrecurse
cleanup: ; preds = %if.end34.1, %if.end34.2, %land.lhs.true.3, %land.lhs.true21.3, %tailrecurse
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @H, ptr noundef nonnull @W)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %for.cond.preheader, label %cleanup
for.cond.preheader: ; preds = %entry
%0 = load i32, ptr @H, align 4, !tbaa !5
%cmp195 = icmp sgt i32 %0, 0
br i1 %cmp195, label %for.body, label %for.end67
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @H, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp1, label %for.body, label %for.cond6.preheader, !llvm.loop !10
for.cond6.preheader: ; preds = %for.cond
%cmp7100 = icmp sgt i32 %1, 0
%3 = load i32, ptr @W, align 4
%4 = icmp sgt i32 %3, 0
%or.cond = select i1 %cmp7100, i1 %4, i1 false
br i1 %or.cond, label %for.cond9.preheader, label %for.end67
for.body: ; preds = %for.cond.preheader, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%cmp3.not = icmp eq i32 %call2, 1
br i1 %cmp3.not, label %for.cond, label %cleanup
for.cond9.preheader: ; preds = %for.cond6.preheader, %for.inc23
%5 = phi i32 [ %24, %for.inc23 ], [ %1, %for.cond6.preheader ]
%6 = phi i32 [ %25, %for.inc23 ], [ %3, %for.cond6.preheader ]
%7 = phi i32 [ %26, %for.inc23 ], [ %3, %for.cond6.preheader ]
%indvars.iv121 = phi i64 [ %indvars.iv.next122, %for.inc23 ], [ 0, %for.cond6.preheader ]
%asumisu.0102 = phi i32 [ %asumisu.1.lcssa, %for.inc23 ], [ 0, %for.cond6.preheader ]
%cmp1097 = icmp sgt i32 %7, 0
br i1 %cmp1097, label %for.body11.lr.ph, label %for.inc23
for.body11.lr.ph: ; preds = %for.cond9.preheader
%8 = trunc i64 %indvars.iv121 to i32
br label %for.body11
for.cond26.preheader: ; preds = %for.inc23
%cmp27108 = icmp sgt i32 %24, 0
br i1 %cmp27108, label %for.cond29.preheader.lr.ph, label %for.cond53.preheader
for.cond29.preheader.lr.ph: ; preds = %for.cond26.preheader
%.pr = load i32, ptr @W, align 4, !tbaa !5
%cmp30106 = icmp sgt i32 %.pr, 0
br i1 %cmp30106, label %for.cond29.preheader.us.preheader, label %for.cond53.preheader
for.cond29.preheader.us.preheader: ; preds = %for.cond29.preheader.lr.ph
%wide.trip.count130 = zext i32 %24 to i64
%wide.trip.count = zext i32 %.pr to i64
%xtraiter = and i64 %wide.trip.count, 1
%9 = icmp eq i32 %.pr, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond29.preheader.us
for.cond29.preheader.us: ; preds = %for.cond29.preheader.us.preheader, %for.cond29.for.inc50_crit_edge.us
%indvars.iv127 = phi i64 [ 0, %for.cond29.preheader.us.preheader ], [ %indvars.iv.next128, %for.cond29.for.inc50_crit_edge.us ]
br i1 %9, label %for.cond29.for.inc50_crit_edge.us.unr-lcssa, label %for.body31.us
for.body31.us: ; preds = %for.cond29.preheader.us, %for.body31.us
%indvars.iv124 = phi i64 [ %indvars.iv.next125.1, %for.body31.us ], [ 0, %for.cond29.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body31.us ], [ 0, %for.cond29.preheader.us ]
%arrayidx35.us = getelementptr inbounds [512 x [512 x i32]], ptr @group, i64 0, i64 %indvars.iv127, i64 %indvars.iv124
%10 = load i32, ptr %arrayidx35.us, align 8, !tbaa !5
%idxprom36.us = sext i32 %10 to i64
%arrayidx41.us = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %indvars.iv127, i64 %indvars.iv124
%11 = load i8, ptr %arrayidx41.us, align 2, !tbaa !9
%cmp42.us = icmp eq i8 %11, 46
%idxprom44.us = zext i1 %cmp42.us to i64
%arrayidx45.us = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %idxprom36.us, i64 %idxprom44.us
%12 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5
%inc46.us = add nsw i32 %12, 1
store i32 %inc46.us, ptr %arrayidx45.us, align 4, !tbaa !5
%indvars.iv.next125 = or i64 %indvars.iv124, 1
%arrayidx35.us.1 = getelementptr inbounds [512 x [512 x i32]], ptr @group, i64 0, i64 %indvars.iv127, i64 %indvars.iv.next125
%13 = load i32, ptr %arrayidx35.us.1, align 4, !tbaa !5
%idxprom36.us.1 = sext i32 %13 to i64
%arrayidx41.us.1 = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %indvars.iv127, i64 %indvars.iv.next125
%14 = load i8, ptr %arrayidx41.us.1, align 1, !tbaa !9
%cmp42.us.1 = icmp eq i8 %14, 46
%idxprom44.us.1 = zext i1 %cmp42.us.1 to i64
%arrayidx45.us.1 = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %idxprom36.us.1, i64 %idxprom44.us.1
%15 = load i32, ptr %arrayidx45.us.1, align 4, !tbaa !5
%inc46.us.1 = add nsw i32 %15, 1
store i32 %inc46.us.1, ptr %arrayidx45.us.1, align 4, !tbaa !5
%indvars.iv.next125.1 = add nuw nsw i64 %indvars.iv124, 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.cond29.for.inc50_crit_edge.us.unr-lcssa, label %for.body31.us, !llvm.loop !12
for.cond29.for.inc50_crit_edge.us.unr-lcssa: ; preds = %for.body31.us, %for.cond29.preheader.us
%indvars.iv124.unr = phi i64 [ 0, %for.cond29.preheader.us ], [ %indvars.iv.next125.1, %for.body31.us ]
br i1 %lcmp.mod.not, label %for.cond29.for.inc50_crit_edge.us, label %for.body31.us.epil
for.body31.us.epil: ; preds = %for.cond29.for.inc50_crit_edge.us.unr-lcssa
%arrayidx35.us.epil = getelementptr inbounds [512 x [512 x i32]], ptr @group, i64 0, i64 %indvars.iv127, i64 %indvars.iv124.unr
%16 = load i32, ptr %arrayidx35.us.epil, align 4, !tbaa !5
%idxprom36.us.epil = sext i32 %16 to i64
%arrayidx41.us.epil = getelementptr inbounds [512 x [512 x i8]], ptr @S, i64 0, i64 %indvars.iv127, i64 %indvars.iv124.unr
%17 = load i8, ptr %arrayidx41.us.epil, align 1, !tbaa !9
%cmp42.us.epil = icmp eq i8 %17, 46
%idxprom44.us.epil = zext i1 %cmp42.us.epil to i64
%arrayidx45.us.epil = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %idxprom36.us.epil, i64 %idxprom44.us.epil
%18 = load i32, ptr %arrayidx45.us.epil, align 4, !tbaa !5
%inc46.us.epil = add nsw i32 %18, 1
store i32 %inc46.us.epil, ptr %arrayidx45.us.epil, align 4, !tbaa !5
br label %for.cond29.for.inc50_crit_edge.us
for.cond29.for.inc50_crit_edge.us: ; preds = %for.cond29.for.inc50_crit_edge.us.unr-lcssa, %for.body31.us.epil
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%exitcond131.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count130
br i1 %exitcond131.not, label %for.cond53.preheader, label %for.cond29.preheader.us, !llvm.loop !13
for.body11: ; preds = %for.body11.lr.ph, %for.inc20
%19 = phi i32 [ %6, %for.body11.lr.ph ], [ %22, %for.inc20 ]
%indvars.iv118 = phi i64 [ 0, %for.body11.lr.ph ], [ %indvars.iv.next119, %for.inc20 ]
%asumisu.199 = phi i32 [ %asumisu.0102, %for.body11.lr.ph ], [ %asumisu.2, %for.inc20 ]
%arrayidx15 = getelementptr inbounds [512 x [512 x i32]], ptr @group, i64 0, i64 %indvars.iv121, i64 %indvars.iv118
%20 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16 = icmp eq i32 %20, 0
br i1 %cmp16, label %if.then17, label %for.inc20
if.then17: ; preds = %for.body11
%inc18 = add nsw i32 %asumisu.199, 1
%21 = trunc i64 %indvars.iv118 to i32
tail call void @dfs(i32 noundef %8, i32 noundef %21, i32 noundef %inc18)
%.pre = load i32, ptr @W, align 4, !tbaa !5
br label %for.inc20
for.inc20: ; preds = %for.body11, %if.then17
%22 = phi i32 [ %.pre, %if.then17 ], [ %19, %for.body11 ]
%asumisu.2 = phi i32 [ %inc18, %if.then17 ], [ %asumisu.199, %for.body11 ]
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%23 = sext i32 %22 to i64
%cmp10 = icmp slt i64 %indvars.iv.next119, %23
br i1 %cmp10, label %for.body11, label %for.inc23.loopexit, !llvm.loop !14
for.inc23.loopexit: ; preds = %for.inc20
%.pre137 = load i32, ptr @H, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.inc23.loopexit, %for.cond9.preheader
%24 = phi i32 [ %5, %for.cond9.preheader ], [ %.pre137, %for.inc23.loopexit ]
%25 = phi i32 [ %6, %for.cond9.preheader ], [ %22, %for.inc23.loopexit ]
%26 = phi i32 [ %7, %for.cond9.preheader ], [ %22, %for.inc23.loopexit ]
%asumisu.1.lcssa = phi i32 [ %asumisu.0102, %for.cond9.preheader ], [ %asumisu.2, %for.inc23.loopexit ]
%indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
%27 = sext i32 %24 to i64
%cmp7 = icmp slt i64 %indvars.iv.next122, %27
br i1 %cmp7, label %for.cond9.preheader, label %for.cond26.preheader, !llvm.loop !15
for.cond53.preheader: ; preds = %for.cond29.for.inc50_crit_edge.us, %for.cond29.preheader.lr.ph, %for.cond26.preheader
%cmp54.not110 = icmp slt i32 %asumisu.1.lcssa, 1
br i1 %cmp54.not110, label %for.end67, label %for.body56.preheader
for.body56.preheader: ; preds = %for.cond53.preheader
%28 = zext i32 %asumisu.1.lcssa to i64
%xtraiter162 = and i64 %28, 1
%29 = icmp eq i32 %asumisu.1.lcssa, 1
br i1 %29, label %for.end67.loopexit.unr-lcssa, label %for.body56.preheader.new
for.body56.preheader.new: ; preds = %for.body56.preheader
%unroll_iter165 = and i64 %28, 4294967294
br label %for.body56
for.body56: ; preds = %for.body56, %for.body56.preheader.new
%indvars.iv132 = phi i64 [ 1, %for.body56.preheader.new ], [ %indvars.iv.next133.1, %for.body56 ]
%mizuhasu.0112 = phi i64 [ 0, %for.body56.preheader.new ], [ %add.1, %for.body56 ]
%niter166 = phi i64 [ 0, %for.body56.preheader.new ], [ %niter166.next.1, %for.body56 ]
%arrayidx58 = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %indvars.iv132
%30 = load i32, ptr %arrayidx58, align 8, !tbaa !5
%conv60 = sext i32 %30 to i64
%arrayidx63 = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %indvars.iv132, i64 1
%31 = load i32, ptr %arrayidx63, align 4, !tbaa !5
%conv64 = sext i32 %31 to i64
%mul = mul nsw i64 %conv64, %conv60
%add = add i64 %mul, %mizuhasu.0112
%indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
%arrayidx58.1 = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %indvars.iv.next133
%32 = load i32, ptr %arrayidx58.1, align 8, !tbaa !5
%conv60.1 = sext i32 %32 to i64
%arrayidx63.1 = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %indvars.iv.next133, i64 1
%33 = load i32, ptr %arrayidx63.1, align 4, !tbaa !5
%conv64.1 = sext i32 %33 to i64
%mul.1 = mul nsw i64 %conv64.1, %conv60.1
%add.1 = add i64 %mul.1, %add
%indvars.iv.next133.1 = add nuw nsw i64 %indvars.iv132, 2
%niter166.next.1 = add i64 %niter166, 2
%niter166.ncmp.1 = icmp eq i64 %niter166.next.1, %unroll_iter165
br i1 %niter166.ncmp.1, label %for.end67.loopexit.unr-lcssa, label %for.body56, !llvm.loop !17
for.end67.loopexit.unr-lcssa: ; preds = %for.body56, %for.body56.preheader
%add.lcssa.ph = phi i64 [ undef, %for.body56.preheader ], [ %add.1, %for.body56 ]
%indvars.iv132.unr = phi i64 [ 1, %for.body56.preheader ], [ %indvars.iv.next133.1, %for.body56 ]
%mizuhasu.0112.unr = phi i64 [ 0, %for.body56.preheader ], [ %add.1, %for.body56 ]
%lcmp.mod163.not = icmp eq i64 %xtraiter162, 0
br i1 %lcmp.mod163.not, label %for.end67, label %for.body56.epil
for.body56.epil: ; preds = %for.end67.loopexit.unr-lcssa
%arrayidx58.epil = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %indvars.iv132.unr
%34 = load i32, ptr %arrayidx58.epil, align 8, !tbaa !5
%conv60.epil = sext i32 %34 to i64
%arrayidx63.epil = getelementptr inbounds [262144 x [2 x i32]], ptr @count, i64 0, i64 %indvars.iv132.unr, i64 1
%35 = load i32, ptr %arrayidx63.epil, align 4, !tbaa !5
%conv64.epil = sext i32 %35 to i64
%mul.epil = mul nsw i64 %conv64.epil, %conv60.epil
%add.epil = add i64 %mul.epil, %mizuhasu.0112.unr
br label %for.end67
for.end67: ; preds = %for.body56.epil, %for.end67.loopexit.unr-lcssa, %for.cond.preheader, %for.cond6.preheader, %for.cond53.preheader
%mizuhasu.0.lcssa = phi i64 [ 0, %for.cond53.preheader ], [ 0, %for.cond6.preheader ], [ 0, %for.cond.preheader ], [ %add.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %add.epil, %for.body56.epil ]
%call68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mizuhasu.0.lcssa)
br label %cleanup
cleanup: ; preds = %for.body, %entry, %for.end67
%retval.0 = phi i32 [ 0, %for.end67 ], [ 1, %entry ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !11}
|
#include <stdio.h>
int main(void)
{
int i,k,n,longest=0,emc=0;
scanf("%d",&k);
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++){
scanf("%d",&a[i]);
if(i>=1&&a[i]-a[i-1]>longest)
longest=a[i]-a[i-1];
}
if((a[0]+(k-a[n-1]))>longest)
longest=a[0]+(k-a[n-1]);
emc=k-longest;
printf("%d",emc);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp42 = icmp sgt i32 %3, 0
br i1 %cmp42, label %for.inc.peel, label %for.end
for.inc.peel: ; preds = %entry
%call2.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vla)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp.peel = icmp sgt i32 %4, 1
br i1 %cmp.peel, label %for.inc, label %for.end.loopexit
for.inc: ; preds = %for.inc.peel, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ]
%longest.043 = phi i32 [ %spec.select, %for.inc ], [ 0, %for.inc.peel ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%6 = add nuw i64 %indvars.iv, 4294967295
%idxprom6 = and i64 %6, 4294967295
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %idxprom6
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%sub8 = sub nsw i32 %5, %7
%spec.select = call i32 @llvm.smax.i32(i32 %sub8, i32 %longest.043)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.inc, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc, %for.inc.peel
%longest.1.lcssa = phi i32 [ 0, %for.inc.peel ], [ %spec.select, %for.inc ]
%.lcssa46 = phi i32 [ %4, %for.inc.peel ], [ %8, %for.inc ]
%.pre = load i32, ptr %vla, align 16, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%10 = phi i32 [ undef, %entry ], [ %.pre, %for.end.loopexit ]
%longest.0.lcssa = phi i32 [ 0, %entry ], [ %longest.1.lcssa, %for.end.loopexit ]
%.lcssa = phi i32 [ %3, %entry ], [ %.lcssa46, %for.end.loopexit ]
%11 = load i32, ptr %k, align 4, !tbaa !5
%sub17 = add nsw i32 %.lcssa, -1
%idxprom18 = sext i32 %sub17 to i64
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %idxprom18
%12 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%sub20 = add i32 %11, %10
%add = sub i32 %sub20, %12
%spec.select41 = call i32 @llvm.smax.i32(i32 %add, i32 %longest.0.lcssa)
%sub30 = sub nsw i32 %11, %spec.select41
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub30)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define BUFSIZE 1000000
int dis[BUFSIZE]={0};
int N,K;
int cal(int start_pos){
if(start_pos == N + 1)
return 0;
if(start_pos == 1 ){
if(dis[N-1] - dis[0] > K - (dis[1] - dis[0]))
return K - (dis[1] - dis[0]);
else return dis[N-1] - dis[0];
}
if(start_pos == N){
if(dis[N-1] - dis[0] > K - (dis[N-1] - dis[N-2]))
return K - (dis[N-1] - dis[N-2]);
else return dis[N-1] - dis[0];
}
if(dis[start_pos - 1] + dis[start_pos + 1] > dis[start_pos]*2 )
return (K - (dis[start_pos + 1] - dis[start_pos]));
else return (K - (dis[start_pos] - dis[start_pos - 1]));
cal(start_pos + 1);
}
int main(void){
scanf("%d %d",&K,&N);
for(int i = 0 ; i < N ; i++){
scanf("%d",&dis[i]);
}
int answer = cal(1);
for(int i = 1 ; i <= N ; i++) {
if(answer >= cal(i)){
answer = cal(i);
}
}
printf(" %d",answer);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dis = dso_local global [1000000 x i32] zeroinitializer, align 16
@N = dso_local global i32 0, align 4
@K = dso_local global i32 0, align 4
@.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\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @cal(i32 noundef %start_pos) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @N, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%cmp = icmp eq i32 %add, %start_pos
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%cmp1 = icmp eq i32 %start_pos, 1
br i1 %cmp1, label %if.then2, label %if.end14
if.then2: ; preds = %if.end
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr @dis, align 16, !tbaa !5
%sub3 = sub nsw i32 %1, %2
%3 = load i32, ptr @K, align 4, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([1000000 x i32], ptr @dis, i64 0, i64 1), align 4, !tbaa !5
%sub4.neg = add i32 %3, %2
%sub5 = sub i32 %sub4.neg, %4
%sub5.sub3 = tail call i32 @llvm.smin.i32(i32 %sub3, i32 %sub5)
br label %return
if.end14: ; preds = %if.end
%cmp15 = icmp eq i32 %0, %start_pos
%sub17 = add nsw i32 %start_pos, -1
%idxprom18 = sext i32 %sub17 to i64
%arrayidx19 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom18
%5 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br i1 %cmp15, label %if.then16, label %if.end44
if.then16: ; preds = %if.end14
%6 = load i32, ptr @dis, align 16, !tbaa !5
%sub20 = sub nsw i32 %5, %6
%7 = load i32, ptr @K, align 4, !tbaa !5
%sub24 = add nsw i32 %start_pos, -2
%idxprom25 = sext i32 %sub24 to i64
%arrayidx26 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom25
%8 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%sub27.neg = sub i32 %7, %5
%sub28 = add i32 %sub27.neg, %8
%sub28.sub20 = tail call i32 @llvm.smin.i32(i32 %sub20, i32 %sub28)
br label %return
if.end44: ; preds = %if.end14
%add48 = add nsw i32 %start_pos, 1
%idxprom49 = sext i32 %add48 to i64
%arrayidx50 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom49
%9 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%add51 = add nsw i32 %9, %5
%idxprom52 = sext i32 %start_pos to i64
%arrayidx53 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom52
%10 = load i32, ptr %arrayidx53, align 4, !tbaa !5
%mul = shl nsw i32 %10, 1
%cmp54 = icmp sgt i32 %add51, %mul
%11 = load i32, ptr @K, align 4, !tbaa !5
br i1 %cmp54, label %if.then55, label %if.else63
if.then55: ; preds = %if.end44
%sub61.neg = sub i32 %10, %9
%sub62 = add i32 %sub61.neg, %11
br label %return
if.else63: ; preds = %if.end44
%sub69.neg = sub i32 %5, %10
%sub70 = add i32 %sub69.neg, %11
br label %return
return: ; preds = %if.then16, %if.then2, %entry, %if.else63, %if.then55
%retval.0 = phi i32 [ %sub62, %if.then55 ], [ %sub70, %if.else63 ], [ 0, %entry ], [ %sub5.sub3, %if.then2 ], [ %sub28.sub20, %if.then16 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @K, ptr noundef nonnull @N)
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp85 = icmp sgt i32 %0, 0
br i1 %cmp85, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %14, %for.body ]
%add.i = add i32 %.lcssa, 1
%cmp.i = icmp eq i32 %.lcssa, 0
br i1 %cmp.i, label %for.cond.cleanup6, label %cal.exit
cal.exit: ; preds = %for.cond.cleanup
%sub.i = add nsw i32 %.lcssa, -1
%idxprom.i = sext i32 %sub.i to i64
%arrayidx.i = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom.i
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%2 = load i32, ptr @dis, align 16, !tbaa !5
%sub3.i = sub nsw i32 %1, %2
%3 = load i32, ptr @K, align 4, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([1000000 x i32], ptr @dis, i64 0, i64 1), align 4, !tbaa !5
%sub4.neg.i = add i32 %3, %2
%sub5.i = sub i32 %sub4.neg.i, %4
%sub5.sub3.i = tail call i32 @llvm.smin.i32(i32 %sub3.i, i32 %sub5.i)
%cmp5.not87 = icmp slt i32 %.lcssa, 1
br i1 %cmp5.not87, label %for.cond.cleanup6, label %cal.exit32.peel
cal.exit32.peel: ; preds = %cal.exit
%5 = load i32, ptr @K, align 4
%6 = load i32, ptr @dis, align 16
%sub.i25 = add nsw i32 %.lcssa, -1
%idxprom.i26 = zext i32 %sub.i25 to i64
%arrayidx.i27 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom.i26
%7 = load i32, ptr getelementptr inbounds ([1000000 x i32], ptr @dis, i64 0, i64 1), align 4
%sub4.neg.i29 = add i32 %5, %6
%sub5.i30 = sub i32 %sub4.neg.i29, %7
%8 = zext i32 %.lcssa to i64
%9 = zext i32 %add.i to i64
%10 = load i32, ptr %arrayidx.i27, align 4, !tbaa !5
%sub3.i28.peel = sub nsw i32 %10, %6
%sub5.sub3.i31.peel = tail call i32 @llvm.smin.i32(i32 %sub3.i28.peel, i32 %sub5.i30)
%cmp9.not.peel = icmp slt i32 %sub5.sub3.i, %sub5.sub3.i31.peel
br i1 %cmp9.not.peel, label %for.inc11.peel, label %if.then2.i66.peel
if.then2.i66.peel: ; preds = %cal.exit32.peel
%11 = load i32, ptr %arrayidx.i27, align 4, !tbaa !5
%sub3.i70.peel = sub nsw i32 %11, %6
%sub5.sub3.i73.peel = tail call i32 @llvm.smin.i32(i32 %sub3.i70.peel, i32 %sub5.i30)
br label %for.inc11.peel
for.inc11.peel: ; preds = %if.then2.i66.peel, %cal.exit32.peel
%answer.1.peel = phi i32 [ %sub5.sub3.i, %cal.exit32.peel ], [ %sub5.sub3.i73.peel, %if.then2.i66.peel ]
%exitcond.peel.not = icmp eq i32 %add.i, 2
br i1 %exitcond.peel.not, label %for.cond.cleanup6, label %for.body7.peel.next
for.body7.peel.next: ; preds = %for.inc11.peel
%12 = add nsw i64 %8, -2
%arrayidx26.i = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %12
%13 = add nsw i64 %8, -2
%arrayidx26.i62 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %13
br label %if.end14.i
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @dis, 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
%14 = load i32, ptr @N, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp = icmp slt i64 %indvars.iv.next, %15
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup6: ; preds = %for.inc11, %for.cond.cleanup, %for.inc11.peel, %cal.exit
%answer.0.lcssa = phi i32 [ %sub5.sub3.i, %cal.exit ], [ %answer.1.peel, %for.inc11.peel ], [ 0, %for.cond.cleanup ], [ %answer.1, %for.inc11 ]
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %answer.0.lcssa)
ret i32 0
if.end14.i: ; preds = %for.body7.peel.next, %for.inc11
%indvars.iv93 = phi i64 [ 2, %for.body7.peel.next ], [ %indvars.iv.next94, %for.inc11 ]
%answer.088 = phi i32 [ %answer.1.peel, %for.body7.peel.next ], [ %answer.1, %for.inc11 ]
%cmp15.i = icmp eq i64 %indvars.iv93, %8
%16 = add nsw i64 %indvars.iv93, -1
%arrayidx19.i = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %16
%17 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
br i1 %cmp15.i, label %if.then16.i, label %if.end44.i
if.then16.i: ; preds = %if.end14.i
%sub20.i = sub nsw i32 %17, %6
%18 = load i32, ptr %arrayidx26.i, align 4, !tbaa !5
%sub27.neg.i = sub i32 %5, %17
%sub28.i = add i32 %sub27.neg.i, %18
%sub28.sub20.i = tail call i32 @llvm.smin.i32(i32 %sub20.i, i32 %sub28.i)
br label %cal.exit32
if.end44.i: ; preds = %if.end14.i
%19 = add nuw i64 %indvars.iv93, 1
%idxprom49.i = and i64 %19, 4294967295
%arrayidx50.i = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom49.i
%20 = load i32, ptr %arrayidx50.i, align 4, !tbaa !5
%add51.i = add nsw i32 %20, %17
%arrayidx53.i = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %indvars.iv93
%21 = load i32, ptr %arrayidx53.i, align 4, !tbaa !5
%mul.i = shl nsw i32 %21, 1
%cmp54.i = icmp sgt i32 %add51.i, %mul.i
br i1 %cmp54.i, label %if.then55.i, label %if.else63.i
if.then55.i: ; preds = %if.end44.i
%sub61.neg.i = sub i32 %21, %20
%sub62.i = add i32 %sub61.neg.i, %5
br label %cal.exit32
if.else63.i: ; preds = %if.end44.i
%sub69.neg.i = sub i32 %17, %21
%sub70.i = add i32 %sub69.neg.i, %5
br label %cal.exit32
cal.exit32: ; preds = %if.then16.i, %if.then55.i, %if.else63.i
%retval.0.i24 = phi i32 [ %sub62.i, %if.then55.i ], [ %sub70.i, %if.else63.i ], [ %sub28.sub20.i, %if.then16.i ]
%cmp9.not = icmp slt i32 %answer.088, %retval.0.i24
br i1 %cmp9.not, label %for.inc11, label %if.end14.i37
if.end14.i37: ; preds = %cal.exit32
%cmp15.i38 = icmp eq i64 %indvars.iv93, %8
%22 = add nsw i64 %indvars.iv93, -1
%arrayidx19.i41 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %22
%23 = load i32, ptr %arrayidx19.i41, align 4, !tbaa !5
br i1 %cmp15.i38, label %if.then16.i58, label %if.end44.i42
if.then16.i58: ; preds = %if.end14.i37
%sub20.i59 = sub nsw i32 %23, %6
%24 = load i32, ptr %arrayidx26.i62, align 4, !tbaa !5
%sub27.neg.i63 = sub i32 %5, %23
%sub28.i64 = add i32 %sub27.neg.i63, %24
%sub28.sub20.i65 = tail call i32 @llvm.smin.i32(i32 %sub20.i59, i32 %sub28.i64)
br label %for.inc11
if.end44.i42: ; preds = %if.end14.i37
%25 = add nuw i64 %indvars.iv93, 1
%idxprom49.i44 = and i64 %25, 4294967295
%arrayidx50.i45 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %idxprom49.i44
%26 = load i32, ptr %arrayidx50.i45, align 4, !tbaa !5
%add51.i46 = add nsw i32 %26, %23
%arrayidx53.i48 = getelementptr inbounds [1000000 x i32], ptr @dis, i64 0, i64 %indvars.iv93
%27 = load i32, ptr %arrayidx53.i48, align 4, !tbaa !5
%mul.i49 = shl nsw i32 %27, 1
%cmp54.i50 = icmp sgt i32 %add51.i46, %mul.i49
br i1 %cmp54.i50, label %if.then55.i55, label %if.else63.i51
if.then55.i55: ; preds = %if.end44.i42
%sub61.neg.i56 = sub i32 %27, %26
%sub62.i57 = add i32 %sub61.neg.i56, %5
br label %for.inc11
if.else63.i51: ; preds = %if.end44.i42
%sub69.neg.i52 = sub i32 %23, %27
%sub70.i53 = add i32 %sub69.neg.i52, %5
br label %for.inc11
for.inc11: ; preds = %cal.exit32, %if.else63.i51, %if.then55.i55, %if.then16.i58
%answer.1 = phi i32 [ %answer.088, %cal.exit32 ], [ %sub62.i57, %if.then55.i55 ], [ %sub70.i53, %if.else63.i51 ], [ %sub28.sub20.i65, %if.then16.i58 ]
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%exitcond.not = icmp eq i64 %indvars.iv.next94, %9
br i1 %exitcond.not, label %for.cond.cleanup6, label %if.end14.i, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
int main()
{
int kk, nn, max = -1;
scanf("%d %d", &kk, &nn);
int aa[nn], sa[nn];
for(int ii = 0;ii < nn;ii++)
{
scanf("%d", &aa[ii]);
}
for(int ii = 0;ii < (nn - 1);ii++)
{
sa[ii] = aa[ii + 1] - aa[ii];
}
sa[nn - 1] = kk + aa[0] - aa[nn - 1];
for(int ii = 0;ii < nn;ii++)
{
if(max < sa[ii])
max = sa[ii];
}
max = kk - max;
printf("%d\n", max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%kk = alloca i32, align 4
%nn = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kk) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nn) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %kk, ptr noundef nonnull %nn)
%0 = load i32, ptr %nn, 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 %nn, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%cmp53 = icmp sgt i32 %3, 0
br i1 %cmp53, label %for.body, label %for.cond4.preheader.thread
for.cond4.preheader.thread: ; preds = %entry
%sub74 = add i32 %3, -1
br label %for.cond4.preheader.for.cond.cleanup6_crit_edge
for.cond4.preheader: ; preds = %for.body
%sub = add i32 %15, -1
%cmp555 = icmp sgt i32 %15, 1
br i1 %cmp555, label %for.body7.preheader, label %for.cond4.preheader.for.cond.cleanup6_crit_edge
for.cond4.preheader.for.cond.cleanup6_crit_edge: ; preds = %for.cond4.preheader.thread, %for.cond4.preheader
%sub79 = phi i32 [ %sub74, %for.cond4.preheader.thread ], [ %sub, %for.cond4.preheader ]
%.lcssa77 = phi i32 [ %3, %for.cond4.preheader.thread ], [ %15, %for.cond4.preheader ]
%.pre72 = load i32, ptr %vla, align 16, !tbaa !5
br label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond4.preheader
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %15, 9
br i1 %min.iters.check, label %for.body7.preheader97, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%vector.recur.init = insertelement <4 x i32> poison, i32 %.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 i32> [ %vector.recur.init, %vector.ph ], [ %wide.load80, %vector.body ]
%5 = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %5
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load80 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%9 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load80, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = sub nsw <4 x i32> %wide.load, %8
%11 = sub nsw <4 x i32> %wide.load80, %9
%12 = getelementptr inbounds i32, ptr %vla1, i64 %index
store <4 x i32> %10, ptr %12, align 16, !tbaa !5
%13 = getelementptr inbounds i32, ptr %12, i64 4
store <4 x i32> %11, ptr %13, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load80, i64 3
br i1 %cmp.n, label %for.cond.cleanup6, label %for.body7.preheader97
for.body7.preheader97: ; preds = %for.body7.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body7.preheader ]
%indvars.iv64.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body7.preheader ]
br label %for.body7
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
%15 = load i32, ptr %nn, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.cond.cleanup6: ; preds = %for.body7, %middle.block, %for.cond4.preheader.for.cond.cleanup6_crit_edge
%sub78 = phi i32 [ %sub79, %for.cond4.preheader.for.cond.cleanup6_crit_edge ], [ %sub, %middle.block ], [ %sub, %for.body7 ]
%.lcssa76 = phi i32 [ %.lcssa77, %for.cond4.preheader.for.cond.cleanup6_crit_edge ], [ %15, %middle.block ], [ %15, %for.body7 ]
%17 = phi i32 [ %.pre72, %for.cond4.preheader.for.cond.cleanup6_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body7 ]
%18 = load i32, ptr %kk, align 4, !tbaa !5
%add19 = add nsw i32 %17, %18
%idxprom21 = sext i32 %sub78 to i64
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %idxprom21
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%sub23 = sub i32 %add19, %19
%arrayidx26 = getelementptr inbounds i32, ptr %vla1, i64 %idxprom21
store i32 %sub23, ptr %arrayidx26, align 4, !tbaa !5
%cmp2958 = icmp sgt i32 %.lcssa76, 0
br i1 %cmp2958, label %for.body31.preheader, label %for.cond.cleanup30
for.body31.preheader: ; preds = %for.cond.cleanup6
%wide.trip.count70 = zext i32 %.lcssa76 to i64
%min.iters.check83 = icmp ult i32 %.lcssa76, 8
br i1 %min.iters.check83, label %for.body31.preheader95, label %vector.ph84
vector.ph84: ; preds = %for.body31.preheader
%n.vec86 = and i64 %wide.trip.count70, 4294967288
br label %vector.body89
vector.body89: ; preds = %vector.body89, %vector.ph84
%index90 = phi i64 [ 0, %vector.ph84 ], [ %index.next94, %vector.body89 ]
%vec.phi = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph84 ], [ %22, %vector.body89 ]
%vec.phi91 = phi <4 x i32> [ <i32 -1, i32 -1, i32 -1, i32 -1>, %vector.ph84 ], [ %23, %vector.body89 ]
%20 = getelementptr inbounds i32, ptr %vla1, i64 %index90
%wide.load92 = load <4 x i32>, ptr %20, align 16, !tbaa !5
%21 = getelementptr inbounds i32, ptr %20, i64 4
%wide.load93 = load <4 x i32>, ptr %21, align 16, !tbaa !5
%22 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load92)
%23 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi91, <4 x i32> %wide.load93)
%index.next94 = add nuw i64 %index90, 8
%24 = icmp eq i64 %index.next94, %n.vec86
br i1 %24, label %middle.block81, label %vector.body89, !llvm.loop !14
middle.block81: ; preds = %vector.body89
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %22, <4 x i32> %23)
%25 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n88 = icmp eq i64 %n.vec86, %wide.trip.count70
br i1 %cmp.n88, label %for.cond.cleanup30, label %for.body31.preheader95
for.body31.preheader95: ; preds = %for.body31.preheader, %middle.block81
%indvars.iv67.ph = phi i64 [ 0, %for.body31.preheader ], [ %n.vec86, %middle.block81 ]
%max.059.ph = phi i32 [ -1, %for.body31.preheader ], [ %25, %middle.block81 ]
br label %for.body31
for.body7: ; preds = %for.body7.preheader97, %for.body7
%scalar.recur = phi i32 [ %26, %for.body7 ], [ %scalar.recur.ph, %for.body7.preheader97 ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.body7 ], [ %indvars.iv64.ph, %for.body7.preheader97 ]
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next65
%26 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%sub12 = sub nsw i32 %26, %scalar.recur
%arrayidx14 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv64
store i32 %sub12, ptr %arrayidx14, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !15
for.cond.cleanup30: ; preds = %for.body31, %middle.block81, %for.cond.cleanup6
%max.0.lcssa = phi i32 [ -1, %for.cond.cleanup6 ], [ %25, %middle.block81 ], [ %spec.select, %for.body31 ]
%sub40 = sub nsw i32 %18, %max.0.lcssa
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub40)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nn) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kk) #5
ret i32 0
for.body31: ; preds = %for.body31.preheader95, %for.body31
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body31 ], [ %indvars.iv67.ph, %for.body31.preheader95 ]
%max.059 = phi i32 [ %spec.select, %for.body31 ], [ %max.059.ph, %for.body31.preheader95 ]
%arrayidx33 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv67
%27 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %max.059, i32 %27)
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
br i1 %exitcond71.not, label %for.cond.cleanup30, label %for.body31, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !12, !11}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
#define INF (1<<29)*2
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define ffor(i, a, b, c) for(i=a;i<=b;i+=c)
#define rep(i, n) for(i=0;i<n;i++)
#define max(a, b) ((a)>(b) ? (a) : (b))
#define min(a, b) ((a)<(b) ? (a) : (b))
#define bit(n) (1LL<<(n))
#define median(a, b) (a+b)/2.0
#define ABS(a) (a >= 0 ? (a) : (-a))
#define zt(a, b) (max(a,b)-min(a,b))
ll swap(ll *a,ll *b){ll tmp;tmp=*a;*a=*b;*b=tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll sum(ll *a,ll n){ll total=0,i;if(n<=0){return 0;}else{rep(i,n) total+=a[i];return total;}}
ld avg(ll *a,ll n){if(n<=0){return 0;}else{return (ld)sum(a,n)/n;}}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define fact(n) nPr((int)n,(int)n)
#define nHr(n,r) nCr((int)(n+r+1),(int)r)
#define sankaku(x) ((1+x)*x)/2
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int stack[LIMIT2];//stack[0]=count;
int queue[LIMIT2];//queue[0]=start,queue[1]=length;
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
int upint(const void *a, const void *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(const void *a, const void *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }
int upchar(const void* left, const void* right) {return strcmp((char *)left,(char *)right);}
//qsort(s,n,sizeof(s[0]),upchar);
int downchar(const void* left, const void* right) {return strcmp((char *)right,(char *)left);}
//qsort(s,n,sizeof(s[0]),downchar);
int push(int n){
if(stack[0]>=LIMIT2) return -1;
stack[0]++;
stack[stack[0]] = n;
return 1;
}
int pop(){
if(stack[0]<=0) return -1;
stack[0]--;
return stack[stack[0]+1];
}
int enqueue(int n){
if(queue[0]+queue[1]>=LIMIT2) return -1;
queue[queue[0]+queue[1]] = n;
queue[1]++;
return 1;
}
int dequeue(){
int result;
if(queue[1]<=0) return -1;
result = queue[queue[0]];
queue[0]++;
queue[1]--;
if(queue[1]==0){
queue[0] = 2;//queue reset
}else if(queue[1]==1){
queue[2] = queue[queue[0]];//only oneth
queue[0] = 2;
}
return result;
}
void initialize(){
stack[0] = 0;//stack size
queue[0] = 2;//queue start
queue[1] = 0;//queue length
}
int main(void){
initialize();
int n,m,i,j,k,x,y,value,b,c;
int a[LIMIT2]={0},q[LIMIT1]={0},r[LIMIT2]={0};
ll result=0;
int s[LIMIT2];
scanf("%d %d",&k,&n);
rep(i,n) scanf("%d",&a[i]);
x = zt(a[0],a[n-1]);
if(x > k/2) x = k-x;
for(i=1;i<n-1;i++){
y = zt(a[i],a[i+1]);
if(y > k/2) y = k-y;
x = max(x, y);
}
printf("%d", k-x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201459/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201459/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dx = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 0, i32 -1, i32 0], align 16
@dy = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 1, i32 0, i32 -1], align 16
@stack = dso_local local_unnamed_addr global [500002 x i32] zeroinitializer, align 16
@queue = dso_local local_unnamed_addr global [500002 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
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i64 @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
store i64 %1, ptr %a, align 8, !tbaa !5
store i64 %0, ptr %b, align 8, !tbaa !5
ret i64 undef
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%mul = mul nsw i64 %b, %a
%div = sdiv i64 %mul, %a.tr.lcssa.i
ret i64 %div
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @sum(ptr nocapture noundef readonly %a, i64 noundef %n) local_unnamed_addr #3 {
entry:
%cmp = icmp slt i64 %n, 1
br i1 %cmp, label %cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader11, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ]
%vec.phi9 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load10 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = add <2 x i64> %wide.load, %vec.phi
%3 = add <2 x i64> %wide.load10, %vec.phi9
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %3, %2
%5 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %cleanup, label %for.body.preheader11
for.body.preheader11: ; preds = %for.body.preheader, %middle.block
%i.08.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%total.07.ph = phi i64 [ 0, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader11, %for.body
%i.08 = phi i64 [ %inc, %for.body ], [ %i.08.ph, %for.body.preheader11 ]
%total.07 = phi i64 [ %add, %for.body ], [ %total.07.ph, %for.body.preheader11 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.08
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%add = add nsw i64 %6, %total.07
%inc = add nuw nsw i64 %i.08, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !13
cleanup: ; preds = %for.body, %middle.block, %entry
%retval.0 = phi i64 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ]
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local x86_fp80 @avg(ptr nocapture noundef readonly %a, i64 noundef %n) local_unnamed_addr #3 {
entry:
%cmp = icmp slt i64 %n, 1
br i1 %cmp, label %return, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.i.preheader6, label %vector.ph
vector.ph: ; preds = %for.body.i.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ]
%vec.phi4 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load5 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = add <2 x i64> %wide.load, %vec.phi
%3 = add <2 x i64> %wide.load5, %vec.phi4
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %3, %2
%5 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %sum.exit, label %for.body.i.preheader6
for.body.i.preheader6: ; preds = %for.body.i.preheader, %middle.block
%i.08.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %n.vec, %middle.block ]
%total.07.i.ph = phi i64 [ 0, %for.body.i.preheader ], [ %5, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader6, %for.body.i
%i.08.i = phi i64 [ %inc.i, %for.body.i ], [ %i.08.i.ph, %for.body.i.preheader6 ]
%total.07.i = phi i64 [ %add.i, %for.body.i ], [ %total.07.i.ph, %for.body.i.preheader6 ]
%arrayidx.i = getelementptr inbounds i64, ptr %a, i64 %i.08.i
%6 = load i64, ptr %arrayidx.i, align 8, !tbaa !5
%add.i = add nsw i64 %6, %total.07.i
%inc.i = add nuw nsw i64 %i.08.i, 1
%exitcond.not.i = icmp eq i64 %inc.i, %n
br i1 %exitcond.not.i, label %sum.exit, label %for.body.i, !llvm.loop !15
sum.exit: ; preds = %for.body.i, %middle.block
%add.i.lcssa = phi i64 [ %5, %middle.block ], [ %add.i, %for.body.i ]
%conv = sitofp i64 %add.i.lcssa to x86_fp80
%conv1 = sitofp i64 %n to x86_fp80
%div = fdiv x86_fp80 %conv, %conv1
br label %return
return: ; preds = %entry, %sum.exit
%retval.0 = phi x86_fp80 [ %div, %sum.exit ], [ 0xK00000000000000000000, %entry ]
ret x86_fp80 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @nPr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 {
entry:
%conv = sext i32 %r to i64
%cmp6 = icmp sgt i32 %r, 0
br i1 %cmp6, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv2 = sext i32 %n to i64
%xtraiter = and i64 %conv, 7
%0 = icmp ult i32 %r, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %mul.7, %for.body ]
%i.07 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.7, %for.body ]
%sub = sub nsw i64 %conv2, %i.07
%mul = mul nsw i64 %result.08, %sub
%inc.neg = xor i64 %i.07, -1
%sub.1 = add i64 %inc.neg, %conv2
%mul.1 = mul nsw i64 %mul, %sub.1
%inc.1 = or i64 %i.07, 2
%sub.2 = sub nsw i64 %conv2, %inc.1
%mul.2 = mul nsw i64 %mul.1, %sub.2
%inc.2 = or i64 %i.07, 3
%sub.3 = sub nsw i64 %conv2, %inc.2
%mul.3 = mul nsw i64 %mul.2, %sub.3
%inc.3 = or i64 %i.07, 4
%sub.4 = sub nsw i64 %conv2, %inc.3
%mul.4 = mul nsw i64 %mul.3, %sub.4
%inc.4 = or i64 %i.07, 5
%sub.5 = sub nsw i64 %conv2, %inc.4
%mul.5 = mul nsw i64 %mul.4, %sub.5
%inc.5 = or i64 %i.07, 6
%sub.6 = sub nsw i64 %conv2, %inc.5
%mul.6 = mul nsw i64 %mul.5, %sub.6
%inc.6 = or i64 %i.07, 7
%sub.7 = sub nsw i64 %conv2, %inc.6
%mul.7 = mul nsw i64 %mul.6, %sub.7
%inc.7 = add nuw nsw i64 %i.07, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%mul.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %mul.7, %for.body ]
%result.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %mul.7, %for.body ]
%i.07.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%result.08.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %result.08.unr, %for.end.loopexit.unr-lcssa ]
%i.07.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.07.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%sub.epil = sub nsw i64 %conv2, %i.07.epil
%mul.epil = mul nsw i64 %result.08.epil, %sub.epil
%inc.epil = add nuw nsw i64 %i.07.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !17
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @nCr(i32 noundef %n, i32 noundef %r) local_unnamed_addr #2 {
entry:
%conv = sext i32 %r to i64
%cmp8 = icmp sgt i32 %r, 0
br i1 %cmp8, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%conv2 = sext i32 %n to i64
%xtraiter = and i64 %conv, 1
%0 = icmp eq i32 %r, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %conv, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%result.010 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.09 = phi i64 [ 0, %for.body.lr.ph.new ], [ %add.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub nsw i64 %conv2, %i.09
%mul = mul nsw i64 %result.010, %sub
%add = or i64 %i.09, 1
%div = sdiv i64 %mul, %add
%sub.1 = sub nsw i64 %conv2, %add
%mul.1 = mul nsw i64 %div, %sub.1
%add.1 = add nuw nsw i64 %i.09, 2
%div.1 = sdiv i64 %mul.1, %add.1
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !19
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%result.010.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.09.unr = phi i64 [ 0, %for.body.lr.ph ], [ %add.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub nsw i64 %conv2, %i.09.unr
%mul.epil = mul nsw i64 %result.010.unr, %sub.epil
%add.epil = add nuw nsw i64 %i.09.unr, 1
%div.epil = sdiv i64 %mul.epil, %add.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !20
%1 = load i32, ptr %b, align 4, !tbaa !20
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downint(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !20
%1 = load i32, ptr %b, align 4, !tbaa !20
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #5 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #14
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #5 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #14
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #7 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %left, ptr noundef nonnull dereferenceable(1) %right) #15
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downchar(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #7 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %right, ptr noundef nonnull dereferenceable(1) %left) #15
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @push(i32 noundef %n) local_unnamed_addr #9 {
entry:
%0 = load i32, ptr @stack, align 16, !tbaa !20
%cmp = icmp sgt i32 %0, 500001
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @stack, align 16, !tbaa !20
%idxprom = sext i32 %inc to i64
%arrayidx = getelementptr inbounds [500002 x i32], ptr @stack, i64 0, i64 %idxprom
store i32 %n, ptr %arrayidx, align 4, !tbaa !20
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 1, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pop() local_unnamed_addr #9 {
entry:
%0 = load i32, ptr @stack, align 16, !tbaa !20
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @stack, align 16, !tbaa !20
%idxprom = zext i32 %0 to i64
%arrayidx = getelementptr inbounds [500002 x i32], ptr @stack, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !20
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %1, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @enqueue(i32 noundef %n) local_unnamed_addr #9 {
entry:
%0 = load i32, ptr @queue, align 16, !tbaa !20
%1 = load i32, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
%add = add nsw i32 %1, %0
%cmp = icmp sgt i32 %add, 500001
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds [500002 x i32], ptr @queue, i64 0, i64 %idxprom
store i32 %n, ptr %arrayidx, align 4, !tbaa !20
%2 = load i32, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
%inc = add nsw i32 %2, 1
store i32 %inc, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ 1, %if.end ], [ -1, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @dequeue() local_unnamed_addr #9 {
entry:
%0 = load i32, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%1 = load i32, ptr @queue, align 16, !tbaa !20
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [500002 x i32], ptr @queue, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !20
%inc = add nsw i32 %1, 1
store i32 %inc, ptr @queue, align 16, !tbaa !20
%dec = add nsw i32 %0, -1
store i32 %dec, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
switch i32 %0, label %cleanup [
i32 1, label %cleanup.sink.split
i32 2, label %if.then4
]
if.then4: ; preds = %if.end
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds [500002 x i32], ptr @queue, i64 0, i64 %idxprom5
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !20
store i32 %3, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 2), align 8, !tbaa !20
br label %cleanup.sink.split
cleanup.sink.split: ; preds = %if.end, %if.then4
store i32 2, ptr @queue, align 16, !tbaa !20
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ %2, %if.end ], [ %2, %cleanup.sink.split ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @initialize() local_unnamed_addr #10 {
entry:
store i32 0, ptr @stack, align 16, !tbaa !20
store i32 2, ptr @queue, align 16, !tbaa !20
store i32 0, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [500002 x i32], align 16
store i32 0, ptr @stack, align 16, !tbaa !20
store i32 2, ptr @queue, align 16, !tbaa !20
store i32 0, ptr getelementptr inbounds ([500002 x i32], ptr @queue, i64 0, i64 1), align 4, !tbaa !20
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #14
call void @llvm.lifetime.start.p0(i64 2000008, ptr nonnull %a) #14
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2000008) %a, i8 0, i64 2000008, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp105 = icmp sgt i32 %0, 0
br i1 %cmp105, 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 [500002 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
%1 = load i32, ptr %n, align 4, !tbaa !20
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !22
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %a, align 16, !tbaa !20
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%3 = phi i32 [ 0, %entry ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.end.loopexit ]
%sub = add nsw i32 %.lcssa, -1
%idxprom3 = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 %idxprom3
%4 = load i32, ptr %arrayidx4, align 4, !tbaa !20
%sub103 = sub nsw i32 %3, %4
%sub23 = call i32 @llvm.abs.i32(i32 %sub103, i1 true)
%5 = load i32, ptr %k, align 4, !tbaa !20
%div = sdiv i32 %5, 2
%cmp24 = icmp sgt i32 %sub23, %div
%sub25 = sub nsw i32 %5, %sub23
%x.0 = select i1 %cmp24, i32 %sub25, i32 %sub23
%cmp28107 = icmp sgt i32 %.lcssa, 2
br i1 %cmp28107, label %for.body29.preheader, label %for.end72
for.body29.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %sub to i64
%arrayidx31.phi.trans.insert = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 1
%.pre116 = load i32, ptr %arrayidx31.phi.trans.insert, align 4, !tbaa !20
%6 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i64 %6, 8
br i1 %min.iters.check, label %for.body29.preheader123, label %vector.ph
vector.ph: ; preds = %for.body29.preheader
%n.vec = and i64 %6, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre116, i64 3
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %x.0, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %div, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert121 = insertelement <4 x i32> poison, i32 %5, i64 0
%broadcast.splat122 = shufflevector <4 x i32> %broadcast.splatinsert121, <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 ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load120, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %22, %vector.body ]
%vec.phi119 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %23, %vector.body ]
%7 = or i64 %index, 2
%8 = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 %7
%wide.load = load <4 x i32>, ptr %8, align 8, !tbaa !20
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load120 = load <4 x i32>, ptr %9, align 8, !tbaa !20
%10 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load120, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%12 = sub nsw <4 x i32> %10, %wide.load
%13 = sub nsw <4 x i32> %11, %wide.load120
%14 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %12, i1 true)
%15 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %13, i1 true)
%16 = icmp sgt <4 x i32> %14, %broadcast.splat
%17 = icmp sgt <4 x i32> %15, %broadcast.splat
%18 = sub nsw <4 x i32> %broadcast.splat122, %14
%19 = sub nsw <4 x i32> %broadcast.splat122, %15
%20 = select <4 x i1> %16, <4 x i32> %18, <4 x i32> %14
%21 = select <4 x i1> %17, <4 x i32> %19, <4 x i32> %15
%22 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %20)
%23 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi119, <4 x i32> %21)
%index.next = add nuw i64 %index, 8
%24 = icmp eq i64 %index.next, %n.vec
br i1 %24, label %middle.block, label %vector.body, !llvm.loop !23
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %22, <4 x i32> %23)
%25 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %6, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load120, i64 3
br i1 %cmp.n, label %for.end72, label %for.body29.preheader123
for.body29.preheader123: ; preds = %for.body29.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre116, %for.body29.preheader ]
%indvars.iv113.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body29.preheader ]
%x.1108.ph = phi i32 [ %25, %middle.block ], [ %x.0, %for.body29.preheader ]
br label %for.body29
for.body29: ; preds = %for.body29.preheader123, %for.body29
%scalar.recur = phi i32 [ %26, %for.body29 ], [ %scalar.recur.ph, %for.body29.preheader123 ]
%indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.body29 ], [ %indvars.iv113.ph, %for.body29.preheader123 ]
%x.1108 = phi i32 [ %cond69, %for.body29 ], [ %x.1108.ph, %for.body29.preheader123 ]
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%arrayidx33 = getelementptr inbounds [500002 x i32], ptr %a, i64 0, i64 %indvars.iv.next114
%26 = load i32, ptr %arrayidx33, align 4, !tbaa !20
%sub104 = sub nsw i32 %scalar.recur, %26
%sub59 = call i32 @llvm.abs.i32(i32 %sub104, i1 true)
%cmp61 = icmp sgt i32 %sub59, %div
%sub63 = sub nsw i32 %5, %sub59
%y.0 = select i1 %cmp61, i32 %sub63, i32 %sub59
%cond69 = call i32 @llvm.smax.i32(i32 %x.1108, i32 %y.0)
%exitcond.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count
br i1 %exitcond.not, label %for.end72, label %for.body29, !llvm.loop !24
for.end72: ; preds = %for.body29, %middle.block, %for.end
%x.1.lcssa = phi i32 [ %x.0, %for.end ], [ %25, %middle.block ], [ %cond69, %for.body29 ]
%sub73 = sub nsw i32 %5, %x.1.lcssa
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub73)
call void @llvm.lifetime.end.p0(i64 2000008, ptr nonnull %a) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #14
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #11
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #12
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #13
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 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress 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 #8 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #12 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind }
attributes #15 = { 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !10}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !11, !12}
!24 = distinct !{!24, !10, !12, !11}
|
#include <stdio.h>
int main()
{
long long int k;
int n;
scanf("%lld%d", &k, &n);
long long int array[n];
for(int i =0;i<n;i++)
scanf("%lld", &array[i]);
long long int differences[n];
long long int i;
for( i = 0;i<n-1;i++)
{
differences[i] = array[i+1]- array[i];
}
differences[i] = (k-array[n-1])+array[0];
long long int max = 0;
for(long long int j = 0;j<n;j++)
{
if(differences[j]>max)
{
max = differences[j];
}
}
printf("%lld", k-max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i64, align 8
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp49 = icmp sgt i32 %3, 0
br i1 %cmp49, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%4 = zext i32 %3 to i64
%vla264 = alloca i64, i64 %4, align 16
%sub65 = add i32 %3, -1
%conv66 = sext i32 %sub65 to i64
br label %for.cond.cleanup.for.end14_crit_edge
for.cond.cleanup: ; preds = %for.body
%5 = zext i32 %16 to i64
%vla2 = alloca i64, i64 %5, align 16
%sub = add i32 %16, -1
%conv = sext i32 %sub to i64
%cmp551 = icmp sgt i32 %16, 1
br i1 %cmp551, label %for.body7.preheader, label %for.cond.cleanup.for.end14_crit_edge
for.cond.cleanup.for.end14_crit_edge: ; preds = %for.cond.cleanup.thread, %for.cond.cleanup
%conv73 = phi i64 [ %conv66, %for.cond.cleanup.thread ], [ %conv, %for.cond.cleanup ]
%vla271 = phi ptr [ %vla264, %for.cond.cleanup.thread ], [ %vla2, %for.cond.cleanup ]
%.lcssa69 = phi i32 [ %3, %for.cond.cleanup.thread ], [ %16, %for.cond.cleanup ]
%.pre62 = load i64, ptr %vla, align 16, !tbaa !9
br label %for.end14
for.body7.preheader: ; preds = %for.cond.cleanup
%smax = call i64 @llvm.smax.i64(i64 %conv, i64 1)
%.pre = load i64, ptr %vla, align 16, !tbaa !9
%min.iters.check = icmp ult i64 %smax, 4
br i1 %min.iters.check, label %for.body7.preheader91, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %smax, 9223372036854775804
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load74, %vector.body ]
%6 = or i64 %index, 1
%7 = getelementptr inbounds i64, ptr %vla, i64 %6
%wide.load = load <2 x i64>, ptr %7, align 8, !tbaa !9
%8 = getelementptr inbounds i64, ptr %7, i64 2
%wide.load74 = load <2 x i64>, ptr %8, align 8, !tbaa !9
%9 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%10 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load74, <2 x i32> <i32 1, i32 2>
%11 = sub nsw <2 x i64> %wide.load, %9
%12 = sub nsw <2 x i64> %wide.load74, %10
%13 = getelementptr inbounds i64, ptr %vla2, i64 %index
store <2 x i64> %11, ptr %13, align 16, !tbaa !9
%14 = getelementptr inbounds i64, ptr %13, i64 2
store <2 x i64> %12, ptr %14, align 16, !tbaa !9
%index.next = add nuw i64 %index, 4
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %smax, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load74, i64 1
br i1 %cmp.n, label %for.end14, label %for.body7.preheader91
for.body7.preheader91: ; preds = %for.body7.preheader, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body7.preheader ]
%i3.052.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body7.preheader ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%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
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp = icmp slt i64 %indvars.iv.next, %17
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15
for.body7: ; preds = %for.body7.preheader91, %for.body7
%scalar.recur = phi i64 [ %18, %for.body7 ], [ %scalar.recur.ph, %for.body7.preheader91 ]
%i3.052 = phi i64 [ %add, %for.body7 ], [ %i3.052.ph, %for.body7.preheader91 ]
%add = add nuw nsw i64 %i3.052, 1
%arrayidx8 = getelementptr inbounds i64, ptr %vla, i64 %add
%18 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%sub10 = sub nsw i64 %18, %scalar.recur
%arrayidx11 = getelementptr inbounds i64, ptr %vla2, i64 %i3.052
store i64 %sub10, ptr %arrayidx11, align 8, !tbaa !9
%exitcond.not = icmp eq i64 %add, %smax
br i1 %exitcond.not, label %for.end14, label %for.body7, !llvm.loop !16
for.end14: ; preds = %for.body7, %middle.block, %for.cond.cleanup.for.end14_crit_edge
%conv72 = phi i64 [ %conv73, %for.cond.cleanup.for.end14_crit_edge ], [ %conv, %middle.block ], [ %conv, %for.body7 ]
%vla270 = phi ptr [ %vla271, %for.cond.cleanup.for.end14_crit_edge ], [ %vla2, %middle.block ], [ %vla2, %for.body7 ]
%.lcssa68 = phi i32 [ %.lcssa69, %for.cond.cleanup.for.end14_crit_edge ], [ %16, %middle.block ], [ %16, %for.body7 ]
%19 = phi i64 [ %.pre62, %for.cond.cleanup.for.end14_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body7 ]
%i3.0.lcssa = phi i64 [ 0, %for.cond.cleanup.for.end14_crit_edge ], [ %smax, %middle.block ], [ %smax, %for.body7 ]
%20 = load i64, ptr %k, align 8, !tbaa !9
%arrayidx17 = getelementptr inbounds i64, ptr %vla, i64 %conv72
%21 = load i64, ptr %arrayidx17, align 8, !tbaa !9
%sub18 = sub i64 %20, %21
%add20 = add nsw i64 %sub18, %19
%arrayidx21 = getelementptr inbounds i64, ptr %vla270, i64 %i3.0.lcssa
store i64 %add20, ptr %arrayidx21, align 8, !tbaa !9
%conv23 = sext i32 %.lcssa68 to i64
%cmp2455 = icmp sgt i32 %.lcssa68, 0
br i1 %cmp2455, label %for.body27.preheader, label %for.cond.cleanup26
for.body27.preheader: ; preds = %for.end14
%min.iters.check77 = icmp ult i32 %.lcssa68, 4
br i1 %min.iters.check77, label %for.body27.preheader89, label %vector.ph78
vector.ph78: ; preds = %for.body27.preheader
%n.vec80 = and i64 %conv23, -4
br label %vector.body83
vector.body83: ; preds = %vector.body83, %vector.ph78
%index84 = phi i64 [ 0, %vector.ph78 ], [ %index.next88, %vector.body83 ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph78 ], [ %24, %vector.body83 ]
%vec.phi85 = phi <2 x i64> [ zeroinitializer, %vector.ph78 ], [ %25, %vector.body83 ]
%22 = getelementptr inbounds i64, ptr %vla270, i64 %index84
%wide.load86 = load <2 x i64>, ptr %22, align 8, !tbaa !9
%23 = getelementptr inbounds i64, ptr %22, i64 2
%wide.load87 = load <2 x i64>, ptr %23, align 8, !tbaa !9
%24 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load86, <2 x i64> %vec.phi)
%25 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load87, <2 x i64> %vec.phi85)
%index.next88 = add nuw i64 %index84, 4
%26 = icmp eq i64 %index.next88, %n.vec80
br i1 %26, label %middle.block75, label %vector.body83, !llvm.loop !17
middle.block75: ; preds = %vector.body83
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %24, <2 x i64> %25)
%27 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n82 = icmp eq i64 %n.vec80, %conv23
br i1 %cmp.n82, label %for.cond.cleanup26, label %for.body27.preheader89
for.body27.preheader89: ; preds = %for.body27.preheader, %middle.block75
%j.057.ph = phi i64 [ 0, %for.body27.preheader ], [ %n.vec80, %middle.block75 ]
%max.056.ph = phi i64 [ 0, %for.body27.preheader ], [ %27, %middle.block75 ]
br label %for.body27
for.cond.cleanup26: ; preds = %for.body27, %middle.block75, %for.end14
%max.0.lcssa = phi i64 [ 0, %for.end14 ], [ %27, %middle.block75 ], [ %spec.select, %for.body27 ]
%sub35 = sub nsw i64 %20, %max.0.lcssa
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub35)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5
ret i32 0
for.body27: ; preds = %for.body27.preheader89, %for.body27
%j.057 = phi i64 [ %inc33, %for.body27 ], [ %j.057.ph, %for.body27.preheader89 ]
%max.056 = phi i64 [ %spec.select, %for.body27 ], [ %max.056.ph, %for.body27.preheader89 ]
%arrayidx28 = getelementptr inbounds i64, ptr %vla270, i64 %j.057
%28 = load i64, ptr %arrayidx28, align 8, !tbaa !9
%spec.select = call i64 @llvm.smax.i64(i64 %28, i64 %max.056)
%inc33 = add nuw nsw i64 %j.057, 1
%exitcond61.not = icmp eq i64 %inc33, %conv23
br i1 %exitcond61.not, label %for.cond.cleanup26, label %for.body27, !llvm.loop !18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !14, !13}
!17 = distinct !{!17, !12, !13, !14}
!18 = distinct !{!18, !12, !14, !13}
|
#include <stdio.h>
#include <stdlib.h>
int max(int a, int b)
{
if (a>b) return a;
else return b;
}
int min(int a, int b)
{
if (a<b) return a;
else return b;
}
int compare_int(const void *a, const void *b)
{
return *(int*)b - *(int*)a;
}
int main()
{
int k, n;
scanf("%d %d", &k, &n);
int a[n];
for(int i=0;i<n;i++) scanf("%d", &a[i]);
qsort(a, n, sizeof(int), compare_int);
int b[n];
for(int i=1;i<n;i++) b[i]=a[i-1]-a[i];
b[0]=min(abs(a[0]-a[n-1]), abs(a[n-1]+k-a[0]));
int max=0;
for(int i=0;i<n;i++){
if(b[i]>max) max = b[i];
}
printf("%d", k-max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%k = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp60 = icmp sgt i32 %3, 0
br i1 %cmp60, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre80 = sext i32 %3 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre80, %entry.for.cond.cleanup_crit_edge ], [ %17, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #9
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = zext i32 %4 to i64
%vla2 = alloca i32, i64 %5, align 16
%cmp562 = icmp sgt i32 %4, 1
%.pre = load i32, ptr %vla, align 16, !tbaa !5
br i1 %cmp562, label %for.body8.preheader, label %for.cond.cleanup7
for.body8.preheader: ; preds = %for.cond.cleanup
%6 = add nsw i64 %5, -1
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body8.preheader98, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %6, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.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 i32> [ %vector.recur.init, %vector.ph ], [ %wide.load81, %vector.body ]
%offset.idx = or i64 %index, 1
%7 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load81 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load81, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = sub nsw <4 x i32> %9, %wide.load
%12 = sub nsw <4 x i32> %10, %wide.load81
%13 = getelementptr inbounds i32, ptr %vla2, i64 %offset.idx
store <4 x i32> %11, ptr %13, align 4, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
store <4 x i32> %12, ptr %14, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %6, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load81, i64 3
br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader98
for.body8.preheader98: ; preds = %for.body8.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body8.preheader ]
%indvars.iv70.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body8.preheader ]
br label %for.body8
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
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp = icmp slt i64 %indvars.iv.next, %17
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond.cleanup
%sub20 = add nsw i32 %4, -1
%idxprom21 = sext i32 %sub20 to i64
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %idxprom21
%18 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%sub23 = sub nsw i32 %.pre, %18
%19 = call i32 @llvm.abs.i32(i32 %sub23, i1 true)
%20 = load i32, ptr %k, align 4, !tbaa !5
%add = sub i32 %18, %.pre
%sub28 = add i32 %add, %20
%21 = call i32 @llvm.abs.i32(i32 %sub28, i1 true)
%a.b.i = call i32 @llvm.smin.i32(i32 %19, i32 %21)
store i32 %a.b.i, ptr %vla2, align 16, !tbaa !5
%cmp3364 = icmp sgt i32 %4, 0
br i1 %cmp3364, label %for.body36.preheader, label %for.cond.cleanup35
for.body36.preheader: ; preds = %for.cond.cleanup7
%min.iters.check84 = icmp ult i32 %4, 8
br i1 %min.iters.check84, label %for.body36.preheader96, label %vector.ph85
vector.ph85: ; preds = %for.body36.preheader
%n.vec87 = and i64 %5, 4294967288
br label %vector.body90
vector.body90: ; preds = %vector.body90, %vector.ph85
%index91 = phi i64 [ 0, %vector.ph85 ], [ %index.next95, %vector.body90 ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph85 ], [ %24, %vector.body90 ]
%vec.phi92 = phi <4 x i32> [ zeroinitializer, %vector.ph85 ], [ %25, %vector.body90 ]
%22 = getelementptr inbounds i32, ptr %vla2, i64 %index91
%wide.load93 = load <4 x i32>, ptr %22, align 16, !tbaa !5
%23 = getelementptr inbounds i32, ptr %22, i64 4
%wide.load94 = load <4 x i32>, ptr %23, align 16, !tbaa !5
%24 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load93, <4 x i32> %vec.phi)
%25 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load94, <4 x i32> %vec.phi92)
%index.next95 = add nuw i64 %index91, 8
%26 = icmp eq i64 %index.next95, %n.vec87
br i1 %26, label %middle.block82, label %vector.body90, !llvm.loop !14
middle.block82: ; preds = %vector.body90
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %24, <4 x i32> %25)
%27 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n89 = icmp eq i64 %n.vec87, %5
br i1 %cmp.n89, label %for.cond.cleanup35, label %for.body36.preheader96
for.body36.preheader96: ; preds = %for.body36.preheader, %middle.block82
%indvars.iv74.ph = phi i64 [ 0, %for.body36.preheader ], [ %n.vec87, %middle.block82 ]
%max.065.ph = phi i32 [ 0, %for.body36.preheader ], [ %27, %middle.block82 ]
br label %for.body36
for.body8: ; preds = %for.body8.preheader98, %for.body8
%scalar.recur = phi i32 [ %28, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader98 ]
%indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body8 ], [ %indvars.iv70.ph, %for.body8.preheader98 ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv70
%28 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%sub13 = sub nsw i32 %scalar.recur, %28
%arrayidx15 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv70
store i32 %sub13, ptr %arrayidx15, align 4, !tbaa !5
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond.not = icmp eq i64 %indvars.iv.next71, %5
br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !15
for.cond.cleanup35: ; preds = %for.body36, %middle.block82, %for.cond.cleanup7
%max.0.lcssa = phi i32 [ 0, %for.cond.cleanup7 ], [ %27, %middle.block82 ], [ %spec.select, %for.body36 ]
%sub46 = sub nsw i32 %20, %max.0.lcssa
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub46)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #9
ret i32 0
for.body36: ; preds = %for.body36.preheader96, %for.body36
%indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body36 ], [ %indvars.iv74.ph, %for.body36.preheader96 ]
%max.065 = phi i32 [ %spec.select, %for.body36 ], [ %max.065.ph, %for.body36.preheader96 ]
%arrayidx38 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv74
%29 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %29, i32 %max.065)
%indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
%exitcond78.not = icmp eq i64 %indvars.iv.next75, %5
br i1 %exitcond78.not, label %for.cond.cleanup35, label %for.body36, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #8
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10, !12, !11}
|
#include<stdio.h>
int main(void){
long k;
int n;
scanf("%ld %d",&k,&n);
long a[n];
for(int i = 0;i < n;i++)scanf("%ld",&a[i]);
long dif[n];
for(int i = 0;i < n-1;i++)dif[i] = a[i+1] - a[i];
dif[n-1] = a[0] + k - a[n-1];
long maxdif = 0;
for(int i = 0;i < n;i++)maxdif = (maxdif>dif[i]?maxdif:dif[i]);
printf("%ld",k-maxdif);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201589/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201589/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i64, align 8
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp54 = icmp sgt i32 %3, 0
br i1 %cmp54, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%4 = zext i32 %3 to i64
%vla275 = alloca i64, i64 %4, align 16
%sub76 = add i32 %3, -1
br label %for.cond.cleanup.for.cond.cleanup6_crit_edge
for.cond.cleanup: ; preds = %for.body
%5 = zext i32 %17 to i64
%vla2 = alloca i64, i64 %5, align 16
%sub = add i32 %17, -1
%cmp556 = icmp sgt i32 %17, 1
br i1 %cmp556, label %for.body7.preheader, label %for.cond.cleanup.for.cond.cleanup6_crit_edge
for.cond.cleanup.for.cond.cleanup6_crit_edge: ; preds = %for.cond.cleanup.thread, %for.cond.cleanup
%sub83 = phi i32 [ %sub76, %for.cond.cleanup.thread ], [ %sub, %for.cond.cleanup ]
%vla281 = phi ptr [ %vla275, %for.cond.cleanup.thread ], [ %vla2, %for.cond.cleanup ]
%6 = phi i64 [ %4, %for.cond.cleanup.thread ], [ %5, %for.cond.cleanup ]
%.lcssa79 = phi i32 [ %3, %for.cond.cleanup.thread ], [ %17, %for.cond.cleanup ]
%.pre73 = load i64, ptr %vla, align 16, !tbaa !9
br label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %sub to i64
%.pre = load i64, ptr %vla, align 16, !tbaa !9
%min.iters.check = icmp ult i32 %17, 5
br i1 %min.iters.check, label %for.body7.preheader101, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load84, %vector.body ]
%7 = or i64 %index, 1
%8 = getelementptr inbounds i64, ptr %vla, i64 %7
%wide.load = load <2 x i64>, ptr %8, align 8, !tbaa !9
%9 = getelementptr inbounds i64, ptr %8, i64 2
%wide.load84 = load <2 x i64>, ptr %9, align 8, !tbaa !9
%10 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%11 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load84, <2 x i32> <i32 1, i32 2>
%12 = sub nsw <2 x i64> %wide.load, %10
%13 = sub nsw <2 x i64> %wide.load84, %11
%14 = getelementptr inbounds i64, ptr %vla2, i64 %index
store <2 x i64> %12, ptr %14, align 16, !tbaa !9
%15 = getelementptr inbounds i64, ptr %14, i64 2
store <2 x i64> %13, ptr %15, align 16, !tbaa !9
%index.next = add nuw i64 %index, 4
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <2 x i64> %wide.load84, i64 1
br i1 %cmp.n, label %for.cond.cleanup6, label %for.body7.preheader101
for.body7.preheader101: ; preds = %for.body7.preheader, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body7.preheader ]
%indvars.iv65.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body7.preheader ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%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
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15
for.cond.cleanup6: ; preds = %for.body7, %middle.block, %for.cond.cleanup.for.cond.cleanup6_crit_edge
%sub82 = phi i32 [ %sub83, %for.cond.cleanup.for.cond.cleanup6_crit_edge ], [ %sub, %middle.block ], [ %sub, %for.body7 ]
%vla280 = phi ptr [ %vla281, %for.cond.cleanup.for.cond.cleanup6_crit_edge ], [ %vla2, %middle.block ], [ %vla2, %for.body7 ]
%19 = phi i64 [ %6, %for.cond.cleanup.for.cond.cleanup6_crit_edge ], [ %5, %middle.block ], [ %5, %for.body7 ]
%.lcssa78 = phi i32 [ %.lcssa79, %for.cond.cleanup.for.cond.cleanup6_crit_edge ], [ %17, %middle.block ], [ %17, %for.body7 ]
%20 = phi i64 [ %.pre73, %for.cond.cleanup.for.cond.cleanup6_crit_edge ], [ %.pre, %middle.block ], [ %.pre, %for.body7 ]
%21 = load i64, ptr %k, align 8, !tbaa !9
%add19 = add nsw i64 %21, %20
%idxprom21 = sext i32 %sub82 to i64
%arrayidx22 = getelementptr inbounds i64, ptr %vla, i64 %idxprom21
%22 = load i64, ptr %arrayidx22, align 8, !tbaa !9
%sub23 = sub i64 %add19, %22
%arrayidx26 = getelementptr inbounds i64, ptr %vla280, i64 %idxprom21
store i64 %sub23, ptr %arrayidx26, align 8, !tbaa !9
%cmp2959 = icmp sgt i32 %.lcssa78, 0
br i1 %cmp2959, label %for.body31.preheader, label %for.cond.cleanup30
for.body31.preheader: ; preds = %for.cond.cleanup6
%min.iters.check87 = icmp ult i64 %19, 4
br i1 %min.iters.check87, label %for.body31.preheader99, label %vector.ph88
vector.ph88: ; preds = %for.body31.preheader
%n.vec90 = and i64 %19, -4
br label %vector.body93
vector.body93: ; preds = %vector.body93, %vector.ph88
%index94 = phi i64 [ 0, %vector.ph88 ], [ %index.next98, %vector.body93 ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph88 ], [ %25, %vector.body93 ]
%vec.phi95 = phi <2 x i64> [ zeroinitializer, %vector.ph88 ], [ %26, %vector.body93 ]
%23 = getelementptr inbounds i64, ptr %vla280, i64 %index94
%wide.load96 = load <2 x i64>, ptr %23, align 8, !tbaa !9
%24 = getelementptr inbounds i64, ptr %23, i64 2
%wide.load97 = load <2 x i64>, ptr %24, align 8, !tbaa !9
%25 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load96)
%26 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi95, <2 x i64> %wide.load97)
%index.next98 = add nuw i64 %index94, 4
%27 = icmp eq i64 %index.next98, %n.vec90
br i1 %27, label %middle.block85, label %vector.body93, !llvm.loop !16
middle.block85: ; preds = %vector.body93
%rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %25, <2 x i64> %26)
%28 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n92 = icmp eq i64 %19, %n.vec90
br i1 %cmp.n92, label %for.cond.cleanup30, label %for.body31.preheader99
for.body31.preheader99: ; preds = %for.body31.preheader, %middle.block85
%indvars.iv68.ph = phi i64 [ 0, %for.body31.preheader ], [ %n.vec90, %middle.block85 ]
%maxdif.060.ph = phi i64 [ 0, %for.body31.preheader ], [ %28, %middle.block85 ]
br label %for.body31
for.body7: ; preds = %for.body7.preheader101, %for.body7
%scalar.recur = phi i64 [ %29, %for.body7 ], [ %scalar.recur.ph, %for.body7.preheader101 ]
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body7 ], [ %indvars.iv65.ph, %for.body7.preheader101 ]
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%arrayidx9 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next66
%29 = load i64, ptr %arrayidx9, align 8, !tbaa !9
%sub12 = sub nsw i64 %29, %scalar.recur
%arrayidx14 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv65
store i64 %sub12, ptr %arrayidx14, align 8, !tbaa !9
%exitcond.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !17
for.cond.cleanup30: ; preds = %for.body31, %middle.block85, %for.cond.cleanup6
%maxdif.0.lcssa = phi i64 [ 0, %for.cond.cleanup6 ], [ %28, %middle.block85 ], [ %maxdif.0., %for.body31 ]
%sub40 = sub nsw i64 %21, %maxdif.0.lcssa
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub40)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5
ret i32 0
for.body31: ; preds = %for.body31.preheader99, %for.body31
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body31 ], [ %indvars.iv68.ph, %for.body31.preheader99 ]
%maxdif.060 = phi i64 [ %maxdif.0., %for.body31 ], [ %maxdif.060.ph, %for.body31.preheader99 ]
%arrayidx33 = getelementptr inbounds i64, ptr %vla280, i64 %indvars.iv68
%30 = load i64, ptr %arrayidx33, align 8, !tbaa !9
%maxdif.0. = call i64 @llvm.smax.i64(i64 %maxdif.060, i64 %30)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%exitcond72.not = icmp eq i64 %indvars.iv.next69, %19
br i1 %exitcond72.not, label %for.cond.cleanup30, label %for.body31, !llvm.loop !18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !13, !14}
!17 = distinct !{!17, !12, !14, !13}
!18 = distinct !{!18, !12, !14, !13}
|
#include <stdio.h>
int main() {
int a,b;
scanf("%d%d",&a,&b);
float c=((float)a+(float)b)/3;
float A=(float)a/3;
float B=(float)b/3;
if(c-(int)c== 0){
printf("Possible");
}
else if(A-(int)A== 0){
printf("Possible");
}
else if(B-(int)B== 0){
printf("Possible");
}
else{
printf("Impossible");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201631/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201631/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"Possible\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%conv = sitofp i32 %0 to float
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to float
%add = fadd float %conv, %conv1
%div = fdiv float %add, 3.000000e+00
%div5 = fdiv float %conv1, 3.000000e+00
%conv6 = fptosi float %div to i32
%conv7 = sitofp i32 %conv6 to float
%sub = fsub float %div, %conv7
%cmp = fcmp oeq float %sub, 0.000000e+00
br i1 %cmp, label %if.end28, label %if.else
if.else: ; preds = %entry
%div3 = fdiv float %conv, 3.000000e+00
%conv10 = fptosi float %div3 to i32
%conv11 = sitofp i32 %conv10 to float
%sub12 = fsub float %div3, %conv11
%cmp13 = fcmp oeq float %sub12, 0.000000e+00
br i1 %cmp13, label %if.end28, label %if.else17
if.else17: ; preds = %if.else
%conv18 = fptosi float %div5 to i32
%conv19 = sitofp i32 %conv18 to float
%sub20 = fsub float %div5, %conv19
%cmp21 = fcmp oeq float %sub20, 0.000000e+00
%.str.1..str.2 = select i1 %cmp21, ptr @.str.1, ptr @.str.2
br label %if.end28
if.end28: ; preds = %if.else17, %if.else, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ @.str.1, %if.else ], [ %.str.1..str.2, %if.else17 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int a, b;
scanf("%d%d", &a, &b);
printf(a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0 ? "Possible\n" : "Impossible\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"Possible\0A\00", align 1
@.str.2 = private unnamed_addr constant [12 x i8] c"Impossible\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 %a, align 4, !tbaa !5
%rem = srem i32 %0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %lor.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%cmp2 = icmp eq i32 %rem1, 0
br i1 %cmp2, label %lor.end, label %lor.rhs
lor.rhs: ; preds = %lor.lhs.false
%add = add nsw i32 %1, %0
%rem3 = srem i32 %add, 3
%cmp4 = icmp eq i32 %rem3, 0
%2 = select i1 %cmp4, ptr @.str.1, ptr @.str.2
br label %lor.end
lor.end: ; preds = %lor.rhs, %lor.lhs.false, %entry
%cond = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ %2, %lor.rhs ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,sum;
scanf("%d %d",&a,&b);
sum=a+b;
if(a%3==0){
printf("Possible\n");
}
else if(b%3==0){
printf("Possible\n");
}
else if(sum%3==0){
printf("Possible\n");
}
else{
printf("Impossible\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201732/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201732/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
@str.5 = private unnamed_addr constant [9 x i8] c"Possible\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
%add = add nsw i32 %1, %0
%rem = srem i32 %0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.end14, label %if.else
if.else: ; preds = %entry
%rem2 = srem i32 %1, 3
%cmp3 = icmp eq i32 %rem2, 0
br i1 %cmp3, label %if.end14, label %if.else6
if.else6: ; preds = %if.else
%rem7 = srem i32 %add, 3
%cmp8 = icmp eq i32 %rem7, 0
%str.3.str = select i1 %cmp8, ptr @str.5, ptr @str
br label %if.end14
if.end14: ; preds = %if.else6, %if.else, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %if.else ], [ %str.3.str, %if.else6 ]
%puts16 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d%d",&a,&b);
if(a%3==0||b%3==0||(a+b)%3==0){
printf("Possible");
}
else{
printf("Impossible");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"Possible\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%cmp2 = icmp eq i32 %rem1, 0
br i1 %cmp2, label %if.end, label %lor.lhs.false3
lor.lhs.false3: ; preds = %lor.lhs.false
%add = add nsw i32 %1, %0
%rem4 = srem i32 %add, 3
%cmp5 = icmp eq i32 %rem4, 0
%spec.select = select i1 %cmp5, ptr @.str.1, ptr @.str.2
br label %if.end
if.end: ; preds = %lor.lhs.false3, %entry, %lor.lhs.false
%.str.2.sink = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a, b;
scanf("%d %d", &a, &b);
if(a%3==0||b%3==0||(a+b)%3==0)
puts("Possible");
else
puts("Impossible");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201833/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201833/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"Possible\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 3
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem1 = srem i32 %1, 3
%cmp2 = icmp eq i32 %rem1, 0
br i1 %cmp2, label %if.end, label %lor.lhs.false3
lor.lhs.false3: ; preds = %lor.lhs.false
%add = add nsw i32 %1, %0
%rem4 = srem i32 %add, 3
%cmp5 = icmp eq i32 %rem4, 0
%spec.select = select i1 %cmp5, ptr @.str.1, ptr @.str.2
br label %if.end
if.end: ; preds = %lor.lhs.false3, %entry, %lor.lhs.false
%.str.2.sink = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ %spec.select, %lor.lhs.false3 ]
%call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a, b, sum;
while(scanf("%d%d", &a, &b) == 2) {
sum = a + b;
if(sum % 3 == 0 || a % 3 == 0 || b % 3 == 0) {
printf("Possible\n");
}
else {
printf("Impossible\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201877/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201877/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
@str.3 = private unnamed_addr constant [9 x i8] c"Possible\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
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp12 = icmp eq i32 %call11, 2
br i1 %cmp12, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%rem = srem i32 %add, 3
%cmp1 = icmp eq i32 %rem, 0
%rem2 = srem i32 %0, 3
%cmp3 = icmp eq i32 %rem2, 0
%or.cond = or i1 %cmp3, %cmp1
%rem5 = srem i32 %1, 3
%cmp6 = icmp eq i32 %rem5, 0
%or.cond10 = or i1 %cmp6, %or.cond
%str.3.str = select i1 %or.cond10, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp = icmp eq i32 %call, 2
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
float n;
scanf("%f", &n);
int ar[100005];
long long sum = 0;
for (int i = 0; i < n; i++)
{
scanf("%d", &ar[i]);
sum = sum + ar[i];
}
float max = ar[0];
for (int i = 0; i < n; i++)
{
if (ar[i] > max)
{
max = ar[i];
}
}
printf("%f\n", (sum - max) / (n - 1) + max);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20192/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20192/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%f\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca float, align 4
%ar = alloca [100005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec49 = add nsw i32 %0, -1
store i32 %dec49, ptr %t, align 4, !tbaa !5
%tobool.not50 = icmp eq i32 %0, 0
br i1 %tobool.not50, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %ar) #3
%1 = load float, ptr %n, align 4, !tbaa !9
%cmp41 = fcmp ogt float %1, 0.000000e+00
br i1 %cmp41, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %for.body
%.pre = load i32, ptr %ar, align 16, !tbaa !5
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %while.body
%2 = phi i32 [ undef, %while.body ], [ %.pre, %for.cond.cleanup.loopexit ]
%sum.0.lcssa = phi i64 [ 0, %while.body ], [ %add, %for.cond.cleanup.loopexit ]
%.lcssa = phi float [ %1, %while.body ], [ %5, %for.cond.cleanup.loopexit ]
%conv8 = sitofp i32 %2 to float
%cmp1245 = fcmp ogt float %.lcssa, 0.000000e+00
br i1 %cmp1245, label %for.body15, label %for.cond.cleanup14
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%sum.042 = phi i64 [ %add, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr %ar, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv6 = sext i32 %3 to i64
%add = add nsw i64 %sum.042, %conv6
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%4 = trunc i64 %indvars.iv.next to i32
%conv = sitofp i32 %4 to float
%5 = load float, ptr %n, align 4, !tbaa !9
%cmp = fcmp ogt float %5, %conv
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !11
for.cond.cleanup14: ; preds = %for.body15, %for.cond.cleanup
%max.0.lcssa = phi float [ %conv8, %for.cond.cleanup ], [ %max.1, %for.body15 ]
%conv27 = sitofp i64 %sum.0.lcssa to float
%sub = fsub float %conv27, %max.0.lcssa
%sub28 = fadd float %.lcssa, -1.000000e+00
%div = fdiv float %sub, %sub28
%add29 = fadd float %max.0.lcssa, %div
%conv30 = fpext float %add29 to double
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %conv30)
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %ar) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
%6 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
for.body15: ; preds = %for.cond.cleanup, %for.body15
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body15 ], [ 0, %for.cond.cleanup ]
%max.046 = phi float [ %max.1, %for.body15 ], [ %conv8, %for.cond.cleanup ]
%arrayidx17 = getelementptr inbounds [100005 x i32], ptr %ar, i64 0, i64 %indvars.iv53
%7 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%conv18 = sitofp i32 %7 to float
%cmp19 = fcmp olt float %max.046, %conv18
%max.1 = select i1 %cmp19, float %conv18, float %max.046
%indvars.iv.next54 = add nuw i64 %indvars.iv53, 1
%8 = trunc i64 %indvars.iv.next54 to i32
%conv11 = sitofp i32 %8 to float
%cmp12 = fcmp ogt float %.lcssa, %conv11
br i1 %cmp12, label %for.body15, label %for.cond.cleanup14, !llvm.loop !14
while.end: ; preds = %for.cond.cleanup14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include<stdio.h>
int main()
{
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
if(a<0&&b<=0){
printf("%d\n",c*(b-a));
}else if(a<0&&b>0){
printf("%d\n",(-a)*c+d+b*e);
}else{
printf("%d\n",(b-a)*e);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_201970/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_201970/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %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
%2 = load i32, ptr %c, align 4, !tbaa !5
%sub = sub nsw i32 %1, %0
%mul = mul nsw i32 %2, %sub
br label %if.end16
if.else: ; preds = %entry
%cmp5 = icmp sgt i32 %1, 0
%or.cond17 = select i1 %cmp, i1 %cmp5, i1 false
br i1 %or.cond17, label %if.then6, label %if.else12
if.then6: ; preds = %if.else
%3 = load i32, ptr %c, align 4, !tbaa !5
%4 = mul i32 %3, %0
%5 = load i32, ptr %d, align 4, !tbaa !5
%add = sub i32 %5, %4
%6 = load i32, ptr %e, align 4, !tbaa !5
%mul9 = mul nsw i32 %6, %1
%add10 = add nsw i32 %add, %mul9
br label %if.end16
if.else12: ; preds = %if.else
%sub13 = sub nsw i32 %1, %0
%7 = load i32, ptr %e, align 4, !tbaa !5
%mul14 = mul nsw i32 %7, %sub13
br label %if.end16
if.end16: ; preds = %if.then6, %if.else12, %if.then
%add10.sink = phi i32 [ %add10, %if.then6 ], [ %mul14, %if.else12 ], [ %mul, %if.then ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add10.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
printf("%d\n",a<0 ? -a*c+d+b*e :(b-a)*e);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202012/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202012/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 0
br i1 %cmp, label %cond.true, label %cond.false
cond.true: ; preds = %entry
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = mul i32 %1, %0
%3 = load i32, ptr %d, align 4, !tbaa !5
%add = sub i32 %3, %2
%4 = load i32, ptr %b, align 4, !tbaa !5
%5 = load i32, ptr %e, align 4, !tbaa !5
%mul1 = mul nsw i32 %5, %4
%add2 = add nsw i32 %add, %mul1
br label %cond.end
cond.false: ; preds = %entry
%6 = load i32, ptr %b, align 4, !tbaa !5
%sub3 = sub nsw i32 %6, %0
%7 = load i32, ptr %e, align 4, !tbaa !5
%mul4 = mul nsw i32 %sub3, %7
br label %cond.end
cond.end: ; preds = %cond.false, %cond.true
%cond = phi i32 [ %add2, %cond.true ], [ %mul4, %cond.false ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int student;
while (scanf("%d", &student) != EOF){
printf("3C%02d\n", (student % 39 == 0) ? 39 : student % 39);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202056/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202056/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"3C%02d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%student = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %student) #3
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %student)
%cmp.not5 = icmp eq i32 %call4, -1
br i1 %cmp.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %student, align 4, !tbaa !5
%rem = srem i32 %0, 39
%cmp1 = icmp eq i32 %rem, 0
%spec.select = select i1 %cmp1, i32 39, i32 %rem
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %student)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %student) #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 candy;
int n;
while (scanf("%d", &candy) != EOF){
n = ((candy - 1) % 39) + 1;
printf("3C%02d\n", n);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202106/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202106/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"3C%02d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%candy = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %candy) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %candy)
%cmp.not3 = icmp eq i32 %call2, -1
br i1 %cmp.not3, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %candy, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%rem = srem i32 %sub, 39
%add = add nsw i32 %rem, 1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %candy)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %candy) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int n,m;
struct element{
char name[101];
int cost;
} *product;
struct recipe{
char name[101];
int num_of_prod;
char zairyo[100][101];
} *menu;
void minimum_cost(int number);
int main(void){
int i,j;
char final[101];
while(scanf("%d",&n) && n){
product=(struct element *)calloc(n,sizeof(struct element));
for(i=0;i<n;i++){
scanf("%s %d%*c", product[i].name,&product[i].cost);
}
/*
for(i=0;i<n;i++){
printf("%s %d\n", product[i].name,product[i].cost);
}*/
scanf("%d",&m);
menu=(struct recipe *)calloc(m,sizeof(struct recipe));
for(i=0;i<m;i++){
scanf("%s %d%*c", menu[i].name,&menu[i].num_of_prod);
for(j=0;j<menu[i].num_of_prod;j++){
scanf("%s%*c",menu[i].zairyo[j]);
}
}
/*
for(i=0;i<m;i++){
printf("%s %d ", menu[i].name,menu[i].num_of_prod);
for(j=0;j<menu[i].num_of_prod;j++){
printf("%s ",menu[i].zairyo[j]);
}
putchar('\n');
}*/
scanf("%s%*c",final);
for(i=0;i<n;i++){
if(!strcmp(final,product[i].name)){
minimum_cost(i);
printf("%d\n",product[i].cost);
break;
}
}
free(menu);
free(product);
}
return 0;
}
void minimum_cost(int number){
int i,j,k;
int sum=0;
//printf("%d %d\n",m,n);
//printf("%s recipe is searching...\n",product[number].name);
for(i=0;i<m;i++){
//printf("%lu %lu\n",strlen(product[number].name),strlen(menu[i].name));
if(!strcmp(product[number].name,menu[i].name)){
//printf("%s menu found!\n",product[number].name);
for(j=0;j<menu[i].num_of_prod;j++){
for(k=0;k<n;k++){
if(!strcmp(menu[i].zairyo[j],product[k].name)){
minimum_cost(k);
sum+=product[k].cost;
break;
}
}
}
//printf("%s cost is from %d to ",product[number].name,product[number].cost);
if(sum<product[number].cost) product[number].cost=sum;
//printf("%d \n",product[number].cost);
break;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202207/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202207/source.c"
target datalayout = "e-m:e-p270: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.element = type { [101 x i8], i32 }
%struct.recipe = type { [101 x i8], i32, [100 x [101 x i8]] }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@product = dso_local local_unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [9 x i8] c"%s %d%*c\00", align 1
@m = dso_local global i32 0, align 4
@menu = dso_local local_unnamed_addr global ptr null, align 8
@.str.2 = private unnamed_addr constant [6 x i8] c"%s%*c\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%final = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %final) #7
%call86 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%tobool87 = icmp ne i32 %call86, 0
%0 = load i32, ptr @n, align 4
%tobool188 = icmp ne i32 %0, 0
%1 = select i1 %tobool87, i1 %tobool188, i1 false
br i1 %1, label %while.body, label %while.end
while.body: ; preds = %entry, %for.end59
%2 = phi i32 [ %24, %for.end59 ], [ %0, %entry ]
%conv = sext i32 %2 to i64
%call2 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 108) #8
store ptr %call2, ptr @product, align 8, !tbaa !5
%cmp77 = icmp sgt i32 %2, 0
br i1 %cmp77, label %for.body, label %for.end
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%3 = load ptr, ptr @product, align 8, !tbaa !5
%arrayidx = getelementptr inbounds %struct.element, ptr %3, i64 %indvars.iv
%cost = getelementptr inbounds %struct.element, ptr %3, i64 %indvars.iv, i32 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef nonnull %cost)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr @n, align 4, !tbaa !9
%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 !11
for.end: ; preds = %for.body, %while.body
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m)
%6 = load i32, ptr @m, align 4, !tbaa !9
%conv8 = sext i32 %6 to i64
%call9 = call noalias ptr @calloc(i64 noundef %conv8, i64 noundef 10208) #8
store ptr %call9, ptr @menu, align 8, !tbaa !5
%cmp1182 = icmp sgt i32 %6, 0
br i1 %cmp1182, label %for.body13, label %for.end39
for.body13: ; preds = %for.end, %for.inc37
%7 = phi ptr [ %14, %for.inc37 ], [ %call9, %for.end ]
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.inc37 ], [ 0, %for.end ]
%arrayidx15 = getelementptr inbounds %struct.recipe, ptr %7, i64 %indvars.iv95
%num_of_prod = getelementptr inbounds %struct.recipe, ptr %7, i64 %indvars.iv95, i32 1
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx15, ptr noundef nonnull %num_of_prod)
%8 = load ptr, ptr @menu, align 8, !tbaa !5
%num_of_prod2479 = getelementptr inbounds %struct.recipe, ptr %8, i64 %indvars.iv95, i32 1
%9 = load i32, ptr %num_of_prod2479, align 4, !tbaa !13
%cmp2580 = icmp sgt i32 %9, 0
br i1 %cmp2580, label %for.body27, label %for.inc37
for.body27: ; preds = %for.body13, %for.body27
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.body27 ], [ 0, %for.body13 ]
%10 = phi ptr [ %11, %for.body27 ], [ %8, %for.body13 ]
%arrayidx31 = getelementptr inbounds %struct.recipe, ptr %10, i64 %indvars.iv95, i32 2, i64 %indvars.iv92
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx31)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%11 = load ptr, ptr @menu, align 8, !tbaa !5
%num_of_prod24 = getelementptr inbounds %struct.recipe, ptr %11, i64 %indvars.iv95, i32 1
%12 = load i32, ptr %num_of_prod24, align 4, !tbaa !13
%13 = sext i32 %12 to i64
%cmp25 = icmp slt i64 %indvars.iv.next93, %13
br i1 %cmp25, label %for.body27, label %for.inc37, !llvm.loop !15
for.inc37: ; preds = %for.body27, %for.body13
%14 = phi ptr [ %8, %for.body13 ], [ %11, %for.body27 ]
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%15 = load i32, ptr @m, align 4, !tbaa !9
%16 = sext i32 %15 to i64
%cmp11 = icmp slt i64 %indvars.iv.next96, %16
br i1 %cmp11, label %for.body13, label %for.end39, !llvm.loop !16
for.end39: ; preds = %for.inc37, %for.end
%call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %final)
%17 = load i32, ptr @n, align 4, !tbaa !9
%cmp4384 = icmp sgt i32 %17, 0
br i1 %cmp4384, label %for.body45.lr.ph, label %for.end59
for.body45.lr.ph: ; preds = %for.end39
%18 = load ptr, ptr @product, align 8, !tbaa !5
%wide.trip.count = zext i32 %17 to i64
br label %for.body45
for.body45: ; preds = %for.body45.lr.ph, %for.inc57
%indvars.iv98 = phi i64 [ 0, %for.body45.lr.ph ], [ %indvars.iv.next99, %for.inc57 ]
%arrayidx48 = getelementptr inbounds %struct.element, ptr %18, i64 %indvars.iv98
%call51 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %final, ptr noundef nonnull dereferenceable(1) %arrayidx48) #9
%tobool52.not = icmp eq i32 %call51, 0
br i1 %tobool52.not, label %if.then, label %for.inc57
if.then: ; preds = %for.body45
%19 = trunc i64 %indvars.iv98 to i32
call void @minimum_cost(i32 noundef %19)
%20 = load ptr, ptr @product, align 8, !tbaa !5
%cost55 = getelementptr inbounds %struct.element, ptr %20, i64 %indvars.iv98, i32 1
%21 = load i32, ptr %cost55, align 4, !tbaa !17
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %21)
br label %for.end59
for.inc57: ; preds = %for.body45
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count
br i1 %exitcond.not, label %for.end59, label %for.body45, !llvm.loop !19
for.end59: ; preds = %for.inc57, %for.end39, %if.then
%22 = load ptr, ptr @menu, align 8, !tbaa !5
call void @free(ptr noundef %22) #7
%23 = load ptr, ptr @product, align 8, !tbaa !5
call void @free(ptr noundef %23) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%tobool = icmp ne i32 %call, 0
%24 = load i32, ptr @n, align 4
%tobool1 = icmp ne i32 %24, 0
%25 = select i1 %tobool, i1 %tobool1, i1 false
br i1 %25, label %while.body, label %while.end, !llvm.loop !20
while.end: ; preds = %for.end59, %entry
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %final) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @minimum_cost(i32 noundef %number) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr @m, align 4, !tbaa !9
%cmp58 = icmp sgt i32 %0, 0
br i1 %cmp58, label %for.body.lr.ph, label %for.end42
for.body.lr.ph: ; preds = %entry
%1 = load ptr, ptr @product, align 8, !tbaa !5
%idxprom = sext i32 %number to i64
%arrayidx = getelementptr inbounds %struct.element, ptr %1, i64 %idxprom
%2 = load ptr, ptr @menu, align 8, !tbaa !5
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end42, label %for.body, !llvm.loop !21
for.body: ; preds = %for.body.lr.ph, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond ]
%arrayidx2 = getelementptr inbounds %struct.recipe, ptr %2, i64 %indvars.iv
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx2) #9
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %for.cond5.preheader, label %for.cond
for.cond5.preheader: ; preds = %for.body
%num_of_prod62 = getelementptr inbounds %struct.recipe, ptr %2, i64 %indvars.iv, i32 1
%3 = load i32, ptr %num_of_prod62, align 4, !tbaa !13
%cmp863 = icmp sgt i32 %3, 0
%4 = load i32, ptr @n, align 4
%5 = icmp sgt i32 %4, 0
%or.cond = select i1 %cmp863, i1 %5, i1 false
br i1 %or.cond, label %for.cond10.preheader, label %for.end29
for.cond10.preheader: ; preds = %for.cond5.preheader, %for.inc27
%6 = phi ptr [ %12, %for.inc27 ], [ %2, %for.cond5.preheader ]
%7 = phi ptr [ %13, %for.inc27 ], [ %1, %for.cond5.preheader ]
%8 = phi i32 [ %14, %for.inc27 ], [ %4, %for.cond5.preheader ]
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.inc27 ], [ 0, %for.cond5.preheader ]
%sum.066 = phi i32 [ %sum.1, %for.inc27 ], [ 0, %for.cond5.preheader ]
%cmp1160 = icmp sgt i32 %8, 0
br i1 %cmp1160, label %for.body12.lr.ph, label %for.inc27
for.body12.lr.ph: ; preds = %for.cond10.preheader
%arrayidx16 = getelementptr inbounds %struct.recipe, ptr %6, i64 %indvars.iv, i32 2, i64 %indvars.iv77
%wide.trip.count75 = zext i32 %8 to i64
br label %for.body12
for.body12: ; preds = %for.body12.lr.ph, %for.inc
%indvars.iv72 = phi i64 [ 0, %for.body12.lr.ph ], [ %indvars.iv.next73, %for.inc ]
%arrayidx19 = getelementptr inbounds %struct.element, ptr %7, i64 %indvars.iv72
%call22 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx16, ptr noundef nonnull dereferenceable(1) %arrayidx19) #9
%tobool23.not = icmp eq i32 %call22, 0
br i1 %tobool23.not, label %if.then24, label %for.inc
if.then24: ; preds = %for.body12
%9 = trunc i64 %indvars.iv72 to i32
tail call void @minimum_cost(i32 noundef %9)
%10 = load ptr, ptr @product, align 8, !tbaa !5
%cost = getelementptr inbounds %struct.element, ptr %10, i64 %indvars.iv72, i32 1
%11 = load i32, ptr %cost, align 4, !tbaa !17
%add = add nsw i32 %11, %sum.066
%.pre = load i32, ptr @n, align 4, !tbaa !9
%.pre81 = load ptr, ptr @menu, align 8, !tbaa !5
br label %for.inc27
for.inc: ; preds = %for.body12
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75
br i1 %exitcond76.not, label %for.inc27, label %for.body12, !llvm.loop !22
for.inc27: ; preds = %for.inc, %for.cond10.preheader, %if.then24
%12 = phi ptr [ %.pre81, %if.then24 ], [ %6, %for.cond10.preheader ], [ %6, %for.inc ]
%13 = phi ptr [ %10, %if.then24 ], [ %7, %for.cond10.preheader ], [ %7, %for.inc ]
%14 = phi i32 [ %.pre, %if.then24 ], [ %8, %for.cond10.preheader ], [ %8, %for.inc ]
%sum.1 = phi i32 [ %add, %if.then24 ], [ %sum.066, %for.cond10.preheader ], [ %sum.066, %for.inc ]
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%num_of_prod = getelementptr inbounds %struct.recipe, ptr %12, i64 %indvars.iv, i32 1
%15 = load i32, ptr %num_of_prod, align 4, !tbaa !13
%16 = sext i32 %15 to i64
%cmp8 = icmp slt i64 %indvars.iv.next78, %16
br i1 %cmp8, label %for.cond10.preheader, label %for.end29, !llvm.loop !23
for.end29: ; preds = %for.inc27, %for.cond5.preheader
%17 = phi ptr [ %1, %for.cond5.preheader ], [ %13, %for.inc27 ]
%sum.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ %sum.1, %for.inc27 ]
%cost32 = getelementptr inbounds %struct.element, ptr %17, i64 %idxprom, i32 1
%18 = load i32, ptr %cost32, align 4, !tbaa !17
%cmp33 = icmp slt i32 %sum.0.lcssa, %18
br i1 %cmp33, label %if.then34, label %for.end42
if.then34: ; preds = %for.end29
store i32 %sum.0.lcssa, ptr %cost32, align 4, !tbaa !17
br label %for.end42
for.end42: ; preds = %for.cond, %entry, %for.end29, %if.then34
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !10, i64 104}
!14 = !{!"recipe", !7, i64 0, !10, i64 104, !7, i64 108}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !10, i64 104}
!18 = !{!"element", !7, i64 0, !10, i64 104}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12, !24}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
|
#include <stdio.h>
int main(){
int densen[5];
for(int i=0; i<5; i++){
scanf("%d", &densen[i]);
}
int k;
scanf("%d", &k);
//全探索
int hasConnection = 0; //0でAllOK、1で通信できない
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
if((densen[i] - densen[j]) > k) hasConnection = 1;
}
}
if(hasConnection == 1){
printf(":(");
}else{
printf("Yay!");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202250/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202250/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%densen = alloca [5 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %densen) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %densen)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %densen, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %densen, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %densen, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %densen, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %densen, align 16, !tbaa !5
%cmp15 = icmp sgt i32 %0, -1
%2 = load <4 x i32>, ptr %arrayidx.1, align 4, !tbaa !5
%3 = shufflevector <4 x i32> %2, <4 x i32> poison, <8 x i32> <i32 3, i32 0, i32 1, i32 2, i32 3, i32 3, i32 3, i32 2>
%4 = extractelement <4 x i32> %2, i64 0
%sub.1 = sub nsw i32 %1, %4
%cmp15.1 = icmp sle i32 %sub.1, %0
%5 = extractelement <4 x i32> %2, i64 1
%sub.2 = sub nsw i32 %1, %5
%cmp15.2 = icmp sle i32 %sub.2, %0
%6 = extractelement <4 x i32> %2, i64 2
%sub.3 = sub nsw i32 %1, %6
%cmp15.3 = icmp sle i32 %sub.3, %0
%7 = extractelement <4 x i32> %2, i64 3
%sub.4 = sub nsw i32 %1, %7
%cmp15.4 = icmp sle i32 %sub.4, %0
%sub.141 = sub nsw i32 %4, %1
%cmp15.142 = icmp sle i32 %sub.141, %0
%8 = shufflevector <4 x i32> %2, <4 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
%9 = insertelement <8 x i32> %8, i32 %1, i64 6
%10 = shufflevector <8 x i32> %9, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 2, i32 1, i32 6, i32 1>
%11 = sub nsw <8 x i32> %3, %10
%12 = insertelement <8 x i32> poison, i32 %0, i64 0
%13 = shufflevector <8 x i32> %12, <8 x i32> poison, <8 x i32> zeroinitializer
%14 = icmp sgt <8 x i32> %11, %13
%sub.3.1 = sub nsw i32 %4, %6
%cmp15.3.1 = icmp sgt i32 %sub.3.1, %0
%sub.4.1 = sub nsw i32 %4, %7
%cmp15.4.1 = icmp sgt i32 %sub.4.1, %0
%sub.244 = sub nsw i32 %5, %1
%cmp15.245 = icmp sgt i32 %sub.244, %0
%sub.1.2 = sub nsw i32 %5, %4
%cmp15.1.2 = icmp sgt i32 %sub.1.2, %0
%sub.4.2 = sub nsw i32 %5, %7
%cmp15.4.2 = icmp sgt i32 %sub.4.2, %0
%sub.347 = sub nsw i32 %6, %1
%cmp15.348 = icmp sgt i32 %sub.347, %0
%sub.1.3 = sub nsw i32 %6, %4
%cmp15.1.3 = icmp sgt i32 %sub.1.3, %0
%15 = freeze <8 x i1> %14
%16 = bitcast <8 x i1> %15 to i8
%17 = icmp ne i8 %16, 0
%cmp15.1.3.fr = freeze i1 %cmp15.1.3
%op.rdx = or i1 %17, %cmp15.1.3.fr
%18 = freeze i1 %cmp15.348
%19 = freeze i1 %cmp15.1.2
%cmp15.245.fr = freeze i1 %cmp15.245
%op.rdx55 = or i1 %19, %cmp15.245.fr
%20 = freeze i1 %cmp15.4.1
%21 = or i1 %op.rdx, %18
%cmp15.4.2.fr = freeze i1 %cmp15.4.2
%op.rdx59 = or i1 %21, %cmp15.4.2.fr
%22 = or i1 %op.rdx55, %20
%23 = or i1 %op.rdx59, %22
%op.rdx62 = select i1 %23, i1 true, i1 %cmp15.3.1
%24 = freeze i1 %op.rdx62
%not. = xor i1 %24, true
%op.rdx64 = select i1 %not., i1 %cmp15, i1 false
%25 = select i1 %op.rdx64, i1 %cmp15.142, i1 false
%26 = select i1 %25, i1 %cmp15.4, i1 false
%27 = select i1 %26, i1 %cmp15.3, i1 false
%28 = select i1 %27, i1 %cmp15.2, i1 false
%29 = select i1 %28, i1 %cmp15.1, i1 false
%cmp22.not53 = icmp sgt i32 %0, -1
%cmp22.not = select i1 %29, i1 %cmp22.not53, i1 false
%.str.2..str.1 = select i1 %cmp22.not, ptr @.str.2, ptr @.str.1
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %densen) #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>
int main(void){
int a, b, c, d, e, k, ch=0;
scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &k);
int A[10]={a, b, c, d, e, k};
for(int i=0;i<5;i++){
for(int j=0;j<5;j++){
if((i!=j) && (A[i]>A[j]) && (A[i]-A[j] >= (k+1) )){
ch+=1;
}else if((i!=j) && (A[i]<A[j]) && (A[j]-A[i]>= (k+1) )){
ch+=1;
}
}
}
if(ch==0){
printf("Yay!\n");
}else{
printf(":(\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202294/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202294/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c":(\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
land.lhs.true.1:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%4 = load i32, ptr %e, align 4, !tbaa !5
%5 = load i32, ptr %k, align 4, !tbaa !5
%cmp13.1 = icmp sgt i32 %0, %1
%sub.1 = sub nsw i32 %0, %1
%cmp19.not.not.1 = icmp sgt i32 %sub.1, %5
%or.cond.1 = select i1 %cmp13.1, i1 %cmp19.not.not.1, i1 false
br i1 %or.cond.1, label %land.lhs.true.2, label %land.lhs.true22.1
land.lhs.true22.1: ; preds = %land.lhs.true.1
%cmp27.1 = icmp slt i32 %0, %1
br i1 %cmp27.1, label %land.lhs.true28.1, label %land.lhs.true.2
land.lhs.true28.1: ; preds = %land.lhs.true22.1
%sub33.1 = sub nsw i32 %1, %0
%cmp35.not.not.1 = icmp sgt i32 %sub33.1, %5
%add37.1 = zext i1 %cmp35.not.not.1 to i32
br label %land.lhs.true.2
land.lhs.true.2: ; preds = %land.lhs.true22.1, %land.lhs.true28.1, %land.lhs.true.1
%ch.2.1 = phi i32 [ 0, %land.lhs.true22.1 ], [ %add37.1, %land.lhs.true28.1 ], [ 1, %land.lhs.true.1 ]
%cmp13.2 = icmp sgt i32 %0, %2
%sub.2 = sub nsw i32 %0, %2
%cmp19.not.not.2 = icmp sgt i32 %sub.2, %5
%or.cond.2 = select i1 %cmp13.2, i1 %cmp19.not.not.2, i1 false
br i1 %or.cond.2, label %if.then.2, label %land.lhs.true22.2
land.lhs.true22.2: ; preds = %land.lhs.true.2
%cmp27.2 = icmp slt i32 %0, %2
br i1 %cmp27.2, label %land.lhs.true28.2, label %land.lhs.true.3
land.lhs.true28.2: ; preds = %land.lhs.true22.2
%sub33.2 = sub nsw i32 %2, %0
%cmp35.not.not.2 = icmp sgt i32 %sub33.2, %5
%add37.2 = zext i1 %cmp35.not.not.2 to i32
%spec.select.2 = add nuw nsw i32 %ch.2.1, %add37.2
br label %land.lhs.true.3
if.then.2: ; preds = %land.lhs.true.2
%add20.2 = add nuw nsw i32 %ch.2.1, 1
br label %land.lhs.true.3
land.lhs.true.3: ; preds = %land.lhs.true22.2, %land.lhs.true28.2, %if.then.2
%ch.2.2 = phi i32 [ %add20.2, %if.then.2 ], [ %ch.2.1, %land.lhs.true22.2 ], [ %spec.select.2, %land.lhs.true28.2 ]
%cmp13.3 = icmp sgt i32 %0, %3
%sub.3 = sub nsw i32 %0, %3
%cmp19.not.not.3 = icmp sgt i32 %sub.3, %5
%or.cond.3 = select i1 %cmp13.3, i1 %cmp19.not.not.3, i1 false
br i1 %or.cond.3, label %if.then.3, label %land.lhs.true22.3
land.lhs.true22.3: ; preds = %land.lhs.true.3
%cmp27.3 = icmp slt i32 %0, %3
br i1 %cmp27.3, label %land.lhs.true28.3, label %land.lhs.true.4
land.lhs.true28.3: ; preds = %land.lhs.true22.3
%sub33.3 = sub nsw i32 %3, %0
%cmp35.not.not.3 = icmp sgt i32 %sub33.3, %5
%add37.3 = zext i1 %cmp35.not.not.3 to i32
%spec.select.3 = add nuw nsw i32 %ch.2.2, %add37.3
br label %land.lhs.true.4
if.then.3: ; preds = %land.lhs.true.3
%add20.3 = add nuw nsw i32 %ch.2.2, 1
br label %land.lhs.true.4
land.lhs.true.4: ; preds = %land.lhs.true22.3, %land.lhs.true28.3, %if.then.3
%ch.2.3 = phi i32 [ %add20.3, %if.then.3 ], [ %ch.2.2, %land.lhs.true22.3 ], [ %spec.select.3, %land.lhs.true28.3 ]
%cmp13.4 = icmp sgt i32 %0, %4
%sub.4 = sub nsw i32 %0, %4
%cmp19.not.not.4 = icmp sgt i32 %sub.4, %5
%or.cond.4 = select i1 %cmp13.4, i1 %cmp19.not.not.4, i1 false
br i1 %or.cond.4, label %if.then.4, label %land.lhs.true22.4
land.lhs.true22.4: ; preds = %land.lhs.true.4
%cmp27.4 = icmp slt i32 %0, %4
br i1 %cmp27.4, label %land.lhs.true28.4, label %land.lhs.true.179
land.lhs.true28.4: ; preds = %land.lhs.true22.4
%sub33.4 = sub nsw i32 %4, %0
%cmp35.not.not.4 = icmp sgt i32 %sub33.4, %5
%add37.4 = zext i1 %cmp35.not.not.4 to i32
%spec.select.4 = add nuw nsw i32 %ch.2.3, %add37.4
br label %land.lhs.true.179
if.then.4: ; preds = %land.lhs.true.4
%add20.4 = add nuw nsw i32 %ch.2.3, 1
br label %land.lhs.true.179
land.lhs.true.179: ; preds = %land.lhs.true22.4, %land.lhs.true28.4, %if.then.4
%ch.2.4 = phi i32 [ %add20.4, %if.then.4 ], [ %ch.2.3, %land.lhs.true22.4 ], [ %spec.select.4, %land.lhs.true28.4 ]
%cmp13.175 = icmp sgt i32 %1, %0
%sub.176 = sub nsw i32 %1, %0
%cmp19.not.not.177 = icmp sgt i32 %sub.176, %5
%or.cond.178 = select i1 %cmp13.175, i1 %cmp19.not.not.177, i1 false
br i1 %or.cond.178, label %if.then.188, label %land.lhs.true22.181
land.lhs.true22.181: ; preds = %land.lhs.true.179
%cmp27.180 = icmp slt i32 %1, %0
br i1 %cmp27.180, label %land.lhs.true28.186, label %land.lhs.true.2.1
land.lhs.true28.186: ; preds = %land.lhs.true22.181
%sub33.182 = sub nsw i32 %0, %1
%cmp35.not.not.183 = icmp sgt i32 %sub33.182, %5
%add37.184 = zext i1 %cmp35.not.not.183 to i32
%spec.select.185 = add nuw nsw i32 %ch.2.4, %add37.184
br label %land.lhs.true.2.1
if.then.188: ; preds = %land.lhs.true.179
%add20.187 = add nuw nsw i32 %ch.2.4, 1
br label %land.lhs.true.2.1
land.lhs.true.2.1: ; preds = %if.then.188, %land.lhs.true28.186, %land.lhs.true22.181
%ch.2.189 = phi i32 [ %add20.187, %if.then.188 ], [ %ch.2.4, %land.lhs.true22.181 ], [ %spec.select.185, %land.lhs.true28.186 ]
%cmp13.2.1 = icmp sgt i32 %1, %2
%sub.2.1 = sub nsw i32 %1, %2
%cmp19.not.not.2.1 = icmp sgt i32 %sub.2.1, %5
%or.cond.2.1 = select i1 %cmp13.2.1, i1 %cmp19.not.not.2.1, i1 false
br i1 %or.cond.2.1, label %if.then.2.1, label %land.lhs.true22.2.1
land.lhs.true22.2.1: ; preds = %land.lhs.true.2.1
%cmp27.2.1 = icmp slt i32 %1, %2
br i1 %cmp27.2.1, label %land.lhs.true28.2.1, label %land.lhs.true.3.1
land.lhs.true28.2.1: ; preds = %land.lhs.true22.2.1
%sub33.2.1 = sub nsw i32 %2, %1
%cmp35.not.not.2.1 = icmp sgt i32 %sub33.2.1, %5
%add37.2.1 = zext i1 %cmp35.not.not.2.1 to i32
%spec.select.2.1 = add nuw nsw i32 %ch.2.189, %add37.2.1
br label %land.lhs.true.3.1
if.then.2.1: ; preds = %land.lhs.true.2.1
%add20.2.1 = add nuw nsw i32 %ch.2.189, 1
br label %land.lhs.true.3.1
land.lhs.true.3.1: ; preds = %land.lhs.true22.2.1, %land.lhs.true28.2.1, %if.then.2.1
%ch.2.2.1 = phi i32 [ %add20.2.1, %if.then.2.1 ], [ %ch.2.189, %land.lhs.true22.2.1 ], [ %spec.select.2.1, %land.lhs.true28.2.1 ]
%cmp13.3.1 = icmp sgt i32 %1, %3
%sub.3.1 = sub nsw i32 %1, %3
%cmp19.not.not.3.1 = icmp sgt i32 %sub.3.1, %5
%or.cond.3.1 = select i1 %cmp13.3.1, i1 %cmp19.not.not.3.1, i1 false
br i1 %or.cond.3.1, label %if.then.3.1, label %land.lhs.true22.3.1
land.lhs.true22.3.1: ; preds = %land.lhs.true.3.1
%cmp27.3.1 = icmp slt i32 %1, %3
br i1 %cmp27.3.1, label %land.lhs.true28.3.1, label %land.lhs.true.4.1
land.lhs.true28.3.1: ; preds = %land.lhs.true22.3.1
%sub33.3.1 = sub nsw i32 %3, %1
%cmp35.not.not.3.1 = icmp sgt i32 %sub33.3.1, %5
%add37.3.1 = zext i1 %cmp35.not.not.3.1 to i32
%spec.select.3.1 = add nuw nsw i32 %ch.2.2.1, %add37.3.1
br label %land.lhs.true.4.1
if.then.3.1: ; preds = %land.lhs.true.3.1
%add20.3.1 = add nuw nsw i32 %ch.2.2.1, 1
br label %land.lhs.true.4.1
land.lhs.true.4.1: ; preds = %land.lhs.true22.3.1, %land.lhs.true28.3.1, %if.then.3.1
%ch.2.3.1 = phi i32 [ %add20.3.1, %if.then.3.1 ], [ %ch.2.2.1, %land.lhs.true22.3.1 ], [ %spec.select.3.1, %land.lhs.true28.3.1 ]
%cmp13.4.1 = icmp sgt i32 %1, %4
%sub.4.1 = sub nsw i32 %1, %4
%cmp19.not.not.4.1 = icmp sgt i32 %sub.4.1, %5
%or.cond.4.1 = select i1 %cmp13.4.1, i1 %cmp19.not.not.4.1, i1 false
br i1 %or.cond.4.1, label %if.then.4.1, label %land.lhs.true22.4.1
land.lhs.true22.4.1: ; preds = %land.lhs.true.4.1
%cmp27.4.1 = icmp slt i32 %1, %4
br i1 %cmp27.4.1, label %land.lhs.true28.4.1, label %land.lhs.true.296
land.lhs.true28.4.1: ; preds = %land.lhs.true22.4.1
%sub33.4.1 = sub nsw i32 %4, %1
%cmp35.not.not.4.1 = icmp sgt i32 %sub33.4.1, %5
%add37.4.1 = zext i1 %cmp35.not.not.4.1 to i32
%spec.select.4.1 = add nuw nsw i32 %ch.2.3.1, %add37.4.1
br label %land.lhs.true.296
if.then.4.1: ; preds = %land.lhs.true.4.1
%add20.4.1 = add nuw nsw i32 %ch.2.3.1, 1
br label %land.lhs.true.296
land.lhs.true.296: ; preds = %land.lhs.true22.4.1, %land.lhs.true28.4.1, %if.then.4.1
%ch.2.4.1 = phi i32 [ %add20.4.1, %if.then.4.1 ], [ %ch.2.3.1, %land.lhs.true22.4.1 ], [ %spec.select.4.1, %land.lhs.true28.4.1 ]
%cmp13.292 = icmp sgt i32 %2, %0
%sub.293 = sub nsw i32 %2, %0
%cmp19.not.not.294 = icmp sgt i32 %sub.293, %5
%or.cond.295 = select i1 %cmp13.292, i1 %cmp19.not.not.294, i1 false
br i1 %or.cond.295, label %if.then.2105, label %land.lhs.true22.298
land.lhs.true22.298: ; preds = %land.lhs.true.296
%cmp27.297 = icmp slt i32 %2, %0
br i1 %cmp27.297, label %land.lhs.true28.2103, label %land.lhs.true.1.2
land.lhs.true28.2103: ; preds = %land.lhs.true22.298
%sub33.299 = sub nsw i32 %0, %2
%cmp35.not.not.2100 = icmp sgt i32 %sub33.299, %5
%add37.2101 = zext i1 %cmp35.not.not.2100 to i32
%spec.select.2102 = add nuw nsw i32 %ch.2.4.1, %add37.2101
br label %land.lhs.true.1.2
if.then.2105: ; preds = %land.lhs.true.296
%add20.2104 = add nuw nsw i32 %ch.2.4.1, 1
br label %land.lhs.true.1.2
land.lhs.true.1.2: ; preds = %land.lhs.true22.298, %land.lhs.true28.2103, %if.then.2105
%ch.2.2106 = phi i32 [ %add20.2104, %if.then.2105 ], [ %ch.2.4.1, %land.lhs.true22.298 ], [ %spec.select.2102, %land.lhs.true28.2103 ]
%cmp13.1.2 = icmp sgt i32 %2, %1
%sub.1.2 = sub nsw i32 %2, %1
%cmp19.not.not.1.2 = icmp sgt i32 %sub.1.2, %5
%or.cond.1.2 = select i1 %cmp13.1.2, i1 %cmp19.not.not.1.2, i1 false
br i1 %or.cond.1.2, label %if.then.1.2, label %land.lhs.true22.1.2
land.lhs.true22.1.2: ; preds = %land.lhs.true.1.2
%cmp27.1.2 = icmp slt i32 %2, %1
br i1 %cmp27.1.2, label %land.lhs.true28.1.2, label %land.lhs.true.3.2
land.lhs.true28.1.2: ; preds = %land.lhs.true22.1.2
%sub33.1.2 = sub nsw i32 %1, %2
%cmp35.not.not.1.2 = icmp sgt i32 %sub33.1.2, %5
%add37.1.2 = zext i1 %cmp35.not.not.1.2 to i32
%spec.select.1.2 = add nuw nsw i32 %ch.2.2106, %add37.1.2
br label %land.lhs.true.3.2
if.then.1.2: ; preds = %land.lhs.true.1.2
%add20.1.2 = add nuw nsw i32 %ch.2.2106, 1
br label %land.lhs.true.3.2
land.lhs.true.3.2: ; preds = %if.then.1.2, %land.lhs.true28.1.2, %land.lhs.true22.1.2
%ch.2.1.2 = phi i32 [ %add20.1.2, %if.then.1.2 ], [ %ch.2.2106, %land.lhs.true22.1.2 ], [ %spec.select.1.2, %land.lhs.true28.1.2 ]
%cmp13.3.2 = icmp sgt i32 %2, %3
%sub.3.2 = sub nsw i32 %2, %3
%cmp19.not.not.3.2 = icmp sgt i32 %sub.3.2, %5
%or.cond.3.2 = select i1 %cmp13.3.2, i1 %cmp19.not.not.3.2, i1 false
br i1 %or.cond.3.2, label %if.then.3.2, label %land.lhs.true22.3.2
land.lhs.true22.3.2: ; preds = %land.lhs.true.3.2
%cmp27.3.2 = icmp slt i32 %2, %3
br i1 %cmp27.3.2, label %land.lhs.true28.3.2, label %land.lhs.true.4.2
land.lhs.true28.3.2: ; preds = %land.lhs.true22.3.2
%sub33.3.2 = sub nsw i32 %3, %2
%cmp35.not.not.3.2 = icmp sgt i32 %sub33.3.2, %5
%add37.3.2 = zext i1 %cmp35.not.not.3.2 to i32
%spec.select.3.2 = add nuw nsw i32 %ch.2.1.2, %add37.3.2
br label %land.lhs.true.4.2
if.then.3.2: ; preds = %land.lhs.true.3.2
%add20.3.2 = add nuw nsw i32 %ch.2.1.2, 1
br label %land.lhs.true.4.2
land.lhs.true.4.2: ; preds = %land.lhs.true22.3.2, %land.lhs.true28.3.2, %if.then.3.2
%ch.2.3.2 = phi i32 [ %add20.3.2, %if.then.3.2 ], [ %ch.2.1.2, %land.lhs.true22.3.2 ], [ %spec.select.3.2, %land.lhs.true28.3.2 ]
%cmp13.4.2 = icmp sgt i32 %2, %4
%sub.4.2 = sub nsw i32 %2, %4
%cmp19.not.not.4.2 = icmp sgt i32 %sub.4.2, %5
%or.cond.4.2 = select i1 %cmp13.4.2, i1 %cmp19.not.not.4.2, i1 false
br i1 %or.cond.4.2, label %if.then.4.2, label %land.lhs.true22.4.2
land.lhs.true22.4.2: ; preds = %land.lhs.true.4.2
%cmp27.4.2 = icmp slt i32 %2, %4
br i1 %cmp27.4.2, label %land.lhs.true28.4.2, label %land.lhs.true.3113
land.lhs.true28.4.2: ; preds = %land.lhs.true22.4.2
%sub33.4.2 = sub nsw i32 %4, %2
%cmp35.not.not.4.2 = icmp sgt i32 %sub33.4.2, %5
%add37.4.2 = zext i1 %cmp35.not.not.4.2 to i32
%spec.select.4.2 = add nuw nsw i32 %ch.2.3.2, %add37.4.2
br label %land.lhs.true.3113
if.then.4.2: ; preds = %land.lhs.true.4.2
%add20.4.2 = add nuw nsw i32 %ch.2.3.2, 1
br label %land.lhs.true.3113
land.lhs.true.3113: ; preds = %land.lhs.true22.4.2, %land.lhs.true28.4.2, %if.then.4.2
%ch.2.4.2 = phi i32 [ %add20.4.2, %if.then.4.2 ], [ %ch.2.3.2, %land.lhs.true22.4.2 ], [ %spec.select.4.2, %land.lhs.true28.4.2 ]
%cmp13.3109 = icmp sgt i32 %3, %0
%sub.3110 = sub nsw i32 %3, %0
%cmp19.not.not.3111 = icmp sgt i32 %sub.3110, %5
%or.cond.3112 = select i1 %cmp13.3109, i1 %cmp19.not.not.3111, i1 false
br i1 %or.cond.3112, label %if.then.3122, label %land.lhs.true22.3115
land.lhs.true22.3115: ; preds = %land.lhs.true.3113
%cmp27.3114 = icmp slt i32 %3, %0
br i1 %cmp27.3114, label %land.lhs.true28.3120, label %land.lhs.true.1.3
land.lhs.true28.3120: ; preds = %land.lhs.true22.3115
%sub33.3116 = sub nsw i32 %0, %3
%cmp35.not.not.3117 = icmp sgt i32 %sub33.3116, %5
%add37.3118 = zext i1 %cmp35.not.not.3117 to i32
%spec.select.3119 = add nuw nsw i32 %ch.2.4.2, %add37.3118
br label %land.lhs.true.1.3
if.then.3122: ; preds = %land.lhs.true.3113
%add20.3121 = add nuw nsw i32 %ch.2.4.2, 1
br label %land.lhs.true.1.3
land.lhs.true.1.3: ; preds = %land.lhs.true22.3115, %land.lhs.true28.3120, %if.then.3122
%ch.2.3123 = phi i32 [ %add20.3121, %if.then.3122 ], [ %ch.2.4.2, %land.lhs.true22.3115 ], [ %spec.select.3119, %land.lhs.true28.3120 ]
%cmp13.1.3 = icmp sgt i32 %3, %1
%sub.1.3 = sub nsw i32 %3, %1
%cmp19.not.not.1.3 = icmp sgt i32 %sub.1.3, %5
%or.cond.1.3 = select i1 %cmp13.1.3, i1 %cmp19.not.not.1.3, i1 false
br i1 %or.cond.1.3, label %if.then.1.3, label %land.lhs.true22.1.3
land.lhs.true22.1.3: ; preds = %land.lhs.true.1.3
%cmp27.1.3 = icmp slt i32 %3, %1
br i1 %cmp27.1.3, label %land.lhs.true28.1.3, label %land.lhs.true.2.3
land.lhs.true28.1.3: ; preds = %land.lhs.true22.1.3
%sub33.1.3 = sub nsw i32 %1, %3
%cmp35.not.not.1.3 = icmp sgt i32 %sub33.1.3, %5
%add37.1.3 = zext i1 %cmp35.not.not.1.3 to i32
%spec.select.1.3 = add nuw nsw i32 %ch.2.3123, %add37.1.3
br label %land.lhs.true.2.3
if.then.1.3: ; preds = %land.lhs.true.1.3
%add20.1.3 = add nuw nsw i32 %ch.2.3123, 1
br label %land.lhs.true.2.3
land.lhs.true.2.3: ; preds = %land.lhs.true22.1.3, %land.lhs.true28.1.3, %if.then.1.3
%ch.2.1.3 = phi i32 [ %add20.1.3, %if.then.1.3 ], [ %ch.2.3123, %land.lhs.true22.1.3 ], [ %spec.select.1.3, %land.lhs.true28.1.3 ]
%cmp13.2.3 = icmp sgt i32 %3, %2
%sub.2.3 = sub nsw i32 %3, %2
%cmp19.not.not.2.3 = icmp sgt i32 %sub.2.3, %5
%or.cond.2.3 = select i1 %cmp13.2.3, i1 %cmp19.not.not.2.3, i1 false
br i1 %or.cond.2.3, label %if.then.2.3, label %land.lhs.true22.2.3
land.lhs.true22.2.3: ; preds = %land.lhs.true.2.3
%cmp27.2.3 = icmp slt i32 %3, %2
br i1 %cmp27.2.3, label %land.lhs.true28.2.3, label %land.lhs.true.4.3
land.lhs.true28.2.3: ; preds = %land.lhs.true22.2.3
%sub33.2.3 = sub nsw i32 %2, %3
%cmp35.not.not.2.3 = icmp sgt i32 %sub33.2.3, %5
%add37.2.3 = zext i1 %cmp35.not.not.2.3 to i32
%spec.select.2.3 = add nuw nsw i32 %ch.2.1.3, %add37.2.3
br label %land.lhs.true.4.3
if.then.2.3: ; preds = %land.lhs.true.2.3
%add20.2.3 = add nuw nsw i32 %ch.2.1.3, 1
br label %land.lhs.true.4.3
land.lhs.true.4.3: ; preds = %if.then.2.3, %land.lhs.true28.2.3, %land.lhs.true22.2.3
%ch.2.2.3 = phi i32 [ %add20.2.3, %if.then.2.3 ], [ %ch.2.1.3, %land.lhs.true22.2.3 ], [ %spec.select.2.3, %land.lhs.true28.2.3 ]
%cmp13.4.3 = icmp sgt i32 %3, %4
%sub.4.3 = sub nsw i32 %3, %4
%cmp19.not.not.4.3 = icmp sgt i32 %sub.4.3, %5
%or.cond.4.3 = select i1 %cmp13.4.3, i1 %cmp19.not.not.4.3, i1 false
br i1 %or.cond.4.3, label %if.then.4.3, label %land.lhs.true22.4.3
land.lhs.true22.4.3: ; preds = %land.lhs.true.4.3
%cmp27.4.3 = icmp slt i32 %3, %4
br i1 %cmp27.4.3, label %land.lhs.true28.4.3, label %land.lhs.true.4130
land.lhs.true28.4.3: ; preds = %land.lhs.true22.4.3
%sub33.4.3 = sub nsw i32 %4, %3
%cmp35.not.not.4.3 = icmp sgt i32 %sub33.4.3, %5
%add37.4.3 = zext i1 %cmp35.not.not.4.3 to i32
%spec.select.4.3 = add nuw nsw i32 %ch.2.2.3, %add37.4.3
br label %land.lhs.true.4130
if.then.4.3: ; preds = %land.lhs.true.4.3
%add20.4.3 = add nuw nsw i32 %ch.2.2.3, 1
br label %land.lhs.true.4130
land.lhs.true.4130: ; preds = %land.lhs.true22.4.3, %land.lhs.true28.4.3, %if.then.4.3
%ch.2.4.3 = phi i32 [ %add20.4.3, %if.then.4.3 ], [ %ch.2.2.3, %land.lhs.true22.4.3 ], [ %spec.select.4.3, %land.lhs.true28.4.3 ]
%cmp13.4126 = icmp sgt i32 %4, %0
%sub.4127 = sub nsw i32 %4, %0
%cmp19.not.not.4128 = icmp sgt i32 %sub.4127, %5
%or.cond.4129 = select i1 %cmp13.4126, i1 %cmp19.not.not.4128, i1 false
br i1 %or.cond.4129, label %if.then.4139, label %land.lhs.true22.4132
land.lhs.true22.4132: ; preds = %land.lhs.true.4130
%cmp27.4131 = icmp slt i32 %4, %0
br i1 %cmp27.4131, label %land.lhs.true28.4137, label %land.lhs.true.1.4
land.lhs.true28.4137: ; preds = %land.lhs.true22.4132
%sub33.4133 = sub nsw i32 %0, %4
%cmp35.not.not.4134 = icmp sgt i32 %sub33.4133, %5
%add37.4135 = zext i1 %cmp35.not.not.4134 to i32
%spec.select.4136 = add nuw nsw i32 %ch.2.4.3, %add37.4135
br label %land.lhs.true.1.4
if.then.4139: ; preds = %land.lhs.true.4130
%add20.4138 = add nuw nsw i32 %ch.2.4.3, 1
br label %land.lhs.true.1.4
land.lhs.true.1.4: ; preds = %land.lhs.true22.4132, %land.lhs.true28.4137, %if.then.4139
%ch.2.4140 = phi i32 [ %add20.4138, %if.then.4139 ], [ %ch.2.4.3, %land.lhs.true22.4132 ], [ %spec.select.4136, %land.lhs.true28.4137 ]
%cmp13.1.4 = icmp sgt i32 %4, %1
%sub.1.4 = sub nsw i32 %4, %1
%cmp19.not.not.1.4 = icmp sgt i32 %sub.1.4, %5
%or.cond.1.4 = select i1 %cmp13.1.4, i1 %cmp19.not.not.1.4, i1 false
br i1 %or.cond.1.4, label %if.then.1.4, label %land.lhs.true22.1.4
land.lhs.true22.1.4: ; preds = %land.lhs.true.1.4
%cmp27.1.4 = icmp slt i32 %4, %1
br i1 %cmp27.1.4, label %land.lhs.true28.1.4, label %land.lhs.true.2.4
land.lhs.true28.1.4: ; preds = %land.lhs.true22.1.4
%sub33.1.4 = sub nsw i32 %1, %4
%cmp35.not.not.1.4 = icmp sgt i32 %sub33.1.4, %5
%add37.1.4 = zext i1 %cmp35.not.not.1.4 to i32
%spec.select.1.4 = add nuw nsw i32 %ch.2.4140, %add37.1.4
br label %land.lhs.true.2.4
if.then.1.4: ; preds = %land.lhs.true.1.4
%add20.1.4 = add nuw nsw i32 %ch.2.4140, 1
br label %land.lhs.true.2.4
land.lhs.true.2.4: ; preds = %land.lhs.true22.1.4, %land.lhs.true28.1.4, %if.then.1.4
%ch.2.1.4 = phi i32 [ %add20.1.4, %if.then.1.4 ], [ %ch.2.4140, %land.lhs.true22.1.4 ], [ %spec.select.1.4, %land.lhs.true28.1.4 ]
%cmp13.2.4 = icmp sgt i32 %4, %2
%sub.2.4 = sub nsw i32 %4, %2
%cmp19.not.not.2.4 = icmp sgt i32 %sub.2.4, %5
%or.cond.2.4 = select i1 %cmp13.2.4, i1 %cmp19.not.not.2.4, i1 false
br i1 %or.cond.2.4, label %if.then.2.4, label %land.lhs.true22.2.4
land.lhs.true22.2.4: ; preds = %land.lhs.true.2.4
%cmp27.2.4 = icmp slt i32 %4, %2
br i1 %cmp27.2.4, label %land.lhs.true28.2.4, label %land.lhs.true.3.4
land.lhs.true28.2.4: ; preds = %land.lhs.true22.2.4
%sub33.2.4 = sub nsw i32 %2, %4
%cmp35.not.not.2.4 = icmp sgt i32 %sub33.2.4, %5
%add37.2.4 = zext i1 %cmp35.not.not.2.4 to i32
%spec.select.2.4 = add nuw nsw i32 %ch.2.1.4, %add37.2.4
br label %land.lhs.true.3.4
if.then.2.4: ; preds = %land.lhs.true.2.4
%add20.2.4 = add nuw nsw i32 %ch.2.1.4, 1
br label %land.lhs.true.3.4
land.lhs.true.3.4: ; preds = %land.lhs.true22.2.4, %land.lhs.true28.2.4, %if.then.2.4
%ch.2.2.4 = phi i32 [ %add20.2.4, %if.then.2.4 ], [ %ch.2.1.4, %land.lhs.true22.2.4 ], [ %spec.select.2.4, %land.lhs.true28.2.4 ]
%cmp13.3.4 = icmp sgt i32 %4, %3
%sub.3.4 = sub nsw i32 %4, %3
%cmp19.not.not.3.4 = icmp sgt i32 %sub.3.4, %5
%or.cond.3.4 = select i1 %cmp13.3.4, i1 %cmp19.not.not.3.4, i1 false
br i1 %or.cond.3.4, label %if.else45, label %land.lhs.true22.3.4
land.lhs.true22.3.4: ; preds = %land.lhs.true.3.4
%cmp27.3.4 = icmp slt i32 %4, %3
%sub33.3.4 = sub nsw i32 %3, %4
%cmp35.not.not.3.4 = icmp sgt i32 %sub33.3.4, %5
%narrow = select i1 %cmp27.3.4, i1 %cmp35.not.not.3.4, i1 false
%spec.select.3.4.neg = sext i1 %narrow to i32
%cmp42 = icmp eq i32 %ch.2.2.4, %spec.select.3.4.neg
br i1 %cmp42, label %if.end47, label %if.else45
if.else45: ; preds = %land.lhs.true.3.4, %land.lhs.true22.3.4
br label %if.end47
if.end47: ; preds = %land.lhs.true22.3.4, %if.else45
%str.sink = phi ptr [ @str, %if.else45 ], [ @str.3, %land.lhs.true22.3.4 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,c,d,e,k;
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&k);
if( e - a > k){
printf(":(\n");
}else{
printf("Yay!");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202337/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202337/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
@str = private unnamed_addr constant [3 x i8] c":(\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
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
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.end
if.else: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int A[6];
int k;
for (int i=0; i<5; i++) {
scanf("%d",&A[i]);
}
scanf("%d",&k);
if(A[4]-A[0]>k){
printf(":(\n");
}
else{
printf("Yay!\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202380/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202380/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [6 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %A) #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 %A)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%1 = load i32, ptr %A, align 16, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %sub, %2
%str.3.str = select i1 %cmp4, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a, b, c, d, e, k;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
scanf("%d", &d);
scanf("%d", &e);
scanf("%d", &k);
if ((e - a) <= k) printf("Yay!");
else printf(":(");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202423/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202423/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yay!\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c":(\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
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %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)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %sub, %2
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a, b, c, d, e, k;
scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &k);
if (e - a > k)
printf(":(\n");
else
printf("Yay!\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202474/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202474/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\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
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %e, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int x[6];
int i,j;
int n=0;
for(i=0;i<6;i++){
scanf("%d",&x[i]);
}
for(j=4;j>0;j--){
if(x[j]-x[0]>x[5]) n++;
}
for(j=4;j>1;j--){
if(x[j]-x[1]>x[5]) n++;
}
for(j=4;j>2;j--){
if(x[j]-x[2]>x[5]) n++;
}
for (j=4;j>3;j--){
if(x[j]-x[3]>x[5]) n++;
}
if(n==0) printf("Yay!\n");
else printf(":(\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202524/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202524/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c":(\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%0 = load <4 x i32>, ptr %x, align 16
%1 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%2 = load <4 x i32>, ptr %arrayidx.1, align 4, !tbaa !5
%3 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> zeroinitializer
%4 = sub nsw <4 x i32> %2, %3
%5 = insertelement <4 x i32> poison, i32 %1, i64 0
%6 = shufflevector <4 x i32> %5, <4 x i32> poison, <4 x i32> zeroinitializer
%7 = icmp sgt <4 x i32> %4, %6
%8 = extractelement <4 x i32> %2, i64 3
%9 = extractelement <4 x i32> %2, i64 2
%10 = extractelement <4 x i32> %2, i64 1
%11 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 3>
%12 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> <i32 0, i32 0, i32 0, i32 1>
%13 = sub nsw <4 x i32> %11, %12
%14 = icmp sgt <4 x i32> %13, %6
%sub33.1 = sub nsw i32 %9, %10
%cmp35.1 = icmp sgt i32 %sub33.1, %1
%inc37.1 = zext i1 %cmp35.1 to i32
%15 = bitcast <4 x i1> %7 to i4
%16 = call i4 @llvm.ctpop.i4(i4 %15), !range !9
%17 = bitcast <4 x i1> %14 to i4
%18 = call i4 @llvm.ctpop.i4(i4 %17), !range !9
%narrow = add nuw i4 %16, %18
%op.rdx = zext i4 %narrow to i32
%op.rdx95 = add nuw nsw i32 %op.rdx, %inc37.1
%sub48 = sub nsw i32 %8, %9
%cmp50 = icmp sgt i32 %sub48, %1
%inc52.neg = sext i1 %cmp50 to i32
%cmp57 = icmp eq i32 %op.rdx95, %inc52.neg
%str.3.str = select i1 %cmp57, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %x) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i4 0, i4 5}
|
#include <stdio.h>
int main() {
int a[5], k;
int i, j, tmp;
for ( i = 0; i < 5; i++ ) {
scanf("%d", &a[i]);
}
scanf("%d", &k);
if ( a[4] - a[0] > k ) {
printf(":(\n");
}
else {
printf("Yay!\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202568/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202568/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"Yay!\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c":(\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [5 x i32], align 16
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %a) #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 %a)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %a, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%1 = load i32, ptr %a, align 16, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %sub, %2
%str.3.str = select i1 %cmp4, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c,d,e,k;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);
scanf("%d",&k);
int way[5];
way[0]=a;
way[1]=b;
way[2]=c;
way[3]=d;
way[4]=e;
for(int i = 0;i < 5;i++){
for(int j = i;j < 5;j++){
if(way[j] - way[i] > k){
printf(":(\n");
return 0;
}
}
}
printf("Yay!\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202610/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202610/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c":(\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"Yay!\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
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %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)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%4 = load i32, ptr %e, align 4, !tbaa !5
%5 = load i32, ptr %k, align 4, !tbaa !5
%cmp17 = icmp slt i32 %5, 0
%sub.152 = sub nsw i32 %1, %0
%cmp17.153 = icmp sgt i32 %sub.152, %5
%or.cond = select i1 %cmp17, i1 true, i1 %cmp17.153
%sub.257 = sub nsw i32 %2, %0
%cmp17.258 = icmp sgt i32 %sub.257, %5
%or.cond86 = select i1 %or.cond, i1 true, i1 %cmp17.258
%sub.362 = sub nsw i32 %3, %0
%cmp17.363 = icmp sgt i32 %sub.362, %5
%or.cond87 = select i1 %or.cond86, i1 true, i1 %cmp17.363
%sub.467 = sub nsw i32 %4, %0
%cmp17.468 = icmp sgt i32 %sub.467, %5
%or.cond88 = select i1 %or.cond87, i1 true, i1 %cmp17.468
%sub.1.1 = sub nsw i32 %2, %1
%cmp17.1.1 = icmp sgt i32 %sub.1.1, %5
%or.cond89 = select i1 %or.cond88, i1 true, i1 %cmp17.1.1
%sub.1.2 = sub nsw i32 %3, %1
%cmp17.1.2 = icmp sgt i32 %sub.1.2, %5
%or.cond90 = select i1 %or.cond89, i1 true, i1 %cmp17.1.2
%sub.1.3 = sub nsw i32 %4, %1
%cmp17.1.3 = icmp sgt i32 %sub.1.3, %5
%or.cond91 = select i1 %or.cond90, i1 true, i1 %cmp17.1.3
%sub.2.1 = sub nsw i32 %3, %2
%cmp17.2.1 = icmp sgt i32 %sub.2.1, %5
%or.cond92 = select i1 %or.cond91, i1 true, i1 %cmp17.2.1
%sub.2.2 = sub nsw i32 %4, %2
%cmp17.2.2 = icmp sgt i32 %sub.2.2, %5
%or.cond93 = select i1 %or.cond92, i1 true, i1 %cmp17.2.2
%sub.3.1 = sub nsw i32 %4, %3
%cmp17.3.1 = icmp sgt i32 %sub.3.1, %5
%or.cond94 = select i1 %or.cond93, i1 true, i1 %cmp17.3.1
%str.str.3 = select i1 %or.cond94, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void){
int A,B,C,a,b,c,d,e,k,i,j,cou,v[1000000];
char S[100000];
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&e);
scanf("%d",&k);
if(e-a>k){
printf(":(");
}else{
printf("Yay!");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202654/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202654/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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":(\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"Yay!\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
%e = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #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 %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)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %e, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp sgt i32 %sub, %2
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int P[8][8],H,W,C,i,j,mv[5]={0,-1,0,1,0};
int ch(int p[8][8],int h,int w,int c,int nc)
{
int i,nh,nw,res=0;
if(nc==-1)res++;
if(p[h][w]==c)
{
p[h][w]=nc;
for(i=0;i<4;i++)
{
nh=h+mv[i],nw=w+mv[i+1];
if(0<=nh&&0<=nw&&nh<H&&nw<W&&p[nh][nw]==c)
{
res+=ch(p,nh,nw,c,nc);
}
}
}
return res;
}
int dfs(int p[8][8],int c,int d)
{
int t[8][8],res=0,i,tm;
if(d==5)
{
if(p[0][0]==C)
return ch(p,0,0,p[0][0],-1);
return 0;
}
for(i=1;i<7;i++)
{
if(p[0][0]==i)continue;
memcpy(t,p,sizeof(t));
ch(t,0,0,t[0][0],i);
tm=dfs(t,i,d+1);
res=res<tm?tm:res;
}
return res;
}
int main()
{
for(;scanf("%d%d%d",&H,&W,&C),W;)
{
int res=0,t;
for(i=0;i<H;i++)
for(j=0;j<W;j++)
scanf("%d",&P[i][j]);
for(i=1;i<7;i++)
{
t=dfs(P,i,0);
res=t<res?res:t;
}
printf("%d\n",res);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202704/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202704/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mv = dso_local local_unnamed_addr global [5 x i32] [i32 0, i32 -1, i32 0, i32 1, i32 0], align 16
@H = dso_local global i32 0, align 4
@W = dso_local global i32 0, align 4
@C = dso_local global i32 0, align 4
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@i = dso_local local_unnamed_addr global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@P = dso_local global [8 x [8 x i32]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @ch(ptr nocapture noundef %p, i32 noundef %h, i32 noundef %w, i32 noundef %c, i32 noundef %nc) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.then28.3, %entry
%accumulator.tr = phi i32 [ 0, %entry ], [ %add29.3, %if.then28.3 ]
%h.tr = phi i32 [ %h, %entry ], [ %add.3, %if.then28.3 ]
%w.tr = phi i32 [ %w, %entry ], [ %add15.3, %if.then28.3 ]
%cmp = icmp eq i32 %nc, -1
%spec.select = zext i1 %cmp to i32
%idxprom = sext i32 %h.tr to i64
%idxprom1 = sext i32 %w.tr to i64
%arrayidx2 = getelementptr inbounds [8 x i32], ptr %p, i64 %idxprom, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3 = icmp eq i32 %0, %c
br i1 %cmp3, label %if.then4, label %if.end32
if.then4: ; preds = %tailrecurse
store i32 %nc, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr @mv, align 16, !tbaa !5
%add = add nsw i32 %1, %h.tr
%2 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 1), align 4, !tbaa !5
%add15 = add nsw i32 %2, %w.tr
%cmp16 = icmp sgt i32 %add, -1
%cmp17 = icmp sgt i32 %add15, -1
%or.cond = select i1 %cmp16, i1 %cmp17, i1 false
%3 = load i32, ptr @H, align 4
%cmp19 = icmp slt i32 %add, %3
%or.cond55 = select i1 %or.cond, i1 %cmp19, i1 false
%4 = load i32, ptr @W, align 4
%cmp21 = icmp slt i32 %add15, %4
%or.cond56 = select i1 %or.cond55, i1 %cmp21, i1 false
br i1 %or.cond56, label %land.lhs.true22, label %for.inc
land.lhs.true22: ; preds = %if.then4
%idxprom23 = zext i32 %add to i64
%idxprom25 = zext i32 %add15 to i64
%arrayidx26 = getelementptr inbounds [8 x i32], ptr %p, i64 %idxprom23, i64 %idxprom25
%5 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27 = icmp eq i32 %5, %c
br i1 %cmp27, label %if.then28, label %for.inc
if.then28: ; preds = %land.lhs.true22
%call = tail call i32 @ch(ptr noundef nonnull %p, i32 noundef %add, i32 noundef %add15, i32 noundef %c, i32 noundef %nc)
%add29 = add nsw i32 %call, %spec.select
%.pre = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 1), align 4, !tbaa !5
%.pre60 = load i32, ptr @H, align 4
%.pre61 = load i32, ptr @W, align 4
br label %for.inc
for.inc: ; preds = %if.then4, %land.lhs.true22, %if.then28
%6 = phi i32 [ %.pre61, %if.then28 ], [ %4, %land.lhs.true22 ], [ %4, %if.then4 ]
%7 = phi i32 [ %.pre60, %if.then28 ], [ %3, %land.lhs.true22 ], [ %3, %if.then4 ]
%8 = phi i32 [ %.pre, %if.then28 ], [ %2, %land.lhs.true22 ], [ %2, %if.then4 ]
%res.2 = phi i32 [ %add29, %if.then28 ], [ %spec.select, %land.lhs.true22 ], [ %spec.select, %if.then4 ]
%add.1 = add nsw i32 %8, %h.tr
%9 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 2), align 8, !tbaa !5
%add15.1 = add nsw i32 %9, %w.tr
%cmp16.1 = icmp sgt i32 %add.1, -1
%cmp17.1 = icmp sgt i32 %add15.1, -1
%or.cond.1 = select i1 %cmp16.1, i1 %cmp17.1, i1 false
%cmp19.1 = icmp slt i32 %add.1, %7
%or.cond55.1 = select i1 %or.cond.1, i1 %cmp19.1, i1 false
%cmp21.1 = icmp slt i32 %add15.1, %6
%or.cond56.1 = select i1 %or.cond55.1, i1 %cmp21.1, i1 false
br i1 %or.cond56.1, label %land.lhs.true22.1, label %for.inc.1
land.lhs.true22.1: ; preds = %for.inc
%idxprom23.1 = zext i32 %add.1 to i64
%idxprom25.1 = zext i32 %add15.1 to i64
%arrayidx26.1 = getelementptr inbounds [8 x i32], ptr %p, i64 %idxprom23.1, i64 %idxprom25.1
%10 = load i32, ptr %arrayidx26.1, align 4, !tbaa !5
%cmp27.1 = icmp eq i32 %10, %c
br i1 %cmp27.1, label %if.then28.1, label %for.inc.1
if.then28.1: ; preds = %land.lhs.true22.1
%call.1 = tail call i32 @ch(ptr noundef nonnull %p, i32 noundef %add.1, i32 noundef %add15.1, i32 noundef %c, i32 noundef %nc)
%add29.1 = add nsw i32 %call.1, %res.2
%.pre62 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 2), align 8, !tbaa !5
%.pre63 = load i32, ptr @H, align 4
%.pre64 = load i32, ptr @W, align 4
br label %for.inc.1
for.inc.1: ; preds = %if.then28.1, %land.lhs.true22.1, %for.inc
%11 = phi i32 [ %.pre64, %if.then28.1 ], [ %6, %land.lhs.true22.1 ], [ %6, %for.inc ]
%12 = phi i32 [ %.pre63, %if.then28.1 ], [ %7, %land.lhs.true22.1 ], [ %7, %for.inc ]
%13 = phi i32 [ %.pre62, %if.then28.1 ], [ %9, %land.lhs.true22.1 ], [ %9, %for.inc ]
%res.2.1 = phi i32 [ %add29.1, %if.then28.1 ], [ %res.2, %land.lhs.true22.1 ], [ %res.2, %for.inc ]
%add.2 = add nsw i32 %13, %h.tr
%14 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 3), align 4, !tbaa !5
%add15.2 = add nsw i32 %14, %w.tr
%cmp16.2 = icmp sgt i32 %add.2, -1
%cmp17.2 = icmp sgt i32 %add15.2, -1
%or.cond.2 = select i1 %cmp16.2, i1 %cmp17.2, i1 false
%cmp19.2 = icmp slt i32 %add.2, %12
%or.cond55.2 = select i1 %or.cond.2, i1 %cmp19.2, i1 false
%cmp21.2 = icmp slt i32 %add15.2, %11
%or.cond56.2 = select i1 %or.cond55.2, i1 %cmp21.2, i1 false
br i1 %or.cond56.2, label %land.lhs.true22.2, label %for.inc.2
land.lhs.true22.2: ; preds = %for.inc.1
%idxprom23.2 = zext i32 %add.2 to i64
%idxprom25.2 = zext i32 %add15.2 to i64
%arrayidx26.2 = getelementptr inbounds [8 x i32], ptr %p, i64 %idxprom23.2, i64 %idxprom25.2
%15 = load i32, ptr %arrayidx26.2, align 4, !tbaa !5
%cmp27.2 = icmp eq i32 %15, %c
br i1 %cmp27.2, label %if.then28.2, label %for.inc.2
if.then28.2: ; preds = %land.lhs.true22.2
%call.2 = tail call i32 @ch(ptr noundef nonnull %p, i32 noundef %add.2, i32 noundef %add15.2, i32 noundef %c, i32 noundef %nc)
%add29.2 = add nsw i32 %call.2, %res.2.1
%.pre65 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 3), align 4, !tbaa !5
%.pre66 = load i32, ptr @H, align 4
%.pre67 = load i32, ptr @W, align 4
br label %for.inc.2
for.inc.2: ; preds = %if.then28.2, %land.lhs.true22.2, %for.inc.1
%16 = phi i32 [ %.pre67, %if.then28.2 ], [ %11, %land.lhs.true22.2 ], [ %11, %for.inc.1 ]
%17 = phi i32 [ %.pre66, %if.then28.2 ], [ %12, %land.lhs.true22.2 ], [ %12, %for.inc.1 ]
%18 = phi i32 [ %.pre65, %if.then28.2 ], [ %14, %land.lhs.true22.2 ], [ %14, %for.inc.1 ]
%res.2.2 = phi i32 [ %add29.2, %if.then28.2 ], [ %res.2.1, %land.lhs.true22.2 ], [ %res.2.1, %for.inc.1 ]
%add.3 = add nsw i32 %18, %h.tr
%19 = load i32, ptr getelementptr inbounds ([5 x i32], ptr @mv, i64 0, i64 4), align 16, !tbaa !5
%add15.3 = add nsw i32 %19, %w.tr
%cmp16.3 = icmp sgt i32 %add.3, -1
%cmp17.3 = icmp sgt i32 %add15.3, -1
%or.cond.3 = select i1 %cmp16.3, i1 %cmp17.3, i1 false
%cmp19.3 = icmp slt i32 %add.3, %17
%or.cond55.3 = select i1 %or.cond.3, i1 %cmp19.3, i1 false
%cmp21.3 = icmp slt i32 %add15.3, %16
%or.cond56.3 = select i1 %or.cond55.3, i1 %cmp21.3, i1 false
br i1 %or.cond56.3, label %land.lhs.true22.3, label %if.end32
land.lhs.true22.3: ; preds = %for.inc.2
%idxprom23.3 = zext i32 %add.3 to i64
%idxprom25.3 = zext i32 %add15.3 to i64
%arrayidx26.3 = getelementptr inbounds [8 x i32], ptr %p, i64 %idxprom23.3, i64 %idxprom25.3
%20 = load i32, ptr %arrayidx26.3, align 4, !tbaa !5
%cmp27.3 = icmp eq i32 %20, %c
br i1 %cmp27.3, label %if.then28.3, label %if.end32
if.then28.3: ; preds = %land.lhs.true22.3
%add29.3 = add nsw i32 %accumulator.tr, %res.2.2
br label %tailrecurse
if.end32: ; preds = %for.inc.2, %land.lhs.true22.3, %tailrecurse
%res.3 = phi i32 [ %spec.select, %tailrecurse ], [ %res.2.2, %land.lhs.true22.3 ], [ %res.2.2, %for.inc.2 ]
%accumulator.ret.tr = add nsw i32 %accumulator.tr, %res.3
ret i32 %accumulator.ret.tr
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(ptr nocapture noundef %p, i32 %c, i32 noundef %d) local_unnamed_addr #0 {
entry:
%t = alloca [8 x [8 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %t) #6
%cmp = icmp eq i32 %d, 5
%0 = load i32, ptr %p, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%add = add nsw i32 %d, 1
%cmp10 = icmp eq i32 %0, 1
br i1 %cmp10, label %for.inc.1, label %for.inc
if.then: ; preds = %entry
%1 = load i32, ptr @C, align 4, !tbaa !5
%cmp2 = icmp eq i32 %0, %1
br i1 %cmp2, label %if.then3, label %cleanup
if.then3: ; preds = %if.then
%call = tail call i32 @ch(ptr noundef nonnull %p, i32 noundef 0, i32 noundef 0, i32 noundef %0, i32 noundef -1)
br label %cleanup
for.inc: ; preds = %for.cond.preheader
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %t, ptr noundef nonnull align 4 dereferenceable(256) %p, i64 256, i1 false)
%2 = load i32, ptr %t, align 16, !tbaa !5
%call16 = call i32 @ch(ptr noundef nonnull %t, i32 noundef 0, i32 noundef 0, i32 noundef %2, i32 noundef 1)
%call18 = call i32 @dfs(ptr noundef nonnull %t, i32 poison, i32 noundef %add)
%cond = tail call i32 @llvm.smax.i32(i32 %call18, i32 0)
%cmp10.1 = icmp eq i32 %0, 2
br i1 %cmp10.1, label %for.inc.2, label %for.inc.1
for.inc.1: ; preds = %for.cond.preheader, %for.inc
%res.139 = phi i32 [ %cond, %for.inc ], [ 0, %for.cond.preheader ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %t, ptr noundef nonnull align 4 dereferenceable(256) %p, i64 256, i1 false)
%3 = load i32, ptr %t, align 16, !tbaa !5
%call16.1 = call i32 @ch(ptr noundef nonnull %t, i32 noundef 0, i32 noundef 0, i32 noundef %3, i32 noundef 2)
%call18.1 = call i32 @dfs(ptr noundef nonnull %t, i32 poison, i32 noundef %add)
%cond.1 = tail call i32 @llvm.smax.i32(i32 %res.139, i32 %call18.1)
%cmp10.2 = icmp eq i32 %0, 3
br i1 %cmp10.2, label %for.inc.3, label %for.inc.2
for.inc.2: ; preds = %for.inc, %for.inc.1
%res.1.142 = phi i32 [ %cond.1, %for.inc.1 ], [ %cond, %for.inc ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %t, ptr noundef nonnull align 4 dereferenceable(256) %p, i64 256, i1 false)
%4 = load i32, ptr %t, align 16, !tbaa !5
%call16.2 = call i32 @ch(ptr noundef nonnull %t, i32 noundef 0, i32 noundef 0, i32 noundef %4, i32 noundef 3)
%call18.2 = call i32 @dfs(ptr noundef nonnull %t, i32 poison, i32 noundef %add)
%cond.2 = tail call i32 @llvm.smax.i32(i32 %res.1.142, i32 %call18.2)
%cmp10.3 = icmp eq i32 %0, 4
br i1 %cmp10.3, label %for.inc.4, label %for.inc.3
for.inc.3: ; preds = %for.inc.1, %for.inc.2
%res.1.245 = phi i32 [ %cond.2, %for.inc.2 ], [ %cond.1, %for.inc.1 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %t, ptr noundef nonnull align 4 dereferenceable(256) %p, i64 256, i1 false)
%5 = load i32, ptr %t, align 16, !tbaa !5
%call16.3 = call i32 @ch(ptr noundef nonnull %t, i32 noundef 0, i32 noundef 0, i32 noundef %5, i32 noundef 4)
%call18.3 = call i32 @dfs(ptr noundef nonnull %t, i32 poison, i32 noundef %add)
%cond.3 = tail call i32 @llvm.smax.i32(i32 %res.1.245, i32 %call18.3)
%cmp10.4 = icmp eq i32 %0, 5
br i1 %cmp10.4, label %if.end12.5, label %for.inc.4
for.inc.4: ; preds = %for.inc.2, %for.inc.3
%res.1.348 = phi i32 [ %cond.3, %for.inc.3 ], [ %cond.2, %for.inc.2 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %t, ptr noundef nonnull align 4 dereferenceable(256) %p, i64 256, i1 false)
%6 = load i32, ptr %t, align 16, !tbaa !5
%call16.4 = call i32 @ch(ptr noundef nonnull %t, i32 noundef 0, i32 noundef 0, i32 noundef %6, i32 noundef 5)
%call18.4 = call i32 @dfs(ptr noundef nonnull %t, i32 poison, i32 noundef %add)
%cond.4 = tail call i32 @llvm.smax.i32(i32 %res.1.348, i32 %call18.4)
%cmp10.5 = icmp eq i32 %0, 6
br i1 %cmp10.5, label %cleanup, label %if.end12.5
if.end12.5: ; preds = %for.inc.3, %for.inc.4
%res.1.451 = phi i32 [ %cond.4, %for.inc.4 ], [ %cond.3, %for.inc.3 ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %t, ptr noundef nonnull align 4 dereferenceable(256) %p, i64 256, i1 false)
%7 = load i32, ptr %t, align 16, !tbaa !5
%call16.5 = call i32 @ch(ptr noundef nonnull %t, i32 noundef 0, i32 noundef 0, i32 noundef %7, i32 noundef 6)
%call18.5 = call i32 @dfs(ptr noundef nonnull %t, i32 poison, i32 noundef %add)
%cond.5 = tail call i32 @llvm.smax.i32(i32 %res.1.451, i32 %call18.5)
br label %cleanup
cleanup: ; preds = %for.inc.4, %if.end12.5, %if.then, %if.then3
%retval.0 = phi i32 [ %call, %if.then3 ], [ 0, %if.then ], [ %cond.4, %for.inc.4 ], [ %cond.5, %if.end12.5 ]
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %t) #6
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call34 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @H, ptr noundef nonnull @W, ptr noundef nonnull @C)
%0 = load i32, ptr @W, align 4, !tbaa !5
%tobool.not35 = icmp eq i32 %0, 0
br i1 %tobool.not35, label %for.end21, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond12.preheader
%1 = phi i32 [ %4, %for.cond12.preheader ], [ %0, %entry ]
store i32 0, ptr @i, align 4, !tbaa !5
%2 = load i32, ptr @H, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %2, 0
br i1 %cmp30, label %for.cond3.preheader.lr.ph, label %for.cond12.preheader
for.cond3.preheader.lr.ph: ; preds = %for.cond1.preheader
%3 = icmp sgt i32 %1, 0
br i1 %3, label %for.cond3.preheader, label %for.cond3.preheader.lr.ph.split.us
for.cond3.preheader.lr.ph.split.us: ; preds = %for.cond3.preheader.lr.ph
store i32 0, ptr @j, align 4, !tbaa !5
br label %for.cond12.preheader
for.cond12.preheader: ; preds = %for.inc9, %for.cond3.preheader.lr.ph.split.us, %for.cond1.preheader
store i32 1, ptr @i, align 4, !tbaa !5
%call15 = tail call i32 @dfs(ptr noundef nonnull @P, i32 poison, i32 noundef 0)
store i32 2, ptr @i, align 4, !tbaa !5
%call15.1 = tail call i32 @dfs(ptr noundef nonnull @P, i32 poison, i32 noundef 0)
%cond = tail call i32 @llvm.smax.i32(i32 %call15, i32 %call15.1)
store i32 3, ptr @i, align 4, !tbaa !5
%call15.2 = tail call i32 @dfs(ptr noundef nonnull @P, i32 poison, i32 noundef 0)
%cond.1 = tail call i32 @llvm.smax.i32(i32 %cond, i32 %call15.2)
store i32 4, ptr @i, align 4, !tbaa !5
%call15.3 = tail call i32 @dfs(ptr noundef nonnull @P, i32 poison, i32 noundef 0)
%cond.2 = tail call i32 @llvm.smax.i32(i32 %cond.1, i32 %call15.3)
store i32 5, ptr @i, align 4, !tbaa !5
%call15.4 = tail call i32 @dfs(ptr noundef nonnull @P, i32 poison, i32 noundef 0)
%cond.3 = tail call i32 @llvm.smax.i32(i32 %cond.2, i32 %call15.4)
store i32 6, ptr @i, align 4, !tbaa !5
%call15.5 = tail call i32 @dfs(ptr noundef nonnull @P, i32 poison, i32 noundef 0)
%cond.4 = tail call i32 @llvm.smax.i32(i32 %cond.3, i32 %call15.5)
%cond.5 = tail call i32 @llvm.smax.i32(i32 %cond.4, i32 0)
store i32 7, ptr @i, align 4, !tbaa !5
%call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond.5)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @H, ptr noundef nonnull @W, ptr noundef nonnull @C)
%4 = load i32, ptr @W, align 4, !tbaa !5
%tobool.not = icmp eq i32 %4, 0
br i1 %tobool.not, label %for.end21, label %for.cond1.preheader, !llvm.loop !9
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc9
%5 = phi i32 [ %11, %for.inc9 ], [ %2, %for.cond3.preheader.lr.ph ]
%6 = phi i32 [ %inc10, %for.inc9 ], [ 0, %for.cond3.preheader.lr.ph ]
%7 = phi i32 [ %13, %for.inc9 ], [ %1, %for.cond3.preheader.lr.ph ]
store i32 0, ptr @j, align 4, !tbaa !5
%cmp428 = icmp sgt i32 %7, 0
br i1 %cmp428, label %for.body5, label %for.inc9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%storemerge2729 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%8 = load i32, ptr @i, align 4, !tbaa !5
%idxprom = sext i32 %8 to i64
%idxprom6 = sext i32 %storemerge2729 to i64
%arrayidx7 = getelementptr inbounds [8 x [8 x i32]], ptr @P, i64 0, i64 %idxprom, i64 %idxprom6
%call8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%9 = load i32, ptr @j, align 4, !tbaa !5
%inc = add nsw i32 %9, 1
store i32 %inc, ptr @j, align 4, !tbaa !5
%10 = load i32, ptr @W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %10
br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !11
for.inc9.loopexit: ; preds = %for.body5
%.pre = load i32, ptr @i, align 4, !tbaa !5
%.pre36 = load i32, ptr @H, align 4, !tbaa !5
br label %for.inc9
for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader
%11 = phi i32 [ %.pre36, %for.inc9.loopexit ], [ %5, %for.cond3.preheader ]
%12 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %6, %for.cond3.preheader ]
%13 = phi i32 [ %10, %for.inc9.loopexit ], [ %7, %for.cond3.preheader ]
%inc10 = add nsw i32 %12, 1
store i32 %inc10, ptr @i, align 4, !tbaa !5
%cmp = icmp slt i32 %inc10, %11
br i1 %cmp, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !12
for.end21: ; preds = %for.cond12.preheader, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
|
#include<stdio.h>
int main(){
int a,b,i,s,M[]={2,3,1,3,2,3,2,3,3,2,3,2,3};
char d[][10]={"Monday","Tuesday","Wednesday","Thursday",
"Friday","Saturday","Sunday"};
while(scanf("%d %d",&a,&b),a||b){
for(i=s=0;i<a;i++)s+=M[i];
s+=b;
printf("%s\n",d[s%7]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202755/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202755/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.M = private unnamed_addr constant [13 x i32] [i32 2, i32 3, i32 1, i32 3, i32 2, i32 3, i32 2, i32 3, i32 3, i32 2, i32 3, i32 2, i32 3], align 16
@__const.main.d = private unnamed_addr constant [7 x [10 x i8]] [[10 x i8] c"Monday\00\00\00\00", [10 x i8] c"Tuesday\00\00\00", [10 x i8] c"Wednesday\00", [10 x i8] c"Thursday\00\00", [10 x i8] c"Friday\00\00\00\00", [10 x i8] c"Saturday\00\00", [10 x i8] c"Sunday\00\00\00\00"], align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call13 = 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
%tobool14 = icmp ne i32 %0, 0
%1 = load i32, ptr %b, align 4
%tobool115 = icmp ne i32 %1, 0
%2 = select i1 %tobool14, i1 true, i1 %tobool115
br i1 %2, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %for.end
%3 = phi i32 [ %13, %for.end ], [ %1, %entry ]
%4 = phi i32 [ %12, %for.end ], [ %0, %entry ]
%cmp10 = icmp sgt i32 %4, 0
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body.preheader19, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%vec.phi17 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%5 = getelementptr inbounds [13 x i32], ptr @__const.main.M, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load18 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = add <4 x i32> %wide.load, %vec.phi
%8 = add <4 x i32> %wide.load18, %vec.phi17
%index.next = add nuw i64 %index, 8
%9 = icmp eq i64 %index.next, %n.vec
br i1 %9, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %8, %7
%10 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader19
for.body.preheader19: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%s.012.ph = phi i32 [ 0, %for.body.preheader ], [ %10, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader19, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader19 ]
%s.012 = phi i32 [ %add, %for.body ], [ %s.012.ph, %for.body.preheader19 ]
%arrayidx = getelementptr inbounds [13 x i32], ptr @__const.main.M, i64 0, i64 %indvars.iv
%11 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %11, %s.012
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %for.cond.preheader
%s.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %10, %middle.block ], [ %add, %for.body ]
%add2 = add nsw i32 %s.0.lcssa, %3
%rem = srem i32 %add2, 7
%idxprom3 = sext i32 %rem to i64
%arrayidx4 = getelementptr inbounds [7 x [10 x i8]], ptr @__const.main.d, i64 0, i64 %idxprom3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%12 = load i32, ptr %a, align 4, !tbaa !5
%tobool = icmp ne i32 %12, 0
%13 = load i32, ptr %b, align 4
%tobool1 = icmp ne i32 %13, 0
%14 = select i1 %tobool, i1 true, i1 %tobool1
br i1 %14, label %for.cond.preheader, label %while.end, !llvm.loop !14
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = 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, m, n, i;
while ( 1 ){
scanf("%d %d", &m, &d);
if ( m == 0) break;
else if ( m == 1) d = d;
else if ( m == 2 ) d = d + 31;
else if ( m == 3 ) d = d + 31 + 29;
else if ( m == 4 ) d = d + 31 + 29 + 31;
else if ( m == 5 ) d = d + 31 + 29 + 31 + 30;
else if ( m == 6 ) d = d + 31 + 29 + 31 + 30 + 31;
else if ( m == 7 ) d = d + 31 + 29 + 31 + 30 + 31 + 30;
else if ( m == 8 ) d = d + 31 + 29 + 31 + 30 + 31 + 30 + 31;
else if ( m == 9 ) d = d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31;
else if ( m == 10 )d = d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30;
else if ( m == 11 )d = d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31;
else if ( m == 12 )d = d + 31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30;
if ( d % 7 == 0 ) printf("Wednesday\n");
else if ( d % 7 == 1 ) printf("Thursday\n");
else if ( d % 7 == 2 ) printf("Friday\n");
else if ( d % 7 == 3 ) printf("Saturday\n");
else if ( d % 7 == 4 ) printf("Sunday\n");
else if ( d % 7 == 5 ) printf("Monday\n");
else if ( d % 7 == 6 ) printf("Tuesday\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202799/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202799/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %d)
%0 = load i32, ptr %m, align 4, !tbaa !5
switch i32 %0, label %while.cond.if.end112_crit_edge [
i32 0, label %while.end
i32 12, label %if.then89
i32 2, label %if.then5
i32 3, label %if.then8
i32 4, label %if.then13
i32 5, label %if.then19
i32 6, label %if.then26
i32 7, label %if.then34
i32 8, label %if.then43
i32 9, label %if.then53
i32 10, label %if.then64
i32 11, label %if.then76
]
while.cond.if.end112_crit_edge: ; preds = %while.cond
%.pre = load i32, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then5: ; preds = %while.cond
%1 = load i32, ptr %d, align 4, !tbaa !5
%add = add nsw i32 %1, 31
store i32 %add, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then8: ; preds = %while.cond
%2 = load i32, ptr %d, align 4, !tbaa !5
%add10 = add nsw i32 %2, 60
store i32 %add10, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then13: ; preds = %while.cond
%3 = load i32, ptr %d, align 4, !tbaa !5
%add16 = add nsw i32 %3, 91
store i32 %add16, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then19: ; preds = %while.cond
%4 = load i32, ptr %d, align 4, !tbaa !5
%add23 = add nsw i32 %4, 121
store i32 %add23, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then26: ; preds = %while.cond
%5 = load i32, ptr %d, align 4, !tbaa !5
%add31 = add nsw i32 %5, 152
store i32 %add31, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then34: ; preds = %while.cond
%6 = load i32, ptr %d, align 4, !tbaa !5
%add40 = add nsw i32 %6, 182
store i32 %add40, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then43: ; preds = %while.cond
%7 = load i32, ptr %d, align 4, !tbaa !5
%add50 = add nsw i32 %7, 213
store i32 %add50, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then53: ; preds = %while.cond
%8 = load i32, ptr %d, align 4, !tbaa !5
%add61 = add nsw i32 %8, 244
store i32 %add61, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then64: ; preds = %while.cond
%9 = load i32, ptr %d, align 4, !tbaa !5
%add73 = add nsw i32 %9, 274
store i32 %add73, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then76: ; preds = %while.cond
%10 = load i32, ptr %d, align 4, !tbaa !5
%add86 = add nsw i32 %10, 305
store i32 %add86, ptr %d, align 4, !tbaa !5
br label %if.end112
if.then89: ; preds = %while.cond
%11 = load i32, ptr %d, align 4, !tbaa !5
%add100 = add nsw i32 %11, 335
store i32 %add100, ptr %d, align 4, !tbaa !5
br label %if.end112
if.end112: ; preds = %while.cond.if.end112_crit_edge, %if.then8, %if.then19, %if.then34, %if.then53, %if.then76, %if.then89, %if.then64, %if.then43, %if.then26, %if.then13, %if.then5
%12 = phi i32 [ %.pre, %while.cond.if.end112_crit_edge ], [ %add10, %if.then8 ], [ %add23, %if.then19 ], [ %add40, %if.then34 ], [ %add61, %if.then53 ], [ %add86, %if.then76 ], [ %add100, %if.then89 ], [ %add73, %if.then64 ], [ %add50, %if.then43 ], [ %add31, %if.then26 ], [ %add16, %if.then13 ], [ %add, %if.then5 ]
%rem = srem i32 %12, 7
%13 = icmp ult i32 %rem, 7
br i1 %13, label %switch.lookup, label %while.cond.backedge
while.cond.backedge: ; preds = %if.end112, %switch.lookup
br label %while.cond
switch.lookup: ; preds = %if.end112
%14 = sext i32 %rem to i64
%reltable.shift = shl i64 %14, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts157 = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %while.cond.backedge
while.end: ; preds = %while.cond
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, 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 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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int data[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int month, day, i, result;
while(1){
scanf("%d %d",&month,&day);
if(month == 0 || day == 0){
break;
}
result = 0;
for(i = 0; i < month-1; i++){
result += data[i];
}
result += day;
switch(result % 7){
case 0:
printf("Wednesday\n");
break;
case 1 :
printf("Thursday\n");
break;
case 2:
printf("Friday\n");
break;
case 3:
printf("Saturday\n");
break;
case 4:
printf("Sunday\n");
break;
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
default :
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202849/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202849/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.data = private unnamed_addr constant [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31], align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%month = alloca i32, align 4
%day = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %day) #6
%call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %day)
%0 = load i32, ptr %month, align 4, !tbaa !5
%cmp31 = icmp eq i32 %0, 0
%1 = load i32, ptr %day, align 4
%cmp132 = icmp eq i32 %1, 0
%or.cond33 = select i1 %cmp31, i1 true, i1 %cmp132
br i1 %or.cond33, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %sw.epilog
%2 = phi i32 [ %14, %sw.epilog ], [ %1, %entry ]
%3 = phi i32 [ %13, %sw.epilog ], [ %0, %entry ]
%cmp227 = icmp sgt i32 %3, 1
br i1 %cmp227, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%sub = add nsw i32 %3, -1
%wide.trip.count = zext i32 %sub to i64
%min.iters.check = icmp ult i32 %3, 9
br i1 %min.iters.check, label %for.body.preheader37, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi35 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%4 = getelementptr inbounds [12 x i32], ptr @__const.main.data, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load36 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load36, %vec.phi35
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader37
for.body.preheader37: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%result.029.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader37, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader37 ]
%result.029 = phi i32 [ %add, %for.body ], [ %result.029.ph, %for.body.preheader37 ]
%arrayidx = getelementptr inbounds [12 x i32], ptr @__const.main.data, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %10, %result.029
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %for.cond.preheader
%result.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %9, %middle.block ], [ %add, %for.body ]
%add3 = add nsw i32 %result.0.lcssa, %2
%rem = srem i32 %add3, 7
%11 = icmp ult i32 %rem, 7
br i1 %11, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %for.end
%12 = sext i32 %rem to i64
%reltable.shift = shl i64 %12, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %for.end, %switch.lookup
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %day)
%13 = load i32, ptr %month, align 4, !tbaa !5
%cmp = icmp eq i32 %13, 0
%14 = load i32, ptr %day, align 4
%cmp1 = icmp eq i32 %14, 0
%or.cond = select i1 %cmp, i1 true, i1 %cmp1
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %day) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include<stdio.h>
int main(){
int mon,day,t,i;
while(1){
scanf("%d%d",&mon,&day);
if(!mon&&!day)break;
t=0;
for(i=1;i<mon;i++){
if(i==2)t+=29;
else if(i==4||i==6||i==9||i==11)t+=30;
else t+=31;
}
t+=day;
switch(t%7){
case 0:
printf("Wednesday\n");
break;
case 1:
printf("Thursday\n");
break;
case 2:
printf("Friday\n");
break;
case 3:
printf("Saturday\n");
break;
case 4:
printf("Sunday\n");
break;
case 5:
printf("Monday\n");
break;
case 6:
printf("Tuesday\n");
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202913/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202913/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%mon = alloca i32, align 4
%day = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %mon) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %day) #6
%call52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %mon, ptr noundef nonnull %day)
%0 = load i32, ptr %mon, align 4, !tbaa !5
%tobool53 = icmp ne i32 %0, 0
%1 = load i32, ptr %day, align 4
%tobool154 = icmp ne i32 %1, 0
%or.cond55 = select i1 %tobool53, i1 true, i1 %tobool154
br i1 %or.cond55, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %sw.epilog
%2 = phi i32 [ %24, %sw.epilog ], [ %1, %entry ]
%3 = phi i32 [ %23, %sw.epilog ], [ %0, %entry ]
%cmp49 = icmp sgt i32 %3, 1
br i1 %cmp49, label %for.inc.peel, label %for.end
for.inc.peel: ; preds = %for.cond.preheader
switch i32 %3, label %if.else.preheader [
i32 2, label %for.end
i32 3, label %for.end.fold.split
]
if.else.preheader: ; preds = %for.inc.peel
%4 = add i32 %3, -3
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %if.else.preheader73, label %vector.ph
vector.ph: ; preds = %if.else.preheader
%n.vec = and i32 %4, -8
%ind.end = or i32 %n.vec, 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 3, i32 4, i32 5, i32 6>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 60, i32 0, i32 0, i32 0>, %vector.ph ], [ %15, %vector.body ]
%vec.phi72 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%5 = and <4 x i32> %vec.ind, <i32 2147483645, i32 2147483645, i32 2147483645, i32 2147483645>
%6 = and <4 x i32> %step.add, <i32 2147483645, i32 2147483645, i32 2147483645, i32 2147483645>
%7 = icmp eq <4 x i32> %5, <i32 9, i32 9, i32 9, i32 9>
%8 = icmp eq <4 x i32> %6, <i32 9, i32 9, i32 9, i32 9>
%9 = icmp eq <4 x i32> %5, <i32 4, i32 4, i32 4, i32 4>
%10 = icmp eq <4 x i32> %6, <i32 4, i32 4, i32 4, i32 4>
%11 = or <4 x i1> %7, %9
%12 = or <4 x i1> %8, %10
%13 = select <4 x i1> %11, <4 x i32> <i32 30, i32 30, i32 30, i32 30>, <4 x i32> <i32 31, i32 31, i32 31, i32 31>
%14 = select <4 x i1> %12, <4 x i32> <i32 30, i32 30, i32 30, i32 30>, <4 x i32> <i32 31, i32 31, i32 31, i32 31>
%15 = add <4 x i32> %vec.phi, %13
%16 = add <4 x i32> %vec.phi72, %14
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%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 %4, %n.vec
br i1 %cmp.n, label %for.end, label %if.else.preheader73
if.else.preheader73: ; preds = %if.else.preheader, %middle.block
%i.051.ph = phi i32 [ 3, %if.else.preheader ], [ %ind.end, %middle.block ]
%t.050.ph = phi i32 [ 60, %if.else.preheader ], [ %18, %middle.block ]
br label %if.else
if.else: ; preds = %if.else.preheader73, %if.else
%i.051 = phi i32 [ %inc, %if.else ], [ %i.051.ph, %if.else.preheader73 ]
%t.050 = phi i32 [ %add13, %if.else ], [ %t.050.ph, %if.else.preheader73 ]
%19 = and i32 %i.051, 2147483645
%switch.selectcmp.case1 = icmp eq i32 %19, 9
%switch.selectcmp.case2 = icmp eq i32 %19, 4
%switch.selectcmp = or i1 %switch.selectcmp.case1, %switch.selectcmp.case2
%20 = select i1 %switch.selectcmp, i32 30, i32 31
%add13 = add nuw nsw i32 %t.050, %20
%inc = add nuw nsw i32 %i.051, 1
%exitcond.not = icmp eq i32 %inc, %3
br i1 %exitcond.not, label %for.end, label %if.else, !llvm.loop !14
for.end.fold.split: ; preds = %for.inc.peel
br label %for.end
for.end: ; preds = %if.else, %middle.block, %for.inc.peel, %for.end.fold.split, %for.cond.preheader
%t.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ 31, %for.inc.peel ], [ 60, %for.end.fold.split ], [ %18, %middle.block ], [ %add13, %if.else ]
%add16 = add nsw i32 %t.0.lcssa, %2
%rem = srem i32 %add16, 7
%21 = icmp ult i32 %rem, 7
br i1 %21, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %for.end
%22 = sext i32 %rem to i64
%reltable.shift = shl i64 %22, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %for.end, %switch.lookup
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %mon, ptr noundef nonnull %day)
%23 = load i32, ptr %mon, align 4, !tbaa !5
%tobool = icmp ne i32 %23, 0
%24 = load i32, ptr %day, align 4
%tobool1 = icmp ne i32 %24, 0
%or.cond = select i1 %tobool, i1 true, i1 %tobool1
br i1 %or.cond, label %for.cond.preheader, label %while.end
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %day) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %mon) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12, !13}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 2}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !11, !13, !12}
|
#include <stdio.h>
int main( void ) {
int month, day, days, nodiem[] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }, i;
while ( scanf( "%d %d", &month, &day ) && month != 0 && day != 0 ) {
days = 0;
for ( i = 0; i < month - 1; i++ ) { days += nodiem[i]; }
days += day;
switch ( days % 7 ) {
case 0: printf( "Wednesday\n" ); break;
case 1: printf( "Thursday\n" ); break;
case 2: printf( "Friday\n" ); break;
case 3: printf( "Saturday\n" ); break;
case 4: printf( "Sunday\n" ); break;
case 5: printf( "Monday\n" ); break;
case 6: printf( "Tuesday\n" ); break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_202964/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_202964/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.nodiem = private unnamed_addr constant [12 x i32] [i32 31, i32 29, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31], align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [8 x i8] c"Tuesday\00", align 1
@str.8 = private unnamed_addr constant [7 x i8] c"Monday\00", align 1
@str.9 = private unnamed_addr constant [7 x i8] c"Sunday\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"Saturday\00", align 1
@str.11 = private unnamed_addr constant [7 x i8] c"Friday\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"Thursday\00", align 1
@str.13 = private unnamed_addr constant [10 x i8] c"Wednesday\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.13 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.8 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%month = alloca i32, align 4
%day = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %day) #6
%call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %day)
%tobool32 = icmp ne i32 %call31, 0
%0 = load i32, ptr %month, align 4
%cmp33 = icmp ne i32 %0, 0
%or.cond34 = select i1 %tobool32, i1 %cmp33, i1 false
%1 = load i32, ptr %day, align 4
%cmp135 = icmp ne i32 %1, 0
%or.cond1736 = select i1 %or.cond34, i1 %cmp135, i1 false
br i1 %or.cond1736, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %sw.epilog
%2 = phi i32 [ %14, %sw.epilog ], [ %1, %entry ]
%3 = phi i32 [ %13, %sw.epilog ], [ %0, %entry ]
%cmp228 = icmp sgt i32 %3, 1
br i1 %cmp228, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%sub = add nsw i32 %3, -1
%wide.trip.count = zext i32 %sub to i64
%min.iters.check = icmp ult i32 %3, 9
br i1 %min.iters.check, label %for.body.preheader40, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%vec.phi38 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %7, %vector.body ]
%4 = getelementptr inbounds [12 x i32], ptr @__const.main.nodiem, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load39 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = add <4 x i32> %wide.load, %vec.phi
%7 = add <4 x i32> %wide.load39, %vec.phi38
%index.next = add nuw i64 %index, 8
%8 = icmp eq i64 %index.next, %n.vec
br i1 %8, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %7, %6
%9 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader40
for.body.preheader40: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%days.029.ph = phi i32 [ 0, %for.body.preheader ], [ %9, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader40, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader40 ]
%days.029 = phi i32 [ %add, %for.body ], [ %days.029.ph, %for.body.preheader40 ]
%arrayidx = getelementptr inbounds [12 x i32], ptr @__const.main.nodiem, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %10, %days.029
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %for.cond.preheader
%days.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %9, %middle.block ], [ %add, %for.body ]
%add3 = add nsw i32 %days.0.lcssa, %2
%rem = srem i32 %add3, 7
%11 = icmp ult i32 %rem, 7
br i1 %11, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %for.end
%12 = sext i32 %rem to i64
%reltable.shift = shl i64 %12, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %for.end, %switch.lookup
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %month, ptr noundef nonnull %day)
%tobool = icmp ne i32 %call, 0
%13 = load i32, ptr %month, align 4
%cmp = icmp ne i32 %13, 0
%or.cond = select i1 %tobool, i1 %cmp, i1 false
%14 = load i32, ptr %day, align 4
%cmp1 = icmp ne i32 %14, 0
%or.cond17 = select i1 %or.cond, i1 %cmp1, i1 false
br i1 %or.cond17, label %for.cond.preheader, label %while.end, !llvm.loop !14
while.end: ; preds = %sw.epilog, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %day) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, 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 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !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>
#include <stdlib.h>
int main(void) {
int h,w;
scanf("%d %d", &h, &w);
long a[h][w],b[h][w];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
scanf("%ld", &a[i][j]);
}
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
scanf("%ld", &b[i][j]);
}
}
long ab[h][w];
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
ab[i][j] = labs(a[i][j]-b[i][j]);
}
}
long limit = (h+w)*80;
long ***dp;
dp = (long ***)malloc(sizeof (long**) * 80);
for (long i = 0; i < 80; i++) {
dp[i] = (long **)malloc(sizeof (long*) * 80);
for (long j = 0; j < 80; j++) {
dp[i][j] = (long *)malloc(sizeof (long) * (limit+1));
for (long k = 0; k <= limit; k++) {
dp[i][j][k] = 0;
}
}
}
long value = ab[0][0];
dp[0][0][value] = 1;
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i != 0) {
for (long k = 0; k <= limit; k++) {
if (dp[i-1][j][k] == 1) {
value = labs(k+ab[i][j]);
dp[i][j][value] = 1;
value = labs(k-ab[i][j]);
dp[i][j][value] = 1;
}
}
}
if (j != 0) {
for (long k = 0; k <= limit; k++) {
if (dp[i][j-1][k] == 1) {
value = labs(k+ab[i][j]);
dp[i][j][value] = 1;
value = labs(k-ab[i][j]);
dp[i][j][value] = 1;
}
}
}
}
}
for (long i = 0; i <= limit; i++) {
if (dp[h-1][w-1][i] == 1) {
printf("%ld\n", i);
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203006/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203006/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
@.str.2 = 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:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %w, align 4, !tbaa !5
%3 = zext i32 %2 to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i64, i64 %5, align 16
%6 = load i32, ptr %h, align 4, !tbaa !5
%7 = zext i32 %6 to i64
%8 = load i32, ptr %w, align 4, !tbaa !5
%9 = zext i32 %8 to i64
%10 = mul nuw i64 %9, %7
%vla1 = alloca i64, i64 %10, align 16
%cmp315 = icmp sgt i32 %6, 0
br i1 %cmp315, label %for.cond2.preheader.lr.ph, label %for.cond.cleanup15.thread451
for.cond2.preheader.lr.ph: ; preds = %entry
%11 = icmp sgt i32 %8, 0
br i1 %11, label %for.cond2.preheader, label %for.cond40.preheader.lr.ph.thread
for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.cond.cleanup4
%12 = phi i32 [ %16, %for.cond.cleanup4 ], [ %6, %for.cond2.preheader.lr.ph ]
%13 = phi i32 [ %17, %for.cond.cleanup4 ], [ %8, %for.cond2.preheader.lr.ph ]
%indvars.iv388 = phi i64 [ %indvars.iv.next389, %for.cond.cleanup4 ], [ 0, %for.cond2.preheader.lr.ph ]
%cmp3313 = icmp sgt i32 %13, 0
br i1 %cmp3313, label %for.body5.lr.ph, label %for.cond.cleanup4
for.body5.lr.ph: ; preds = %for.cond2.preheader
%14 = mul nuw nsw i64 %indvars.iv388, %3
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %14
br label %for.body5
for.cond13.preheader: ; preds = %for.cond.cleanup4
%cmp14319 = icmp sgt i32 %16, 0
br i1 %cmp14319, label %for.cond18.preheader.lr.ph, label %for.cond.cleanup15.thread451
for.cond18.preheader.lr.ph: ; preds = %for.cond13.preheader
%15 = icmp sgt i32 %17, 0
br i1 %15, label %for.cond18.preheader, label %for.cond40.preheader.lr.ph.thread
for.cond.cleanup4.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %for.cond.cleanup4.loopexit, %for.cond2.preheader
%16 = phi i32 [ %.pre, %for.cond.cleanup4.loopexit ], [ %12, %for.cond2.preheader ]
%17 = phi i32 [ %19, %for.cond.cleanup4.loopexit ], [ %13, %for.cond2.preheader ]
%indvars.iv.next389 = add nuw nsw i64 %indvars.iv388, 1
%18 = sext i32 %16 to i64
%cmp = icmp slt i64 %indvars.iv.next389, %18
br i1 %cmp, label %for.cond2.preheader, label %for.cond13.preheader, !llvm.loop !9
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.body5 ]
%arrayidx7 = getelementptr inbounds i64, ptr %arrayidx, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%19 = load i32, ptr %w, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %20
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4.loopexit, !llvm.loop !12
for.cond18.preheader: ; preds = %for.cond18.preheader.lr.ph, %for.cond.cleanup20
%21 = phi i32 [ %50, %for.cond.cleanup20 ], [ %16, %for.cond18.preheader.lr.ph ]
%22 = phi i32 [ %51, %for.cond.cleanup20 ], [ %17, %for.cond18.preheader.lr.ph ]
%indvars.iv394 = phi i64 [ %indvars.iv.next395, %for.cond.cleanup20 ], [ 0, %for.cond18.preheader.lr.ph ]
%cmp19317 = icmp sgt i32 %22, 0
br i1 %cmp19317, label %for.body21.lr.ph, label %for.cond.cleanup20
for.body21.lr.ph: ; preds = %for.cond18.preheader
%23 = mul nuw nsw i64 %indvars.iv394, %9
%arrayidx23 = getelementptr inbounds i64, ptr %vla1, i64 %23
br label %for.body21
for.cond40.preheader.lr.ph.thread: ; preds = %for.cond2.preheader.lr.ph, %for.cond18.preheader.lr.ph
%.ph = phi i32 [ %17, %for.cond18.preheader.lr.ph ], [ %8, %for.cond2.preheader.lr.ph ]
%.lcssa.ph = phi i32 [ %16, %for.cond18.preheader.lr.ph ], [ %6, %for.cond2.preheader.lr.ph ]
%24 = zext i32 %.lcssa.ph to i64
%25 = zext i32 %.ph to i64
%26 = mul nuw nsw i64 %25, %24
%vla33440 = alloca i64, i64 %26, align 16
br label %for.cond.cleanup37
for.cond.cleanup15.thread451: ; preds = %for.cond13.preheader, %entry
%.ph449 = phi i32 [ %17, %for.cond13.preheader ], [ %8, %entry ]
%.lcssa.ph450 = phi i32 [ %16, %for.cond13.preheader ], [ %6, %entry ]
%27 = zext i32 %.lcssa.ph450 to i64
%28 = zext i32 %.ph449 to i64
%29 = mul nuw i64 %28, %27
%vla33453 = alloca i64, i64 %29, align 16
br label %for.cond.cleanup37
for.cond.cleanup15: ; preds = %for.cond.cleanup20
%30 = zext i32 %50 to i64
%31 = zext i32 %51 to i64
%32 = mul nuw i64 %31, %30
%vla33 = alloca i64, i64 %32, align 16
%cmp36323 = icmp sgt i32 %50, 0
br i1 %cmp36323, label %for.cond40.preheader.lr.ph, label %for.cond.cleanup37
for.cond40.preheader.lr.ph: ; preds = %for.cond.cleanup15
%cmp41321 = icmp sgt i32 %51, 0
br i1 %cmp41321, label %for.cond40.preheader.us.preheader, label %for.cond.cleanup37
for.cond40.preheader.us.preheader: ; preds = %for.cond40.preheader.lr.ph
%min.iters.check = icmp ult i32 %51, 4
%n.vec = and i64 %31, 4294967292
%cmp.n = icmp eq i64 %n.vec, %31
br label %for.cond40.preheader.us
for.cond40.preheader.us: ; preds = %for.cond40.preheader.us.preheader, %for.cond40.for.cond.cleanup42_crit_edge.us
%indvars.iv400 = phi i64 [ %indvars.iv.next401, %for.cond40.for.cond.cleanup42_crit_edge.us ], [ 0, %for.cond40.preheader.us.preheader ]
%33 = mul nuw nsw i64 %indvars.iv400, %3
%arrayidx45.us = getelementptr inbounds i64, ptr %vla, i64 %33
%34 = mul nuw nsw i64 %indvars.iv400, %9
%arrayidx49.us = getelementptr inbounds i64, ptr %vla1, i64 %34
%35 = mul nuw nsw i64 %indvars.iv400, %31
%arrayidx53.us = getelementptr inbounds i64, ptr %vla33, i64 %35
br i1 %min.iters.check, label %for.body43.us.preheader, label %vector.body
vector.body: ; preds = %for.cond40.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond40.preheader.us ]
%36 = getelementptr inbounds i64, ptr %arrayidx45.us, i64 %index
%wide.load = load <2 x i64>, ptr %36, align 8, !tbaa !13
%37 = getelementptr inbounds i64, ptr %36, i64 2
%wide.load480 = load <2 x i64>, ptr %37, align 8, !tbaa !13
%38 = getelementptr inbounds i64, ptr %arrayidx49.us, i64 %index
%wide.load481 = load <2 x i64>, ptr %38, align 8, !tbaa !13
%39 = getelementptr inbounds i64, ptr %38, i64 2
%wide.load482 = load <2 x i64>, ptr %39, align 8, !tbaa !13
%40 = sub nsw <2 x i64> %wide.load, %wide.load481
%41 = sub nsw <2 x i64> %wide.load480, %wide.load482
%42 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %40, i1 true)
%43 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %41, i1 true)
%44 = getelementptr inbounds i64, ptr %arrayidx53.us, i64 %index
store <2 x i64> %42, ptr %44, align 8, !tbaa !13
%45 = getelementptr inbounds i64, ptr %44, i64 2
store <2 x i64> %43, ptr %45, align 8, !tbaa !13
%index.next = add nuw i64 %index, 4
%46 = icmp eq i64 %index.next, %n.vec
br i1 %46, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond40.for.cond.cleanup42_crit_edge.us, label %for.body43.us.preheader
for.body43.us.preheader: ; preds = %for.cond40.preheader.us, %middle.block
%indvars.iv397.ph = phi i64 [ 0, %for.cond40.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body43.us
for.body43.us: ; preds = %for.body43.us.preheader, %for.body43.us
%indvars.iv397 = phi i64 [ %indvars.iv.next398, %for.body43.us ], [ %indvars.iv397.ph, %for.body43.us.preheader ]
%arrayidx47.us = getelementptr inbounds i64, ptr %arrayidx45.us, i64 %indvars.iv397
%47 = load i64, ptr %arrayidx47.us, align 8, !tbaa !13
%arrayidx51.us = getelementptr inbounds i64, ptr %arrayidx49.us, i64 %indvars.iv397
%48 = load i64, ptr %arrayidx51.us, align 8, !tbaa !13
%sub.us = sub nsw i64 %47, %48
%49 = call i64 @llvm.abs.i64(i64 %sub.us, i1 true)
%arrayidx55.us = getelementptr inbounds i64, ptr %arrayidx53.us, i64 %indvars.iv397
store i64 %49, ptr %arrayidx55.us, align 8, !tbaa !13
%indvars.iv.next398 = add nuw nsw i64 %indvars.iv397, 1
%exitcond.not = icmp eq i64 %indvars.iv.next398, %31
br i1 %exitcond.not, label %for.cond40.for.cond.cleanup42_crit_edge.us, label %for.body43.us, !llvm.loop !18
for.cond40.for.cond.cleanup42_crit_edge.us: ; preds = %for.body43.us, %middle.block
%indvars.iv.next401 = add nuw nsw i64 %indvars.iv400, 1
%exitcond404.not = icmp eq i64 %indvars.iv.next401, %30
br i1 %exitcond404.not, label %for.cond.cleanup37, label %for.cond40.preheader.us, !llvm.loop !19
for.cond.cleanup20.loopexit: ; preds = %for.body21
%.pre435 = load i32, ptr %h, align 4, !tbaa !5
br label %for.cond.cleanup20
for.cond.cleanup20: ; preds = %for.cond.cleanup20.loopexit, %for.cond18.preheader
%50 = phi i32 [ %.pre435, %for.cond.cleanup20.loopexit ], [ %21, %for.cond18.preheader ]
%51 = phi i32 [ %53, %for.cond.cleanup20.loopexit ], [ %22, %for.cond18.preheader ]
%indvars.iv.next395 = add nuw nsw i64 %indvars.iv394, 1
%52 = sext i32 %50 to i64
%cmp14 = icmp slt i64 %indvars.iv.next395, %52
br i1 %cmp14, label %for.cond18.preheader, label %for.cond.cleanup15, !llvm.loop !20
for.body21: ; preds = %for.body21.lr.ph, %for.body21
%indvars.iv391 = phi i64 [ 0, %for.body21.lr.ph ], [ %indvars.iv.next392, %for.body21 ]
%arrayidx25 = getelementptr inbounds i64, ptr %arrayidx23, i64 %indvars.iv391
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx25)
%indvars.iv.next392 = add nuw nsw i64 %indvars.iv391, 1
%53 = load i32, ptr %w, align 4, !tbaa !5
%54 = sext i32 %53 to i64
%cmp19 = icmp slt i64 %indvars.iv.next392, %54
br i1 %cmp19, label %for.body21, label %for.cond.cleanup20.loopexit, !llvm.loop !21
for.cond.cleanup37: ; preds = %for.cond40.for.cond.cleanup42_crit_edge.us, %for.cond40.preheader.lr.ph, %for.cond40.preheader.lr.ph.thread, %for.cond.cleanup15.thread451, %for.cond.cleanup15
%cmp36323446 = phi i1 [ false, %for.cond.cleanup15 ], [ false, %for.cond.cleanup15.thread451 ], [ true, %for.cond40.preheader.lr.ph.thread ], [ true, %for.cond40.preheader.lr.ph ], [ true, %for.cond40.for.cond.cleanup42_crit_edge.us ]
%vla33444 = phi ptr [ %vla33, %for.cond.cleanup15 ], [ %vla33453, %for.cond.cleanup15.thread451 ], [ %vla33440, %for.cond40.preheader.lr.ph.thread ], [ %vla33, %for.cond40.preheader.lr.ph ], [ %vla33, %for.cond40.for.cond.cleanup42_crit_edge.us ]
%55 = phi i64 [ %31, %for.cond.cleanup15 ], [ %28, %for.cond.cleanup15.thread451 ], [ %25, %for.cond40.preheader.lr.ph.thread ], [ %31, %for.cond40.preheader.lr.ph ], [ %31, %for.cond40.for.cond.cleanup42_crit_edge.us ]
%56 = phi i64 [ %30, %for.cond.cleanup15 ], [ %27, %for.cond.cleanup15.thread451 ], [ %24, %for.cond40.preheader.lr.ph.thread ], [ %30, %for.cond40.preheader.lr.ph ], [ %30, %for.cond40.for.cond.cleanup42_crit_edge.us ]
%.lcssa442 = phi i32 [ %50, %for.cond.cleanup15 ], [ %.lcssa.ph450, %for.cond.cleanup15.thread451 ], [ %.lcssa.ph, %for.cond40.preheader.lr.ph.thread ], [ %50, %for.cond40.preheader.lr.ph ], [ %50, %for.cond40.for.cond.cleanup42_crit_edge.us ]
%57 = phi i32 [ %51, %for.cond.cleanup15 ], [ %.ph449, %for.cond.cleanup15.thread451 ], [ %.ph, %for.cond40.preheader.lr.ph.thread ], [ %51, %for.cond40.preheader.lr.ph ], [ %51, %for.cond40.for.cond.cleanup42_crit_edge.us ]
%add = add nsw i32 %57, %.lcssa442
%add.fr = freeze i32 %add
%mul = mul i32 %add.fr, 80
%conv = sext i32 %mul to i64
%call62 = call noalias dereferenceable_or_null(640) ptr @malloc(i64 noundef 640) #9
%add77 = shl nsw i64 %conv, 3
%mul78 = or i64 %add77, 8
%cmp83.not325 = icmp slt i32 %add.fr, 0
br i1 %cmp83.not325, label %for.body68.us, label %for.body68.preheader
for.body68.preheader: ; preds = %for.cond.cleanup37
%smax = call i64 @llvm.smax.i64(i64 %conv, i64 0)
%58 = shl nuw nsw i64 %smax, 3
%59 = or i64 %58, 8
br label %for.body68
for.body68.us: ; preds = %for.cond.cleanup37, %for.cond.cleanup75.split.us.us
%i63.0328.us = phi i64 [ %inc97.us, %for.cond.cleanup75.split.us.us ], [ 0, %for.cond.cleanup37 ]
%call69.us = call noalias dereferenceable_or_null(640) ptr @malloc(i64 noundef 640) #9
%arrayidx70.us = getelementptr inbounds ptr, ptr %call62, i64 %i63.0328.us
store ptr %call69.us, ptr %arrayidx70.us, align 8, !tbaa !22
br label %for.body76.us.us
for.body76.us.us: ; preds = %for.body76.us.us, %for.body68.us
%j71.0327.us.us = phi i64 [ 0, %for.body68.us ], [ %inc94.us.us, %for.body76.us.us ]
%call79.us.us = call noalias ptr @malloc(i64 noundef %mul78) #9
%arrayidx81.us.us = getelementptr inbounds ptr, ptr %call69.us, i64 %j71.0327.us.us
store ptr %call79.us.us, ptr %arrayidx81.us.us, align 8, !tbaa !22
%inc94.us.us = add nuw nsw i64 %j71.0327.us.us, 1
%exitcond407.not = icmp eq i64 %inc94.us.us, 80
br i1 %exitcond407.not, label %for.cond.cleanup75.split.us.us, label %for.body76.us.us, !llvm.loop !24
for.cond.cleanup75.split.us.us: ; preds = %for.body76.us.us
%inc97.us = add nuw nsw i64 %i63.0328.us, 1
%exitcond408.not = icmp eq i64 %inc97.us, 80
br i1 %exitcond408.not, label %for.cond.cleanup67, label %for.body68.us, !llvm.loop !25
for.cond.cleanup67: ; preds = %for.cond.cleanup75.split, %for.cond.cleanup75.split.us.us
%60 = load i64, ptr %vla33444, align 16, !tbaa !13
%61 = load ptr, ptr %call62, align 8, !tbaa !22
%62 = load ptr, ptr %61, align 8, !tbaa !22
%arrayidx103 = getelementptr inbounds i64, ptr %62, i64 %60
store i64 1, ptr %arrayidx103, align 8, !tbaa !13
%cmp112333 = icmp sgt i32 %57, 0
%or.cond = select i1 %cmp36323446, i1 %cmp112333, i1 false
br i1 %or.cond, label %for.cond111.preheader.us.preheader, label %for.cond207.preheader
for.cond111.preheader.us.preheader: ; preds = %for.cond.cleanup67
%smax409 = call i64 @llvm.smax.i64(i64 %conv, i64 0)
%63 = or i64 %smax409, 1
%invariant.gep = getelementptr ptr, ptr %call62, i64 -1
br label %for.cond111.preheader.us
for.cond111.preheader.us: ; preds = %for.cond111.preheader.us.preheader, %for.cond111.for.cond.cleanup114_crit_edge.us
%indvars.iv427 = phi i64 [ 0, %for.cond111.preheader.us.preheader ], [ %indvars.iv.next428, %for.cond111.for.cond.cleanup114_crit_edge.us ]
%cmp116.not.us = icmp eq i64 %indvars.iv427, 0
%gep = getelementptr ptr, ptr %invariant.gep, i64 %indvars.iv427
%64 = mul nuw nsw i64 %indvars.iv427, %55
%arrayidx134.us = getelementptr inbounds i64, ptr %vla33444, i64 %64
%arrayidx139.us = getelementptr inbounds ptr, ptr %call62, i64 %indvars.iv427
br i1 %cmp116.not.us, label %for.body115.lr.ph.split.us.us, label %for.body115.us339
for.body115.us339: ; preds = %for.cond111.preheader.us, %for.inc200.us353
%indvars.iv413 = phi i64 [ %indvars.iv.next414, %for.inc200.us353 ], [ 0, %for.cond111.preheader.us ]
br i1 %cmp83.not325, label %for.inc200.us353, label %for.body123.lr.ph.us
for.body123.us: ; preds = %for.body123.lr.ph.us, %for.inc153.us
%k118.0330.us = phi i64 [ 0, %for.body123.lr.ph.us ], [ %inc154.us, %for.inc153.us ]
%arrayidx129.us = getelementptr inbounds i64, ptr %77, i64 %k118.0330.us
%65 = load i64, ptr %arrayidx129.us, align 8, !tbaa !13
%cmp130.us = icmp eq i64 %65, 1
br i1 %cmp130.us, label %if.then132.us, label %for.inc153.us
if.then132.us: ; preds = %for.body123.us
%66 = load i64, ptr %arrayidx136.us, align 8, !tbaa !13
%add137.us = add nsw i64 %66, %k118.0330.us
%67 = call i64 @llvm.abs.i64(i64 %add137.us, i1 true)
%68 = load ptr, ptr %arrayidx139.us, align 8, !tbaa !22
%arrayidx141.us = getelementptr inbounds ptr, ptr %68, i64 %indvars.iv413
%69 = load ptr, ptr %arrayidx141.us, align 8, !tbaa !22
%arrayidx142.us = getelementptr inbounds i64, ptr %69, i64 %67
store i64 1, ptr %arrayidx142.us, align 8, !tbaa !13
%sub147.us = sub nsw i64 %k118.0330.us, %66
%70 = call i64 @llvm.abs.i64(i64 %sub147.us, i1 true)
%arrayidx152.us = getelementptr inbounds i64, ptr %69, i64 %70
store i64 1, ptr %arrayidx152.us, align 8, !tbaa !13
br label %for.inc153.us
for.inc153.us: ; preds = %if.then132.us, %for.body123.us
%inc154.us = add nuw nsw i64 %k118.0330.us, 1
%exitcond410.not = icmp eq i64 %inc154.us, %63
br i1 %exitcond410.not, label %if.end156.loopexit.us, label %for.body123.us, !llvm.loop !26
for.body165.us341: ; preds = %for.body165.lr.ph.us, %for.inc196.us350
%k160.0332.us342 = phi i64 [ 0, %for.body165.lr.ph.us ], [ %inc197.us351, %for.inc196.us350 ]
%arrayidx171.us343 = getelementptr inbounds i64, ptr %80, i64 %k160.0332.us342
%71 = load i64, ptr %arrayidx171.us343, align 8, !tbaa !13
%cmp172.us344 = icmp eq i64 %71, 1
br i1 %cmp172.us344, label %if.then174.us345, label %for.inc196.us350
if.then174.us345: ; preds = %for.body165.us341
%72 = load i64, ptr %arrayidx178.us362, align 8, !tbaa !13
%add179.us346 = add nsw i64 %72, %k160.0332.us342
%73 = call i64 @llvm.abs.i64(i64 %add179.us346, i1 true)
%74 = load ptr, ptr %arrayidx183.us363, align 8, !tbaa !22
%arrayidx184.us347 = getelementptr inbounds i64, ptr %74, i64 %73
store i64 1, ptr %arrayidx184.us347, align 8, !tbaa !13
%sub189.us348 = sub nsw i64 %k160.0332.us342, %72
%75 = call i64 @llvm.abs.i64(i64 %sub189.us348, i1 true)
%arrayidx194.us349 = getelementptr inbounds i64, ptr %74, i64 %75
store i64 1, ptr %arrayidx194.us349, align 8, !tbaa !13
br label %for.inc196.us350
for.inc196.us350: ; preds = %if.then174.us345, %for.body165.us341
%inc197.us351 = add nuw nsw i64 %k160.0332.us342, 1
%exitcond412.not = icmp eq i64 %inc197.us351, %63
br i1 %exitcond412.not, label %for.inc200.us353, label %for.body165.us341, !llvm.loop !27
for.inc200.us353: ; preds = %for.inc196.us350, %for.body115.us339, %if.end156.loopexit.us
%indvars.iv.next414 = add nuw nsw i64 %indvars.iv413, 1
%exitcond418.not = icmp eq i64 %indvars.iv.next414, %55
br i1 %exitcond418.not, label %for.cond111.for.cond.cleanup114_crit_edge.us, label %for.body115.us339, !llvm.loop !28
if.end156.loopexit.us: ; preds = %for.inc153.us
%cmp157.not.us357 = icmp eq i64 %indvars.iv413, 0
%brmerge = or i1 %cmp157.not.us357, %cmp83.not325
br i1 %brmerge, label %for.inc200.us353, label %for.body165.lr.ph.us
for.body123.lr.ph.us: ; preds = %for.body115.us339
%76 = load ptr, ptr %gep, align 8, !tbaa !22
%arrayidx128.us = getelementptr inbounds ptr, ptr %76, i64 %indvars.iv413
%77 = load ptr, ptr %arrayidx128.us, align 8, !tbaa !22
%arrayidx136.us = getelementptr inbounds i64, ptr %arrayidx134.us, i64 %indvars.iv413
br label %for.body123.us
for.body165.lr.ph.us: ; preds = %if.end156.loopexit.us
%78 = load ptr, ptr %arrayidx139.us, align 8, !tbaa !22
%79 = getelementptr ptr, ptr %78, i64 %indvars.iv413
%arrayidx170.us360 = getelementptr ptr, ptr %79, i64 -1
%80 = load ptr, ptr %arrayidx170.us360, align 8, !tbaa !22
%arrayidx178.us362 = getelementptr inbounds i64, ptr %arrayidx134.us, i64 %indvars.iv413
%arrayidx183.us363 = getelementptr inbounds ptr, ptr %78, i64 %indvars.iv413
br label %for.body165.us341
for.cond111.for.cond.cleanup114_crit_edge.us: ; preds = %for.inc200.us353, %for.inc200.us.us370, %for.body115.lr.ph.split.us.us
%indvars.iv.next428 = add nuw nsw i64 %indvars.iv427, 1
%exitcond432.not = icmp eq i64 %indvars.iv.next428, %56
br i1 %exitcond432.not, label %for.cond207.preheader, label %for.cond111.preheader.us, !llvm.loop !29
for.body115.lr.ph.split.us.us: ; preds = %for.cond111.preheader.us
br i1 %cmp83.not325, label %for.cond111.for.cond.cleanup114_crit_edge.us, label %for.body115.us.us367
for.body115.us.us367: ; preds = %for.body115.lr.ph.split.us.us, %for.inc200.us.us370
%indvars.iv421 = phi i64 [ %indvars.iv.next422, %for.inc200.us.us370 ], [ 0, %for.body115.lr.ph.split.us.us ]
%cmp157.not.us.us369 = icmp eq i64 %indvars.iv421, 0
br i1 %cmp157.not.us.us369, label %for.inc200.us.us370, label %for.cond161.preheader.us.us373
for.body165.us.us: ; preds = %for.cond161.preheader.us.us373, %for.inc196.us.us
%k160.0332.us.us = phi i64 [ 0, %for.cond161.preheader.us.us373 ], [ %inc197.us.us, %for.inc196.us.us ]
%arrayidx171.us.us = getelementptr inbounds i64, ptr %88, i64 %k160.0332.us.us
%81 = load i64, ptr %arrayidx171.us.us, align 8, !tbaa !13
%cmp172.us.us = icmp eq i64 %81, 1
br i1 %cmp172.us.us, label %if.then174.us.us, label %for.inc196.us.us
if.then174.us.us: ; preds = %for.body165.us.us
%82 = load i64, ptr %arrayidx178.us.us, align 8, !tbaa !13
%add179.us.us = add nsw i64 %82, %k160.0332.us.us
%83 = call i64 @llvm.abs.i64(i64 %add179.us.us, i1 true)
%84 = load ptr, ptr %arrayidx183.us.us, align 8, !tbaa !22
%arrayidx184.us.us = getelementptr inbounds i64, ptr %84, i64 %83
store i64 1, ptr %arrayidx184.us.us, align 8, !tbaa !13
%sub189.us.us = sub nsw i64 %k160.0332.us.us, %82
%85 = call i64 @llvm.abs.i64(i64 %sub189.us.us, i1 true)
%arrayidx194.us.us = getelementptr inbounds i64, ptr %84, i64 %85
store i64 1, ptr %arrayidx194.us.us, align 8, !tbaa !13
br label %for.inc196.us.us
for.inc196.us.us: ; preds = %if.then174.us.us, %for.body165.us.us
%inc197.us.us = add nuw nsw i64 %k160.0332.us.us, 1
%exitcond420.not = icmp eq i64 %inc197.us.us, %63
br i1 %exitcond420.not, label %for.inc200.us.us370, label %for.body165.us.us, !llvm.loop !27
for.inc200.us.us370: ; preds = %for.inc196.us.us, %for.body115.us.us367
%indvars.iv.next422 = add nuw nsw i64 %indvars.iv421, 1
%exitcond426.not = icmp eq i64 %indvars.iv.next422, %55
br i1 %exitcond426.not, label %for.cond111.for.cond.cleanup114_crit_edge.us, label %for.body115.us.us367, !llvm.loop !28
for.cond161.preheader.us.us373: ; preds = %for.body115.us.us367
%86 = load ptr, ptr %arrayidx139.us, align 8, !tbaa !22
%87 = getelementptr ptr, ptr %86, i64 %indvars.iv421
%arrayidx170.us.us = getelementptr ptr, ptr %87, i64 -1
%88 = load ptr, ptr %arrayidx170.us.us, align 8, !tbaa !22
%arrayidx178.us.us = getelementptr inbounds i64, ptr %arrayidx134.us, i64 %indvars.iv421
%arrayidx183.us.us = getelementptr inbounds ptr, ptr %86, i64 %indvars.iv421
br label %for.body165.us.us
for.body68: ; preds = %for.body68.preheader, %for.cond.cleanup75.split
%i63.0328 = phi i64 [ %inc97, %for.cond.cleanup75.split ], [ 0, %for.body68.preheader ]
%call69 = call noalias dereferenceable_or_null(640) ptr @malloc(i64 noundef 640) #9
%arrayidx70 = getelementptr inbounds ptr, ptr %call62, i64 %i63.0328
store ptr %call69, ptr %arrayidx70, align 8, !tbaa !22
br label %for.body76
for.cond.cleanup75.split: ; preds = %for.body76
%inc97 = add nuw nsw i64 %i63.0328, 1
%exitcond406.not = icmp eq i64 %inc97, 80
br i1 %exitcond406.not, label %for.cond.cleanup67, label %for.body68, !llvm.loop !25
for.body76: ; preds = %for.body68, %for.body76
%j71.0327 = phi i64 [ 0, %for.body68 ], [ %inc94, %for.body76 ]
%call79 = call noalias ptr @malloc(i64 noundef %mul78) #9
%arrayidx81 = getelementptr inbounds ptr, ptr %call69, i64 %j71.0327
store ptr %call79, ptr %arrayidx81, align 8, !tbaa !22
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(1) %call79, i8 0, i64 %59, i1 false), !tbaa !13
%inc94 = add nuw nsw i64 %j71.0327, 1
%exitcond405.not = icmp eq i64 %inc94, 80
br i1 %exitcond405.not, label %for.cond.cleanup75.split, label %for.body76, !llvm.loop !24
for.cond207.preheader: ; preds = %for.cond111.for.cond.cleanup114_crit_edge.us, %for.cond.cleanup67
br i1 %cmp83.not325, label %cleanup, label %for.body211.lr.ph
for.body211.lr.ph: ; preds = %for.cond207.preheader
%sub212 = add nsw i32 %.lcssa442, -1
%idxprom213 = sext i32 %sub212 to i64
%arrayidx214 = getelementptr inbounds ptr, ptr %call62, i64 %idxprom213
%89 = load ptr, ptr %arrayidx214, align 8, !tbaa !22
%sub215 = add nsw i32 %57, -1
%idxprom216 = sext i32 %sub215 to i64
%arrayidx217 = getelementptr inbounds ptr, ptr %89, i64 %idxprom216
%90 = load ptr, ptr %arrayidx217, align 8, !tbaa !22
%smax433 = call i64 @llvm.smax.i64(i64 %conv, i64 0)
%91 = or i64 %smax433, 1
br label %for.body211
for.body211: ; preds = %for.body211.lr.ph, %for.inc224
%i206.0377 = phi i64 [ 0, %for.body211.lr.ph ], [ %inc225, %for.inc224 ]
%arrayidx218 = getelementptr inbounds i64, ptr %90, i64 %i206.0377
%92 = load i64, ptr %arrayidx218, align 8, !tbaa !13
%cmp219 = icmp eq i64 %92, 1
br i1 %cmp219, label %if.then221, label %for.inc224
if.then221: ; preds = %for.body211
%call222 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %i206.0377)
br label %cleanup
for.inc224: ; preds = %for.body211
%inc225 = add nuw nsw i64 %i206.0377, 1
%exitcond434.not = icmp eq i64 %inc225, %91
br i1 %exitcond434.not, label %cleanup, label %for.body211, !llvm.loop !30
cleanup: ; preds = %for.inc224, %for.cond207.preheader, %if.then221
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.abs.v2i64(<2 x i64>, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = distinct !{!12, !10}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10, !11}
!21 = distinct !{!21, !10}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
|
#include<stdio.h>
int main()
{
long long int a, b, t, r, f, y;
scanf("%lld", &t);
while(t--)
{
scanf("%lld %lld", &a, &b);
r=0;
f=0;
y=0;
if(a==b)
{
printf("0\n");
y=1;
}
else if(a<b)
{
while(a<=b)
{
if(a*8<=b){
a=a*8;
}
else if(a*4<=b){
a=a*4;
}
else{
a=a*2;
}
r++;
if(a==b){
break;
}
else if(a>b){
f=1;
break;
}
}
}
else
{
while(a>=b)
{
if(a/8 >= b && a%8==0){
a=a/8;
}
else if(a/4 >= b && a%4==0){
a=a/4;
}
else if(a%2==0){
a=a/2;
}
else{
f=1;
break;
}
r++;
if(a==b){
break;
}
else if(a<b){
f=1;
break;
}
}
}
if(f==1 && y==0){
printf("-1\n");
}
else if(y==0){
printf("%lld\n", r);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20305/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20305/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%lld %lld\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
@str.5 = 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:
%a = alloca i64, align 8
%b = alloca i64, align 8
%t = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec98 = add nsw i64 %0, -1
store i64 %dec98, ptr %t, align 8, !tbaa !5
%tobool.not99 = icmp eq i64 %0, 0
br i1 %tobool.not99, label %while.end73, label %while.body
while.body: ; preds = %entry, %if.end72
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%cmp.not = icmp eq i64 %1, %2
br i1 %cmp.not, label %if.else67.thread, label %if.else
if.else67.thread: ; preds = %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end72
if.else: ; preds = %while.body
%cmp3 = icmp slt i64 %1, %2
br i1 %cmp3, label %while.cond5, label %while.cond27
while.cond5: ; preds = %if.else, %if.else21
%3 = phi i64 [ %4, %if.else21 ], [ %1, %if.else ]
%r.0 = phi i64 [ %inc, %if.else21 ], [ 0, %if.else ]
%cmp6.not = icmp sgt i64 %3, %2
br i1 %cmp6.not, label %if.then69, label %while.body7
while.body7: ; preds = %while.cond5
%mul = shl nsw i64 %3, 3
%cmp8.not = icmp sgt i64 %mul, %2
br i1 %cmp8.not, label %if.else11, label %if.then9
if.then9: ; preds = %while.body7
store i64 %mul, ptr %a, align 8, !tbaa !5
br label %if.end18
if.else11: ; preds = %while.body7
%mul12 = shl nsw i64 %3, 2
%cmp13.not = icmp sgt i64 %mul12, %2
br i1 %cmp13.not, label %if.else16, label %if.then14
if.then14: ; preds = %if.else11
store i64 %mul12, ptr %a, align 8, !tbaa !5
br label %if.end18
if.else16: ; preds = %if.else11
%mul17 = shl nsw i64 %3, 1
store i64 %mul17, ptr %a, align 8, !tbaa !5
br label %if.end18
if.end18: ; preds = %if.then14, %if.else16, %if.then9
%4 = phi i64 [ %mul12, %if.then14 ], [ %mul17, %if.else16 ], [ %mul, %if.then9 ]
%inc = add nuw nsw i64 %r.0, 1
%cmp19 = icmp eq i64 %4, %2
br i1 %cmp19, label %if.then69, label %if.else21
if.else21: ; preds = %if.end18
%cmp22 = icmp sgt i64 %4, %2
br i1 %cmp22, label %if.then65, label %while.cond5, !llvm.loop !9
while.cond27: ; preds = %if.else, %if.else54
%5 = phi i64 [ %9, %if.else54 ], [ %1, %if.else ]
%r.1 = phi i64 [ %inc51, %if.else54 ], [ 0, %if.else ]
%cmp28.not = icmp slt i64 %5, %2
br i1 %cmp28.not, label %if.then69, label %while.body29
while.body29: ; preds = %while.cond27
%div = sdiv i64 %5, 8
%cmp30.not = icmp sge i64 %div, %2
%6 = and i64 %5, 7
%cmp31 = icmp eq i64 %6, 0
%or.cond87 = and i1 %cmp30.not, %cmp31
br i1 %or.cond87, label %if.then32, label %if.else34
if.then32: ; preds = %while.body29
store i64 %div, ptr %a, align 8, !tbaa !5
br label %if.end50
if.else34: ; preds = %while.body29
%div35 = sdiv i64 %5, 4
%cmp36.not = icmp sge i64 %div35, %2
%7 = and i64 %5, 3
%cmp39 = icmp eq i64 %7, 0
%or.cond88 = and i1 %cmp36.not, %cmp39
br i1 %or.cond88, label %if.then40, label %if.else42
if.then40: ; preds = %if.else34
store i64 %div35, ptr %a, align 8, !tbaa !5
br label %if.end50
if.else42: ; preds = %if.else34
%8 = and i64 %5, 1
%cmp44 = icmp eq i64 %8, 0
br i1 %cmp44, label %if.then45, label %if.then65
if.then45: ; preds = %if.else42
%div46 = sdiv i64 %5, 2
store i64 %div46, ptr %a, align 8, !tbaa !5
br label %if.end50
if.end50: ; preds = %if.then40, %if.then45, %if.then32
%9 = phi i64 [ %div35, %if.then40 ], [ %div46, %if.then45 ], [ %div, %if.then32 ]
%inc51 = add nuw nsw i64 %r.1, 1
%cmp52 = icmp eq i64 %9, %2
br i1 %cmp52, label %if.then69, label %if.else54
if.else54: ; preds = %if.end50
%cmp55 = icmp slt i64 %9, %2
br i1 %cmp55, label %if.then65, label %while.cond27, !llvm.loop !11
if.then65: ; preds = %if.else42, %if.else54, %if.else21
%puts86 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end72
if.then69: ; preds = %if.end50, %while.cond27, %if.end18, %while.cond5
%r.292 = phi i64 [ %inc, %if.end18 ], [ %r.0, %while.cond5 ], [ %inc51, %if.end50 ], [ %r.1, %while.cond27 ]
%call70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %r.292)
br label %if.end72
if.end72: ; preds = %if.else67.thread, %if.then69, %if.then65
%10 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %10, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %10, 0
br i1 %tobool.not, label %while.end73, label %while.body, !llvm.loop !12
while.end73: ; preds = %if.end72, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind 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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<math.h>
int main(void){
long A,B;
scanf("%ld%ld",&A,&B);
long base;
int i;
if(A<B){
base=A;
A=B;
B=base;
}
long r;
r=A%B;
while(r!=0){
A=B;
B=r;
r=A%B;
}
long gcm=B;
int count=1;
if(gcm%2==0){
count++;
while(gcm%2==0 && gcm!=0){
gcm/=2;
}
}
for(i=3;i<=sqrt(gcm);i+=2){
if(gcm%i==0){
count++;
while(gcm%i==0 && gcm!=0){
gcm/=i;
}
}
}
if(gcm>1){
count++;
}
printf("%d",count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203093/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203093/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [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 i64, align 8
%B = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %A, align 8, !tbaa !5
%1 = load i64, ptr %B, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i64 %1, ptr %A, align 8, !tbaa !5
store i64 %0, ptr %B, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i64 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i64 [ %1, %if.then ], [ %0, %entry ]
%rem = srem i64 %3, %2
%cmp1.not62 = icmp eq i64 %rem, 0
br i1 %cmp1.not62, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%r.064 = phi i64 [ %rem2, %while.body ], [ %rem, %if.end ]
%r.06163 = phi i64 [ %r.064, %while.body ], [ %2, %if.end ]
%rem2 = srem i64 %r.06163, %r.064
%cmp1.not = icmp eq i64 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %r.06163, ptr %A, align 8, !tbaa !5
store i64 %r.064, ptr %B, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i64 [ %r.064, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%5 = and i64 %4, 1
%cmp4 = icmp eq i64 %5, 0
br i1 %cmp4, label %while.cond6.preheader, label %if.end12
while.cond6.preheader: ; preds = %while.end
%cmp966.not = icmp eq i64 %4, 0
br i1 %cmp966.not, label %if.end12, label %while.body10
while.body10: ; preds = %while.cond6.preheader, %while.body10
%gcm.067 = phi i64 [ %div, %while.body10 ], [ %4, %while.cond6.preheader ]
%div = sdiv i64 %gcm.067, 2
%6 = and i64 %div, 1
%cmp8 = icmp eq i64 %6, 0
%7 = add i64 %gcm.067, -2
%cmp9 = icmp ult i64 %7, -3
%8 = and i1 %cmp9, %cmp8
br i1 %8, label %while.body10, label %if.end12, !llvm.loop !11
if.end12: ; preds = %while.body10, %while.cond6.preheader, %while.end
%gcm.1 = phi i64 [ %4, %while.end ], [ 0, %while.cond6.preheader ], [ %div, %while.body10 ]
%count.0 = phi i32 [ 1, %while.end ], [ 2, %while.cond6.preheader ], [ 2, %while.body10 ]
%conv1373 = sitofp i64 %gcm.1 to double
%call1474 = call double @sqrt(double noundef %conv1373) #4
%cmp1575 = fcmp ult double %call1474, 3.000000e+00
br i1 %cmp1575, label %for.end, label %for.body
for.body: ; preds = %if.end12, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 3, %if.end12 ]
%count.178 = phi i32 [ %count.2, %for.inc ], [ %count.0, %if.end12 ]
%gcm.277 = phi i64 [ %gcm.4, %for.inc ], [ %gcm.1, %if.end12 ]
%rem18 = srem i64 %gcm.277, %indvars.iv
%cmp19 = icmp eq i64 %rem18, 0
br i1 %cmp19, label %if.then21, label %for.inc
if.then21: ; preds = %for.body
%inc22 = add nsw i32 %count.178, 1
%cmp2970.not = icmp eq i64 %gcm.277, 0
br i1 %cmp2970.not, label %for.inc, label %while.body32
while.body32: ; preds = %if.then21, %while.body32
%gcm.371 = phi i64 [ %div34, %while.body32 ], [ %gcm.277, %if.then21 ]
%div34 = sdiv i64 %gcm.371, %indvars.iv
%rem25 = srem i64 %div34, %indvars.iv
%cmp26 = icmp eq i64 %rem25, 0
%cmp29 = icmp ne i64 %div34, 0
%9 = and i1 %cmp29, %cmp26
br i1 %9, label %while.body32, label %for.inc, !llvm.loop !12
for.inc: ; preds = %while.body32, %if.then21, %for.body
%gcm.4 = phi i64 [ %gcm.277, %for.body ], [ 0, %if.then21 ], [ %div34, %while.body32 ]
%count.2 = phi i32 [ %count.178, %for.body ], [ %inc22, %if.then21 ], [ %inc22, %while.body32 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 2
%10 = trunc i64 %indvars.iv.next to i32
%conv = sitofp i32 %10 to double
%conv13 = sitofp i64 %gcm.4 to double
%call14 = call double @sqrt(double noundef %conv13) #4
%cmp15 = fcmp ult double %call14, %conv
br i1 %cmp15, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.inc, %if.end12
%gcm.2.lcssa = phi i64 [ %gcm.1, %if.end12 ], [ %gcm.4, %for.inc ]
%count.1.lcssa = phi i32 [ %count.0, %if.end12 ], [ %count.2, %for.inc ]
%cmp37 = icmp sgt i64 %gcm.2.lcssa, 1
%inc40 = zext i1 %cmp37 to i32
%spec.select = add nsw i32 %count.1.lcssa, %inc40
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
int a,b,c,d,h1,h2,k1,k2,H,K;
scanf("%d%d%d%d%d%d%d%d",&h1,&h2,&k1,&k2,&a,&b,&c,&d);
H=a*h1+h1/10*c+b*h2+h2/20*d;
K=a*k1+k1/10*c+b*k2+k2/20*d;
if(H>K)
{
printf("hiroshi\n");
}
else if(H<K)
{
printf("kenjiro\n");
}
else
{
printf("even\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203150/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203150/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [17 x i8] c"%d%d%d%d%d%d%d%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"even\00", align 1
@str.4 = private unnamed_addr constant [8 x i8] c"kenjiro\00", align 1
@str.5 = private unnamed_addr constant [8 x i8] c"hiroshi\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
%h1 = alloca i32, align 4
%h2 = alloca i32, align 4
%k1 = alloca i32, align 4
%k2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %h2, ptr noundef nonnull %k1, ptr noundef nonnull %k2, 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 %h1, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%div = sdiv i32 %1, 10
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul1 = mul nsw i32 %div, %2
%add = add nsw i32 %mul1, %mul
%3 = load i32, ptr %b, align 4, !tbaa !5
%4 = load i32, ptr %h2, align 4, !tbaa !5
%mul2 = mul nsw i32 %4, %3
%add3 = add nsw i32 %add, %mul2
%div4 = sdiv i32 %4, 20
%5 = load i32, ptr %d, align 4, !tbaa !5
%mul5 = mul nsw i32 %div4, %5
%add6 = add nsw i32 %add3, %mul5
%6 = load i32, ptr %k1, align 4, !tbaa !5
%mul7 = mul nsw i32 %6, %0
%div8 = sdiv i32 %6, 10
%mul9 = mul nsw i32 %div8, %2
%add10 = add nsw i32 %mul9, %mul7
%7 = load i32, ptr %k2, align 4, !tbaa !5
%mul11 = mul nsw i32 %7, %3
%add12 = add nsw i32 %add10, %mul11
%div13 = sdiv i32 %7, 20
%mul14 = mul nsw i32 %div13, %5
%add15 = add nsw i32 %add12, %mul14
%cmp = icmp sgt i32 %add6, %add15
%cmp17 = icmp slt i32 %add6, %add15
%str.4.str = select i1 %cmp17, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts25 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int h1,h2,k1,k2,a,b,c,d,x,y,x1,x2,y1,y2;
scanf("%d %d",&h1,&h2);
scanf("%d %d",&k1,&k2);
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
x1=h1*a;
x2=k1*a;
y1=h2*b;
y2=k2*b;
h1=h1/10*c+x1;
h2=h2/20*d+y1;
k1=k1/10*c+x2;
k2=k2/20*d+y2;
x=h1+h2;
y=k1+k2;
if(x>y) printf("hiroshi\n");
else if(x<y) printf("kenjiro\n");
else printf("even\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203194/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203194/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"even\00", align 1
@str.5 = private unnamed_addr constant [8 x i8] c"kenjiro\00", align 1
@str.6 = private unnamed_addr constant [8 x i8] c"hiroshi\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h1 = alloca i32, align 4
%h2 = alloca i32, align 4
%k1 = alloca i32, align 4
%k2 = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h1, ptr noundef nonnull %h2)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k1, ptr noundef nonnull %k2)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %d)
%0 = load i32, ptr %h1, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %k1, align 4, !tbaa !5
%mul6 = mul nsw i32 %2, %1
%3 = load i32, ptr %h2, align 4, !tbaa !5
%4 = load i32, ptr %b, align 4, !tbaa !5
%mul7 = mul nsw i32 %4, %3
%5 = load i32, ptr %k2, align 4, !tbaa !5
%mul8 = mul nsw i32 %5, %4
%div = sdiv i32 %0, 10
%6 = load i32, ptr %c, align 4, !tbaa !5
%mul9 = mul nsw i32 %6, %div
%add = add nsw i32 %mul9, %mul
store i32 %add, ptr %h1, align 4, !tbaa !5
%div10 = sdiv i32 %3, 20
%7 = load i32, ptr %d, align 4, !tbaa !5
%mul11 = mul nsw i32 %7, %div10
%add12 = add nsw i32 %mul11, %mul7
store i32 %add12, ptr %h2, align 4, !tbaa !5
%div13 = sdiv i32 %2, 10
%mul14 = mul nsw i32 %6, %div13
%add15 = add nsw i32 %mul14, %mul6
store i32 %add15, ptr %k1, align 4, !tbaa !5
%div16 = sdiv i32 %5, 20
%mul17 = mul nsw i32 %7, %div16
%add18 = add nsw i32 %mul17, %mul8
store i32 %add18, ptr %k2, align 4, !tbaa !5
%add19 = add nsw i32 %add12, %add
%add20 = add nsw i32 %add18, %add15
%cmp = icmp sgt i32 %add19, %add20
%cmp22 = icmp slt i32 %add19, %add20
%str.5.str = select i1 %cmp22, ptr @str.5, ptr @str
%str.5.sink = select i1 %cmp, ptr @str.6, ptr %str.5.str
%puts30 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h2) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,m,d[100],p,pp,s,a,b,c,i,j;
while(scanf("%d",&n),n){
for(j=0;j<n;j++){
s=0;
a=b=c=1;
scanf("%d",&m);
for(i=0;i<10;i++){
scanf("%d",&p);
s+=p*a;//printf("!%d %d %d %d %d",s,i,a,b,c);
if(p==10){
if(i<9){
b++;
c++;
}
}
a=b;
b=c;
c=1;
if(p-10||i==9){
scanf("%d",&pp);
s+=pp*a;//printf("!!%d %d %d %d %d",s,i,a,b,c);
if(p+pp==10){
b++;
}
a=b;
b=c;
c=1;
}//printf("\n");
}
if(p+pp>=10){
scanf("%d",&p);
s+=p;
}
s=(300-s)*10000+m;
//printf("%d\n",s);
for(i=j;j&&d[i-1]>s;i--)d[i]=d[i-1];
d[i]=s;
//for(i=0;i<=j;i++)printf("!%d %d",300-d[i]/10000,d[i]%10000);printf("\n");
}
for(i=0;i<n;i++)printf("%d %d\n",d[i]%10000,300-d[i]/10000);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203244/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203244/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\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
%d = alloca [100 x i32], align 16
%p = alloca i32, align 4
%pp = 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 %m) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pp) #3
%call110 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not111 = icmp eq i32 %0, 0
br i1 %tobool.not111, label %while.end, label %for.cond.preheader
while.cond.loopexit: ; preds = %for.body52, %for.cond.preheader, %for.cond50.preheader
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end, label %for.cond.preheader, !llvm.loop !9
for.cond.preheader: ; preds = %entry, %while.cond.loopexit
%2 = phi i32 [ %1, %while.cond.loopexit ], [ %0, %entry ]
%cmp104 = icmp sgt i32 %2, 0
br i1 %cmp104, label %for.body, label %while.cond.loopexit
for.cond50.preheader: ; preds = %for.end44
%cmp51108 = icmp sgt i32 %38, 0
br i1 %cmp51108, label %for.body52, label %while.cond.loopexit
for.body: ; preds = %for.cond.preheader, %for.end44
%indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.end44 ], [ 0, %for.cond.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.end44 ], [ -1, %for.cond.preheader ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%3 = load i32, ptr %p, align 4, !tbaa !5
%cmp6 = icmp eq i32 %3, 10
%spec.select = select i1 %cmp6, i32 2, i32 1
%spec.select89 = select i1 %cmp6, i32 2, i32 1
%tobool11.not = icmp eq i32 %3, 10
br i1 %tobool11.not, label %for.inc, label %if.then13
if.then13: ; preds = %for.body
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%4 = load i32, ptr %pp, align 4, !tbaa !5
%add16 = add nsw i32 %4, %3
%5 = load i32, ptr %p, align 4, !tbaa !5
%add17 = add nsw i32 %5, %4
%cmp18 = icmp eq i32 %add17, 10
%inc20 = zext i1 %cmp18 to i32
%spec.select90 = add nuw nsw i32 %spec.select89, %inc20
br label %for.inc
for.inc: ; preds = %if.then13, %for.body
%s.1 = phi i32 [ %add16, %if.then13 ], [ 10, %for.body ]
%a.1 = phi i32 [ %spec.select90, %if.then13 ], [ %spec.select, %for.body ]
%b.3 = phi i32 [ 1, %if.then13 ], [ %spec.select89, %for.body ]
%call5.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%6 = load i32, ptr %p, align 4, !tbaa !5
%mul.1 = mul nsw i32 %6, %a.1
%add.1 = add nsw i32 %mul.1, %s.1
%cmp6.1 = icmp eq i32 %6, 10
%inc.1 = zext i1 %cmp6.1 to i32
%spec.select.1 = add nuw nsw i32 %b.3, %inc.1
%spec.select89.1 = select i1 %cmp6.1, i32 2, i32 1
%tobool11.1.not = icmp eq i32 %6, 10
br i1 %tobool11.1.not, label %for.inc.1, label %if.then13.1
if.then13.1: ; preds = %for.inc
%call14.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%7 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.1 = mul nsw i32 %7, %spec.select.1
%add16.1 = add nsw i32 %mul15.1, %add.1
%8 = load i32, ptr %p, align 4, !tbaa !5
%add17.1 = add nsw i32 %8, %7
%cmp18.1 = icmp eq i32 %add17.1, 10
%inc20.1 = zext i1 %cmp18.1 to i32
%spec.select90.1 = add nuw nsw i32 %spec.select89.1, %inc20.1
br label %for.inc.1
for.inc.1: ; preds = %if.then13.1, %for.inc
%s.1.1 = phi i32 [ %add16.1, %if.then13.1 ], [ %add.1, %for.inc ]
%a.1.1 = phi i32 [ %spec.select90.1, %if.then13.1 ], [ %spec.select.1, %for.inc ]
%b.3.1 = phi i32 [ 1, %if.then13.1 ], [ %spec.select89.1, %for.inc ]
%call5.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%9 = load i32, ptr %p, align 4, !tbaa !5
%mul.2 = mul nsw i32 %9, %a.1.1
%add.2 = add nsw i32 %mul.2, %s.1.1
%cmp6.2 = icmp eq i32 %9, 10
%inc.2 = zext i1 %cmp6.2 to i32
%spec.select.2 = add nuw nsw i32 %b.3.1, %inc.2
%spec.select89.2 = select i1 %cmp6.2, i32 2, i32 1
%tobool11.2.not = icmp eq i32 %9, 10
br i1 %tobool11.2.not, label %for.inc.2, label %if.then13.2
if.then13.2: ; preds = %for.inc.1
%call14.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%10 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.2 = mul nsw i32 %10, %spec.select.2
%add16.2 = add nsw i32 %mul15.2, %add.2
%11 = load i32, ptr %p, align 4, !tbaa !5
%add17.2 = add nsw i32 %11, %10
%cmp18.2 = icmp eq i32 %add17.2, 10
%inc20.2 = zext i1 %cmp18.2 to i32
%spec.select90.2 = add nuw nsw i32 %spec.select89.2, %inc20.2
br label %for.inc.2
for.inc.2: ; preds = %if.then13.2, %for.inc.1
%s.1.2 = phi i32 [ %add16.2, %if.then13.2 ], [ %add.2, %for.inc.1 ]
%a.1.2 = phi i32 [ %spec.select90.2, %if.then13.2 ], [ %spec.select.2, %for.inc.1 ]
%b.3.2 = phi i32 [ 1, %if.then13.2 ], [ %spec.select89.2, %for.inc.1 ]
%call5.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%12 = load i32, ptr %p, align 4, !tbaa !5
%mul.3 = mul nsw i32 %12, %a.1.2
%add.3 = add nsw i32 %mul.3, %s.1.2
%cmp6.3 = icmp eq i32 %12, 10
%inc.3 = zext i1 %cmp6.3 to i32
%spec.select.3 = add nuw nsw i32 %b.3.2, %inc.3
%spec.select89.3 = select i1 %cmp6.3, i32 2, i32 1
%tobool11.3.not = icmp eq i32 %12, 10
br i1 %tobool11.3.not, label %for.inc.3, label %if.then13.3
if.then13.3: ; preds = %for.inc.2
%call14.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%13 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.3 = mul nsw i32 %13, %spec.select.3
%add16.3 = add nsw i32 %mul15.3, %add.3
%14 = load i32, ptr %p, align 4, !tbaa !5
%add17.3 = add nsw i32 %14, %13
%cmp18.3 = icmp eq i32 %add17.3, 10
%inc20.3 = zext i1 %cmp18.3 to i32
%spec.select90.3 = add nuw nsw i32 %spec.select89.3, %inc20.3
br label %for.inc.3
for.inc.3: ; preds = %if.then13.3, %for.inc.2
%s.1.3 = phi i32 [ %add16.3, %if.then13.3 ], [ %add.3, %for.inc.2 ]
%a.1.3 = phi i32 [ %spec.select90.3, %if.then13.3 ], [ %spec.select.3, %for.inc.2 ]
%b.3.3 = phi i32 [ 1, %if.then13.3 ], [ %spec.select89.3, %for.inc.2 ]
%call5.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%15 = load i32, ptr %p, align 4, !tbaa !5
%mul.4 = mul nsw i32 %15, %a.1.3
%add.4 = add nsw i32 %mul.4, %s.1.3
%cmp6.4 = icmp eq i32 %15, 10
%inc.4 = zext i1 %cmp6.4 to i32
%spec.select.4 = add nuw nsw i32 %b.3.3, %inc.4
%spec.select89.4 = select i1 %cmp6.4, i32 2, i32 1
%tobool11.4.not = icmp eq i32 %15, 10
br i1 %tobool11.4.not, label %for.inc.4, label %if.then13.4
if.then13.4: ; preds = %for.inc.3
%call14.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%16 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.4 = mul nsw i32 %16, %spec.select.4
%add16.4 = add nsw i32 %mul15.4, %add.4
%17 = load i32, ptr %p, align 4, !tbaa !5
%add17.4 = add nsw i32 %17, %16
%cmp18.4 = icmp eq i32 %add17.4, 10
%inc20.4 = zext i1 %cmp18.4 to i32
%spec.select90.4 = add nuw nsw i32 %spec.select89.4, %inc20.4
br label %for.inc.4
for.inc.4: ; preds = %if.then13.4, %for.inc.3
%s.1.4 = phi i32 [ %add16.4, %if.then13.4 ], [ %add.4, %for.inc.3 ]
%a.1.4 = phi i32 [ %spec.select90.4, %if.then13.4 ], [ %spec.select.4, %for.inc.3 ]
%b.3.4 = phi i32 [ 1, %if.then13.4 ], [ %spec.select89.4, %for.inc.3 ]
%call5.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%18 = load i32, ptr %p, align 4, !tbaa !5
%mul.5 = mul nsw i32 %18, %a.1.4
%add.5 = add nsw i32 %mul.5, %s.1.4
%cmp6.5 = icmp eq i32 %18, 10
%inc.5 = zext i1 %cmp6.5 to i32
%spec.select.5 = add nuw nsw i32 %b.3.4, %inc.5
%spec.select89.5 = select i1 %cmp6.5, i32 2, i32 1
%tobool11.5.not = icmp eq i32 %18, 10
br i1 %tobool11.5.not, label %for.inc.5, label %if.then13.5
if.then13.5: ; preds = %for.inc.4
%call14.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%19 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.5 = mul nsw i32 %19, %spec.select.5
%add16.5 = add nsw i32 %mul15.5, %add.5
%20 = load i32, ptr %p, align 4, !tbaa !5
%add17.5 = add nsw i32 %20, %19
%cmp18.5 = icmp eq i32 %add17.5, 10
%inc20.5 = zext i1 %cmp18.5 to i32
%spec.select90.5 = add nuw nsw i32 %spec.select89.5, %inc20.5
br label %for.inc.5
for.inc.5: ; preds = %if.then13.5, %for.inc.4
%s.1.5 = phi i32 [ %add16.5, %if.then13.5 ], [ %add.5, %for.inc.4 ]
%a.1.5 = phi i32 [ %spec.select90.5, %if.then13.5 ], [ %spec.select.5, %for.inc.4 ]
%b.3.5 = phi i32 [ 1, %if.then13.5 ], [ %spec.select89.5, %for.inc.4 ]
%call5.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%21 = load i32, ptr %p, align 4, !tbaa !5
%mul.6 = mul nsw i32 %21, %a.1.5
%add.6 = add nsw i32 %mul.6, %s.1.5
%cmp6.6 = icmp eq i32 %21, 10
%inc.6 = zext i1 %cmp6.6 to i32
%spec.select.6 = add nuw nsw i32 %b.3.5, %inc.6
%spec.select89.6 = select i1 %cmp6.6, i32 2, i32 1
%tobool11.6.not = icmp eq i32 %21, 10
br i1 %tobool11.6.not, label %for.inc.6, label %if.then13.6
if.then13.6: ; preds = %for.inc.5
%call14.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%22 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.6 = mul nsw i32 %22, %spec.select.6
%add16.6 = add nsw i32 %mul15.6, %add.6
%23 = load i32, ptr %p, align 4, !tbaa !5
%add17.6 = add nsw i32 %23, %22
%cmp18.6 = icmp eq i32 %add17.6, 10
%inc20.6 = zext i1 %cmp18.6 to i32
%spec.select90.6 = add nuw nsw i32 %spec.select89.6, %inc20.6
br label %for.inc.6
for.inc.6: ; preds = %if.then13.6, %for.inc.5
%s.1.6 = phi i32 [ %add16.6, %if.then13.6 ], [ %add.6, %for.inc.5 ]
%a.1.6 = phi i32 [ %spec.select90.6, %if.then13.6 ], [ %spec.select.6, %for.inc.5 ]
%b.3.6 = phi i32 [ 1, %if.then13.6 ], [ %spec.select89.6, %for.inc.5 ]
%call5.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%24 = load i32, ptr %p, align 4, !tbaa !5
%mul.7 = mul nsw i32 %24, %a.1.6
%add.7 = add nsw i32 %mul.7, %s.1.6
%cmp6.7 = icmp eq i32 %24, 10
%inc.7 = zext i1 %cmp6.7 to i32
%spec.select.7 = add nuw nsw i32 %b.3.6, %inc.7
%spec.select89.7 = select i1 %cmp6.7, i32 2, i32 1
%tobool11.7.not = icmp eq i32 %24, 10
br i1 %tobool11.7.not, label %for.inc.7, label %if.then13.7
if.then13.7: ; preds = %for.inc.6
%call14.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%25 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.7 = mul nsw i32 %25, %spec.select.7
%add16.7 = add nsw i32 %mul15.7, %add.7
%26 = load i32, ptr %p, align 4, !tbaa !5
%add17.7 = add nsw i32 %26, %25
%cmp18.7 = icmp eq i32 %add17.7, 10
%inc20.7 = zext i1 %cmp18.7 to i32
%spec.select90.7 = add nuw nsw i32 %spec.select89.7, %inc20.7
br label %for.inc.7
for.inc.7: ; preds = %if.then13.7, %for.inc.6
%s.1.7 = phi i32 [ %add16.7, %if.then13.7 ], [ %add.7, %for.inc.6 ]
%a.1.7 = phi i32 [ %spec.select90.7, %if.then13.7 ], [ %spec.select.7, %for.inc.6 ]
%b.3.7 = phi i32 [ 1, %if.then13.7 ], [ %spec.select89.7, %for.inc.6 ]
%call5.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%27 = load i32, ptr %p, align 4, !tbaa !5
%mul.8 = mul nsw i32 %27, %a.1.7
%add.8 = add nsw i32 %mul.8, %s.1.7
%cmp6.8 = icmp eq i32 %27, 10
%inc.8 = zext i1 %cmp6.8 to i32
%spec.select.8 = add nuw nsw i32 %b.3.7, %inc.8
%spec.select89.8 = select i1 %cmp6.8, i32 2, i32 1
%tobool11.8.not = icmp eq i32 %27, 10
br i1 %tobool11.8.not, label %for.inc.9, label %if.then13.8
if.then13.8: ; preds = %for.inc.7
%call14.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%28 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.8 = mul nsw i32 %28, %spec.select.8
%add16.8 = add nsw i32 %mul15.8, %add.8
%29 = load i32, ptr %p, align 4, !tbaa !5
%add17.8 = add nsw i32 %29, %28
%cmp18.8 = icmp eq i32 %add17.8, 10
%inc20.8 = zext i1 %cmp18.8 to i32
%spec.select90.8 = add nuw nsw i32 %spec.select89.8, %inc20.8
br label %for.inc.9
for.inc.9: ; preds = %if.then13.8, %for.inc.7
%s.1.8 = phi i32 [ %add16.8, %if.then13.8 ], [ %add.8, %for.inc.7 ]
%a.1.8 = phi i32 [ %spec.select90.8, %if.then13.8 ], [ %spec.select.8, %for.inc.7 ]
%b.3.8 = phi i32 [ 1, %if.then13.8 ], [ %spec.select89.8, %for.inc.7 ]
%call5.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%30 = load i32, ptr %p, align 4, !tbaa !5
%mul.9 = mul nsw i32 %30, %a.1.8
%add.9 = add nsw i32 %mul.9, %s.1.8
%call14.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pp)
%31 = load i32, ptr %pp, align 4, !tbaa !5
%mul15.9 = mul nsw i32 %31, %b.3.8
%add16.9 = add nsw i32 %mul15.9, %add.9
%.pre = load i32, ptr %p, align 4, !tbaa !5
%add24 = add nsw i32 %31, %.pre
%cmp25 = icmp sgt i32 %add24, 9
br i1 %cmp25, label %if.then26, label %if.end29
if.then26: ; preds = %for.inc.9
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%32 = load i32, ptr %p, align 4, !tbaa !5
%add28 = add nsw i32 %32, %add16.9
br label %if.end29
if.end29: ; preds = %if.then26, %for.inc.9
%s.2 = phi i32 [ %add28, %if.then26 ], [ %add16.9, %for.inc.9 ]
%sub30 = sub nsw i32 300, %s.2
%mul31 = mul nsw i32 %sub30, 10000
%33 = load i32, ptr %m, align 4, !tbaa !5
%add32 = add nsw i32 %mul31, %33
%tobool34.not = icmp eq i64 %indvars.iv114, 0
br i1 %tobool34.not, label %for.end44, label %land.rhs.lr.ph.split
land.rhs.lr.ph.split: ; preds = %if.end29
%34 = add nsw i64 %indvars.iv114, -1
%arrayidx100 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %34
%35 = load i32, ptr %arrayidx100, align 4, !tbaa !5
%cmp36101 = icmp sgt i32 %35, %add32
br i1 %cmp36101, label %for.body37, label %for.end44
for.body37: ; preds = %land.rhs.lr.ph.split, %for.body37
%indvars.iv116 = phi i64 [ %indvars.iv.next117, %for.body37 ], [ %indvars.iv114, %land.rhs.lr.ph.split ]
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.body37 ], [ %indvars.iv, %land.rhs.lr.ph.split ]
%36 = phi i32 [ %37, %for.body37 ], [ %35, %land.rhs.lr.ph.split ]
%indvars.iv.next117 = add nsw i64 %indvars.iv116, -1
%arrayidx42 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv116
store i32 %36, ptr %arrayidx42, align 4, !tbaa !5
%indvars.iv.next113 = add nsw i64 %indvars.iv112, -1
%arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv.next113
%37 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %37, %add32
br i1 %cmp36, label %for.body37, label %for.end44
for.end44: ; preds = %for.body37, %land.rhs.lr.ph.split, %if.end29
%i.1.lcssa.in = phi i64 [ 0, %if.end29 ], [ %indvars.iv114, %land.rhs.lr.ph.split ], [ %indvars.iv112, %for.body37 ]
%sext = shl i64 %i.1.lcssa.in, 32
%idxprom45 = ashr exact i64 %sext, 32
%arrayidx46 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %idxprom45
store i32 %add32, ptr %arrayidx46, align 4, !tbaa !5
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%38 = load i32, ptr %n, align 4, !tbaa !5
%39 = sext i32 %38 to i64
%cmp = icmp slt i64 %indvars.iv.next115, %39
%indvars.iv.next = add nsw i64 %indvars.iv, 1
br i1 %cmp, label %for.body, label %for.cond50.preheader, !llvm.loop !11
for.body52: ; preds = %for.cond50.preheader, %for.body52
%indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.body52 ], [ 0, %for.cond50.preheader ]
%arrayidx54 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv123
%40 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%rem = srem i32 %40, 10000
%div.neg = sdiv i32 %40, -10000
%sub57 = add nsw i32 %div.neg, 300
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem, i32 noundef %sub57)
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%41 = load i32, ptr %n, align 4, !tbaa !5
%42 = sext i32 %41 to i64
%cmp51 = icmp slt i64 %indvars.iv.next124, %42
br i1 %cmp51, label %for.body52, label %while.cond.loopexit, !llvm.loop !12
while.end: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pp) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
void judge_triangle(int side1, int side2, int side3);
int main(void)
{
int i, j, number;/*submitすると、"code.c: In function ‘main’:
code.c:10:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
code.c:10:5: note: use option -std=c99 or -std=gnu99 to compile your code
code.c:13:14: error: redefinition of ‘i’
code.c:10:14: note: previous definition of ‘i’ was here
code.c:13:5: error: ‘for’ loop initial declarations are only allowed in C99 mode"
と出るのでfor外でi, jの宣言をしました。*/
scanf("%d", &number);
int side1[number], side2[number], side3[number];
for (i = 0; i < number; i++) {
scanf("%d %d %d", &side1[i], &side2[i], &side3[i]);
}
for (j = 0; j < number; j++) {
judge_triangle(side1[j], side2[j], side3[j]);
}
return 0;
}
void judge_triangle(int side1, int side2, int side3)
{
int shorter1, shorter2, longest;
if(side1 <= side2) {
shorter1 = side1;
shorter2 = side2;
} else {
shorter1 = side2;
shorter2 = side1;
}
if(shorter2 <= side3) {
longest = side3;
} else {
longest = shorter2;
shorter2 = side3;
}
if (longest * longest == shorter1 * shorter1 + shorter2 * shorter2) {
printf("YES\n");
} else {
printf("NO\n");
}
return;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203288/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203288/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%number = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %number) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number)
%0 = load i32, ptr %number, 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 %number, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i32, i64 %4, align 16
%vla2 = alloca i32, i64 %4, align 16
%cmp28 = icmp sgt i32 %3, 0
br i1 %cmp28, label %for.body, label %for.end19
for.cond8.preheader: ; preds = %for.body
%5 = icmp sgt i32 %6, 0
br i1 %5, label %for.body10, label %for.end19
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv
%arrayidx6 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %number, 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.cond8.preheader, !llvm.loop !9
for.body10: ; preds = %for.cond8.preheader, %for.body10
%indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.body10 ], [ 0, %for.cond8.preheader ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv33
%8 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv33
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx16 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv33
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%side2.side1.i = call i32 @llvm.smin.i32(i32 %8, i32 %9)
%side1.side2.i = call i32 @llvm.smax.i32(i32 %8, i32 %9)
%shorter2.1.i = call i32 @llvm.smin.i32(i32 %side1.side2.i, i32 %10)
%longest.0.i = call i32 @llvm.smax.i32(i32 %side1.side2.i, i32 %10)
%mul.i = mul nsw i32 %longest.0.i, %longest.0.i
%mul5.i = mul nsw i32 %side2.side1.i, %side2.side1.i
%mul6.i = mul nsw i32 %shorter2.1.i, %shorter2.1.i
%add.i = add nuw nsw i32 %mul6.i, %mul5.i
%cmp7.i = icmp eq i32 %mul.i, %add.i
%str.4.str.i = select i1 %cmp7.i, ptr @str.4, ptr @str
%puts.i = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str.i)
%indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
%11 = load i32, ptr %number, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp9 = icmp slt i64 %indvars.iv.next34, %12
br i1 %cmp9, label %for.body10, label %for.end19, !llvm.loop !11
for.end19: ; preds = %for.body10, %entry, %for.cond8.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %number) #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: nofree nounwind uwtable
define dso_local void @judge_triangle(i32 noundef %side1, i32 noundef %side2, i32 noundef %side3) local_unnamed_addr #0 {
entry:
%side2.side1 = tail call i32 @llvm.smin.i32(i32 %side1, i32 %side2)
%side1.side2 = tail call i32 @llvm.smax.i32(i32 %side1, i32 %side2)
%shorter2.1 = tail call i32 @llvm.smin.i32(i32 %side1.side2, i32 %side3)
%longest.0 = tail call i32 @llvm.smax.i32(i32 %side1.side2, i32 %side3)
%mul = mul nsw i32 %longest.0, %longest.0
%mul5 = mul nsw i32 %side2.side1, %side2.side1
%mul6 = mul nsw i32 %shorter2.1, %shorter2.1
%add = add nuw nsw i32 %mul6, %mul5
%cmp7 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp7, ptr @str.4, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
ret void
}
; 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main() {
int i, n, a, b, c, temp;
scanf("%d", &n);
for(i=0; i<n; i++) {
scanf("%d%d%d", &a, &b, &c);
if(a > c) {
temp = c;
c = a;
a = temp;
}
if(b > c) {
temp = c;
c = b;
b = temp;
}
if(c*c == a*a + b*b) {
puts("YES");
} else {
puts("NO");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203345/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203345/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end5
%i.019 = phi i32 [ %inc, %if.end5 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %1, ptr %c, align 4, !tbaa !5
store i32 %2, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body
%3 = phi i32 [ %2, %if.then ], [ %1, %for.body ]
%4 = phi i32 [ %1, %if.then ], [ %2, %for.body ]
%5 = load i32, ptr %b, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %5, %4
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %5, ptr %c, align 4, !tbaa !5
store i32 %4, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%6 = phi i32 [ %4, %if.then4 ], [ %5, %if.end ]
%7 = phi i32 [ %5, %if.then4 ], [ %4, %if.end ]
%mul = mul nsw i32 %7, %7
%mul6 = mul nsw i32 %3, %3
%mul7 = mul nsw i32 %6, %6
%add = add nuw nsw i32 %mul7, %mul6
%cmp8 = icmp eq i32 %mul, %add
%.str.2..str.3 = select i1 %cmp8, ptr @.str.2, ptr @.str.3
%call10 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
%inc = add nuw nsw i32 %i.019, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end5, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
//#define DEBUG
#define MAX 20
#ifdef DEBUG
#define DBGPRINTF(...) printf(__VA_ARGS__)
#else
#define DBGPRINTF(...)
#endif
int main( int argc, char *argv[] )
{
int i, j, tmp, m[3], loopcount = 0, datanum, flag;
char s[MAX];
scanf( "%d", &datanum );
if ( datanum > 1000 ) datanum = 1000;
DBGPRINTF( "datanum: %d\n", datanum );
while( ( fgets( s, MAX, stdin ) != NULL ) && ( loopcount < datanum ) )
{
DBGPRINTF( "%s", s );
if ( sscanf( s, "%d %d %d", &m[0], &m[1], &m[2] ) == 3 )
{
DBGPRINTF( "m[0]: %d, m[1]: %d, m[2]: %d\n", m[0], m[1], m[2] );
flag = 0;
if ( ( m[0] >= m[1] ) && ( m[0] >= m[2] ) )
{
/* m[0]???????????§?????? */
if ( m[0] * m[0] == m[1] * m[1] + m[2] * m[2] ) flag = 1;
}
else if ( ( m[1] >= m[0] ) && ( m[1] >= m[2] ) )
{
/* m[1]???????????§?????? */
if ( m[1] * m[1] == m[0] * m[0] + m[2] * m[2] ) flag = 1;
}
else if ( ( m[2] >= m[0] ) && ( m[2] >= m[1] ) )
{
/* m[2]???????????§?????? */
if ( m[2] * m[2] == m[0] * m[0] + m[1] * m[1] ) flag = 1;
}
else
{
/* nanikore */
}
if ( flag > 0 )
{
printf( "YES\n" );
}
else
{
printf( "NO\n" );
}
memset( s, 0, sizeof(s) );
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203389/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%m = alloca [3 x i32], align 4
%datanum = alloca i32, align 4
%s = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %datanum) #5
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %datanum)
%0 = load i32, ptr %datanum, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 1000
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 1000, ptr %datanum, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call194 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 20, ptr noundef %1)
%cmp295 = icmp ne ptr %call194, null
%2 = load i32, ptr %datanum, align 4
%cmp396 = icmp sgt i32 %2, 0
%3 = select i1 %cmp295, i1 %cmp396, i1 false
br i1 %3, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %if.end
%arrayidx5 = getelementptr inbounds [3 x i32], ptr %m, i64 0, i64 1
%arrayidx6 = getelementptr inbounds [3 x i32], ptr %m, i64 0, i64 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end82
%call7 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %s, ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx6) #5
%cmp8 = icmp eq i32 %call7, 3
br i1 %cmp8, label %if.then9, label %if.end82
if.then9: ; preds = %while.body
%4 = load i32, ptr %m, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp12.not = icmp slt i32 %4, %5
%.pre.pre = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp15.not = icmp slt i32 %4, %.pre.pre
%or.cond97 = select i1 %cmp12.not, i1 true, i1 %cmp15.not
br i1 %or.cond97, label %if.else, label %if.then16
if.then16: ; preds = %if.then9
%mul = mul nsw i32 %4, %4
%mul21 = mul nsw i32 %5, %5
%mul24 = mul nsw i32 %.pre.pre, %.pre.pre
%add = add nuw nsw i32 %mul24, %mul21
%cmp25 = icmp eq i32 %mul, %add
br i1 %cmp25, label %if.end80, label %if.else78
if.else: ; preds = %if.then9
%cmp30.not = icmp slt i32 %5, %4
%cmp34.not = icmp slt i32 %5, %.pre.pre
%or.cond98 = select i1 %cmp30.not, i1 true, i1 %cmp34.not
br i1 %or.cond98, label %if.else49, label %if.then35
if.then35: ; preds = %if.else
%mul38 = mul nsw i32 %5, %5
%mul41 = mul nsw i32 %4, %4
%mul44 = mul nsw i32 %.pre.pre, %.pre.pre
%add45 = add nuw nsw i32 %mul44, %mul41
%cmp46 = icmp eq i32 %mul38, %add45
br i1 %cmp46, label %if.end80, label %if.else78
if.else49: ; preds = %if.else
%cmp52.not = icmp slt i32 %.pre.pre, %4
%cmp56.not = icmp slt i32 %.pre.pre, %5
%or.cond = or i1 %cmp52.not, %cmp56.not
br i1 %or.cond, label %if.else78, label %if.end74
if.end74: ; preds = %if.else49
%mul60 = mul nsw i32 %.pre.pre, %.pre.pre
%mul63 = mul nsw i32 %4, %4
%mul66 = mul nsw i32 %5, %5
%add67 = add nuw nsw i32 %mul66, %mul63
%cmp68 = icmp eq i32 %mul60, %add67
br i1 %cmp68, label %if.end80, label %if.else78
if.else78: ; preds = %if.then35, %if.then16, %if.else49, %if.end74
br label %if.end80
if.end80: ; preds = %if.end74, %if.then16, %if.then35, %if.else78
%str.sink = phi ptr [ @str, %if.else78 ], [ @str.4, %if.then35 ], [ @str.4, %if.then16 ], [ @str.4, %if.end74 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %s, i8 0, i64 20, i1 false)
br label %if.end82
if.end82: ; preds = %if.end80, %while.body
%6 = load ptr, ptr @stdin, align 8, !tbaa !9
%call1 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 20, ptr noundef %6)
%cmp2 = icmp ne ptr %call1, null
%7 = load i32, ptr %datanum, align 4
%cmp3 = icmp sgt i32 %7, 0
%8 = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %8, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %if.end82, %if.end
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %datanum) #5
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %m) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int N;
int i;
int a , b , c;
scanf("%d" ,&N);
for( i = 1 ; i <= N ; i++){
scanf("%d %d %d" , &a ,&b ,&c);
if((a * a) + (b * b) == (c * c)){
printf("YES\n");
}
else if ((a * a) - (c * c) == (b * b)){
printf("YES\n");
}
else if((b * b) - (c * c) == (a * a)){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203431/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203431/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not28 = icmp slt i32 %0, 1
br i1 %cmp.not28, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.029 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
br i1 %cmp4, label %for.inc, label %if.else
if.else: ; preds = %for.body
%sub = sub nsw i32 %mul, %mul3
%cmp9 = icmp eq i32 %sub, %mul2
br i1 %cmp9, label %for.inc, label %if.else12
if.else12: ; preds = %if.else
%sub15 = sub nsw i32 %mul2, %mul3
%cmp17 = icmp eq i32 %sub15, %mul
%str.4.str = select i1 %cmp17, ptr @str.6, ptr @str
br label %for.inc
for.inc: ; preds = %if.else12, %if.else, %for.body
%str.6.sink = phi ptr [ @str.6, %for.body ], [ @str.6, %if.else ], [ %str.4.str, %if.else12 ]
%puts27 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
%inc = add nuw nsw i32 %i.029, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.029, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int a[3],t,i,j,k,max,m;
scanf("%d",&t);
for(i=1;i<=t;i++)
{
for(j=0;j<3;j++)
{
scanf("%d",&a[j]);
}
if(a[0]>a[1]&&a[0]>a[2])
max=a[0];
else if(a[1]>a[2]&&a[1]>a[0])
{
k=a[0];
a[0]=a[1];
a[1]=k;
}
if(a[2]>a[0]&&a[2]>a[1])
{
k=a[2];
a[2]=a[0];
a[0]=k;
}
if(a[0]*a[0]==(a[1]*a[1])+(a[2]*a[2]))
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [3 x i32], align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not69 = icmp slt i32 %0, 1
br i1 %cmp.not69, label %for.end54, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%arrayidx6 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%arrayidx9 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %if.end37
%i.070 = phi i32 [ 1, %for.cond1.preheader.lr.ph ], [ %inc53, %if.end37 ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6)
%call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx6, align 4
%3 = load i32, ptr %arrayidx9, align 4
%cmp14 = icmp sgt i32 %2, %3
%cmp18 = icmp sgt i32 %2, %1
%or.cond66 = select i1 %cmp18, i1 %cmp14, i1 false
br i1 %or.cond66, label %if.then19, label %if.end24
if.then19: ; preds = %for.cond1.preheader
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %1, ptr %arrayidx6, align 4, !tbaa !5
br label %if.end24
if.end24: ; preds = %for.cond1.preheader, %if.then19
%4 = phi i32 [ %2, %for.cond1.preheader ], [ %1, %if.then19 ]
%5 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %if.then19 ]
%cmp27 = icmp sgt i32 %3, %5
%cmp31 = icmp sgt i32 %3, %4
%or.cond64 = and i1 %cmp27, %cmp31
br i1 %or.cond64, label %if.then32, label %if.end37
if.then32: ; preds = %if.end24
store i32 %5, ptr %arrayidx9, align 4, !tbaa !5
store i32 %3, ptr %a, align 4, !tbaa !5
br label %if.end37
if.end37: ; preds = %if.then32, %if.end24
%6 = phi i32 [ %5, %if.then32 ], [ %3, %if.end24 ]
%7 = phi i32 [ %3, %if.then32 ], [ %5, %if.end24 ]
%mul = mul nsw i32 %7, %7
%mul42 = mul nsw i32 %4, %4
%mul45 = mul nsw i32 %6, %6
%add = add nuw nsw i32 %mul45, %mul42
%cmp46 = icmp eq i32 %mul, %add
%str.3.str = select i1 %cmp46, ptr @str.3, ptr @str
%puts63 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%inc53 = add nuw nsw i32 %i.070, 1
%8 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.070, %8
br i1 %cmp.not.not, label %for.cond1.preheader, label %for.end54, !llvm.loop !9
for.end54: ; preds = %if.end37, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n,a,b,c,i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d %d",&a,&b,&c);
if(a*a+b*b==c*c){
printf("YES\n");
continue;
}
if(b*b+c*c==a*a){
printf("YES\n");
continue;
}
if(c*c+a*a==b*b){
printf("YES\n");
continue;
}
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203532/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203532/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %0, 0
br i1 %cmp27, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.028 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul2, %mul
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%cmp4 = icmp eq i32 %add, %mul3
br i1 %cmp4, label %for.inc, label %if.end
if.end: ; preds = %for.body
%add8 = add nuw nsw i32 %mul3, %mul2
%cmp10 = icmp eq i32 %add8, %mul
br i1 %cmp10, label %for.inc, label %if.end13
if.end13: ; preds = %if.end
%add16 = add nuw nsw i32 %mul3, %mul
%cmp18 = icmp eq i32 %add16, %mul2
%str.4.str = select i1 %cmp18, ptr @str.6, ptr @str
br label %for.inc
for.inc: ; preds = %if.end13, %if.end, %for.body
%str.sink = phi ptr [ @str.6, %for.body ], [ @str.6, %if.end ], [ %str.4.str, %if.end13 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%inc = add nuw nsw i32 %i.028, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int a,b,c,n;
scanf("%d",&n);
while(n>0){
scanf("%d %d %d",&a,&b,&c);
if(a>=b && a>=c){
if(a*a==b*b+c*c)printf("YES\n");
else printf("NO\n");
}
else if(b>=a &&b>=c){
if(b*b==a*a+c*c)printf("YES\n");
else printf("NO\n");
}
else if(c>=a && c>=a){
if(c*c==b*b+a*a)printf("YES\n");
else printf("NO\n");
}
n--;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203576/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203576/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp55 = icmp sgt i32 %.pr, 0
br i1 %cmp55, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end42
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp3.not = icmp slt i32 %0, %.pre.pre
%or.cond = select i1 %cmp2.not, i1 true, i1 %cmp3.not
br i1 %or.cond, label %if.else10, label %if.then
if.then: ; preds = %while.body
%mul = mul nsw i32 %0, %0
%mul4 = mul nsw i32 %1, %1
%mul5 = mul nsw i32 %.pre.pre, %.pre.pre
%add = add nuw nsw i32 %mul5, %mul4
%cmp6 = icmp eq i32 %mul, %add
%str.8.str.7 = select i1 %cmp6, ptr @str.8, ptr @str.7
br label %if.end42.sink.split
if.else10: ; preds = %while.body
%cmp11.not = icmp slt i32 %1, %0
%cmp13.not = icmp slt i32 %1, %.pre.pre
%or.cond56 = select i1 %cmp11.not, i1 true, i1 %cmp13.not
br i1 %or.cond56, label %if.else25, label %if.then14
if.then14: ; preds = %if.else10
%mul15 = mul nsw i32 %1, %1
%mul16 = mul nsw i32 %0, %0
%mul17 = mul nsw i32 %.pre.pre, %.pre.pre
%add18 = add nuw nsw i32 %mul17, %mul16
%cmp19 = icmp eq i32 %mul15, %add18
%str.6.str.5 = select i1 %cmp19, ptr @str.8, ptr @str.7
br label %if.end42.sink.split
if.else25: ; preds = %if.else10
%cmp26.not = icmp slt i32 %.pre.pre, %0
br i1 %cmp26.not, label %if.end42, label %if.then29
if.then29: ; preds = %if.else25
%mul30 = mul nsw i32 %.pre.pre, %.pre.pre
%mul31 = mul nsw i32 %1, %1
%mul32 = mul nsw i32 %0, %0
%add33 = add nuw nsw i32 %mul31, %mul32
%cmp34 = icmp eq i32 %mul30, %add33
%str.4.str = select i1 %cmp34, ptr @str.8, ptr @str.7
br label %if.end42.sink.split
if.end42.sink.split: ; preds = %if.then29, %if.then14, %if.then
%str.5.sink = phi ptr [ %str.8.str.7, %if.then ], [ %str.6.str.5, %if.then14 ], [ %str.4.str, %if.then29 ]
%puts51 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
br label %if.end42
if.end42: ; preds = %if.end42.sink.split, %if.else25
%2 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%cmp = icmp sgt i32 %2, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end42, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int cnt, a, b, c, max;
int i = 0;
scanf("%d",&cnt);
for (i; i < cnt; i++) {
scanf("%d %d %d",&a,&b,&c);
max = a;
if(b > max) max = b;
if(c > max) max = c;
if (max == a) {
if (a*a == b*b+c*c) {
printf("YES\n");
} else {
printf("NO\n");
}
} else if (max == b) {
if (b*b == a*a+c*c) {
printf("YES\n");
} else {
printf("NO\n");
}
} else {
if (c*c == a*a+b*b) {
printf("YES\n");
} else {
printf("NO\n");
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203619/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203619/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%cnt = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %cnt) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %cnt)
%0 = load i32, ptr %cnt, align 4, !tbaa !5
%cmp56 = icmp sgt i32 %0, 0
br i1 %cmp56, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.057 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %2, i32 %1)
%3 = load i32, ptr %c, align 4, !tbaa !5
%max.1 = call i32 @llvm.smax.i32(i32 %3, i32 %spec.select)
%cmp6 = icmp eq i32 %max.1, %1
br i1 %cmp6, label %if.then7, label %if.else15
if.then7: ; preds = %for.body
%mul = mul nsw i32 %1, %1
%mul8 = mul nsw i32 %2, %2
%mul9 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul9, %mul8
%cmp10 = icmp eq i32 %mul, %add
%str.8.str.7 = select i1 %cmp10, ptr @str.8, ptr @str.7
br label %for.inc
if.else15: ; preds = %for.body
%cmp16 = icmp eq i32 %max.1, %2
%mul19 = mul nsw i32 %1, %1
br i1 %cmp16, label %if.then17, label %if.else28
if.then17: ; preds = %if.else15
%mul18 = mul nsw i32 %2, %2
%mul20 = mul nsw i32 %3, %3
%add21 = add nuw nsw i32 %mul20, %mul19
%cmp22 = icmp eq i32 %mul18, %add21
%str.6.str.5 = select i1 %cmp22, ptr @str.8, ptr @str.7
br label %for.inc
if.else28: ; preds = %if.else15
%mul29 = mul nsw i32 %3, %3
%mul31 = mul nsw i32 %2, %2
%add32 = add nuw nsw i32 %mul31, %mul19
%cmp33 = icmp eq i32 %mul29, %add32
%str.4.str = select i1 %cmp33, ptr @str.8, ptr @str.7
br label %for.inc
for.inc: ; preds = %if.else28, %if.then17, %if.then7
%str.7.sink = phi ptr [ %str.8.str.7, %if.then7 ], [ %str.6.str.5, %if.then17 ], [ %str.4.str, %if.else28 ]
%puts54 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink)
%inc = add nuw nsw i32 %i.057, 1
%4 = load i32, ptr %cnt, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %cnt) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
// Aizu Vol0 0003: Is it a Right Triangle?
// 2017.7.28
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int main()
{
int a, b, c, k;
int i, n;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d%d", &c, &k);
if (k > c) a = c, c = k;
else a = k;
scanf("%d", &k);
if (k > c) b = a, a = c, c = k;
else if (k < c) b = a, a = k;
else goto NO;
if (a*a + b*b == c*c) puts("YES");
else {
NO: puts("NO");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203662/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203662/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca i32, align 4
%k = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 0
br i1 %cmp30, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.031 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %k)
%1 = load i32, ptr %k, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %1, %2
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
store i32 %1, ptr %c, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %for.body, %if.then
%a.0 = phi i32 [ %2, %if.then ], [ %1, %for.body ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%3 = load i32, ptr %k, align 4, !tbaa !5
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %3, %4
br i1 %cmp4, label %if.then5, label %if.else6
if.then5: ; preds = %if.end
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end11
if.else6: ; preds = %if.end
%cmp7 = icmp slt i32 %3, %4
br i1 %cmp7, label %if.end11, label %NO
if.end11: ; preds = %if.else6, %if.then5
%5 = phi i32 [ %3, %if.then5 ], [ %4, %if.else6 ]
%a.1 = phi i32 [ %4, %if.then5 ], [ %3, %if.else6 ]
%mul = mul nsw i32 %a.1, %a.1
%mul12 = mul nsw i32 %a.0, %a.0
%add = add nuw nsw i32 %mul, %mul12
%mul13 = mul nsw i32 %5, %5
%cmp14 = icmp eq i32 %add, %mul13
br i1 %cmp14, label %for.inc, label %NO
NO: ; preds = %if.end11, %if.else6
br label %for.inc
for.inc: ; preds = %if.end11, %NO
%.str.2.sink = phi ptr [ @.str.3, %NO ], [ @.str.2, %if.end11 ]
%call16 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
%inc = add nuw nsw i32 %i.031, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a,b,c,n;
scanf("%d",&n);
while(n>0){
scanf("%d %d %d",&a,&b,&c);
if((a*a+b*b==c*c) || (c*c+b*b==a*a) || (a*a+c*c==b*b))
printf("YES\n");
else
printf("NO\n");
n--;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203712/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203712/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %.pr, 0
br i1 %cmp20, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %1, %1
%add = add nuw nsw i32 %mul2, %mul
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %2, %2
%cmp4 = icmp eq i32 %add, %mul3
%add7 = add nuw nsw i32 %mul3, %mul2
%cmp9 = icmp eq i32 %add7, %mul
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add13 = add nuw nsw i32 %mul3, %mul
%cmp15 = icmp eq i32 %add13, %mul2
%or.cond19 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond19, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%3 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%cmp = icmp sgt i32 %3, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int pita();
int main(){
int num,length[2],longest,i,temp,unko;
scanf("%d",&num);
for (;num>0;num--){
longest=0;
for(i=0;i<3;i++){
scanf("%d",&temp);
if (temp>longest){
if (longest>0) length[i-1]=longest;
longest=temp;
}else{
length[i-1]=temp;
}
}
unko=pita((double)length[0],(double)length[1],(double)longest);
if (unko){
printf("YES\n");
}else{
printf("NO\n");
}
}
return 0;
}
int pita(double a,double b,double c){
return (c*c==a*a+b*b);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203778/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203778/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%temp = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%.pr = load i32, ptr %num, align 4, !tbaa !5
%cmp33 = icmp sgt i32 %.pr, 0
br i1 %cmp33, label %for.cond1.preheader, label %for.end23
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%length.sroa.5.0 = phi i32 [ %length.sroa.5.1, %for.cond1.preheader ], [ undef, %entry ]
%length.sroa.0.0 = phi i32 [ %length.sroa.0.1, %for.cond1.preheader ], [ undef, %entry ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%0 = load i32, ptr %temp, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 0)
%call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%1 = load i32, ptr %temp, align 4, !tbaa !5
%cmp5.1 = icmp sgt i32 %1, %spec.select
%cmp6.1.not = icmp slt i32 %0, 1
%spec.select37 = select i1 %cmp6.1.not, i32 %length.sroa.0.0, i32 %spec.select
%length.sroa.0.1 = select i1 %cmp5.1, i32 %spec.select37, i32 %1
%longest.1.1 = call i32 @llvm.smax.i32(i32 %1, i32 %spec.select)
%call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%2 = load i32, ptr %temp, align 4, !tbaa !5
%cmp5.2 = icmp sgt i32 %2, %longest.1.1
%cmp6.2.not = icmp eq i32 %longest.1.1, 0
%spec.select38 = select i1 %cmp6.2.not, i32 %length.sroa.5.0, i32 %longest.1.1
%length.sroa.5.1 = select i1 %cmp5.2, i32 %spec.select38, i32 %2
%longest.1.2 = call i32 @llvm.smax.i32(i32 %2, i32 %longest.1.1)
%conv = sitofp i32 %length.sroa.0.1 to double
%conv14 = sitofp i32 %length.sroa.5.1 to double
%conv15 = sitofp i32 %longest.1.2 to double
%mul.i = fmul double %conv15, %conv15
%mul2.i = fmul double %conv14, %conv14
%3 = call double @llvm.fmuladd.f64(double %conv, double %conv, double %mul2.i)
%cmp.i = fcmp une double %mul.i, %3
%str.3.sink = select i1 %cmp.i, ptr @str, ptr @str.3
%puts30 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
%4 = load i32, ptr %num, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
store i32 %dec, ptr %num, align 4, !tbaa !5
%cmp = icmp sgt i32 %4, 1
br i1 %cmp, label %for.cond1.preheader, label %for.end23, !llvm.loop !9
for.end23: ; preds = %for.cond1.preheader, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @pita(double noundef %a, double noundef %b, double noundef %c) local_unnamed_addr #3 {
entry:
%mul = fmul double %c, %c
%mul2 = fmul double %b, %b
%0 = tail call double @llvm.fmuladd.f64(double %a, double %a, double %mul2)
%cmp = fcmp oeq double %mul, %0
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; 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.smax.i32(i32, i32) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int n, one, two, three;
scanf("%d", &n);
while(n!=0){
scanf("%d %d %d", &one, &two, &three);
if((one*one)+(two*two)==(three*three)){
printf("YES\n");
}else if((one*one)+(three*three)==(two*two)){
printf("YES\n");
}else if((two*two)+(three*three)==(one*one)){
printf("YES\n");
}else{
printf("NO\n");
}
n--;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203842/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203842/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%one = alloca i32, align 4
%two = alloca i32, align 4
%three = 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 %one) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %two) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %three) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%.pr = load i32, ptr %n, align 4, !tbaa !5
%cmp.not28 = icmp eq i32 %.pr, 0
br i1 %cmp.not28, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end24
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %one, ptr noundef nonnull %two, ptr noundef nonnull %three)
%0 = load i32, ptr %one, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%1 = load i32, ptr %two, align 4, !tbaa !5
%mul2 = mul nsw i32 %1, %1
%add = add nuw nsw i32 %mul2, %mul
%2 = load i32, ptr %three, align 4, !tbaa !5
%mul3 = mul nsw i32 %2, %2
%cmp4 = icmp eq i32 %add, %mul3
br i1 %cmp4, label %if.end24, label %if.else
if.else: ; preds = %while.body
%add8 = add nuw nsw i32 %mul3, %mul
%cmp10 = icmp eq i32 %add8, %mul2
br i1 %cmp10, label %if.end24, label %if.else13
if.else13: ; preds = %if.else
%add16 = add nuw nsw i32 %mul3, %mul2
%cmp18 = icmp eq i32 %add16, %mul
%str.4.str = select i1 %cmp18, ptr @str.6, ptr @str
br label %if.end24
if.end24: ; preds = %if.else13, %if.else, %while.body
%str.5.sink = phi ptr [ @str.6, %while.body ], [ @str.6, %if.else ], [ %str.4.str, %if.else13 ]
%puts26 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
%3 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%cmp.not = icmp eq i32 %dec, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end24, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %three) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %two) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %one) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int a,b,c,i,x;
scanf("%d",&x);
for(i=0;i<x;i++){
scanf("%d%d%d",&a,&b,&c);
if(a==b || a==c || b==c){
printf("NO\n");
}
else if(a*a==b*b+c*c){
printf("YES\n");
}
else if(b*b==a*a+c*c){
printf("YES\n");
}
else if(c*c==a*a+b*b){
printf("YES\n");
}
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203886/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203886/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.7 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%cmp40 = icmp sgt i32 %0, 0
br i1 %cmp40, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.041 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2 = icmp eq i32 %1, %2
br i1 %cmp2, label %for.inc, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body
%3 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp eq i32 %1, %3
%cmp5 = icmp eq i32 %2, %3
%or.cond = or i1 %cmp3, %cmp5
br i1 %or.cond, label %for.inc, label %if.else
if.else: ; preds = %lor.lhs.false
%mul = mul nsw i32 %1, %1
%mul7 = mul nsw i32 %2, %2
%mul8 = mul nsw i32 %3, %3
%add = add nuw nsw i32 %mul8, %mul7
%cmp9 = icmp eq i32 %mul, %add
br i1 %cmp9, label %for.inc, label %if.else12
if.else12: ; preds = %if.else
%add16 = add nuw nsw i32 %mul8, %mul
%cmp17 = icmp eq i32 %mul7, %add16
br i1 %cmp17, label %for.inc, label %if.else20
if.else20: ; preds = %if.else12
%add24 = add nuw nsw i32 %mul7, %mul
%cmp25 = icmp eq i32 %mul8, %add24
%str.4.str = select i1 %cmp25, ptr @str.6, ptr @str.7
br label %for.inc
for.inc: ; preds = %if.else20, %if.else12, %if.else, %for.body, %lor.lhs.false
%str.7.sink = phi ptr [ @str.7, %lor.lhs.false ], [ @str.7, %for.body ], [ @str.6, %if.else ], [ @str.6, %if.else12 ], [ %str.4.str, %if.else20 ]
%puts39 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink)
%inc = add nuw nsw i32 %i.041, 1
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#define TRI (3)
int isRightAngle(int a[]);
int main()
{
int i, j, n, a[TRI];
scanf("%d", &n);
for (i = 0; i < n; ++i) {
for (j = 0; j < TRI; ++j) {
scanf("%d", (a + j));
}
if (!isRightAngle(a)) {
puts("YES");
} else {
puts("NO");
}
}
return 0;
}
int isRightAngle(int a[])
{
int i, idx = 0, ret;
for (i = 1; i < TRI; ++i) {
if (a[i] > a[idx]) idx = i;
}
ret = a[idx]*a[idx];
for (i = 1; i < TRI; ++i) {
ret -= a[(idx + i) % TRI] * a[(idx + i) % TRI];
}
return ret;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203936/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203936/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %0, 0
br i1 %cmp16, label %for.cond1.preheader.lr.ph, label %for.end11
for.cond1.preheader.lr.ph: ; preds = %entry
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 1
%arrayidx.1.i = getelementptr inbounds i32, ptr %a, i64 2
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond1.preheader
%i.017 = phi i32 [ 0, %for.cond1.preheader.lr.ph ], [ %inc10, %for.cond1.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i)
%call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1.i)
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
%cmp3.i = icmp sgt i32 %1, %2
%spec.select.i = zext i1 %cmp3.i to i32
%3 = load i32, ptr %arrayidx.1.i, align 4, !tbaa !5
%idxprom1.1.i = zext i1 %cmp3.i to i64
%arrayidx2.1.i = getelementptr inbounds i32, ptr %a, i64 %idxprom1.1.i
%4 = load i32, ptr %arrayidx2.1.i, align 4, !tbaa !5
%cmp3.1.i = icmp sgt i32 %3, %4
%spec.select.1.i = select i1 %cmp3.1.i, i32 2, i32 %spec.select.i
%spec.select.1.fr.i = freeze i32 %spec.select.1.i
%idxprom4.i = zext i32 %spec.select.1.fr.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %a, i64 %idxprom4.i
%5 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%add.i = add i32 %spec.select.1.fr.i, 1
%6 = icmp eq i32 %add.i, 3
%rem.urem.i = select i1 %6, i32 0, i32 %add.i
%idxprom11.i = zext i32 %rem.urem.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %a, i64 %idxprom11.i
%7 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5
%add43.i = add nsw i32 %7, %5
%sub44.i = sub nsw i32 %5, %7
%sub.i = mul nsw i32 %add43.i, %sub44.i
%add.1.i = add nuw nsw i32 %spec.select.1.fr.i, 2
%rem.urem.1.i = urem i32 %add.1.i, 3
%idxprom11.1.i = zext i32 %rem.urem.1.i to i64
%arrayidx12.1.i = getelementptr inbounds i32, ptr %a, i64 %idxprom11.1.i
%8 = load i32, ptr %arrayidx12.1.i, align 4, !tbaa !5
%mul17.1.i = mul nsw i32 %8, %8
%tobool.not = icmp eq i32 %sub.i, %mul17.1.i
%.str.1..str.2 = select i1 %tobool.not, ptr @.str.1, ptr @.str.2
%call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
%inc10 = add nuw nsw i32 %i.017, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc10, %9
br i1 %cmp, label %for.cond1.preheader, label %for.end11, !llvm.loop !9
for.end11: ; preds = %for.cond1.preheader, %entry
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @isRightAngle(ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds i32, ptr %a, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %0, %1
%spec.select = zext i1 %cmp3 to i32
%arrayidx.1 = getelementptr inbounds i32, ptr %a, i64 2
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%idxprom1.1 = zext i1 %cmp3 to i64
%arrayidx2.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom1.1
%3 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%cmp3.1 = icmp sgt i32 %2, %3
%spec.select.1 = select i1 %cmp3.1, i32 2, i32 %spec.select
%spec.select.1.fr = freeze i32 %spec.select.1
%idxprom4 = zext i32 %spec.select.1.fr to i64
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %idxprom4
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add = add i32 %spec.select.1.fr, 1
%5 = icmp eq i32 %add, 3
%rem.urem = select i1 %5, i32 0, i32 %add
%idxprom11 = zext i32 %rem.urem to i64
%arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %idxprom11
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add43 = add nsw i32 %4, %6
%sub44 = sub nsw i32 %4, %6
%sub = mul nsw i32 %add43, %sub44
%add.1 = add nuw nsw i32 %spec.select.1.fr, 2
%rem.urem.1 = urem i32 %add.1, 3
%idxprom11.1 = zext i32 %rem.urem.1 to i64
%arrayidx12.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom11.1
%7 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5
%mul17.1 = mul nsw i32 %7, %7
%sub.1 = sub nsw i32 %sub, %mul17.1
ret i32 %sub.1
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 judge(int a, int b, int c) {
return a == b + c || b == c + a || c == a + b;
}
int main() {
int num;
int a, b, c;
scanf(" %d", &num);
while (num--) {
scanf(" %d %d %d", &a, &b, &c);
printf("%s\n", judge(a * a, b * b, c * c) ? "YES" : "NO");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_203987/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_203987/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c" %d %d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @judge(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %c, %b
%cmp = icmp eq i32 %add, %a
%add1 = add nsw i32 %c, %a
%cmp2 = icmp eq i32 %add1, %b
%or.cond = select i1 %cmp, i1 true, i1 %cmp2
%add3 = add nsw i32 %b, %a
%cmp4 = icmp eq i32 %add3, %c
%narrow = select i1 %or.cond, i1 true, i1 %cmp4
%lor.ext = zext i1 %narrow to i32
ret i32 %lor.ext
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%num = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%dec7 = add nsw i32 %0, -1
store i32 %dec7, ptr %num, align 4, !tbaa !5
%tobool.not8 = icmp eq i32 %0, 0
br i1 %tobool.not8, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%1 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %1, %1
%2 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %2, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %3, %3
%add.i = add nuw nsw i32 %mul3, %mul2
%cmp.i = icmp ne i32 %add.i, %mul
%add1.i = add nuw nsw i32 %mul3, %mul
%cmp2.i = icmp ne i32 %add1.i, %mul2
%or.cond.i.not = select i1 %cmp.i, i1 %cmp2.i, i1 false
%add3.i = add nuw nsw i32 %mul2, %mul
%cmp4.i = icmp ne i32 %add3.i, %mul3
%narrow.i = select i1 %or.cond.i.not, i1 %cmp4.i, i1 false
%cond = select i1 %narrow.i, ptr @.str.4, ptr @.str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
%4 = load i32, ptr %num, align 4, !tbaa !5
%dec = add nsw i32 %4, -1
store i32 %dec, ptr %num, align 4, !tbaa !5
%tobool.not = icmp eq i32 %4, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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"}
|
#include<stdio.h>
int main(void){
int i,N,x[1000]={},y[1000]={},z[1000]={};
N=0;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d %d %d",&x[i],&y[i],&z[i]);
}
for(i=0;i<N;i++){
if(x[i]*x[i] == y[i]*y[i]+z[i]*z[i]){
printf("YES\n");
}
else if(y[i]*y[i] == x[i]*x[i]+z[i]*z[i]){
printf("YES\n");
}
else if(z[i]*z[i] == x[i]*x[i]+y[i]*y[i]){
printf("YES\n");
}
else if(x[i]*x[i] != y[i]*y[i]+z[i]*z[i] && y[i]*y[i] != x[i]*x[i]+z[i]*z[i] && z[i]*z[i] != x[i]*x[i]+y[i]*y[i]){
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204029/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204029/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%x = alloca [1000 x i32], align 16
%y = alloca [1000 x i32], align 16
%z = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %x, i8 0, i64 4000, i1 false)
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %y) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %y, i8 0, i64 4000, i1 false)
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %z) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000) %z, i8 0, i64 4000, i1 false)
store i32 0, ptr %N, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp171 = icmp sgt i32 %0, 0
br i1 %cmp171, label %for.body, label %for.end124
for.cond6.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body8, label %for.end124
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [1000 x i32], ptr %z, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.body8: ; preds = %for.cond6.preheader, %for.inc122
%indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.inc122 ], [ 0, %for.cond6.preheader ]
%arrayidx10 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv176
%4 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%mul = mul nsw i32 %4, %4
%arrayidx14 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv176
%5 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%mul17 = mul nsw i32 %5, %5
%arrayidx19 = getelementptr inbounds [1000 x i32], ptr %z, i64 0, i64 %indvars.iv176
%6 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%mul22 = mul nsw i32 %6, %6
%add = add nuw nsw i32 %mul22, %mul17
%cmp23 = icmp eq i32 %mul, %add
br i1 %cmp23, label %for.inc122, label %if.else
if.else: ; preds = %for.body8
%add40 = add nuw nsw i32 %mul22, %mul
%cmp41 = icmp eq i32 %mul17, %add40
br i1 %cmp41, label %for.inc122, label %if.else44
if.else44: ; preds = %if.else
%add60 = add nuw nsw i32 %mul17, %mul
%cmp61 = icmp eq i32 %mul22, %add60
%str.4.str = select i1 %cmp61, ptr @str.6, ptr @str
br label %for.inc122
for.inc122: ; preds = %if.else44, %if.else, %for.body8
%str.6.sink = phi ptr [ @str.6, %for.body8 ], [ @str.6, %if.else ], [ %str.4.str, %if.else44 ]
%puts169 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%7 = load i32, ptr %N, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp7 = icmp slt i64 %indvars.iv.next177, %8
br i1 %cmp7, label %for.body8, label %for.end124, !llvm.loop !11
for.end124: ; preds = %for.inc122, %entry, %for.cond6.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %z) #5
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int N,a,b,c;
scanf("%d",&N);
while(N>0){
scanf("%d %d %d",&a,&b,&c);
if(a*a==b*b+c*c || b*b==c*c+a*a || c*c==a*a+b*b){
printf("YES\n");
}
else{
printf("NO\n");
}
N--;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204087/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204087/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%.pr = load i32, ptr %N, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %.pr, 0
br i1 %cmp20, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %1, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add8 = add nuw nsw i32 %mul3, %mul
%cmp9 = icmp eq i32 %mul2, %add8
%or.cond = select i1 %cmp4, i1 true, i1 %cmp9
%add14 = add nuw nsw i32 %mul2, %mul
%cmp15 = icmp eq i32 %mul3, %add14
%or.cond19 = select i1 %or.cond, i1 true, i1 %cmp15
%str.4.str = select i1 %or.cond19, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%3 = load i32, ptr %N, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %N, align 4, !tbaa !5
%cmp = icmp sgt i32 %3, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int t,a[1000],q,i,n,k,s;
scanf("%d",&n);
for(i=1;i<=n;i++)
{s=0;
scanf("%d",&t);
for(k=1;k<=t;k++)
scanf("%d",&a[k]);
q=a[1];
for(k=1;k<=t;k++)
{if(a[k]<=q)
q=a[k];
}
for(k=1;k<=t;k++)
{
if(a[k]==q)
s++;
}
printf("%d\n",t-s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%a = alloca [1000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not58 = icmp slt i32 %0, 1
br i1 %cmp.not58, label %for.end33, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%arrayidx6 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.end29
%i.059 = phi i32 [ 1, %for.body.lr.ph ], [ %inc32, %for.end29 ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%1 = load i32, ptr %t, align 4, !tbaa !5
%cmp3.not48 = icmp slt i32 %1, 1
br i1 %cmp3.not48, label %for.end29, label %for.body4
for.body4: ; preds = %for.body, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 1, %for.body ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp3.not.not, label %for.body4, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body4
%cmp8.not50 = icmp slt i32 %2, 1
br i1 %cmp8.not50, label %for.end29, label %for.body9.preheader
for.body9.preheader: ; preds = %for.end
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%5 = add nuw i32 %2, 1
%wide.trip.count = zext i32 %5 to i64
%6 = add nsw i64 %wide.trip.count, -1
%min.iters.check82 = icmp ult i32 %2, 8
br i1 %min.iters.check82, label %for.body9.preheader99, label %vector.ph83
vector.ph83: ; preds = %for.body9.preheader
%n.vec85 = and i64 %6, -8
%ind.end86 = or i64 %n.vec85, 1
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %4, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body89
vector.body89: ; preds = %vector.body89, %vector.ph83
%index90 = phi i64 [ 0, %vector.ph83 ], [ %index.next96, %vector.body89 ]
%vec.phi91 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph83 ], [ %9, %vector.body89 ]
%vec.phi92 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph83 ], [ %10, %vector.body89 ]
%offset.idx93 = or i64 %index90, 1
%7 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %offset.idx93
%wide.load94 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load95 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load94, <4 x i32> %vec.phi91)
%10 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %wide.load95, <4 x i32> %vec.phi92)
%index.next96 = add nuw i64 %index90, 8
%11 = icmp eq i64 %index.next96, %n.vec85
br i1 %11, label %middle.block80, label %vector.body89, !llvm.loop !11
middle.block80: ; preds = %vector.body89
%rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %9, <4 x i32> %10)
%12 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax)
%cmp.n88 = icmp eq i64 %6, %n.vec85
br i1 %cmp.n88, label %for.cond18.preheader, label %for.body9.preheader99
for.body9.preheader99: ; preds = %for.body9.preheader, %middle.block80
%indvars.iv62.ph = phi i64 [ 1, %for.body9.preheader ], [ %ind.end86, %middle.block80 ]
%q.051.ph = phi i32 [ %4, %for.body9.preheader ], [ %12, %middle.block80 ]
br label %for.body9
for.cond18.preheader: ; preds = %for.body9, %middle.block80
%spec.select.lcssa = phi i32 [ %12, %middle.block80 ], [ %spec.select, %for.body9 ]
br i1 %cmp8.not50, label %for.end29, label %for.body20.preheader
for.body20.preheader: ; preds = %for.cond18.preheader
%13 = add nuw i32 %2, 1
%wide.trip.count68 = zext i32 %13 to i64
%14 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %2, 8
br i1 %min.iters.check, label %for.body20.preheader98, label %vector.ph
vector.ph: ; preds = %for.body20.preheader
%n.vec = and i64 %14, -8
%ind.end = or i64 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %spec.select.lcssa, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%vec.phi78 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %22, %vector.body ]
%offset.idx = or i64 %index, 1
%15 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load79 = load <4 x i32>, ptr %16, align 4, !tbaa !5
%17 = icmp eq <4 x i32> %wide.load, %broadcast.splat
%18 = icmp eq <4 x i32> %wide.load79, %broadcast.splat
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = zext <4 x i1> %18 to <4 x i32>
%21 = add <4 x i32> %vec.phi, %19
%22 = add <4 x i32> %vec.phi78, %20
%index.next = add nuw i64 %index, 8
%23 = icmp eq i64 %index.next, %n.vec
br i1 %23, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %22, %21
%24 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %14, %n.vec
br i1 %cmp.n, label %for.end29, label %for.body20.preheader98
for.body20.preheader98: ; preds = %for.body20.preheader, %middle.block
%indvars.iv65.ph = phi i64 [ 1, %for.body20.preheader ], [ %ind.end, %middle.block ]
%s.056.ph = phi i32 [ 0, %for.body20.preheader ], [ %24, %middle.block ]
br label %for.body20
for.body9: ; preds = %for.body9.preheader99, %for.body9
%indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body9 ], [ %indvars.iv62.ph, %for.body9.preheader99 ]
%q.051 = phi i32 [ %spec.select, %for.body9 ], [ %q.051.ph, %for.body9.preheader99 ]
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv62
%25 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %25, i32 %q.051)
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%exitcond.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count
br i1 %exitcond.not, label %for.cond18.preheader, label %for.body9, !llvm.loop !15
for.body20: ; preds = %for.body20.preheader98, %for.body20
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.body20 ], [ %indvars.iv65.ph, %for.body20.preheader98 ]
%s.056 = phi i32 [ %spec.select47, %for.body20 ], [ %s.056.ph, %for.body20.preheader98 ]
%arrayidx22 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv65
%26 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp eq i32 %26, %spec.select.lcssa
%inc25 = zext i1 %cmp23 to i32
%spec.select47 = add nuw nsw i32 %s.056, %inc25
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond69.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count68
br i1 %exitcond69.not, label %for.end29, label %for.body20, !llvm.loop !16
for.end29: ; preds = %for.body20, %middle.block, %for.body, %for.end, %for.cond18.preheader
%.lcssa7277 = phi i32 [ %2, %for.cond18.preheader ], [ %2, %for.end ], [ %1, %for.body ], [ %2, %middle.block ], [ %2, %for.body20 ]
%s.0.lcssa = phi i32 [ 0, %for.cond18.preheader ], [ 0, %for.end ], [ 0, %for.body ], [ %24, %middle.block ], [ %spec.select47, %for.body20 ]
%sub = sub nsw i32 %.lcssa7277, %s.0.lcssa
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%inc32 = add nuw nsw i32 %i.059, 1
%27 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.059, %27
br i1 %cmp.not.not, label %for.body, label %for.end33, !llvm.loop !17
for.end33: ; preds = %for.end29, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !12, !13}
!15 = distinct !{!15, !10, !13, !12}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
void sort(int data[], int length)
{
int i, j;
int tmp;
for (i = length; i > 0; i--) {
for (j = 0; j < i - 1; j++) {
if (data[j] > data[j + 1]) {
tmp = data[j];
data[j] = data[j + 1];
data[j + 1] = tmp;
}
}
}
}
int main(void)
{
int n;
int data[3];
int i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d %d %d", &data[0], &data[1], &data[2]);
sort(data, 3);
if (data[2] * data[2] == (data[0] * data[0] + data[1] * data[1])) {
printf("YES\n");
} else {
printf("NO\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204180/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204180/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort(ptr nocapture noundef %data, i32 noundef %length) local_unnamed_addr #0 {
entry:
%cmp36 = icmp sgt i32 %length, 0
br i1 %cmp36, label %for.cond1.preheader.preheader, label %for.end18
for.cond1.preheader.preheader: ; preds = %entry
%0 = add i32 %length, -1
%1 = zext i32 %0 to i64
%2 = sub nsw i64 0, %1
%invariant.gep = getelementptr i32, ptr %data, i64 1
br label %for.cond1.preheader
for.cond.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body3.preheader
%.unr = phi i32 [ %.pre, %for.body3.preheader ], [ %10, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.loopexit, label %for.body3.epil
for.body3.epil: ; preds = %for.cond.loopexit.unr-lcssa
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.unr
%3 = load i32, ptr %gep, align 4, !tbaa !5
%cmp6.epil = icmp sgt i32 %.unr, %3
br i1 %cmp6.epil, label %if.then.epil, label %for.cond.loopexit
if.then.epil: ; preds = %for.body3.epil
%arrayidx.epil = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.unr
store i32 %3, ptr %arrayidx.epil, align 4, !tbaa !5
store i32 %.unr, ptr %gep, align 4, !tbaa !5
br label %for.cond.loopexit
for.cond.loopexit: ; preds = %for.body3.epil, %if.then.epil, %for.cond.loopexit.unr-lcssa
%indvars.iv.next42 = add i64 %indvars.iv41, -1
%indvar.next = add i64 %indvar, 1
br i1 %cmp234, label %for.cond1.preheader, label %for.end18, !llvm.loop !9
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond.loopexit
%indvar = phi i64 [ 0, %for.cond1.preheader.preheader ], [ %indvar.next, %for.cond.loopexit ]
%indvars.iv41 = phi i64 [ %1, %for.cond1.preheader.preheader ], [ %indvars.iv.next42, %for.cond.loopexit ]
%i.037 = phi i32 [ %length, %for.cond1.preheader.preheader ], [ %sub, %for.cond.loopexit ]
%sub = add nsw i32 %i.037, -1
%cmp234 = icmp ugt i32 %i.037, 1
br i1 %cmp234, label %for.body3.preheader, label %for.end18
for.body3.preheader: ; preds = %for.cond1.preheader
%.pre = load i32, ptr %data, align 4, !tbaa !5
%xtraiter = and i64 %indvars.iv41, 1
%4 = xor i64 %indvar, %2
%5 = icmp eq i64 %4, -1
br i1 %5, label %for.cond.loopexit.unr-lcssa, label %for.body3.preheader.new
for.body3.preheader.new: ; preds = %for.body3.preheader
%unroll_iter = and i64 %indvars.iv41, -2
br label %for.body3
for.body3: ; preds = %for.inc.1, %for.body3.preheader.new
%6 = phi i32 [ %.pre, %for.body3.preheader.new ], [ %10, %for.inc.1 ]
%indvars.iv = phi i64 [ 0, %for.body3.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body3.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx5 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next
%7 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %6, %7
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
store i32 %7, ptr %arrayidx, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%8 = phi i32 [ %7, %for.body3 ], [ %6, %if.then ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%arrayidx5.1 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next.1
%9 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp sgt i32 %8, %9
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%arrayidx.1 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next
store i32 %9, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%10 = phi i32 [ %9, %for.inc ], [ %8, %if.then.1 ]
%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.loopexit.unr-lcssa, label %for.body3, !llvm.loop !11
for.end18: ; preds = %for.cond.loopexit, %for.cond1.preheader, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%data = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %data) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %data, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %data, i64 0, i64 2
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc.i.1
%i.020 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc.i.1 ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %data, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%.pre.i = load i32, ptr %data, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp6.i = icmp sgt i32 %.pre.i, %1
br i1 %cmp6.i, label %if.then.i, label %for.inc.i
if.then.i.1: ; preds = %for.inc.i.126
store i32 %8, ptr %data, align 4, !tbaa !5
store i32 %.pre.i.1, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i.126
%2 = phi i32 [ %.pre.i.1, %if.then.i.1 ], [ %8, %for.inc.i.126 ]
%3 = phi i32 [ %8, %if.then.i.1 ], [ %.pre.i.1, %for.inc.i.126 ]
%mul = mul nsw i32 %7, %7
%mul8 = mul nsw i32 %3, %3
%mul11 = mul nsw i32 %2, %2
%add = add nuw nsw i32 %mul11, %mul8
%cmp12 = icmp eq i32 %mul, %add
%str.4.str = select i1 %cmp12, ptr @str.4, ptr @str
%puts16 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc = add nuw nsw i32 %i.020, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12
if.then.i: ; preds = %for.body
store i32 %1, ptr %data, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body
%.pre.i.1 = phi i32 [ %.pre.i, %for.body ], [ %1, %if.then.i ]
%5 = phi i32 [ %1, %for.body ], [ %.pre.i, %if.then.i ]
%6 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp6.i.123 = icmp sgt i32 %5, %6
br i1 %cmp6.i.123, label %if.then.i.125, label %for.inc.i.126
if.then.i.125: ; preds = %for.inc.i
store i32 %6, ptr %arrayidx1, align 4, !tbaa !5
store i32 %5, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.i.126
for.inc.i.126: ; preds = %if.then.i.125, %for.inc.i
%7 = phi i32 [ %5, %if.then.i.125 ], [ %6, %for.inc.i ]
%8 = phi i32 [ %6, %if.then.i.125 ], [ %5, %for.inc.i ]
%cmp6.i.1 = icmp sgt i32 %.pre.i.1, %8
br i1 %cmp6.i.1, label %if.then.i.1, label %for.inc.i.1
for.end: ; preds = %for.inc.i.1, %entry
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %data) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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>
int main(void){
int kazu,a,b,c,z,i,kotae[1000];
scanf("%d",&kazu);
for(z=1;z<=kazu;z++){
scanf("%d%d%d",&a,&b,&c);
kotae[z]=0;
if(a*a==b*b+c*c){
kotae[z]=1;
goto a;
}
if(a*a+b*b==c*c){
kotae[z]=1;
goto a;
}
if(a*a+c*c==b*b){
kotae[z]=1;
goto a;
}
a:;
}
for(z=1;z<=kazu;z++){
if(kotae[z]){
printf("YES\n");
}else{
printf("NO\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204230/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204230/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%kazu = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%kotae = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kazu) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %kotae) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %kazu)
%0 = load i32, ptr %kazu, align 4, !tbaa !5
%cmp.not47 = icmp slt i32 %0, 1
br i1 %cmp.not47, label %for.end37, label %for.body
for.cond26.preheader: ; preds = %for.inc
%1 = icmp slt i32 %5, 1
br i1 %1, label %for.end37, label %for.body28
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%arrayidx = getelementptr inbounds [1000 x i32], ptr %kotae, i64 0, i64 %indvars.iv
store i32 0, ptr %arrayidx, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
%mul = mul nsw i32 %2, %2
%3 = load i32, ptr %b, align 4, !tbaa !5
%mul2 = mul nsw i32 %3, %3
%4 = load i32, ptr %c, align 4, !tbaa !5
%mul3 = mul nsw i32 %4, %4
%add = add nuw nsw i32 %mul3, %mul2
%cmp4 = icmp eq i32 %mul, %add
%add9 = add nuw nsw i32 %mul2, %mul
%cmp11 = icmp eq i32 %add9, %mul3
%or.cond = select i1 %cmp4, i1 true, i1 %cmp11
%add18 = add nuw nsw i32 %mul3, %mul
%cmp20 = icmp eq i32 %add18, %mul2
%or.cond56 = select i1 %or.cond, i1 true, i1 %cmp20
br i1 %or.cond56, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %for.body
store i32 1, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %for.inc.sink.split
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %kazu, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %6
br i1 %cmp.not.not, label %for.body, label %for.cond26.preheader, !llvm.loop !9
for.body28: ; preds = %for.cond26.preheader, %for.body28
%indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body28 ], [ 1, %for.cond26.preheader ]
%arrayidx30 = getelementptr inbounds [1000 x i32], ptr %kotae, i64 0, i64 %indvars.iv52
%7 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%tobool.not = icmp eq i32 %7, 0
%str.str.4 = select i1 %tobool.not, ptr @str, ptr @str.4
%puts46 = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%8 = load i32, ptr %kazu, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp27.not.not = icmp slt i64 %indvars.iv52, %9
br i1 %cmp27.not.not, label %for.body28, label %for.end37, !llvm.loop !11
for.end37: ; preds = %for.body28, %entry, %for.cond26.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %kotae) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kazu) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
#define max(x,y)(x>y?x:y)
#define min(x,y)(x>y?y:x)
typedef long long int ll;
typedef unsigned long long int ull;;
int asc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return -1;else if(x==y)return 0;else return 1;}
int desc_cmp(const void* X,const void* Y){int x=*(int*)X,y=*(int*)Y;if(x<y)return 1;else if(x==y)return 0;else return -1;}
void println(){printf("\n");}
int main(){
int n;scanf("%d",&n);
int a[3*n];for(int i=0;i<3*n;i++)scanf("%d",&a[i]);
qsort(a,3*n,sizeof(int),desc_cmp);
ll ans=0;
for(int i=1;i<2*n;i+=2){
ans+=a[i];
}
printf("%lld\n",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204274/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204274/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @asc_cmp(ptr nocapture noundef readonly %X, ptr nocapture noundef readonly %Y) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %X, align 4, !tbaa !5
%1 = load i32, ptr %Y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @desc_cmp(ptr nocapture noundef readonly %X, ptr nocapture noundef readonly %Y) #0 {
entry:
%0 = load i32, ptr %X, align 4, !tbaa !5
%1 = load i32, ptr %Y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @println() local_unnamed_addr #2 {
entry:
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %0, 3
%1 = zext i32 %mul to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %3, 0
br i1 %cmp24, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%mul123 = mul nsw i32 %3, 3
%.pre = sext i32 %mul123 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %23, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @desc_cmp) #8
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp726 = icmp sgt i32 %4, 0
br i1 %cmp726, label %for.body10.preheader, label %for.cond.cleanup9
for.body10.preheader: ; preds = %for.cond.cleanup
%mul6 = shl nuw nsw i32 %4, 1
%5 = zext i32 %mul6 to i64
%umax = call i64 @llvm.umax.i64(i64 %5, i64 3)
%6 = add nsw i64 %umax, -2
%min.iters.check = icmp ult i64 %6, 8
br i1 %min.iters.check, label %for.body10.preheader38, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%7 = lshr i64 %6, 1
%8 = add nuw nsw i64 %7, 1
%n.mod.vf = and i64 %8, 3
%9 = icmp eq i64 %n.mod.vf, 0
%10 = select i1 %9, i64 4, i64 %n.mod.vf
%n.vec = sub nsw i64 %8, %10
%11 = shl i64 %n.vec, 1
%ind.end = or i64 %11, 1
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 ], [ %18, %vector.body ]
%vec.phi35 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%12 = shl i64 %index, 1
%offset.idx = or i64 %12, 1
%13 = or i64 %12, 5
%14 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%15 = getelementptr inbounds i32, ptr %vla, i64 %13
%wide.vec = load <4 x i32>, ptr %14, align 4, !tbaa !5
%wide.vec36 = load <4 x i32>, ptr %15, align 4, !tbaa !5
%strided.vec = shufflevector <4 x i32> %wide.vec, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%strided.vec37 = shufflevector <4 x i32> %wide.vec36, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%16 = sext <2 x i32> %strided.vec to <2 x i64>
%17 = sext <2 x i32> %strided.vec37 to <2 x i64>
%18 = add <2 x i64> %vec.phi, %16
%19 = add <2 x i64> %vec.phi35, %17
%index.next = add nuw i64 %index, 4
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %19, %18
%21 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
br label %for.body10.preheader38
for.body10.preheader38: ; preds = %for.body10.preheader, %middle.block
%indvars.iv32.ph = phi i64 [ 1, %for.body10.preheader ], [ %ind.end, %middle.block ]
%ans.027.ph = phi i64 [ 0, %for.body10.preheader ], [ %21, %middle.block ]
br label %for.body10
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
%22 = load i32, ptr %n, align 4, !tbaa !5
%mul1 = mul nsw i32 %22, 3
%23 = sext i32 %mul1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %23
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup9: ; preds = %for.body10, %for.cond.cleanup
%ans.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %add, %for.body10 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
for.body10: ; preds = %for.body10.preheader38, %for.body10
%indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.body10 ], [ %indvars.iv32.ph, %for.body10.preheader38 ]
%ans.027 = phi i64 [ %add, %for.body10 ], [ %ans.027.ph, %for.body10.preheader38 ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv32
%24 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%conv13 = sext i32 %24 to i64
%add = add nsw i64 %ans.027, %conv13
%indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 2
%cmp7 = icmp ult i64 %indvars.iv.next33, %5
br i1 %cmp7, label %for.body10, label %for.cond.cleanup9, !llvm.loop !14
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#if 0
cat <<EOF >mistaken-paste
#endif
// thx Ebi-chan!
// #pragma GCC optimize("unroll-loops")
// #pragma GCC optimize("O3")
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007LL
#define VERYBIG 20000000000000007LL
#define ULTRABIG 3000000000000000000LL
#define MOD 1000000007LL
#define FOD 998244353LL
#define HOD 1000000009LL
#define IOD 100000007LL
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1048576
#ifdef __cplusplus
#include <queue>
#include <stack>
// #include <tuple>
#include <set>
#include <map>
#include <string>
#include <algorithm>
// #include <functional>
// #include <array>
using std::queue;
using std::priority_queue;
using std::stack;
// using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
// using std::get;
// using std::function;
// using std::array;
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> l, pair<T, U> r) {
return pair<T, U>(l.first + r.first, l.second + r.second);
}
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846264338327950
#endif
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
typedef struct {
double a;
double b;
} hwreal;
sll n, m;
sll h, w;
sll k;
sll q;
sll va, vb, vc, vd, ve, vf;
ull ua, ub, uc, ud, ue, uf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
double dmin (double x, double y) {
return (x < y) ? x : y;
}
double dmax (double x, double y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#define BEGCMP(NAME) int32_t NAME (const void *left, const void *right)
#define DEFLR(TYPE) TYPE l=*(TYPE*)left,r=*(TYPE*)right
#define CMPRET(L, R) if((L)<(R))return-1;if((L)>(R))return+1
// int32_t pullcomp (const void *left, const void *right) {
// ull l = *(ull*)left;
// ull r = *(ull*)right;
// if (l < r) {
// return -1;
// }
// if (l > r) {
// return +1;
// }
// return 0;
// }
BEGCMP(pullcomp){
DEFLR(ull);
CMPRET(l, r);
return 0;
}
BEGCMP(prevcomp){
DEFLR(sll);
CMPRET(r, l);
return 0;
}
BEGCMP(psllcomp){
DEFLR(sll);
CMPRET(l, r);
return 0;
}
BEGCMP(pcharcomp){
DEFLR(char);
CMPRET(l, r);
return 0;
}
BEGCMP(pdoublecomp){
DEFLR(double);
CMPRET(l, r);
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
BEGCMP(phwllABcomp){
DEFLR(hwll);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwllREVcomp){
DEFLR(hwll);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
return 0;
}
BEGCMP(ptriplecomp){
DEFLR(hwllc);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleREVcomp){
DEFLR(hwllc);
CMPRET(l.b, r.b);
CMPRET(l.a, r.a);
CMPRET(l.c, r.c);
return 0;
}
BEGCMP(ptripleCABcomp){
DEFLR(hwllc);
CMPRET(l.c, r.c);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
BEGCMP(phwrealcomp){
DEFLR(hwreal);
CMPRET(l.a, r.a);
CMPRET(l.b, r.b);
return 0;
}
int32_t pquadcomp (const void *left, const void *right) {
linell l = *(linell*)left;
linell r = *(linell*)right;
sll ac = phwllABcomp(&(l.a), &(r.a));
if (ac) return ac;
sll bc = phwllABcomp(&(l.b), &(r.b));
if (bc) return bc;
return 0;
}
int32_t pfracomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
CMPRET(l.a * r.b, l.b * r.a);
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
void sw (sll *l, sll *r) {
if (*l == *r) return;
sll t = *l;
*l = *r;
*r = t;
}
void uw (ull *l, ull *r) {
if (*l == *r) return;
ull t = *l;
*l = *r;
*r = t;
}
ull frac[N_MAX * 3], invf[N_MAX * 3];
ull ncr (sll n, sll r, ull m) {
if (n < 0 || r < 0 || n < r) return 0;
return frac[n] * (invf[r] * invf[n - r] % m) % m;
}
sll a[N_MAX * 5];
// ull a[N_MAX + 5];
// sll a[3001][3001];
sll b[N_MAX * 5];
// ull b[N_MAX + 5];
// sll b[3001][3001];
sll c[N_MAX * 5];
sll d[N_MAX * 5];
sll e[N_MAX * 4];
// char s[N_MAX + 1];
char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
char u[N_MAX + 1];
hwll xy[N_MAX + 5];
hwllc tup[N_MAX + 5];
// sll table[3005][3005];
sll table[1005][1005];
ull gin[N_MAX];
// here we go
double ans[N_MAX];
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
sll *dpcell;
for (i = 0; i < n; i++) {
xy[i] = (hwll){a[i], i};
}
for (i = 0; i < q; i++) {
xy[n + i] = (hwll){c[i], n + i};
xy[n + q + i] = (hwll){d[i], n + q + i};
}
qsort(xy, n + q * 2, sizeof(hwll), phwllABcomp);
for (i = 0; i < q; i++) ans[i] = 1.0;
dresult = 1;
for (i = 0; i < n + q * 2; i++) {
sll v = xy[i].b;
if (v < n) {
// sum += b[v];
dresult *= (double)(10 - b[v]) / (double)10;
} else if (v < n + q) {
ans[v - n] /= dresult;
// printf("%lld -= %lld\n", v - n, sum);
} else {
ans[v - n - q] *= dresult;
// printf("%lld -= %lld\n", v - n - q, sum);
}
}
for (i = 0; i < q; i++) {
printf("%.12lf\n", 1000000000.0 * ans[i]);
}
// printf("%lld\n", result);
// printf("%.15f\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("First");
return 0;
fail:
// puts("NO");
puts("No");
// puts("0");
// puts("-1");
// puts("-1 -1 -1");
// puts("Second");
return 1;
}
int32_t main (int argc, char *argv[]) {
int32_t i, j;
n = 3;
m = 0;
// scanf("%llu", &m);
// scanf("%llu%llu", &h, &w);
scanf("%llu", &n, &m);
// scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &h, &w);
// scanf("%llu", &q);
// scanf("%lld%lld", &va, &vb, &vc, &vd);
// va--;
// vb--;
// scanf("%llu%llu%llu%llu", &ua, &ub, &uc, &ud, &ue);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%s", u);
// scanf("%lld", &k);
// scanf("%lld", &m);
// for (i = 0; i < n; i++) {
// // scanf("%lld", &a[i]);
// scanf("%lld", &d[i]);
// }
// scanf(" %c", &ch);
// scanf("%llu", &q);
for (i = 0; i < n; i++) {
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld%lld%lld", &tup[i].a, &tup[i].b, &tup[i].c);
// scanf("%lld", &c[i]);
scanf("%lld", &a[i]);
scanf("%lld", &b[i]);
// scanf("%lld", &c[i]);
// scanf("%lld", &d[i]);
// a[i]--;
// b[i]--;
// c[i]--;
// d[i]--;
// xy[i].a--;
// xy[i].b--;
// tup[i].a--;
// tup[i].b--;
}
// scanf("%lld%lld", &va, &vb);
// scanf("%llu", &m);
scanf("%llu", &q);
// scanf("%s", s);
for (i = 0; i < q; i++) {
// scanf("%lld%lld", &xy[i].a, &xy[i].b);
// xy[i].a--;
// xy[i].b--;
// scanf("%lld", &a[i], &b[i]);
// scanf("%lld", &b[i]);
// a[i]--;
// b[i]--;
scanf("%lld", &c[i]);
scanf("%lld", &d[i]);
// scanf("%lld", &e[i]);
// c[i]--;
// d[i]--;
}
// for (i = 0; i < q; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &c[i]);
// // xy[i].a--;
// // xy[i].b--;
// }
// for (i = 0; i < h; i++) {
// for (j = 0; j < w; j++) {
// scanf("%lld", &table[i][j]);
// // table[i][j]--;
// }
// }
for (i = 0; i < h; i++) {
scanf("%s", s[i]);
}
// for (i = 0; i < n; i++) {
// scanf("%s", t[i]);
// }
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204317/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204317/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.hwll = type { i64, i64 }
%struct.hwllc = type { i64, i64, i64 }
@frac = dso_local local_unnamed_addr global [3145728 x i64] zeroinitializer, align 16
@invf = dso_local local_unnamed_addr global [3145728 x i64] zeroinitializer, align 16
@n = dso_local global i64 0, align 8
@xy = dso_local global [1048581 x %struct.hwll] zeroinitializer, align 16
@a = dso_local global [5242880 x i64] zeroinitializer, align 16
@q = dso_local global i64 0, align 8
@c = dso_local global [5242880 x i64] zeroinitializer, align 16
@d = dso_local global [5242880 x i64] zeroinitializer, align 16
@ans = dso_local local_unnamed_addr global [1048576 x double] zeroinitializer, align 16
@b = dso_local global [5242880 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [8 x i8] c"%.12lf\0A\00", align 1
@m = dso_local global i64 0, align 8
@.str.3 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@h = dso_local local_unnamed_addr global i64 0, align 8
@.str.5 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@s = dso_local global [3010 x [3010 x i8]] zeroinitializer, align 16
@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
@ua = dso_local local_unnamed_addr global i64 0, align 8
@ub = dso_local local_unnamed_addr global i64 0, align 8
@uc = dso_local local_unnamed_addr global i64 0, align 8
@ud = dso_local local_unnamed_addr global i64 0, align 8
@ue = dso_local local_unnamed_addr global i64 0, align 8
@uf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@e = dso_local local_unnamed_addr global [4194304 x i64] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@u = dso_local local_unnamed_addr global [1048577 x i8] zeroinitializer, align 16
@tup = dso_local local_unnamed_addr global [1048581 x %struct.hwllc] zeroinitializer, align 16
@table = dso_local local_unnamed_addr global [1005 x [1005 x i64]] zeroinitializer, align 16
@gin = dso_local local_unnamed_addr global [1048576 x i64] zeroinitializer, align 16
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmin(double noundef %x, double noundef %y) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %x, %y
%cond = select i1 %cmp, double %x, double %y
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %x, double noundef %y) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %x, %y
%cond = select i1 %cmp, double %x, double %y
ret double %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:
%cmp4 = icmp eq i64 %y, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%y.tr6 = phi i64 [ %rem, %if.else ], [ %y, %entry ]
%x.tr5 = phi i64 [ %y.tr6, %if.else ], [ %x, %entry ]
%rem = urem i64 %x.tr5, %y.tr6
%cmp = icmp eq i64 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%x.tr.lcssa = phi i64 [ %x, %entry ], [ %y.tr6, %if.else ]
ret i64 %x.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #2 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #2 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #2 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !7
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%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 @prevcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %1, %0
%cmp1 = icmp sgt i64 %1, %0
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !8
%1 = load i64, ptr %right, align 8, !tbaa !8
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !12
%1 = load i8, ptr %right, align 1, !tbaa !12
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pdoublecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%0 = load double, ptr %left, align 8, !tbaa !13
%1 = load double, ptr %right, align 8, !tbaa !13
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp ogt double %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !15
%1 = load ptr, ptr %right, align 8, !tbaa !15
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptripleCABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !18
%cmp = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwrealcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load double, ptr %left, align 8, !tbaa.struct !20
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load double, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21
%r.sroa.0.0.copyload = load double, ptr %right, align 8, !tbaa.struct !20
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load double, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !21
%cmp = fcmp olt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = fcmp ogt double %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = fcmp olt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = fcmp ogt double %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pquadcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !22
%l.sroa.4.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.4.0.copyload = load i64, ptr %l.sroa.4.0.left.sroa_idx, align 8, !tbaa.struct !19
%l.sroa.5.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0.left.sroa_idx, align 8, !tbaa.struct !17
%l.sroa.6.0.left.sroa_idx = getelementptr inbounds i8, ptr %left, i64 24
%l.sroa.6.0.copyload = load i64, ptr %l.sroa.6.0.left.sroa_idx, align 8, !tbaa.struct !18
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !22
%r.sroa.4.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.4.0.copyload = load i64, ptr %r.sroa.4.0.right.sroa_idx, align 8, !tbaa.struct !19
%r.sroa.5.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0.right.sroa_idx, align 8, !tbaa.struct !17
%r.sroa.6.0.right.sroa_idx = getelementptr inbounds i8, ptr %right, i64 24
%r.sroa.6.0.copyload = load i64, ptr %r.sroa.6.0.right.sroa_idx, align 8, !tbaa.struct !18
%cmp.i = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp.i, label %cleanup10, label %if.end.i
if.end.i: ; preds = %entry
%cmp4.i = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4.i, label %cleanup10, label %if.end6.i
if.end6.i: ; preds = %if.end.i
%cmp8.i = icmp slt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp8.i, label %cleanup10, label %phwllABcomp.exit
phwllABcomp.exit: ; preds = %if.end6.i
%cmp13.i.not = icmp sgt i64 %l.sroa.4.0.copyload, %r.sroa.4.0.copyload
br i1 %cmp13.i.not, label %cleanup10, label %if.end
if.end: ; preds = %phwllABcomp.exit
%cmp.i21 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp.i21, label %cleanup10, label %if.end.i22
if.end.i22: ; preds = %if.end
%cmp4.i23 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4.i23, label %cleanup10, label %if.end6.i24
if.end6.i24: ; preds = %if.end.i22
%cmp8.i25 = icmp slt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
br i1 %cmp8.i25, label %cleanup10, label %if.end10.i26
if.end10.i26: ; preds = %if.end6.i24
%cmp13.i27 = icmp sgt i64 %l.sroa.6.0.copyload, %r.sroa.6.0.copyload
%..i28 = zext i1 %cmp13.i27 to i32
br label %cleanup10
cleanup10: ; preds = %if.end10.i26, %if.end6.i24, %if.end.i22, %if.end, %if.end6.i, %if.end.i, %entry, %phwllABcomp.exit
%retval.1 = phi i32 [ 1, %phwllABcomp.exit ], [ -1, %if.end6.i ], [ 1, %if.end.i ], [ -1, %entry ], [ -1, %if.end ], [ 1, %if.end.i22 ], [ -1, %if.end6.i24 ], [ %..i28, %if.end10.i26 ]
ret i32 %retval.1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pfracomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #3 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !19
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !19
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !17
%mul = mul nsw i64 %r.sroa.5.0.copyload, %l.sroa.0.0.copyload
%mul3 = mul nsw i64 %r.sroa.0.0.copyload, %l.sroa.5.0.copyload
%cmp = icmp slt i64 %mul, %mul3
%cmp10 = icmp sgt i64 %mul, %mul3
%. = zext i1 %cmp10 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #1 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #1 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @sw(ptr nocapture noundef %l, ptr nocapture noundef %r) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr %l, align 8, !tbaa !8
%1 = load i64, ptr %r, align 8, !tbaa !8
%cmp = icmp eq i64 %0, %1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
store i64 %1, ptr %l, align 8, !tbaa !8
store i64 %0, ptr %r, align 8, !tbaa !8
br label %return
return: ; preds = %entry, %if.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @uw(ptr nocapture noundef %l, ptr nocapture noundef %r) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr %l, align 8, !tbaa !8
%1 = load i64, ptr %r, align 8, !tbaa !8
%cmp = icmp eq i64 %0, %1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
store i64 %1, ptr %l, align 8, !tbaa !8
store i64 %0, ptr %r, align 8, !tbaa !8
br label %return
return: ; preds = %entry, %if.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @ncr(i64 noundef %n, i64 noundef %r, i64 noundef %m) local_unnamed_addr #7 {
entry:
%0 = or i64 %r, %n
%or.cond.not = icmp slt i64 %0, 0
%cmp3 = icmp slt i64 %n, %r
%or.cond = or i1 %cmp3, %or.cond.not
br i1 %or.cond, label %return, label %if.end
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [3145728 x i64], ptr @frac, i64 0, i64 %n
%1 = load i64, ptr %arrayidx, align 8, !tbaa !8
%arrayidx4 = getelementptr inbounds [3145728 x i64], ptr @invf, i64 0, i64 %r
%2 = load i64, ptr %arrayidx4, align 8, !tbaa !8
%sub = sub nsw i64 %n, %r
%arrayidx5 = getelementptr inbounds [3145728 x i64], ptr @invf, i64 0, i64 %sub
%3 = load i64, ptr %arrayidx5, align 8, !tbaa !8
%mul = mul i64 %3, %2
%rem = urem i64 %mul, %m
%mul6 = mul i64 %rem, %1
%rem7 = urem i64 %mul6, %m
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i64 [ %rem7, %if.end ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #8 {
entry:
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp108 = icmp sgt i64 %0, 0
br i1 %cmp108, label %for.body.preheader, label %for.cond2.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %0, 1
%1 = icmp eq i64 %0, 1
br i1 %1, label %for.cond2.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %0, -2
br label %for.body
for.cond2.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%i.0109.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond2.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond2.preheader.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [1048581 x %struct.hwll], ptr @xy, i64 0, i64 %i.0109.unr
%arrayidx1.epil = getelementptr inbounds [5242880 x i64], ptr @a, i64 0, i64 %i.0109.unr
%2 = load i64, ptr %arrayidx1.epil, align 8, !tbaa !8
store i64 %2, ptr %arrayidx.epil, align 16, !tbaa.struct !17
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx.epil = getelementptr inbounds i8, ptr %arrayidx.epil, i64 8
store i64 %i.0109.unr, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx.epil, align 8, !tbaa.struct !18
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body.epil, %for.cond2.preheader.loopexit.unr-lcssa, %entry
%3 = load i64, ptr @q, align 8, !tbaa !8
%cmp3110 = icmp sgt i64 %3, 0
br i1 %cmp3110, label %for.body4, label %for.end22
for.body: ; preds = %for.body, %for.body.preheader.new
%i.0109 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx = getelementptr inbounds [1048581 x %struct.hwll], ptr @xy, i64 0, i64 %i.0109
%arrayidx1 = getelementptr inbounds [5242880 x i64], ptr @a, i64 0, i64 %i.0109
%4 = load i64, ptr %arrayidx1, align 16, !tbaa !8
store i64 %4, ptr %arrayidx, align 16, !tbaa.struct !17
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8
store i64 %i.0109, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 8, !tbaa.struct !18
%inc = or i64 %i.0109, 1
%arrayidx.1 = getelementptr inbounds [1048581 x %struct.hwll], ptr @xy, i64 0, i64 %inc
%arrayidx1.1 = getelementptr inbounds [5242880 x i64], ptr @a, i64 0, i64 %inc
%5 = load i64, ptr %arrayidx1.1, align 8, !tbaa !8
store i64 %5, ptr %arrayidx.1, align 16, !tbaa.struct !17
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx.1 = getelementptr inbounds i8, ptr %arrayidx.1, i64 8
store i64 %inc, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx.1, align 8, !tbaa.struct !18
%inc.1 = add nuw nsw i64 %i.0109, 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.cond2.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !23
for.body4: ; preds = %for.cond2.preheader, %for.body4
%i.1111 = phi i64 [ %inc21, %for.body4 ], [ 0, %for.cond2.preheader ]
%add = add nsw i64 %i.1111, %0
%arrayidx5 = getelementptr inbounds [1048581 x %struct.hwll], ptr @xy, i64 0, i64 %add
%arrayidx8 = getelementptr inbounds [5242880 x i64], ptr @c, i64 0, i64 %i.1111
%6 = load i64, ptr %arrayidx8, align 8, !tbaa !8
store i64 %6, ptr %arrayidx5, align 16, !tbaa.struct !17
%.compoundliteral6.sroa.2.0.arrayidx5.sroa_idx = getelementptr inbounds i8, ptr %arrayidx5, i64 8
store i64 %add, ptr %.compoundliteral6.sroa.2.0.arrayidx5.sroa_idx, align 8, !tbaa.struct !18
%add12 = add i64 %add, %3
%arrayidx13 = getelementptr inbounds [1048581 x %struct.hwll], ptr @xy, i64 0, i64 %add12
%arrayidx16 = getelementptr inbounds [5242880 x i64], ptr @d, i64 0, i64 %i.1111
%7 = load i64, ptr %arrayidx16, align 8, !tbaa !8
store i64 %7, ptr %arrayidx13, align 16, !tbaa.struct !17
%.compoundliteral14.sroa.2.0.arrayidx13.sroa_idx = getelementptr inbounds i8, ptr %arrayidx13, i64 8
store i64 %add12, ptr %.compoundliteral14.sroa.2.0.arrayidx13.sroa_idx, align 8, !tbaa.struct !18
%inc21 = add nuw nsw i64 %i.1111, 1
%exitcond121.not = icmp eq i64 %inc21, %3
br i1 %exitcond121.not, label %for.end22, label %for.body4, !llvm.loop !24
for.end22: ; preds = %for.body4, %for.cond2.preheader
%mul = shl nsw i64 %3, 1
%add23 = add nsw i64 %mul, %0
tail call void @qsort(ptr noundef nonnull @xy, i64 noundef %add23, i64 noundef 16, ptr noundef nonnull @phwllABcomp) #13
%8 = load i64, ptr @q, align 8, !tbaa !8
%cmp25113 = icmp sgt i64 %8, 0
br i1 %cmp25113, label %for.body26.preheader, label %for.cond31.preheader
for.body26.preheader: ; preds = %for.end22
%min.iters.check = icmp ult i64 %8, 4
br i1 %min.iters.check, label %for.body26.preheader124, label %vector.ph
vector.ph: ; preds = %for.body26.preheader
%n.vec = and i64 %8, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%9 = getelementptr inbounds [1048576 x double], ptr @ans, i64 0, i64 %index
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %9, align 16, !tbaa !13
%10 = getelementptr inbounds double, ptr %9, i64 2
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %10, align 16, !tbaa !13
%index.next = add nuw i64 %index, 4
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !25
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %8, %n.vec
br i1 %cmp.n, label %for.cond31.preheader, label %for.body26.preheader124
for.body26.preheader124: ; preds = %for.body26.preheader, %middle.block
%i.2114.ph = phi i64 [ 0, %for.body26.preheader ], [ %n.vec, %middle.block ]
br label %for.body26
for.cond31.preheader: ; preds = %for.body26, %middle.block, %for.end22
%12 = load i64, ptr @n, align 8, !tbaa !8
%mul32 = shl nsw i64 %8, 1
%add33 = add nsw i64 %12, %mul32
%cmp34116 = icmp sgt i64 %add33, 0
br i1 %cmp34116, label %for.body35.lr.ph, label %for.cond57.preheader
for.body35.lr.ph: ; preds = %for.cond31.preheader
%add41 = add nsw i64 %12, %8
br label %for.body35
for.body26: ; preds = %for.body26.preheader124, %for.body26
%i.2114 = phi i64 [ %inc29, %for.body26 ], [ %i.2114.ph, %for.body26.preheader124 ]
%arrayidx27 = getelementptr inbounds [1048576 x double], ptr @ans, i64 0, i64 %i.2114
store double 1.000000e+00, ptr %arrayidx27, align 8, !tbaa !13
%inc29 = add nuw nsw i64 %i.2114, 1
%exitcond122.not = icmp eq i64 %inc29, %8
br i1 %exitcond122.not, label %for.cond31.preheader, label %for.body26, !llvm.loop !28
for.cond57.preheader: ; preds = %if.end53, %for.cond31.preheader
br i1 %cmp25113, label %for.body60, label %for.end65
for.body35: ; preds = %for.body35.lr.ph, %if.end53
%i.3118 = phi i64 [ 0, %for.body35.lr.ph ], [ %inc55, %if.end53 ]
%dresult.0117 = phi double [ 1.000000e+00, %for.body35.lr.ph ], [ %dresult.1, %if.end53 ]
%b37 = getelementptr inbounds [1048581 x %struct.hwll], ptr @xy, i64 0, i64 %i.3118, i32 1
%13 = load i64, ptr %b37, align 8, !tbaa !29
%cmp38 = icmp slt i64 %13, %12
br i1 %cmp38, label %if.then, label %if.else
if.then: ; preds = %for.body35
%arrayidx39 = getelementptr inbounds [5242880 x i64], ptr @b, i64 0, i64 %13
%14 = load i64, ptr %arrayidx39, align 8, !tbaa !8
%sub = sub nsw i64 10, %14
%conv = sitofp i64 %sub to double
%div = fdiv double %conv, 1.000000e+01
%mul40 = fmul double %dresult.0117, %div
br label %if.end53
if.else: ; preds = %for.body35
%cmp42 = icmp slt i64 %13, %add41
br i1 %cmp42, label %if.then44, label %if.else48
if.then44: ; preds = %if.else
%sub45 = sub nsw i64 %13, %12
%arrayidx46 = getelementptr inbounds [1048576 x double], ptr @ans, i64 0, i64 %sub45
%15 = load double, ptr %arrayidx46, align 8, !tbaa !13
%div47 = fdiv double %15, %dresult.0117
store double %div47, ptr %arrayidx46, align 8, !tbaa !13
br label %if.end53
if.else48: ; preds = %if.else
%sub50 = sub i64 %13, %add41
%arrayidx51 = getelementptr inbounds [1048576 x double], ptr @ans, i64 0, i64 %sub50
%16 = load double, ptr %arrayidx51, align 8, !tbaa !13
%mul52 = fmul double %dresult.0117, %16
store double %mul52, ptr %arrayidx51, align 8, !tbaa !13
br label %if.end53
if.end53: ; preds = %if.then44, %if.else48, %if.then
%dresult.1 = phi double [ %mul40, %if.then ], [ %dresult.0117, %if.then44 ], [ %dresult.0117, %if.else48 ]
%inc55 = add nuw nsw i64 %i.3118, 1
%exitcond123.not = icmp eq i64 %inc55, %add33
br i1 %exitcond123.not, label %for.cond57.preheader, label %for.body35, !llvm.loop !31
for.body60: ; preds = %for.cond57.preheader, %for.body60
%i.4120 = phi i64 [ %inc64, %for.body60 ], [ 0, %for.cond57.preheader ]
%arrayidx61 = getelementptr inbounds [1048576 x double], ptr @ans, i64 0, i64 %i.4120
%17 = load double, ptr %arrayidx61, align 8, !tbaa !13
%mul62 = fmul double %17, 1.000000e+09
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %mul62)
%inc64 = add nuw nsw i64 %i.4120, 1
%18 = load i64, ptr @q, align 8, !tbaa !8
%cmp58 = icmp slt i64 %inc64, %18
br i1 %cmp58, label %for.body60, label %for.end65, !llvm.loop !32
for.end65: ; preds = %for.body60, %for.cond57.preheader
ret i64 0
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #8 {
entry:
store i64 3, ptr @n, align 8, !tbaa !8
store i64 0, ptr @m, align 8, !tbaa !8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @n, align 8, !tbaa !8
%cmp43 = icmp sgt i64 %0, 0
br i1 %cmp43, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [5242880 x i64], ptr @a, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx)
%arrayidx4 = getelementptr inbounds [5242880 x i64], ptr @b, i64 0, i64 %indvars.iv
%call5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i64, ptr @n, align 8, !tbaa !8
%cmp = icmp sgt i64 %1, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !33
for.end: ; preds = %for.body, %entry
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull @q)
%2 = load i64, ptr @q, align 8, !tbaa !8
%cmp946 = icmp sgt i64 %2, 0
br i1 %cmp946, label %for.body11, label %for.cond21.preheader
for.cond21.preheader: ; preds = %for.body11, %for.end
%3 = load i64, ptr @h, align 8, !tbaa !8
%cmp2349 = icmp sgt i64 %3, 0
br i1 %cmp2349, label %for.body25, label %for.end31
for.body11: ; preds = %for.end, %for.body11
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body11 ], [ 0, %for.end ]
%arrayidx13 = getelementptr inbounds [5242880 x i64], ptr @c, i64 0, i64 %indvars.iv53
%call14 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx13)
%arrayidx16 = getelementptr inbounds [5242880 x i64], ptr @d, i64 0, i64 %indvars.iv53
%call17 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx16)
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%4 = load i64, ptr @q, align 8, !tbaa !8
%cmp9 = icmp sgt i64 %4, %indvars.iv.next54
br i1 %cmp9, label %for.body11, label %for.cond21.preheader, !llvm.loop !34
for.body25: ; preds = %for.cond21.preheader, %for.body25
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %for.body25 ], [ 0, %for.cond21.preheader ]
%arrayidx27 = getelementptr inbounds [3010 x [3010 x i8]], ptr @s, i64 0, i64 %indvars.iv56
%call28 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %arrayidx27)
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%5 = load i64, ptr @h, align 8, !tbaa !8
%cmp23 = icmp sgt i64 %5, %indvars.iv.next57
br i1 %cmp23, label %for.body25, label %for.end31, !llvm.loop !35
for.end31: ; preds = %for.body25, %for.cond21.preheader
%call32 = tail call i64 @solve()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { 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 #7 = { 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 #8 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !10, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !10, i64 0}
!17 = !{i64 0, i64 8, !8, i64 8, i64 8, !8}
!18 = !{i64 0, i64 8, !8}
!19 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8}
!20 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!21 = !{i64 0, i64 8, !13}
!22 = !{i64 0, i64 8, !8, i64 8, i64 8, !8, i64 16, i64 8, !8, i64 24, i64 8, !8}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
!25 = distinct !{!25, !6, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !6, !27, !26}
!29 = !{!30, !9, i64 8}
!30 = !{!"", !9, i64 0, !9, i64 8}
!31 = distinct !{!31, !6}
!32 = distinct !{!32, !6}
!33 = distinct !{!33, !6}
!34 = distinct !{!34, !6}
!35 = distinct !{!35, !6}
|
#include <stdio.h>
#define Mod 1000000007
int main()
{
char S[100001];
scanf("%s", S);
int i, j, k, l, tmp;
long long dp[2][13] = {};
for (l = 0; S[l] != 0; l++);
for (i = l - 1, tmp = 1, dp[1-i%2][0] = 1; i >= 0; i--, tmp = tmp * 10 % 13) {
if (S[i] != '?') {
k = S[i] - '0';
for (j = 0; j < 13; j++) dp[i%2][(j+tmp*k)%13] = dp[1-i%2][j];
} else {
for (j = 0; j < 13; j++) dp[i%2][j] = 0;
for (j = 0; j < 13; j++) {
for (k = 0; k <= 9; k++) dp[i%2][(j+tmp*k)%13] += dp[1-i%2][j];
}
for (j = 0; j < 13; j++) dp[i%2][j] %= Mod;
}
}
printf("%lld\n", dp[0][5]);
fflush(stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204360/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204360/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\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:
%S = alloca [100001 x i8], align 16
%dp = alloca [2 x [13 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
call void @llvm.lifetime.start.p0(i64 208, ptr nonnull %dp) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(208) %dp, i8 0, i64 208, i1 false)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv164 = phi i32 [ %indvars.iv.next165, %for.cond ], [ -1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i8], ptr %S, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next165 = add nsw i32 %indvars.iv164, 1
br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
%1 = trunc i64 %indvars.iv to i32
%sub = add nsw i32 %1, -1
%rem = srem i32 %sub, 2
%sub2 = sub nsw i32 1, %rem
%idxprom3 = zext i32 %sub2 to i64
%arrayidx4 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom3
store i64 1, ptr %arrayidx4, align 8, !tbaa !10
%cmp7136.not = icmp eq i32 %1, 0
br i1 %cmp7136.not, label %for.end95, label %for.body9.preheader
for.body9.preheader: ; preds = %for.end
%2 = and i64 %indvars.iv, 1
%3 = icmp eq i64 %2, 0
%4 = zext i32 %indvars.iv164 to i64
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.inc92
%indvars.iv166 = phi i64 [ %4, %for.body9.preheader ], [ %indvars.iv.next167, %for.inc92 ]
%indvar = phi i1 [ false, %for.body9.preheader ], [ %indvar.next, %for.inc92 ]
%tmp.0138 = phi i32 [ 1, %for.body9.preheader ], [ %rem94, %for.inc92 ]
%arrayidx11 = getelementptr inbounds [100001 x i8], ptr %S, i64 0, i64 %indvars.iv166
%5 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%cmp13.not = icmp eq i8 %5, 63
%rem58 = and i64 %indvars.iv166, 1
br i1 %cmp13.not, label %for.cond38.preheader, label %if.then
for.cond38.preheader: ; preds = %for.body9
%6 = xor i1 %3, %indvar
%7 = select i1 %6, i64 104, i64 0
%scevgep = getelementptr i8, ptr %dp, i64 %7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(104) %scevgep, i8 0, i64 104, i1 false), !tbaa !10
%sub59 = xor i64 %rem58, 1
%idxprom65 = and i64 %indvars.iv166, 1
%mul67.2 = shl nuw nsw i32 %tmp.0138, 1
%mul67.3 = mul nuw nsw i32 %tmp.0138, 3
%mul67.4 = shl nuw nsw i32 %tmp.0138, 2
%mul67.5 = mul nuw nsw i32 %tmp.0138, 5
%mul67.6 = mul nuw nsw i32 %tmp.0138, 6
%mul67.7 = mul nuw nsw i32 %tmp.0138, 7
%mul67.8 = shl nuw nsw i32 %tmp.0138, 3
%mul67.9 = mul nuw nsw i32 %tmp.0138, 9
br label %for.cond54.preheader
if.then: ; preds = %for.body9
%conv12 = sext i8 %5 to i32
%sub18 = add nsw i32 %conv12, -48
%rem23 = and i64 %indvars.iv166, 1
%sub24 = xor i64 %rem23, 1
%mul = mul nsw i32 %sub18, %tmp.0138
%arrayidx28 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 0
%8 = load i64, ptr %arrayidx28, align 8, !tbaa !10
%rem32 = srem i32 %mul, 13
%idxprom33 = sext i32 %rem32 to i64
%arrayidx34 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33
store i64 %8, ptr %arrayidx34, align 8, !tbaa !10
%arrayidx28.1 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 1
%9 = load i64, ptr %arrayidx28.1, align 8, !tbaa !10
%10 = add nsw i32 %mul, 1
%rem32.1 = srem i32 %10, 13
%idxprom33.1 = sext i32 %rem32.1 to i64
%arrayidx34.1 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.1
store i64 %9, ptr %arrayidx34.1, align 8, !tbaa !10
%arrayidx28.2 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 2
%11 = load i64, ptr %arrayidx28.2, align 8, !tbaa !10
%12 = add nsw i32 %mul, 2
%rem32.2 = srem i32 %12, 13
%idxprom33.2 = sext i32 %rem32.2 to i64
%arrayidx34.2 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.2
store i64 %11, ptr %arrayidx34.2, align 8, !tbaa !10
%arrayidx28.3 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 3
%13 = load i64, ptr %arrayidx28.3, align 8, !tbaa !10
%14 = add nsw i32 %mul, 3
%rem32.3 = srem i32 %14, 13
%idxprom33.3 = sext i32 %rem32.3 to i64
%arrayidx34.3 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.3
store i64 %13, ptr %arrayidx34.3, align 8, !tbaa !10
%arrayidx28.4 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 4
%15 = load i64, ptr %arrayidx28.4, align 8, !tbaa !10
%16 = add nsw i32 %mul, 4
%rem32.4 = srem i32 %16, 13
%idxprom33.4 = sext i32 %rem32.4 to i64
%arrayidx34.4 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.4
store i64 %15, ptr %arrayidx34.4, align 8, !tbaa !10
%arrayidx28.5 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 5
%17 = load i64, ptr %arrayidx28.5, align 8, !tbaa !10
%18 = add nsw i32 %mul, 5
%rem32.5 = srem i32 %18, 13
%idxprom33.5 = sext i32 %rem32.5 to i64
%arrayidx34.5 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.5
store i64 %17, ptr %arrayidx34.5, align 8, !tbaa !10
%arrayidx28.6 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 6
%19 = load i64, ptr %arrayidx28.6, align 8, !tbaa !10
%20 = add nsw i32 %mul, 6
%rem32.6 = srem i32 %20, 13
%idxprom33.6 = sext i32 %rem32.6 to i64
%arrayidx34.6 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.6
store i64 %19, ptr %arrayidx34.6, align 8, !tbaa !10
%arrayidx28.7 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 7
%21 = load i64, ptr %arrayidx28.7, align 8, !tbaa !10
%22 = add nsw i32 %mul, 7
%rem32.7 = srem i32 %22, 13
%idxprom33.7 = sext i32 %rem32.7 to i64
%arrayidx34.7 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.7
store i64 %21, ptr %arrayidx34.7, align 8, !tbaa !10
%arrayidx28.8 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 8
%23 = load i64, ptr %arrayidx28.8, align 8, !tbaa !10
%24 = add nsw i32 %mul, 8
%rem32.8 = srem i32 %24, 13
%idxprom33.8 = sext i32 %rem32.8 to i64
%arrayidx34.8 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.8
store i64 %23, ptr %arrayidx34.8, align 8, !tbaa !10
%arrayidx28.9 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 9
%25 = load i64, ptr %arrayidx28.9, align 8, !tbaa !10
%26 = add nsw i32 %mul, 9
%rem32.9 = srem i32 %26, 13
%idxprom33.9 = sext i32 %rem32.9 to i64
%arrayidx34.9 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.9
store i64 %25, ptr %arrayidx34.9, align 8, !tbaa !10
%arrayidx28.10 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 10
%27 = load i64, ptr %arrayidx28.10, align 8, !tbaa !10
%28 = add nsw i32 %mul, 10
%rem32.10 = srem i32 %28, 13
%idxprom33.10 = sext i32 %rem32.10 to i64
%arrayidx34.10 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.10
store i64 %27, ptr %arrayidx34.10, align 8, !tbaa !10
%arrayidx28.11 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 11
%29 = load i64, ptr %arrayidx28.11, align 8, !tbaa !10
%30 = add nsw i32 %mul, 11
%rem32.11 = srem i32 %30, 13
%idxprom33.11 = sext i32 %rem32.11 to i64
%arrayidx34.11 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.11
store i64 %29, ptr %arrayidx34.11, align 8, !tbaa !10
%arrayidx28.12 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub24, i64 12
%31 = load i64, ptr %arrayidx28.12, align 8, !tbaa !10
%32 = add nsw i32 %mul, 12
%rem32.12 = srem i32 %32, 13
%idxprom33.12 = sext i32 %rem32.12 to i64
%arrayidx34.12 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %rem58, i64 %idxprom33.12
store i64 %31, ptr %arrayidx34.12, align 8, !tbaa !10
br label %for.inc92
for.cond79.preheader: ; preds = %for.cond54.preheader
%arrayidx87 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 0
%33 = load i64, ptr %arrayidx87, align 8, !tbaa !10
%rem88 = srem i64 %33, 1000000007
store i64 %rem88, ptr %arrayidx87, align 8, !tbaa !10
%arrayidx87.1 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 1
%34 = load i64, ptr %arrayidx87.1, align 8, !tbaa !10
%rem88.1 = srem i64 %34, 1000000007
store i64 %rem88.1, ptr %arrayidx87.1, align 8, !tbaa !10
%arrayidx87.2 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 2
%35 = load i64, ptr %arrayidx87.2, align 8, !tbaa !10
%rem88.2 = srem i64 %35, 1000000007
store i64 %rem88.2, ptr %arrayidx87.2, align 8, !tbaa !10
%arrayidx87.3 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 3
%36 = load i64, ptr %arrayidx87.3, align 8, !tbaa !10
%rem88.3 = srem i64 %36, 1000000007
store i64 %rem88.3, ptr %arrayidx87.3, align 8, !tbaa !10
%arrayidx87.4 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 4
%37 = load i64, ptr %arrayidx87.4, align 8, !tbaa !10
%rem88.4 = srem i64 %37, 1000000007
store i64 %rem88.4, ptr %arrayidx87.4, align 8, !tbaa !10
%arrayidx87.5 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 5
%38 = load i64, ptr %arrayidx87.5, align 8, !tbaa !10
%rem88.5 = srem i64 %38, 1000000007
store i64 %rem88.5, ptr %arrayidx87.5, align 8, !tbaa !10
%arrayidx87.6 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 6
%39 = load i64, ptr %arrayidx87.6, align 8, !tbaa !10
%rem88.6 = srem i64 %39, 1000000007
store i64 %rem88.6, ptr %arrayidx87.6, align 8, !tbaa !10
%arrayidx87.7 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 7
%40 = load i64, ptr %arrayidx87.7, align 8, !tbaa !10
%rem88.7 = srem i64 %40, 1000000007
store i64 %rem88.7, ptr %arrayidx87.7, align 8, !tbaa !10
%arrayidx87.8 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 8
%41 = load i64, ptr %arrayidx87.8, align 8, !tbaa !10
%rem88.8 = srem i64 %41, 1000000007
store i64 %rem88.8, ptr %arrayidx87.8, align 8, !tbaa !10
%arrayidx87.9 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 9
%42 = load i64, ptr %arrayidx87.9, align 8, !tbaa !10
%rem88.9 = srem i64 %42, 1000000007
store i64 %rem88.9, ptr %arrayidx87.9, align 8, !tbaa !10
%arrayidx87.10 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 10
%43 = load i64, ptr %arrayidx87.10, align 8, !tbaa !10
%rem88.10 = srem i64 %43, 1000000007
store i64 %rem88.10, ptr %arrayidx87.10, align 8, !tbaa !10
%arrayidx87.11 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 11
%44 = load i64, ptr %arrayidx87.11, align 8, !tbaa !10
%rem88.11 = srem i64 %44, 1000000007
store i64 %rem88.11, ptr %arrayidx87.11, align 8, !tbaa !10
%arrayidx87.12 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 12
%45 = load i64, ptr %arrayidx87.12, align 8, !tbaa !10
%rem88.12 = srem i64 %45, 1000000007
store i64 %rem88.12, ptr %arrayidx87.12, align 8, !tbaa !10
br label %for.inc92
for.cond54.preheader: ; preds = %for.cond38.preheader, %for.cond54.preheader
%indvars.iv148 = phi i64 [ 0, %for.cond38.preheader ], [ %indvars.iv.next149, %for.cond54.preheader ]
%arrayidx63 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %sub59, i64 %indvars.iv148
%46 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%arrayidx71 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %indvars.iv148
%47 = load i64, ptr %arrayidx71, align 8, !tbaa !10
%add72 = add nsw i64 %47, %46
store i64 %add72, ptr %arrayidx71, align 8, !tbaa !10
%48 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%49 = trunc i64 %indvars.iv148 to i32
%50 = add i32 %tmp.0138, %49
%rem69.1 = urem i32 %50, 13
%idxprom70.1 = zext i32 %rem69.1 to i64
%arrayidx71.1 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.1
%51 = load i64, ptr %arrayidx71.1, align 8, !tbaa !10
%add72.1 = add nsw i64 %51, %48
store i64 %add72.1, ptr %arrayidx71.1, align 8, !tbaa !10
%52 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%53 = trunc i64 %indvars.iv148 to i32
%54 = add i32 %mul67.2, %53
%rem69.2 = urem i32 %54, 13
%idxprom70.2 = zext i32 %rem69.2 to i64
%arrayidx71.2 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.2
%55 = load i64, ptr %arrayidx71.2, align 8, !tbaa !10
%add72.2 = add nsw i64 %55, %52
store i64 %add72.2, ptr %arrayidx71.2, align 8, !tbaa !10
%56 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%57 = trunc i64 %indvars.iv148 to i32
%58 = add i32 %mul67.3, %57
%rem69.3 = urem i32 %58, 13
%idxprom70.3 = zext i32 %rem69.3 to i64
%arrayidx71.3 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.3
%59 = load i64, ptr %arrayidx71.3, align 8, !tbaa !10
%add72.3 = add nsw i64 %59, %56
store i64 %add72.3, ptr %arrayidx71.3, align 8, !tbaa !10
%60 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%61 = trunc i64 %indvars.iv148 to i32
%62 = add i32 %mul67.4, %61
%rem69.4 = urem i32 %62, 13
%idxprom70.4 = zext i32 %rem69.4 to i64
%arrayidx71.4 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.4
%63 = load i64, ptr %arrayidx71.4, align 8, !tbaa !10
%add72.4 = add nsw i64 %63, %60
store i64 %add72.4, ptr %arrayidx71.4, align 8, !tbaa !10
%64 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%65 = trunc i64 %indvars.iv148 to i32
%66 = add i32 %mul67.5, %65
%rem69.5 = urem i32 %66, 13
%idxprom70.5 = zext i32 %rem69.5 to i64
%arrayidx71.5 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.5
%67 = load i64, ptr %arrayidx71.5, align 8, !tbaa !10
%add72.5 = add nsw i64 %67, %64
store i64 %add72.5, ptr %arrayidx71.5, align 8, !tbaa !10
%68 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%69 = trunc i64 %indvars.iv148 to i32
%70 = add i32 %mul67.6, %69
%rem69.6 = urem i32 %70, 13
%idxprom70.6 = zext i32 %rem69.6 to i64
%arrayidx71.6 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.6
%71 = load i64, ptr %arrayidx71.6, align 8, !tbaa !10
%add72.6 = add nsw i64 %71, %68
store i64 %add72.6, ptr %arrayidx71.6, align 8, !tbaa !10
%72 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%73 = trunc i64 %indvars.iv148 to i32
%74 = add i32 %mul67.7, %73
%rem69.7 = urem i32 %74, 13
%idxprom70.7 = zext i32 %rem69.7 to i64
%arrayidx71.7 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.7
%75 = load i64, ptr %arrayidx71.7, align 8, !tbaa !10
%add72.7 = add nsw i64 %75, %72
store i64 %add72.7, ptr %arrayidx71.7, align 8, !tbaa !10
%76 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%77 = trunc i64 %indvars.iv148 to i32
%78 = add i32 %mul67.8, %77
%rem69.8 = urem i32 %78, 13
%idxprom70.8 = zext i32 %rem69.8 to i64
%arrayidx71.8 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.8
%79 = load i64, ptr %arrayidx71.8, align 8, !tbaa !10
%add72.8 = add nsw i64 %79, %76
store i64 %add72.8, ptr %arrayidx71.8, align 8, !tbaa !10
%80 = load i64, ptr %arrayidx63, align 8, !tbaa !10
%81 = trunc i64 %indvars.iv148 to i32
%82 = add i32 %mul67.9, %81
%rem69.9 = urem i32 %82, 13
%idxprom70.9 = zext i32 %rem69.9 to i64
%arrayidx71.9 = getelementptr inbounds [2 x [13 x i64]], ptr %dp, i64 0, i64 %idxprom65, i64 %idxprom70.9
%83 = load i64, ptr %arrayidx71.9, align 8, !tbaa !10
%add72.9 = add nsw i64 %83, %80
store i64 %add72.9, ptr %arrayidx71.9, align 8, !tbaa !10
%indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1
%exitcond.not = icmp eq i64 %indvars.iv.next149, 13
br i1 %exitcond.not, label %for.cond79.preheader, label %for.cond54.preheader, !llvm.loop !12
for.inc92: ; preds = %if.then, %for.cond79.preheader
%.pre-phi = trunc i64 %indvars.iv166 to i32
%mul93 = mul nuw nsw i32 %tmp.0138, 10
%rem94 = urem i32 %mul93, 13
%cmp7 = icmp sgt i32 %.pre-phi, 0
%indvar.next = xor i1 %indvar, true
%indvars.iv.next167 = add nsw i64 %indvars.iv166, -1
br i1 %cmp7, label %for.body9, label %for.end95.loopexit, !llvm.loop !13
for.end95.loopexit: ; preds = %for.inc92
%arrayidx97.phi.trans.insert = getelementptr inbounds [13 x i64], ptr %dp, i64 0, i64 5
%.pre = load i64, ptr %arrayidx97.phi.trans.insert, align 8, !tbaa !10
br label %for.end95
for.end95: ; preds = %for.end95.loopexit, %for.end
%84 = phi i64 [ %.pre, %for.end95.loopexit ], [ 0, %for.end ]
%call98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %84)
%85 = load ptr, ptr @stdout, align 8, !tbaa !14
%call99 = call i32 @fflush(ptr noundef %85)
call void @llvm.lifetime.end.p0(i64 208, ptr nonnull %dp) #4
call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !6, i64 0}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define mod 1000000007
int main(){
long long dp[16]={0},ndp[16]={0},l,i,j,k;
char *s=malloc(sizeof(char)*131072);
dp[0]=1;
scanf("%s",s);
l=strlen(s);
for(i=0;i<l;i++){
for(j=0;j<13;j++){
for(k=0;k<=9;k++){
if(s[i]=='?' || s[i]==('0'+k)){
ndp[(j*10+k)%13]+=dp[j];
ndp[(j*10+k)%13]%=mod;
}
}
}
for(j=0;j<13;j++){
dp[j]=ndp[j];
ndp[j]=0;
}
}
printf("%lld\n",dp[5]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204410/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204410/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dp = alloca [16 x i64], align 16
%ndp = alloca [16 x i64], align 16
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %dp) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %dp, i8 0, i64 128, i1 false)
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %ndp) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(128) %ndp, i8 0, i64 128, i1 false)
%call = tail call noalias dereferenceable_or_null(131072) ptr @malloc(i64 noundef 131072) #7
store i64 1, ptr %dp, align 16, !tbaa !5
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call)
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %call) #8
%cmp65 = icmp sgt i64 %call2, 0
br i1 %cmp65, label %for.cond3.preheader.preheader, label %for.end40
for.cond3.preheader.preheader: ; preds = %entry
%arrayidx32.1 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 1
%arrayidx32.2 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 2
%arrayidx33.2 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 2
%arrayidx32.3 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 3
%arrayidx32.4 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 4
%arrayidx33.4 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 4
%arrayidx32.5 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 5
%arrayidx33.5 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 5
%arrayidx32.6 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 6
%arrayidx32.7 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 7
%arrayidx33.7 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 7
%arrayidx32.8 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 8
%arrayidx32.9 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 9
%arrayidx33.9 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 9
%arrayidx32.10 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 10
%arrayidx32.11 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 11
%arrayidx33.11 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 11
%arrayidx32.12 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 12
br label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond3.preheader.preheader, %for.cond28.preheader
%i.066 = phi i64 [ %inc39, %for.cond28.preheader ], [ 0, %for.cond3.preheader.preheader ]
%arrayidx9 = getelementptr inbounds i8, ptr %call, i64 %i.066
%0 = load i8, ptr %arrayidx9, align 1, !tbaa !9
%.fr = freeze i8 %0
%cmp10 = icmp eq i8 %.fr, 63
br i1 %cmp10, label %for.cond6.preheader.us, label %for.cond6.preheader
for.cond6.preheader.us: ; preds = %for.cond3.preheader, %for.cond6.preheader.us
%j.063.us = phi i64 [ %inc26.us, %for.cond6.preheader.us ], [ 0, %for.cond3.preheader ]
%arrayidx16.us = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 %j.063.us
%mul.us = mul nuw nsw i64 %j.063.us, 10
%1 = load i64, ptr %arrayidx16.us, align 8, !tbaa !5
%rem.us.us = urem i64 %mul.us, 13
%arrayidx18.us.us = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us
%2 = load i64, ptr %arrayidx18.us.us, align 8, !tbaa !5
%add19.us.us = add nsw i64 %2, %1
%rem24.us.us = srem i64 %add19.us.us, 1000000007
store i64 %rem24.us.us, ptr %arrayidx18.us.us, align 8, !tbaa !5
%add17.us.us.1 = or i64 %mul.us, 1
%rem.us.us.1 = urem i64 %add17.us.us.1, 13
%arrayidx18.us.us.1 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.1
%3 = load i64, ptr %arrayidx18.us.us.1, align 8, !tbaa !5
%add19.us.us.1 = add nsw i64 %3, %1
%rem24.us.us.1 = srem i64 %add19.us.us.1, 1000000007
store i64 %rem24.us.us.1, ptr %arrayidx18.us.us.1, align 8, !tbaa !5
%add17.us.us.2 = add nuw nsw i64 %mul.us, 2
%rem.us.us.2 = urem i64 %add17.us.us.2, 13
%arrayidx18.us.us.2 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.2
%4 = load i64, ptr %arrayidx18.us.us.2, align 8, !tbaa !5
%add19.us.us.2 = add nsw i64 %4, %1
%rem24.us.us.2 = srem i64 %add19.us.us.2, 1000000007
store i64 %rem24.us.us.2, ptr %arrayidx18.us.us.2, align 8, !tbaa !5
%add17.us.us.3 = add nuw nsw i64 %mul.us, 3
%rem.us.us.3 = urem i64 %add17.us.us.3, 13
%arrayidx18.us.us.3 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.3
%5 = load i64, ptr %arrayidx18.us.us.3, align 8, !tbaa !5
%add19.us.us.3 = add nsw i64 %5, %1
%rem24.us.us.3 = srem i64 %add19.us.us.3, 1000000007
store i64 %rem24.us.us.3, ptr %arrayidx18.us.us.3, align 8, !tbaa !5
%add17.us.us.4 = add nuw nsw i64 %mul.us, 4
%rem.us.us.4 = urem i64 %add17.us.us.4, 13
%arrayidx18.us.us.4 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.4
%6 = load i64, ptr %arrayidx18.us.us.4, align 8, !tbaa !5
%add19.us.us.4 = add nsw i64 %6, %1
%rem24.us.us.4 = srem i64 %add19.us.us.4, 1000000007
store i64 %rem24.us.us.4, ptr %arrayidx18.us.us.4, align 8, !tbaa !5
%add17.us.us.5 = add nuw nsw i64 %mul.us, 5
%rem.us.us.5 = urem i64 %add17.us.us.5, 13
%arrayidx18.us.us.5 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.5
%7 = load i64, ptr %arrayidx18.us.us.5, align 8, !tbaa !5
%add19.us.us.5 = add nsw i64 %7, %1
%rem24.us.us.5 = srem i64 %add19.us.us.5, 1000000007
store i64 %rem24.us.us.5, ptr %arrayidx18.us.us.5, align 8, !tbaa !5
%add17.us.us.6 = add nuw nsw i64 %mul.us, 6
%rem.us.us.6 = urem i64 %add17.us.us.6, 13
%arrayidx18.us.us.6 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.6
%8 = load i64, ptr %arrayidx18.us.us.6, align 8, !tbaa !5
%add19.us.us.6 = add nsw i64 %8, %1
%rem24.us.us.6 = srem i64 %add19.us.us.6, 1000000007
store i64 %rem24.us.us.6, ptr %arrayidx18.us.us.6, align 8, !tbaa !5
%add17.us.us.7 = add nuw nsw i64 %mul.us, 7
%rem.us.us.7 = urem i64 %add17.us.us.7, 13
%arrayidx18.us.us.7 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.7
%9 = load i64, ptr %arrayidx18.us.us.7, align 8, !tbaa !5
%add19.us.us.7 = add nsw i64 %9, %1
%rem24.us.us.7 = srem i64 %add19.us.us.7, 1000000007
store i64 %rem24.us.us.7, ptr %arrayidx18.us.us.7, align 8, !tbaa !5
%add17.us.us.8 = add nuw nsw i64 %mul.us, 8
%rem.us.us.8 = urem i64 %add17.us.us.8, 13
%arrayidx18.us.us.8 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.8
%10 = load i64, ptr %arrayidx18.us.us.8, align 8, !tbaa !5
%add19.us.us.8 = add nsw i64 %10, %1
%rem24.us.us.8 = srem i64 %add19.us.us.8, 1000000007
store i64 %rem24.us.us.8, ptr %arrayidx18.us.us.8, align 8, !tbaa !5
%add17.us.us.9 = add nuw nsw i64 %mul.us, 9
%rem.us.us.9 = urem i64 %add17.us.us.9, 13
%arrayidx18.us.us.9 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.us.us.9
%11 = load i64, ptr %arrayidx18.us.us.9, align 8, !tbaa !5
%add19.us.us.9 = add nsw i64 %11, %1
%rem24.us.us.9 = srem i64 %add19.us.us.9, 1000000007
store i64 %rem24.us.us.9, ptr %arrayidx18.us.us.9, align 8, !tbaa !5
%inc26.us = add nuw nsw i64 %j.063.us, 1
%exitcond69.not = icmp eq i64 %inc26.us, 13
br i1 %exitcond69.not, label %for.cond28.preheader, label %for.cond6.preheader.us, !llvm.loop !10
for.cond28.preheader: ; preds = %for.inc.9, %for.cond6.preheader.us
%12 = load <2 x i64>, ptr %ndp, align 16, !tbaa !5
store i64 0, ptr %ndp, align 16, !tbaa !5
store <2 x i64> %12, ptr %dp, align 16, !tbaa !5
store i64 0, ptr %arrayidx32.1, align 8, !tbaa !5
%13 = load <2 x i64>, ptr %arrayidx32.2, align 16, !tbaa !5
store i64 0, ptr %arrayidx32.2, align 16, !tbaa !5
store <2 x i64> %13, ptr %arrayidx33.2, align 16, !tbaa !5
store i64 0, ptr %arrayidx32.3, align 8, !tbaa !5
%14 = load i64, ptr %arrayidx32.4, align 16, !tbaa !5
store i64 %14, ptr %arrayidx33.4, align 16, !tbaa !5
store i64 0, ptr %arrayidx32.4, align 16, !tbaa !5
%15 = load <2 x i64>, ptr %arrayidx32.5, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.5, align 8, !tbaa !5
store <2 x i64> %15, ptr %arrayidx33.5, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.6, align 16, !tbaa !5
%16 = load <2 x i64>, ptr %arrayidx32.7, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.7, align 8, !tbaa !5
store <2 x i64> %16, ptr %arrayidx33.7, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.8, align 16, !tbaa !5
%17 = load <2 x i64>, ptr %arrayidx32.9, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.9, align 8, !tbaa !5
store <2 x i64> %17, ptr %arrayidx33.9, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.10, align 16, !tbaa !5
%18 = load <2 x i64>, ptr %arrayidx32.11, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.11, align 8, !tbaa !5
store <2 x i64> %18, ptr %arrayidx33.11, align 8, !tbaa !5
store i64 0, ptr %arrayidx32.12, align 16, !tbaa !5
%inc39 = add nuw nsw i64 %i.066, 1
%exitcond71.not = icmp eq i64 %inc39, %call2
br i1 %exitcond71.not, label %for.end40.loopexit, label %for.cond3.preheader, !llvm.loop !12
for.cond6.preheader: ; preds = %for.cond3.preheader, %for.inc.9
%j.063 = phi i64 [ %inc26, %for.inc.9 ], [ 0, %for.cond3.preheader ]
%arrayidx16 = getelementptr inbounds [16 x i64], ptr %dp, i64 0, i64 %j.063
%mul = mul nuw nsw i64 %j.063, 10
switch i8 %.fr, label %for.inc.9 [
i8 48, label %for.inc.9.sink.split
i8 49, label %if.then.1
i8 50, label %if.then.2
i8 51, label %if.then.3
i8 52, label %if.then.4
i8 53, label %if.then.5
i8 54, label %if.then.6
i8 55, label %if.then.7
i8 56, label %if.then.8
i8 57, label %if.then.9
]
if.then.1: ; preds = %for.cond6.preheader
%add17.1 = or i64 %mul, 1
br label %for.inc.9.sink.split
if.then.2: ; preds = %for.cond6.preheader
%add17.2 = add nuw nsw i64 %mul, 2
br label %for.inc.9.sink.split
if.then.3: ; preds = %for.cond6.preheader
%add17.3 = add nuw nsw i64 %mul, 3
br label %for.inc.9.sink.split
if.then.4: ; preds = %for.cond6.preheader
%add17.4 = add nuw nsw i64 %mul, 4
br label %for.inc.9.sink.split
if.then.5: ; preds = %for.cond6.preheader
%add17.5 = add nuw nsw i64 %mul, 5
br label %for.inc.9.sink.split
if.then.6: ; preds = %for.cond6.preheader
%add17.6 = add nuw nsw i64 %mul, 6
br label %for.inc.9.sink.split
if.then.7: ; preds = %for.cond6.preheader
%add17.7 = add nuw nsw i64 %mul, 7
br label %for.inc.9.sink.split
if.then.8: ; preds = %for.cond6.preheader
%add17.8 = add nuw nsw i64 %mul, 8
br label %for.inc.9.sink.split
if.then.9: ; preds = %for.cond6.preheader
%add17.9 = add nuw nsw i64 %mul, 9
br label %for.inc.9.sink.split
for.inc.9.sink.split: ; preds = %for.cond6.preheader, %if.then.9, %if.then.8, %if.then.7, %if.then.6, %if.then.5, %if.then.4, %if.then.3, %if.then.2, %if.then.1
%add17.9.sink = phi i64 [ %add17.9, %if.then.9 ], [ %add17.8, %if.then.8 ], [ %add17.7, %if.then.7 ], [ %add17.6, %if.then.6 ], [ %add17.5, %if.then.5 ], [ %add17.4, %if.then.4 ], [ %add17.3, %if.then.3 ], [ %add17.2, %if.then.2 ], [ %add17.1, %if.then.1 ], [ %mul, %for.cond6.preheader ]
%.sink82 = load i64, ptr %arrayidx16, align 8, !tbaa !5
%rem.9 = urem i64 %add17.9.sink, 13
%arrayidx18.9 = getelementptr inbounds [16 x i64], ptr %ndp, i64 0, i64 %rem.9
%19 = load i64, ptr %arrayidx18.9, align 8, !tbaa !5
%add19.1 = add nsw i64 %19, %.sink82
%rem24.1 = srem i64 %add19.1, 1000000007
store i64 %rem24.1, ptr %arrayidx18.9, align 8, !tbaa !5
br label %for.inc.9
for.inc.9: ; preds = %for.inc.9.sink.split, %for.cond6.preheader
%inc26 = add nuw nsw i64 %j.063, 1
%exitcond.not = icmp eq i64 %inc26, 13
br i1 %exitcond.not, label %for.cond28.preheader, label %for.cond6.preheader, !llvm.loop !10
for.end40.loopexit: ; preds = %for.cond28.preheader
%20 = extractelement <2 x i64> %15, i64 0
br label %for.end40
for.end40: ; preds = %for.end40.loopexit, %entry
%21 = phi i64 [ 0, %entry ], [ %20, %for.end40.loopexit ]
%call42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %21)
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %ndp) #6
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %dp) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void){
int n,d,t,i=0;
scanf("%d%d",&n,&d);
while(t<n){
i++;
t=(2*d+1)*i;
}
printf("%d\n",i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204454/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204454/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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)"}
|
/* ex4_1
potter0723sw */
#include <stdio.h>
#include <math.h>
int main(void) {
float num,d;//小数点以下も考えたいのでfloat型
int answer;
scanf("%f %f",&num ,&d);
answer = ceil(num/(d * 2 + 1));
//監視員が見れるのは自分がいる木と周囲d本だから2d+1本見れる。
//監視範囲が被ってもいいことを考慮し小数以下切り上げ
printf("%d\n", answer);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204498/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204498/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f %f\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:
%num = alloca float, align 4
%d = alloca float, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #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 %num, ptr noundef nonnull %d)
%0 = load float, ptr %num, align 4, !tbaa !5
%1 = load float, ptr %d, align 4, !tbaa !5
%2 = call float @llvm.fmuladd.f32(float %1, float 2.000000e+00, float 1.000000e+00)
%div = fdiv float %0, %2
%3 = call float @llvm.ceil.f32(float %div)
%conv1 = fptosi float %3 to i32
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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 float @llvm.fmuladd.f32(float, float, float) #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 float @llvm.ceil.f32(float) #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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex4_1
riverstone*/
#include<stdio.h>
#include<math.h> //math.h を include する。
int main(void){
double apple,range;
scanf("%lf %lf",&apple,&range); //りんごの個数と監視の幅を入力
//1人の監視員は(監視の幅)×2+1のりんごを監視できるので、りんごの数をそれで割り切り上げる
int watchmen = ceil(apple / (range*2 + 1));
printf("%d",watchmen); //監視員の人数を出力
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204540/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204540/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf %lf\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:
%apple = alloca double, align 8
%range = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %apple) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %range) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %apple, ptr noundef nonnull %range)
%0 = load double, ptr %apple, align 8, !tbaa !5
%1 = load double, ptr %range, align 8, !tbaa !5
%2 = call double @llvm.fmuladd.f64(double %1, double 2.000000e+00, double 1.000000e+00)
%div = fdiv double %0, %2
%3 = call double @llvm.ceil.f64(double %div)
%conv = fptosi double %3 to i32
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %range) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %apple) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,d,k,c=1;
scanf("%d%d",&n,&d);
k=2*d+1;
while(k<n){
k+=2*d+1;
c++;
}
printf("%d",c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204591/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204591/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add = or i32 %mul, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp slt i32 %add, %1
br i1 %cmp7, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %entry
%2 = shl i32 %0, 2
%3 = or i32 %2, 2
%smax = call i32 @llvm.smax.i32(i32 %1, i32 %3)
%4 = add i32 %smax, -2
%5 = icmp ne i32 %4, %2
%umin = zext i1 %5 to i32
%6 = or i32 %2, %umin
%7 = sub i32 %4, %6
%8 = udiv i32 %7, %add
%9 = add i32 %8, %umin
%10 = add i32 %9, 2
br label %while.end
while.end: ; preds = %while.body.preheader, %entry
%c.0.lcssa = phi i32 [ 1, %entry ], [ %10, %while.body.preheader ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int tree, range, watch, watcher;
scanf("%d %d", &tree, &range);
watch = 2*range+1;
watcher = (int)((double)tree / (double)watch + 0.99999);
printf("%d", watcher);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204634/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204634/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%tree = alloca i32, align 4
%range = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tree) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %range) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tree, ptr noundef nonnull %range)
%0 = load i32, ptr %range, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add = or i32 %mul, 1
%1 = load i32, ptr %tree, align 4, !tbaa !5
%conv = sitofp i32 %1 to double
%conv1 = sitofp i32 %add to double
%div = fdiv double %conv, %conv1
%add2 = fadd double %div, 9.999900e-01
%conv3 = fptosi double %add2 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %range) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tree) #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"}
|
// AtCoder ABC134: B - Golden Apple
// 2019.8.26 bal4u
#include <stdio.h>
int main()
{
int N, D;
scanf("%d%d", &N, &D);
printf("%d\n", (N-1)/(2*D+1)+1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204678/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204678/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%1 = load i32, ptr %D, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%div = sdiv i32 %sub, %add
%add1 = add nsw i32 %div, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int N,D,i,j;
scanf("%d",&N);
scanf("%d",&D);
i=2*D+1;
j=N/i;
if(N%i>0)
{
j=j+1;
}
printf("%d",j);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204720/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204720/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D)
%0 = load i32, ptr %D, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add = or i32 %mul, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%div = sdiv i32 %1, %add
%rem = srem i32 %1, %add
%cmp = icmp sgt i32 %rem, 0
%add2 = zext i1 %cmp to i32
%spec.select = add nsw i32 %div, %add2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int n, d;
scanf("%d %d", &n, &d);
int min = (n + 2*d)/(2*d+1);
printf("%d", min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204764/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204764/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = add nsw i32 %mul, %0
%add2 = or i32 %mul, 1
%div = sdiv i32 %add, %add2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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>
#include <stdlib.h>
int main(void) {
int left, right, n, d, ans =1;
scanf("%d%d",&n, &d);
left = 1;
right = left + 2*d;
while(right < n){
left = right +1 ;
right = left + 2 *d;
ans++;
}
printf("%d", ans);
return EXIT_SUCCESS;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204807/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204807/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%add = or i32 %mul, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp8 = icmp slt i32 %add, %1
br i1 %cmp8, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%ans.010 = phi i32 [ %inc, %while.body ], [ 1, %entry ]
%right.09 = phi i32 [ %add3, %while.body ], [ %add, %entry ]
%add3 = add i32 %add, %right.09
%inc = add nuw nsw i32 %ans.010, 1
%cmp = icmp slt i32 %add3, %1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%ans.0.lcssa = phi i32 [ 1, %entry ], [ %inc, %while.body ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #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(void) {
int N,D,a;
scanf("%d",&N);
scanf("%d",&D);
a=N/(1+2*D);
if(N%(1+2*D)>0)
a++;
printf("%d",a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_204858/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_204858/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%D = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %D, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%add = or i32 %mul, 1
%div = sdiv i32 %0, %add
%rem = srem i32 %0, %add
%cmp = icmp sgt i32 %rem, 0
%inc = zext i1 %cmp to i32
%spec.select = add nsw i32 %div, %inc
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.