Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(void)
{
int d,r;
double a,b,f;
scanf("%lf %lf",&a,&b);
d=(int)a/b;
r=(int)a%(int)b;
f=a/b;
printf("%d %d %lf",d,r,f);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132216/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132216/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %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
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load double, ptr %a, align 8, !tbaa !5
%conv = fptosi double %0 to i32
%conv1 = sitofp i32 %conv to double
%1 = load double, ptr %b, align 8, !tbaa !5
%div = fdiv double %conv1, %1
%conv2 = fptosi double %div to i32
%conv4 = fptosi double %1 to i32
%rem = srem i32 %conv, %conv4
%div5 = fdiv double %0, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv2, i32 noundef %rem, double noundef %div5)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,d,r;
double f;
scanf("%d %d",&a,&b);
d=a/b;
r=a%b;
f=(double)a/(double)b;
printf("%d %d %f\n",d,r,f);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132302/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\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
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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,d,r;
double f;
scanf("%d %d", &a, &b);
d = a / b;
r = a % b;
f = ((double)a / (double)b);
printf("%d %d %lf\n", d, r, f);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132346/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132346/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\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
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
while(n--){
int x,i,j;
scanf("%d",&x);
for(i=0;i<=x;i++){
for(j=0;j<=x;j++){
if(i*3+j*7==x){
printf("YES\n");
break;
}
}
if(i*3+j*7==x)
break;
}
if(i>x)
printf("NO\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13239/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%dec37 = add nsw i32 %0, -1
store i32 %dec37, ptr %n, align 4, !tbaa !5
%tobool.not38 = icmp eq i32 %0, 0
br i1 %tobool.not38, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end20
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp.not33 = icmp slt i32 %1, 0
br i1 %cmp.not33, label %for.end16, label %for.cond2.preheader
for.cond2.preheader: ; preds = %while.body, %for.inc14
%2 = phi i32 [ %10, %for.inc14 ], [ %1, %while.body ]
%indvars.iv = phi i32 [ %indvars.iv.next, %for.inc14 ], [ 0, %while.body ]
%i.034 = phi i32 [ %inc15, %for.inc14 ], [ 0, %while.body ]
%cmp3.not31 = icmp slt i32 %2, 0
br i1 %cmp3.not31, label %for.end, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%3 = add i32 %2, %indvars.iv
%4 = mul i32 %3, -1227133513
%5 = add nuw i32 %2, 1
%umin = call i32 @llvm.umin.i32(i32 %2, i32 %4)
%6 = add i32 %umin, 1
%min.iters.check = icmp ult i32 %6, 17
br i1 %min.iters.check, label %for.body4.preheader, label %vector.ph
vector.ph: ; preds = %for.body4.lr.ph
%n.mod.vf = and i32 %6, 15
%7 = icmp eq i32 %n.mod.vf, 0
%8 = select i1 %7, i32 16, i32 %n.mod.vf
%n.vec = sub i32 %6, %8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%index.next = add nuw i32 %index, 16
%9 = icmp eq i32 %index.next, %n.vec
br i1 %9, label %for.body4.preheader, label %vector.body, !llvm.loop !9
for.body4.preheader: ; preds = %vector.body, %for.body4.lr.ph
%j.032.ph = phi i32 [ 0, %for.body4.lr.ph ], [ %n.vec, %vector.body ]
br label %for.body4
for.body4: ; preds = %for.body4.preheader, %for.inc
%j.032 = phi i32 [ %inc, %for.inc ], [ %j.032.ph, %for.body4.preheader ]
%exitcond = icmp eq i32 %j.032, %4
br i1 %exitcond, label %if.then, label %for.inc
if.then: ; preds = %for.body4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %x, align 4, !tbaa !5
br label %for.end
for.inc: ; preds = %for.body4
%inc = add nuw i32 %j.032, 1
%exitcond40.not = icmp eq i32 %j.032, %2
br i1 %exitcond40.not, label %for.end, label %for.body4, !llvm.loop !13
for.end: ; preds = %for.inc, %for.cond2.preheader, %if.then
%10 = phi i32 [ %.pre, %if.then ], [ %2, %for.cond2.preheader ], [ %2, %for.inc ]
%j.030 = phi i32 [ %4, %if.then ], [ 0, %for.cond2.preheader ], [ %5, %for.inc ]
%mul8 = mul nsw i32 %i.034, 3
%mul9 = mul nsw i32 %j.030, 7
%add10 = add nuw nsw i32 %mul9, %mul8
%cmp11 = icmp eq i32 %add10, %10
br i1 %cmp11, label %for.end16, label %for.inc14
for.inc14: ; preds = %for.end
%inc15 = add nuw nsw i32 %i.034, 1
%cmp.not.not = icmp slt i32 %i.034, %10
%indvars.iv.next = add i32 %indvars.iv, -3
br i1 %cmp.not.not, label %for.cond2.preheader, label %for.end16, !llvm.loop !14
for.end16: ; preds = %for.inc14, %for.end, %while.body
%11 = phi i32 [ %1, %while.body ], [ %10, %for.end ], [ %10, %for.inc14 ]
%i.0.lcssa = phi i32 [ 0, %while.body ], [ %inc15, %for.inc14 ], [ %i.034, %for.end ]
%cmp17 = icmp sgt i32 %i.0.lcssa, %11
br i1 %cmp17, label %if.then18, label %if.end20
if.then18: ; preds = %for.end16
%puts28 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3)
br label %if.end20
if.end20: ; preds = %if.then18, %for.end16
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
%12 = load i32, ptr %n, align 4, !tbaa !5
%dec = add nsw i32 %12, -1
store i32 %dec, ptr %n, align 4, !tbaa !5
%tobool.not = icmp eq i32 %12, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %if.end20, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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.umin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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}
!15 = distinct !{!15, !10}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void) {
int a,b;
double c;
scanf("%d%d", &a,&b);
printf("%d ",a/b);
printf("%d ", a%b);
c = a * 1.0;
printf("%f\n", c / b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132432/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132432/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\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
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%rem = srem i32 %2, %3
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem)
%4 = load i32, ptr %a, align 4, !tbaa !5
%conv = sitofp i32 %4 to double
%5 = load i32, ptr %b, align 4, !tbaa !5
%conv3 = sitofp i32 %5 to double
%div4 = fdiv double %conv, %conv3
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %div4)
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,d,r;
double f;
scanf("%d%d",&a,&b);
d=a/b;
r=a%b;
f=(double)a/b;
printf("%d %d %lf\n",d,r,f);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132476/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132476/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\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
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 d,r,a,b;
double f;
scanf("%d %d",&a,&b);
d=a/b;
r=a%b;
f=(double)a/(double)b;
printf("%d %d %f\n",d,r,f);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132519/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132519/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\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
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%conv1 = sitofp i32 %1 to double
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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,d=0,r=0;
double z,x,f=0;
scanf("%d %d",&a,&b);
z = a;
x = b;
d = a / b;
r = a % b;
f = z / x;
printf("%d %d %f\n",d,r,f);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132562/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132562/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\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
%conv = sitofp i32 %0 to double
%1 = load i32, ptr %b, align 4, !tbaa !5
%conv1 = sitofp i32 %1 to double
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%div2 = fdiv double %conv, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2)
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 <math.h>
int main()
{
double x,y;
scanf("%lf %lf", &x, &y);
printf("%.0lf %.0lf %.5lf\n", floor(x/y), x-y*(int)(x/y), x/y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132605/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132605/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [19 x i8] c"%.0lf %.0lf %.5lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca double, align 8
%y = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load double, ptr %x, align 8, !tbaa !5
%1 = load double, ptr %y, align 8, !tbaa !5
%div = fdiv double %0, %1
%2 = call double @llvm.floor.f64(double %div)
%conv = fptosi double %div to i32
%conv2 = sitofp i32 %conv to double
%neg = fneg double %1
%3 = call double @llvm.fmuladd.f64(double %neg, double %conv2, double %0)
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %2, double noundef %3, double noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a, b, d, r;
double f;
scanf("%d%d", &a, &b);
//a/b(整数)
d = a / b;
//a/bの余り
r = a % b;
//a/b(浮動小数点数)
// f = (float)a / (float)b;
f = (0.1*a) / (0.1*b);
printf("%d %d %lf\n", d, r, f);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132656/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132656/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\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
%1 = load i32, ptr %b, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, 1.000000e-01
%conv1 = sitofp i32 %1 to double
%mul2 = fmul double %conv1, 1.000000e-01
%div3 = fdiv double %mul, %mul2
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,i;
scanf("%d\n",&n);
int ar[n];
for(i=0;i<n;i++)
{
scanf("%d ",&ar[i]);
}
int l=0,r=0,a=0,b=0;
for(i=0;i<n;i++)
{
if(ar[i]==0)
l++;
else if(ar[i]==1)
r++;
}
for(i=0;i<n;i++)
{
if(ar[i]==0)
{
a++;
if(a==l)
break;
}
else if(ar[i]==1)
{
b++;
if(b==r)
break;
}
}
printf("\n%d",i+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1327/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1327/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"\0A%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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 %for.end42
for.cond2.preheader: ; preds = %for.body
%cmp362 = icmp sgt i32 %5, 0
br i1 %cmp362, label %for.body4.preheader, label %for.end42
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %5, 1
br i1 %4, label %for.cond18.preheader.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond18.preheader.unr-lcssa: ; preds = %for.inc15.1, %for.body4.preheader
%l.1.lcssa.ph = phi i32 [ undef, %for.body4.preheader ], [ %l.1.1, %for.inc15.1 ]
%r.1.lcssa.ph = phi i32 [ undef, %for.body4.preheader ], [ %r.1.1, %for.inc15.1 ]
%indvars.iv77.unr = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next78.1, %for.inc15.1 ]
%r.065.unr = phi i32 [ 0, %for.body4.preheader ], [ %r.1.1, %for.inc15.1 ]
%l.064.unr = phi i32 [ 0, %for.body4.preheader ], [ %l.1.1, %for.inc15.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond18.preheader, label %for.body4.epil
for.body4.epil: ; preds = %for.cond18.preheader.unr-lcssa
%arrayidx6.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77.unr
%7 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5
switch i32 %7, label %for.cond18.preheader [
i32 0, label %if.then.epil
i32 1, label %if.then12.epil
]
if.then12.epil: ; preds = %for.body4.epil
%inc13.epil = add nsw i32 %r.065.unr, 1
br label %for.cond18.preheader
if.then.epil: ; preds = %for.body4.epil
%inc8.epil = add nsw i32 %l.064.unr, 1
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %for.body4.epil, %if.then12.epil, %if.then.epil, %for.cond18.preheader.unr-lcssa
%l.1.lcssa = phi i32 [ %l.1.lcssa.ph, %for.cond18.preheader.unr-lcssa ], [ %inc8.epil, %if.then.epil ], [ %l.064.unr, %if.then12.epil ], [ %l.064.unr, %for.body4.epil ]
%r.1.lcssa = phi i32 [ %r.1.lcssa.ph, %for.cond18.preheader.unr-lcssa ], [ %r.065.unr, %if.then.epil ], [ %inc13.epil, %if.then12.epil ], [ %r.065.unr, %for.body4.epil ]
br i1 %cmp362, label %for.body20.preheader, label %for.end42
for.body20.preheader: ; preds = %for.cond18.preheader
%wide.trip.count83 = zext i32 %5 to i64
br label %for.body20
for.body4: ; preds = %for.inc15.1, %for.body4.preheader.new
%indvars.iv77 = phi i64 [ 0, %for.body4.preheader.new ], [ %indvars.iv.next78.1, %for.inc15.1 ]
%r.065 = phi i32 [ 0, %for.body4.preheader.new ], [ %r.1.1, %for.inc15.1 ]
%l.064 = phi i32 [ 0, %for.body4.preheader.new ], [ %l.1.1, %for.inc15.1 ]
%niter = phi i64 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.inc15.1 ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77
%8 = load i32, ptr %arrayidx6, align 8, !tbaa !5
switch i32 %8, label %for.inc15 [
i32 0, label %if.then
i32 1, label %if.then12
]
if.then: ; preds = %for.body4
%inc8 = add nsw i32 %l.064, 1
br label %for.inc15
if.then12: ; preds = %for.body4
%inc13 = add nsw i32 %r.065, 1
br label %for.inc15
for.inc15: ; preds = %for.body4, %if.then, %if.then12
%l.1 = phi i32 [ %inc8, %if.then ], [ %l.064, %if.then12 ], [ %l.064, %for.body4 ]
%r.1 = phi i32 [ %r.065, %if.then ], [ %inc13, %if.then12 ], [ %r.065, %for.body4 ]
%indvars.iv.next78 = or i64 %indvars.iv77, 1
%arrayidx6.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next78
%9 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
switch i32 %9, label %for.inc15.1 [
i32 0, label %if.then.1
i32 1, label %if.then12.1
]
if.then12.1: ; preds = %for.inc15
%inc13.1 = add nsw i32 %r.1, 1
br label %for.inc15.1
if.then.1: ; preds = %for.inc15
%inc8.1 = add nsw i32 %l.1, 1
br label %for.inc15.1
for.inc15.1: ; preds = %if.then.1, %if.then12.1, %for.inc15
%l.1.1 = phi i32 [ %inc8.1, %if.then.1 ], [ %l.1, %if.then12.1 ], [ %l.1, %for.inc15 ]
%r.1.1 = phi i32 [ %r.1, %if.then.1 ], [ %inc13.1, %if.then12.1 ], [ %r.1, %for.inc15 ]
%indvars.iv.next78.1 = add nuw nsw i64 %indvars.iv77, 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.cond18.preheader.unr-lcssa, label %for.body4, !llvm.loop !11
for.body20: ; preds = %for.body20.preheader, %for.inc40
%indvars.iv80 = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next81, %for.inc40 ]
%b.071 = phi i32 [ 0, %for.body20.preheader ], [ %b.1, %for.inc40 ]
%a.070 = phi i32 [ 0, %for.body20.preheader ], [ %a.1, %for.inc40 ]
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv80
%10 = load i32, ptr %arrayidx22, align 4, !tbaa !5
switch i32 %10, label %for.inc40 [
i32 0, label %if.then24
i32 1, label %if.then33
]
if.then24: ; preds = %for.body20
%inc25 = add nsw i32 %a.070, 1
%cmp26 = icmp eq i32 %inc25, %l.1.lcssa
br i1 %cmp26, label %for.end42.loopexit.split.loop.exit93, label %for.inc40
if.then33: ; preds = %for.body20
%inc34 = add nsw i32 %b.071, 1
%cmp35 = icmp eq i32 %inc34, %r.1.lcssa
br i1 %cmp35, label %for.end42.loopexit.split.loop.exit, label %for.inc40
for.inc40: ; preds = %for.body20, %if.then24, %if.then33
%a.1 = phi i32 [ %inc25, %if.then24 ], [ %a.070, %if.then33 ], [ %a.070, %for.body20 ]
%b.1 = phi i32 [ %b.071, %if.then24 ], [ %inc34, %if.then33 ], [ %b.071, %for.body20 ]
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
br i1 %exitcond84.not, label %for.end42.loopexit, label %for.body20, !llvm.loop !12
for.end42.loopexit.split.loop.exit: ; preds = %if.then33
%11 = trunc i64 %indvars.iv80 to i32
br label %for.end42.loopexit
for.end42.loopexit.split.loop.exit93: ; preds = %if.then24
%12 = trunc i64 %indvars.iv80 to i32
br label %for.end42.loopexit
for.end42.loopexit: ; preds = %for.inc40, %for.end42.loopexit.split.loop.exit93, %for.end42.loopexit.split.loop.exit
%i.2.lcssa.ph = phi i32 [ %11, %for.end42.loopexit.split.loop.exit ], [ %12, %for.end42.loopexit.split.loop.exit93 ], [ %5, %for.inc40 ]
%13 = add nuw nsw i32 %i.2.lcssa.ph, 1
br label %for.end42
for.end42: ; preds = %entry, %for.cond2.preheader, %for.end42.loopexit, %for.cond18.preheader
%i.2.lcssa = phi i32 [ 1, %for.cond18.preheader ], [ %13, %for.end42.loopexit ], [ 1, %for.cond2.preheader ], [ 1, %entry ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.2.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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 = distinct !{!12, !10}
|
#include<stdio.h>
typedef unsigned u;
u K[555555],Q[555555],Qi;
int main()
{
u m,i,j,k,l;
scanf("%u",&m);
for(i=j=k=l=0;j<=m;)
{
if(++i,++k==5){k=0;K[i]=K[++l]+1;}
if((j+=K[i])==m)Q[Qi++]=i;
}
printf("%u\n",Qi);
for(i=-1;++i<Qi;)printf("%u%c",Q[i],i+1==Qi?'\n':' ');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13275/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13275/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%u\00", align 1
@K = dso_local local_unnamed_addr global [555555 x i32] zeroinitializer, align 16
@Q = dso_local local_unnamed_addr global [555555 x i32] zeroinitializer, align 16
@Qi = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%u\0A\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%u%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%Qi.promoted = load i32, ptr @Qi, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %entry, %if.end14
%l.039 = phi i32 [ 0, %entry ], [ %l.1, %if.end14 ]
%k.038 = phi i32 [ 0, %entry ], [ %k.1, %if.end14 ]
%j.037 = phi i32 [ 0, %entry ], [ %add8, %if.end14 ]
%i.036 = phi i32 [ 0, %entry ], [ %inc, %if.end14 ]
%inc113435 = phi i32 [ %Qi.promoted, %entry ], [ %3, %if.end14 ]
%inc = add i32 %i.036, 1
%inc1 = add i32 %k.038, 1
%cmp2 = icmp eq i32 %inc1, 5
br i1 %cmp2, label %if.then, label %for.body.if.end_crit_edge
for.body.if.end_crit_edge: ; preds = %for.body
%idxprom6.phi.trans.insert = zext i32 %inc to i64
%arrayidx7.phi.trans.insert = getelementptr inbounds [555555 x i32], ptr @K, i64 0, i64 %idxprom6.phi.trans.insert
%.pre = load i32, ptr %arrayidx7.phi.trans.insert, align 4, !tbaa !5
br label %if.end
if.then: ; preds = %for.body
%inc3 = add i32 %l.039, 1
%idxprom = zext i32 %inc3 to i64
%arrayidx = getelementptr inbounds [555555 x i32], ptr @K, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add i32 %1, 1
%idxprom4 = zext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [555555 x i32], ptr @K, i64 0, i64 %idxprom4
store i32 %add, ptr %arrayidx5, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %for.body.if.end_crit_edge, %if.then
%2 = phi i32 [ %add, %if.then ], [ %.pre, %for.body.if.end_crit_edge ]
%k.1 = phi i32 [ 0, %if.then ], [ %inc1, %for.body.if.end_crit_edge ]
%l.1 = phi i32 [ %inc3, %if.then ], [ %l.039, %for.body.if.end_crit_edge ]
%add8 = add i32 %2, %j.037
%cmp9 = icmp eq i32 %add8, %0
br i1 %cmp9, label %if.then10, label %if.end14
if.then10: ; preds = %if.end
%inc11 = add i32 %inc113435, 1
store i32 %inc11, ptr @Qi, align 4, !tbaa !5
%idxprom12 = zext i32 %inc113435 to i64
%arrayidx13 = getelementptr inbounds [555555 x i32], ptr @Q, i64 0, i64 %idxprom12
store i32 %inc, ptr %arrayidx13, align 4, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then10, %if.end
%3 = phi i32 [ %inc11, %if.then10 ], [ %inc113435, %if.end ]
%cmp.not = icmp ugt i32 %add8, %0
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %if.end14
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%4 = load i32, ptr @Qi, align 4, !tbaa !5
%cmp1840.not = icmp eq i32 %4, 0
br i1 %cmp1840.not, label %for.end25, label %for.body19
for.body19: ; preds = %for.end, %for.body19
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body19 ], [ 0, %for.end ]
%5 = phi i32 [ %7, %for.body19 ], [ %4, %for.end ]
%i.141 = phi i32 [ %9, %for.body19 ], [ -1, %for.end ]
%arrayidx21 = getelementptr inbounds [555555 x i32], ptr @Q, i64 0, i64 %indvars.iv
%6 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%add22 = add i32 %i.141, 2
%cmp23 = icmp eq i32 %add22, %5
%cond = select i1 %cmp23, i32 10, i32 32
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6, i32 noundef %cond)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr @Qi, align 4, !tbaa !5
%8 = zext i32 %7 to i64
%cmp18 = icmp ult i64 %indvars.iv.next, %8
%9 = trunc i64 %indvars.iv to i32
br i1 %cmp18, label %for.body19, label %for.end25, !llvm.loop !11
for.end25: ; preds = %for.body19, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
char f[6][6],s[6],i,j,a,y,x,p,b;
int main()
{
for(;i<9;++i,b=!b){
scanf("%s",s);
for(j=4+b;j--;)
a=s[j]-48,f[i/2][j]|=a<<1+b,f[i/2+b][j+!b]|=a<<3-b*3;
}
do{
while(!((f[y][x]>>(p=(p+1)%4))&1));
putchar("URDL"[p]);
x+=p?2-p:0;
y+=p==3?0:p-1;
p=(p+2)%4;
}while(y|x|**f==6&p==3);
return!puts("");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132793/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132793/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@i = dso_local local_unnamed_addr global i8 0, align 1
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@s = dso_local global [6 x i8] zeroinitializer, align 1
@b = dso_local local_unnamed_addr global i8 0, align 1
@j = dso_local local_unnamed_addr global i8 0, align 1
@a = dso_local local_unnamed_addr global i8 0, align 1
@f = dso_local local_unnamed_addr global [6 x [6 x i8]] zeroinitializer, align 16
@y = dso_local local_unnamed_addr global i8 0, align 1
@x = dso_local local_unnamed_addr global i8 0, align 1
@p = dso_local local_unnamed_addr global i8 0, align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"URDL\00", align 1
@.str.2 = private unnamed_addr constant [1 x i8] zeroinitializer, 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:
%.pr = load i8, ptr @i, align 1, !tbaa !5
%cmp106 = icmp slt i8 %.pr, 9
br i1 %cmp106, label %for.body, label %do.body.preheader
do.body.preheader: ; preds = %for.inc, %entry
%.pre109 = load i8, ptr @y, align 1, !tbaa !5
%.pre110 = load i8, ptr @x, align 1, !tbaa !5
%p.promoted.pre = load i8, ptr @p, align 1, !tbaa !5
br label %do.body
for.body: ; preds = %entry, %for.inc
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s)
%0 = load i8, ptr @b, align 1, !tbaa !5
%tobool.not104 = icmp eq i8 %0, -4
%.pre = load i8, ptr @i, align 1, !tbaa !5
br i1 %tobool.not104, label %for.inc, label %iter.check
iter.check: ; preds = %for.body
%dec103 = add i8 %0, 3
%conv9 = sext i8 %0 to i32
%add10 = add nsw i32 %conv9, 1
%1 = sdiv i8 %.pre, 2
%idxprom12 = sext i8 %1 to i64
%mul.neg = mul nsw i32 %conv9, -3
%sub20 = add nsw i32 %mul.neg, 3
%div23 = sext i8 %1 to i32
%add25 = add nsw i32 %div23, %conv9
%idxprom26 = sext i32 %add25 to i64
%tobool29.not = icmp eq i8 %0, 0
%lnot.ext = zext i1 %tobool29.not to i64
%2 = add i8 %0, 4
%3 = zext i8 %2 to i32
%min.iters.check = icmp ugt i8 %0, -5
br i1 %min.iters.check, label %for.body5.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%4 = icmp slt i8 %dec103, 0
%5 = mul nsw i64 %idxprom12, 6
%6 = sext i8 %dec103 to i64
%7 = getelementptr i8, ptr @f, i64 %5
%scevgep = getelementptr i8, ptr %7, i64 %6
%8 = zext i8 %dec103 to i64
%9 = sub nsw i64 0, %8
%10 = getelementptr i8, ptr %scevgep, i64 %9
%11 = icmp ugt ptr %10, %scevgep
%12 = mul nsw i64 %idxprom26, 6
%13 = getelementptr i8, ptr @f, i64 %12
%14 = getelementptr i8, ptr %13, i64 %6
%scevgep115 = getelementptr i8, ptr %14, i64 %lnot.ext
%15 = zext i8 %dec103 to i64
%16 = sub nsw i64 0, %15
%17 = getelementptr i8, ptr %scevgep115, i64 %16
%18 = icmp ugt ptr %17, %scevgep115
%19 = or i1 %4, %11
%20 = or i1 %19, %18
br i1 %20, label %for.body5.preheader, label %vector.memcheck
vector.memcheck: ; preds = %vector.scevcheck
%21 = mul nsw i64 %idxprom12, 6
%22 = sext i8 %dec103 to i64
%23 = add nsw i64 %21, %22
%24 = zext i8 %dec103 to i64
%25 = sub nsw i64 %23, %24
%scevgep119 = getelementptr i8, ptr @f, i64 %25
%scevgep120 = getelementptr i8, ptr getelementptr inbounds ([6 x [6 x i8]], ptr @f, i64 0, i64 0, i64 1), i64 %23
%26 = mul nsw i64 %idxprom26, 6
%27 = add nsw i64 %26, %22
%28 = add nsw i64 %27, %lnot.ext
%29 = sub nsw i64 %28, %24
%scevgep121 = getelementptr i8, ptr @f, i64 %29
%scevgep122 = getelementptr i8, ptr getelementptr inbounds ([6 x [6 x i8]], ptr @f, i64 0, i64 0, i64 1), i64 %28
%bound0 = icmp ult ptr %scevgep119, %scevgep122
%bound1 = icmp ult ptr %scevgep121, %scevgep120
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body5.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.memcheck
%min.iters.check123 = icmp ult i8 %2, 16
br i1 %min.iters.check123, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i32 %3, 240
%broadcast.splatinsert = insertelement <16 x i32> poison, i32 %add10, i64 0
%broadcast.splat = shufflevector <16 x i32> %broadcast.splatinsert, <16 x i32> poison, <16 x i32> zeroinitializer
%broadcast.splatinsert127 = insertelement <16 x i32> poison, i32 %sub20, i64 0
%broadcast.splat128 = shufflevector <16 x i32> %broadcast.splatinsert127, <16 x i32> poison, <16 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%.cast = trunc i32 %index to i8
%offset.idx = sub i8 %dec103, %.cast
%30 = sext i8 %offset.idx to i64
%gep = getelementptr [6 x i8], ptr getelementptr (i8, ptr @s, i64 -15), i64 0, i64 %30
%wide.load = load <16 x i8>, ptr %gep, align 1, !tbaa !5
%31 = add <16 x i8> %wide.load, <i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48, i8 -48>
%32 = shufflevector <16 x i8> %31, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%33 = zext <16 x i8> %32 to <16 x i32>
%34 = shl <16 x i32> %33, %broadcast.splat
%gep158 = getelementptr [6 x [6 x i8]], ptr getelementptr (i8, ptr @f, i64 -15), i64 0, i64 %idxprom12, i64 %30
%wide.load124 = load <16 x i8>, ptr %gep158, align 1, !tbaa !5, !alias.scope !8, !noalias !11
%reverse125 = shufflevector <16 x i8> %wide.load124, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%35 = trunc <16 x i32> %34 to <16 x i8>
%36 = or <16 x i8> %reverse125, %35
%reverse126 = shufflevector <16 x i8> %36, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
store <16 x i8> %reverse126, ptr %gep158, align 1, !tbaa !5, !alias.scope !8, !noalias !11
%37 = shl <16 x i32> %33, %broadcast.splat128
%38 = add nsw i64 %30, %lnot.ext
%gep159 = getelementptr [6 x [6 x i8]], ptr getelementptr (i8, ptr @f, i64 -15), i64 0, i64 %idxprom26, i64 %38
%wide.load129 = load <16 x i8>, ptr %gep159, align 1, !tbaa !5, !alias.scope !11
%reverse130 = shufflevector <16 x i8> %wide.load129, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%39 = trunc <16 x i32> %37 to <16 x i8>
%40 = or <16 x i8> %reverse130, %39
%reverse131 = shufflevector <16 x i8> %40, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
store <16 x i8> %reverse131, ptr %gep159, align 1, !tbaa !5, !alias.scope !11
%index.next = add nuw i32 %index, 16
%41 = icmp eq i32 %index.next, %n.vec
br i1 %41, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%42 = extractelement <16 x i8> %31, i64 0
%cmp.n = icmp eq i32 %n.vec, %3
br i1 %cmp.n, label %for.cond4.for.inc_crit_edge, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%.cast135 = trunc i32 %n.vec to i8
%ind.end136 = sub i8 %dec103, %.cast135
%n.vec.remaining = and i32 %3, 12
%min.epilog.iters.check = icmp eq i32 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body5.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i32 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec133 = and i32 %3, 252
%.cast134 = trunc i32 %n.vec133 to i8
%ind.end = sub i8 %dec103, %.cast134
%broadcast.splatinsert143 = insertelement <4 x i32> poison, i32 %add10, i64 0
%broadcast.splat144 = shufflevector <4 x i32> %broadcast.splatinsert143, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert148 = insertelement <4 x i32> poison, i32 %sub20, i64 0
%broadcast.splat149 = shufflevector <4 x i32> %broadcast.splatinsert148, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%index138 = phi i32 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next153, %vec.epilog.vector.body ]
%.cast139 = trunc i32 %index138 to i8
%offset.idx140 = sub i8 %dec103, %.cast139
%43 = sext i8 %offset.idx140 to i64
%gep160 = getelementptr [6 x i8], ptr getelementptr (i8, ptr @s, i64 -3), i64 0, i64 %43
%wide.load141 = load <4 x i8>, ptr %gep160, align 1, !tbaa !5
%44 = add <4 x i8> %wide.load141, <i8 -48, i8 -48, i8 -48, i8 -48>
%45 = shufflevector <4 x i8> %44, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%46 = zext <4 x i8> %45 to <4 x i32>
%47 = shl <4 x i32> %46, %broadcast.splat144
%gep161 = getelementptr [6 x [6 x i8]], ptr getelementptr (i8, ptr @f, i64 -3), i64 0, i64 %idxprom12, i64 %43
%wide.load145 = load <4 x i8>, ptr %gep161, align 1, !tbaa !5, !alias.scope !17, !noalias !20
%reverse146 = shufflevector <4 x i8> %wide.load145, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%48 = trunc <4 x i32> %47 to <4 x i8>
%49 = or <4 x i8> %reverse146, %48
%reverse147 = shufflevector <4 x i8> %49, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
store <4 x i8> %reverse147, ptr %gep161, align 1, !tbaa !5, !alias.scope !17, !noalias !20
%50 = shl <4 x i32> %46, %broadcast.splat149
%51 = add nsw i64 %43, %lnot.ext
%gep162 = getelementptr [6 x [6 x i8]], ptr getelementptr (i8, ptr @f, i64 -3), i64 0, i64 %idxprom26, i64 %51
%wide.load150 = load <4 x i8>, ptr %gep162, align 1, !tbaa !5, !alias.scope !20
%reverse151 = shufflevector <4 x i8> %wide.load150, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%52 = trunc <4 x i32> %50 to <4 x i8>
%53 = or <4 x i8> %reverse151, %52
%reverse152 = shufflevector <4 x i8> %53, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
store <4 x i8> %reverse152, ptr %gep162, align 1, !tbaa !5, !alias.scope !20
%index.next153 = add nuw i32 %index138, 4
%54 = icmp eq i32 %index.next153, %n.vec133
br i1 %54, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !22
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%55 = extractelement <4 x i8> %44, i64 0
%cmp.n137 = icmp eq i32 %n.vec133, %3
br i1 %cmp.n137, label %for.cond4.for.inc_crit_edge, label %for.body5.preheader
for.body5.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%dec105.ph = phi i8 [ %dec103, %iter.check ], [ %dec103, %vector.memcheck ], [ %dec103, %vector.scevcheck ], [ %ind.end136, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%dec105 = phi i8 [ %dec, %for.body5 ], [ %dec105.ph, %for.body5.preheader ]
%idxprom = sext i8 %dec105 to i64
%arrayidx = getelementptr inbounds [6 x i8], ptr @s, i64 0, i64 %idxprom
%56 = load i8, ptr %arrayidx, align 1, !tbaa !5
%sub = add i8 %56, -48
%conv8 = zext i8 %sub to i32
%shl = shl i32 %conv8, %add10
%arrayidx15 = getelementptr inbounds [6 x [6 x i8]], ptr @f, i64 0, i64 %idxprom12, i64 %idxprom
%57 = load i8, ptr %arrayidx15, align 1, !tbaa !5
%58 = trunc i32 %shl to i8
%conv17 = or i8 %57, %58
store i8 %conv17, ptr %arrayidx15, align 1, !tbaa !5
%shl21 = shl i32 %conv8, %sub20
%add30 = add nsw i64 %idxprom, %lnot.ext
%arrayidx32 = getelementptr inbounds [6 x [6 x i8]], ptr @f, i64 0, i64 %idxprom26, i64 %add30
%59 = load i8, ptr %arrayidx32, align 1, !tbaa !5
%60 = trunc i32 %shl21 to i8
%conv35 = or i8 %59, %60
store i8 %conv35, ptr %arrayidx32, align 1, !tbaa !5
%dec = add i8 %dec105, -1
%tobool.not = icmp eq i8 %dec105, 0
br i1 %tobool.not, label %for.cond4.for.inc_crit_edge, label %for.body5, !llvm.loop !23
for.cond4.for.inc_crit_edge: ; preds = %for.body5, %vec.epilog.middle.block, %middle.block
%sub.lcssa = phi i8 [ %42, %middle.block ], [ %55, %vec.epilog.middle.block ], [ %sub, %for.body5 ]
store i8 %sub.lcssa, ptr @a, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond4.for.inc_crit_edge, %for.body
store i8 -1, ptr @j, align 1, !tbaa !5
%inc = add i8 %.pre, 1
store i8 %inc, ptr @i, align 1, !tbaa !5
%tobool36.not = icmp eq i8 %0, 0
%conv39 = zext i1 %tobool36.not to i8
store i8 %conv39, ptr @b, align 1, !tbaa !5
%cmp = icmp slt i8 %inc, 9
br i1 %cmp, label %for.body, label %do.body.preheader, !llvm.loop !24
do.body: ; preds = %do.body.preheader, %while.end
%p.promoted = phi i8 [ %p.promoted.pre, %do.body.preheader ], [ %conv79, %while.end ]
%61 = phi i8 [ %.pre110, %do.body.preheader ], [ %add62, %while.end ]
%62 = phi i8 [ %.pre109, %do.body.preheader ], [ %add74, %while.end ]
%idxprom41 = sext i8 %62 to i64
%idxprom43 = sext i8 %61 to i64
%arrayidx44 = getelementptr inbounds [6 x [6 x i8]], ptr @f, i64 0, i64 %idxprom41, i64 %idxprom43
%63 = load i8, ptr %arrayidx44, align 1, !tbaa !5
%conv45 = sext i8 %63 to i32
br label %while.cond
while.cond: ; preds = %while.cond, %do.body
%conv48107 = phi i8 [ %conv48, %while.cond ], [ %p.promoted, %do.body ]
%conv46 = sext i8 %conv48107 to i16
%add47 = add nsw i16 %conv46, 1
%rem100 = srem i16 %add47, 4
%conv48 = trunc i16 %rem100 to i8
%rem.sext102 = zext i16 %rem100 to i32
%64 = shl nuw i32 1, %rem.sext102
%65 = and i32 %64, %conv45
%tobool50.not = icmp eq i32 %65, 0
br i1 %tobool50.not, label %while.cond, label %while.end, !llvm.loop !25
while.end: ; preds = %while.cond
store i8 %conv48, ptr @p, align 1, !tbaa !5
%idxprom53 = sext i16 %rem100 to i64
%arrayidx54 = getelementptr inbounds [5 x i8], ptr @.str.1, i64 0, i64 %idxprom53
%66 = load i8, ptr %arrayidx54, align 1, !tbaa !5
%conv55 = sext i8 %66 to i32
%67 = load ptr, ptr @stdout, align 8, !tbaa !26
%call.i = tail call i32 @putc(i32 noundef %conv55, ptr noundef %67)
%68 = load i8, ptr @p, align 1
%tobool58.not = icmp eq i8 %68, 0
%sub60 = sub i8 2, %68
%cond = select i1 %tobool58.not, i8 0, i8 %sub60
%69 = load i8, ptr @x, align 1, !tbaa !5
%add62 = add i8 %cond, %69
store i8 %add62, ptr @x, align 1, !tbaa !5
%cmp65 = icmp eq i8 %68, 3
%sub70 = add i8 %68, -1
%cond72 = select i1 %cmp65, i8 0, i8 %sub70
%70 = load i8, ptr @y, align 1, !tbaa !5
%add74 = add i8 %70, %cond72
store i8 %add74, ptr @y, align 1, !tbaa !5
%conv76 = sext i8 %68 to i16
%add77 = add nsw i16 %conv76, 2
%rem78101 = srem i16 %add77, 4
%conv79 = trunc i16 %rem78101 to i8
store i8 %conv79, ptr @p, align 1, !tbaa !5
%or8297 = or i8 %add74, %add62
%or82 = sext i8 %or8297 to i32
%71 = load i8, ptr @f, align 16, !tbaa !5
%cmp84 = icmp eq i8 %71, 6
%cmp87 = icmp eq i16 %rem78101, 3
%and8998 = and i1 %cmp87, %cmp84
%and89 = zext i1 %and8998 to i32
%or90 = or i32 %and89, %or82
%tobool91.not = icmp eq i32 %or90, 0
br i1 %tobool91.not, label %do.end, label %do.body, !llvm.loop !28
do.end: ; preds = %while.end
%call92 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
%tobool93.not = icmp eq i32 %call92, 0
%lnot.ext95 = zext i1 %tobool93.not to i32
ret i32 %lnot.ext95
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9}
!9 = distinct !{!9, !10}
!10 = distinct !{!10, !"LVerDomain"}
!11 = !{!12}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = !{!18}
!18 = distinct !{!18, !19}
!19 = distinct !{!19, !"LVerDomain"}
!20 = !{!21}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !14, !15, !16}
!23 = distinct !{!23, !14, !15}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = !{!27, !27, i64 0}
!27 = !{!"any pointer", !6, i64 0}
!28 = distinct !{!28, !14}
|
#include <stdio.h>
#define INF 9999999
int n, m;
int c[10];
int memo[6][512];
int search(int leftMaisu, int leftKane) {
int answer = INF;
int i;
if (leftKane < 0) return INF;
if (leftMaisu <= 0) return 0;
if (memo[leftMaisu][leftKane]) return ~memo[leftMaisu][leftKane];
for (i = 0; i <= 9; i++) {
if (c[i] <= leftKane) {
int candidate = search(leftMaisu - 1, leftKane - c[i]) * 10 + i;
if (candidate < answer) answer = candidate;
}
}
return ~(memo[leftMaisu][leftKane] = ~answer);
}
int main(void) {
int i;
int kotae;
if (scanf("%d%d", &n, &m) != 2) return 1;
for (i = 0; i < 10; i++) {
if (scanf("%d", &c[i]) != 1) return 1;
}
kotae = search(n, m);
if (kotae < INF) {
printf("%0*d\n", n, kotae);
} else {
puts("NA");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132836/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132836/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@memo = dso_local local_unnamed_addr global [6 x [512 x i32]] zeroinitializer, align 16
@c = dso_local global [10 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@n = dso_local global i32 0, align 4
@m = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%0*d\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @search(i32 noundef %leftMaisu, i32 noundef %leftKane) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %leftKane, 0
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp1 = icmp slt i32 %leftMaisu, 1
br i1 %cmp1, label %cleanup, label %if.end3
if.end3: ; preds = %if.end
%idxprom = zext i32 %leftMaisu to i64
%idxprom4 = zext i32 %leftKane to i64
%arrayidx5 = getelementptr inbounds [6 x [512 x i32]], ptr @memo, i64 0, i64 %idxprom, i64 %idxprom4
%0 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
br i1 %tobool.not, label %for.cond.preheader, label %if.then6
for.cond.preheader: ; preds = %if.end3
%sub = add nsw i32 %leftMaisu, -1
%1 = load i32, ptr @c, align 16, !tbaa !5
%cmp15.not = icmp sgt i32 %1, %leftKane
br i1 %cmp15.not, label %for.inc, label %if.then16
if.then6: ; preds = %if.end3
%not = xor i32 %0, -1
br label %cleanup
if.then16: ; preds = %for.cond.preheader
%sub19 = sub nsw i32 %leftKane, %1
%call = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19)
%mul = mul nsw i32 %call, 10
%spec.select = tail call i32 @llvm.smin.i32(i32 %mul, i32 9999999)
br label %for.inc
for.inc: ; preds = %for.cond.preheader, %if.then16
%answer.2 = phi i32 [ %spec.select, %if.then16 ], [ 9999999, %for.cond.preheader ]
%2 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 1), align 4, !tbaa !5
%cmp15.not.1 = icmp sgt i32 %2, %leftKane
br i1 %cmp15.not.1, label %for.inc.1, label %if.then16.1
if.then16.1: ; preds = %for.inc
%sub19.1 = sub nsw i32 %leftKane, %2
%call.1 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.1)
%mul.1 = mul nsw i32 %call.1, 10
%add.1 = or i32 %mul.1, 1
%spec.select.1 = tail call i32 @llvm.smin.i32(i32 %add.1, i32 %answer.2)
br label %for.inc.1
for.inc.1: ; preds = %if.then16.1, %for.inc
%answer.2.1 = phi i32 [ %spec.select.1, %if.then16.1 ], [ %answer.2, %for.inc ]
%3 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 2), align 8, !tbaa !5
%cmp15.not.2 = icmp sgt i32 %3, %leftKane
br i1 %cmp15.not.2, label %for.inc.2, label %if.then16.2
if.then16.2: ; preds = %for.inc.1
%sub19.2 = sub nsw i32 %leftKane, %3
%call.2 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.2)
%mul.2 = mul nsw i32 %call.2, 10
%add.2 = add nsw i32 %mul.2, 2
%spec.select.2 = tail call i32 @llvm.smin.i32(i32 %add.2, i32 %answer.2.1)
br label %for.inc.2
for.inc.2: ; preds = %if.then16.2, %for.inc.1
%answer.2.2 = phi i32 [ %spec.select.2, %if.then16.2 ], [ %answer.2.1, %for.inc.1 ]
%4 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 3), align 4, !tbaa !5
%cmp15.not.3 = icmp sgt i32 %4, %leftKane
br i1 %cmp15.not.3, label %for.inc.3, label %if.then16.3
if.then16.3: ; preds = %for.inc.2
%sub19.3 = sub nsw i32 %leftKane, %4
%call.3 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.3)
%mul.3 = mul nsw i32 %call.3, 10
%add.3 = add nsw i32 %mul.3, 3
%spec.select.3 = tail call i32 @llvm.smin.i32(i32 %add.3, i32 %answer.2.2)
br label %for.inc.3
for.inc.3: ; preds = %if.then16.3, %for.inc.2
%answer.2.3 = phi i32 [ %spec.select.3, %if.then16.3 ], [ %answer.2.2, %for.inc.2 ]
%5 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 4), align 16, !tbaa !5
%cmp15.not.4 = icmp sgt i32 %5, %leftKane
br i1 %cmp15.not.4, label %for.inc.4, label %if.then16.4
if.then16.4: ; preds = %for.inc.3
%sub19.4 = sub nsw i32 %leftKane, %5
%call.4 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.4)
%mul.4 = mul nsw i32 %call.4, 10
%add.4 = add nsw i32 %mul.4, 4
%spec.select.4 = tail call i32 @llvm.smin.i32(i32 %add.4, i32 %answer.2.3)
br label %for.inc.4
for.inc.4: ; preds = %if.then16.4, %for.inc.3
%answer.2.4 = phi i32 [ %spec.select.4, %if.then16.4 ], [ %answer.2.3, %for.inc.3 ]
%6 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 5), align 4, !tbaa !5
%cmp15.not.5 = icmp sgt i32 %6, %leftKane
br i1 %cmp15.not.5, label %for.inc.5, label %if.then16.5
if.then16.5: ; preds = %for.inc.4
%sub19.5 = sub nsw i32 %leftKane, %6
%call.5 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.5)
%mul.5 = mul nsw i32 %call.5, 10
%add.5 = add nsw i32 %mul.5, 5
%spec.select.5 = tail call i32 @llvm.smin.i32(i32 %add.5, i32 %answer.2.4)
br label %for.inc.5
for.inc.5: ; preds = %if.then16.5, %for.inc.4
%answer.2.5 = phi i32 [ %spec.select.5, %if.then16.5 ], [ %answer.2.4, %for.inc.4 ]
%7 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 6), align 8, !tbaa !5
%cmp15.not.6 = icmp sgt i32 %7, %leftKane
br i1 %cmp15.not.6, label %for.inc.6, label %if.then16.6
if.then16.6: ; preds = %for.inc.5
%sub19.6 = sub nsw i32 %leftKane, %7
%call.6 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.6)
%mul.6 = mul nsw i32 %call.6, 10
%add.6 = add nsw i32 %mul.6, 6
%spec.select.6 = tail call i32 @llvm.smin.i32(i32 %add.6, i32 %answer.2.5)
br label %for.inc.6
for.inc.6: ; preds = %if.then16.6, %for.inc.5
%answer.2.6 = phi i32 [ %spec.select.6, %if.then16.6 ], [ %answer.2.5, %for.inc.5 ]
%8 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 7), align 4, !tbaa !5
%cmp15.not.7 = icmp sgt i32 %8, %leftKane
br i1 %cmp15.not.7, label %for.inc.7, label %if.then16.7
if.then16.7: ; preds = %for.inc.6
%sub19.7 = sub nsw i32 %leftKane, %8
%call.7 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.7)
%mul.7 = mul nsw i32 %call.7, 10
%add.7 = add nsw i32 %mul.7, 7
%spec.select.7 = tail call i32 @llvm.smin.i32(i32 %add.7, i32 %answer.2.6)
br label %for.inc.7
for.inc.7: ; preds = %if.then16.7, %for.inc.6
%answer.2.7 = phi i32 [ %spec.select.7, %if.then16.7 ], [ %answer.2.6, %for.inc.6 ]
%9 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 8), align 16, !tbaa !5
%cmp15.not.8 = icmp sgt i32 %9, %leftKane
br i1 %cmp15.not.8, label %for.inc.8, label %if.then16.8
if.then16.8: ; preds = %for.inc.7
%sub19.8 = sub nsw i32 %leftKane, %9
%call.8 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.8)
%mul.8 = mul nsw i32 %call.8, 10
%add.8 = add nsw i32 %mul.8, 8
%spec.select.8 = tail call i32 @llvm.smin.i32(i32 %add.8, i32 %answer.2.7)
br label %for.inc.8
for.inc.8: ; preds = %if.then16.8, %for.inc.7
%answer.2.8 = phi i32 [ %spec.select.8, %if.then16.8 ], [ %answer.2.7, %for.inc.7 ]
%10 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 9), align 4, !tbaa !5
%cmp15.not.9 = icmp sgt i32 %10, %leftKane
br i1 %cmp15.not.9, label %for.inc.9, label %if.then16.9
if.then16.9: ; preds = %for.inc.8
%sub19.9 = sub nsw i32 %leftKane, %10
%call.9 = tail call i32 @search(i32 noundef %sub, i32 noundef %sub19.9)
%mul.9 = mul nsw i32 %call.9, 10
%add.9 = add nsw i32 %mul.9, 9
%spec.select.9 = tail call i32 @llvm.smin.i32(i32 %add.9, i32 %answer.2.8)
br label %for.inc.9
for.inc.9: ; preds = %if.then16.9, %for.inc.8
%answer.2.9 = phi i32 [ %spec.select.9, %if.then16.9 ], [ %answer.2.8, %for.inc.8 ]
%not24 = xor i32 %answer.2.9, -1
store i32 %not24, ptr %arrayidx5, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %if.end, %entry, %for.inc.9, %if.then6
%retval.0 = phi i32 [ %not, %if.then6 ], [ %answer.2.9, %for.inc.9 ], [ 9999999, %entry ], [ 0, %if.end ]
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 @n, ptr noundef nonnull @m)
%cmp.not = icmp eq i32 %call, 2
br i1 %cmp.not, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @c)
%cmp3.not = icmp eq i32 %call2, 1
br i1 %cmp3.not, label %for.cond, label %cleanup
for.cond: ; preds = %for.body.preheader
%call2.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 1))
%cmp3.not.1 = icmp eq i32 %call2.1, 1
br i1 %cmp3.not.1, label %for.cond.1, label %cleanup
for.cond.1: ; preds = %for.cond
%call2.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 2))
%cmp3.not.2 = icmp eq i32 %call2.2, 1
br i1 %cmp3.not.2, label %for.cond.2, label %cleanup
for.cond.2: ; preds = %for.cond.1
%call2.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 3))
%cmp3.not.3 = icmp eq i32 %call2.3, 1
br i1 %cmp3.not.3, label %for.cond.3, label %cleanup
for.cond.3: ; preds = %for.cond.2
%call2.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 4))
%cmp3.not.4 = icmp eq i32 %call2.4, 1
br i1 %cmp3.not.4, label %for.cond.4, label %cleanup
for.cond.4: ; preds = %for.cond.3
%call2.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 5))
%cmp3.not.5 = icmp eq i32 %call2.5, 1
br i1 %cmp3.not.5, label %for.cond.5, label %cleanup
for.cond.5: ; preds = %for.cond.4
%call2.6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 6))
%cmp3.not.6 = icmp eq i32 %call2.6, 1
br i1 %cmp3.not.6, label %for.cond.6, label %cleanup
for.cond.6: ; preds = %for.cond.5
%call2.7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 7))
%cmp3.not.7 = icmp eq i32 %call2.7, 1
br i1 %cmp3.not.7, label %for.cond.7, label %cleanup
for.cond.7: ; preds = %for.cond.6
%call2.8 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 8))
%cmp3.not.8 = icmp eq i32 %call2.8, 1
br i1 %cmp3.not.8, label %for.cond.8, label %cleanup
for.cond.8: ; preds = %for.cond.7
%call2.9 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull getelementptr inbounds ([10 x i32], ptr @c, i64 0, i64 9))
%cmp3.not.9 = icmp eq i32 %call2.9, 1
br i1 %cmp3.not.9, label %for.cond.9, label %cleanup
for.cond.9: ; preds = %for.cond.8
%0 = load i32, ptr @n, align 4, !tbaa !5
%1 = load i32, ptr @m, align 4, !tbaa !5
%call6 = tail call i32 @search(i32 noundef %0, i32 noundef %1)
%cmp7 = icmp slt i32 %call6, 9999999
br i1 %cmp7, label %if.then8, label %if.else
if.then8: ; preds = %for.cond.9
%2 = load i32, ptr @n, align 4, !tbaa !5
%call9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2, i32 noundef %call6)
br label %cleanup
if.else: ; preds = %for.cond.9
%call10 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %cleanup
cleanup: ; preds = %for.body.preheader, %for.cond, %for.cond.1, %for.cond.2, %for.cond.3, %for.cond.4, %for.cond.5, %for.cond.6, %for.cond.7, %for.cond.8, %if.then8, %if.else, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 0, %if.else ], [ 0, %if.then8 ], [ 1, %for.cond.8 ], [ 1, %for.cond.7 ], [ 1, %for.cond.6 ], [ 1, %for.cond.5 ], [ 1, %for.cond.4 ], [ 1, %for.cond.3 ], [ 1, %for.cond.2 ], [ 1, %for.cond.1 ], [ 1, %for.cond ], [ 1, %for.body.preheader ]
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
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define ll long long
int n;
ll a[100010];
int main(){
scanf("%d",&n);
for(int i=0;i<=n;i++){
scanf("%lld",&a[i]);}
ll fflag[100010]={};
ll ans =0;
ll count = 1;
ll tmp;
ll sum=0;
for(int i=0;i<=n;i++){
sum += a[i];}
if(sum==0){
printf("0\n");
return 0;}
for(int i=0;i<=n;i++){
if(a[i]>count){
printf("-1\n");
return 0;}
if(sum > count){
tmp = count;}
else{
tmp = sum;}
ans += tmp;
sum -= a[i];
count = (tmp-a[i])*2;}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132887/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132887/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@a = dso_local global [100010 x i64] zeroinitializer, align 16
@.str.4 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not61 = icmp slt i32 %0, 0
br i1 %cmp.not61, label %if.then, label %for.body
for.cond3.preheader: ; preds = %for.body
%cmp4.not63 = icmp slt i32 %8, 0
br i1 %cmp4.not63, label %if.then, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond3.preheader
%1 = add nuw i32 %8, 1
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %8, 3
br i1 %min.iters.check, label %for.body6.preheader93, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%vec.phi91 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%2 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %index
%wide.load = load <2 x i64>, ptr %2, align 16, !tbaa !9
%3 = getelementptr inbounds i64, ptr %2, i64 2
%wide.load92 = load <2 x i64>, ptr %3, align 16, !tbaa !9
%4 = add <2 x i64> %wide.load, %vec.phi
%5 = add <2 x i64> %wide.load92, %vec.phi91
%index.next = add nuw i64 %index, 4
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %5, %4
%7 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup5, label %for.body6.preheader93
for.body6.preheader93: ; preds = %for.body6.preheader, %middle.block
%indvars.iv75.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
%sum.064.ph = phi i64 [ 0, %for.body6.preheader ], [ %7, %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 [100010 x i64], ptr @a, 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
%8 = load i32, ptr @n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %9
br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !15
for.cond.cleanup5: ; preds = %for.body6, %middle.block
%add.lcssa = phi i64 [ %7, %middle.block ], [ %add, %for.body6 ]
%cmp12 = icmp eq i64 %add.lcssa, 0
br i1 %cmp12, label %if.then, label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond.cleanup5
br i1 %cmp4.not63, label %for.end36, label %for.body18.preheader
for.body18.preheader: ; preds = %for.cond15.preheader
%10 = add nuw i32 %8, 1
%wide.trip.count81 = zext i32 %10 to i64
br label %for.body18
for.body6: ; preds = %for.body6.preheader93, %for.body6
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body6 ], [ %indvars.iv75.ph, %for.body6.preheader93 ]
%sum.064 = phi i64 [ %add, %for.body6 ], [ %sum.064.ph, %for.body6.preheader93 ]
%arrayidx8 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv75
%11 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%add = add nsw i64 %11, %sum.064
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !16
if.then: ; preds = %entry, %for.cond3.preheader, %for.cond.cleanup5
%puts59 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup38
for.body18: ; preds = %for.body18.preheader, %if.end24
%indvars.iv78 = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next79, %if.end24 ]
%sum.170 = phi i64 [ %add.lcssa, %for.body18.preheader ], [ %sub, %if.end24 ]
%count.069 = phi i64 [ 1, %for.body18.preheader ], [ %mul, %if.end24 ]
%ans.068 = phi i64 [ 0, %for.body18.preheader ], [ %add28, %if.end24 ]
%arrayidx20 = getelementptr inbounds [100010 x i64], ptr @a, i64 0, i64 %indvars.iv78
%12 = load i64, ptr %arrayidx20, align 8, !tbaa !9
%cmp21 = icmp sgt i64 %12, %count.069
br i1 %cmp21, label %if.then22, label %if.end24
if.then22: ; preds = %for.body18
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup38
if.end24: ; preds = %for.body18
%count.0.sum.1 = tail call i64 @llvm.smin.i64(i64 %sum.170, i64 %count.069)
%add28 = add nsw i64 %count.0.sum.1, %ans.068
%sub = sub nsw i64 %sum.170, %12
%sub33 = sub nsw i64 %count.0.sum.1, %12
%mul = shl nsw i64 %sub33, 1
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
br i1 %exitcond82.not, label %for.end36, label %for.body18, !llvm.loop !17
for.end36: ; preds = %if.end24, %for.cond15.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond15.preheader ], [ %add28, %if.end24 ]
%call37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %ans.0.lcssa)
br label %cleanup38
cleanup38: ; preds = %if.then22, %for.end36, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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 }
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 = !{!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}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
typedef long long ll;
const double PI = 3.1415926535897932384626433;
const int MOD = 1e9+7;
const int INF = 1e9;
#define rep(i, n) for(int i=0;i<(n);++i)
//prototype declaration
//gloval variable
int main(void){
int h, w;
scanf("%d %d\n", &h, &w);
char ** map;
map = (char**)calloc(h, sizeof(char*));
if(map == NULL){
fprintf(stderr, "memory allocation error.\n");
exit(1);
}
for(int i = 0; i < h; i++){
map[i] = (char*)calloc(w, sizeof(char));
if(map[i] == NULL){
fprintf(stderr, "memory allocation error.\n");
exit(1);
}
}
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++){
scanf(" %c", &map[i][j]);
}
}
int * discardROW;
discardROW = (int*)calloc(h, sizeof(int));
if(discardROW == NULL){
fprintf(stderr, "memory allocation error.");
exit(1);
}
int * discardCOLUMN;
discardCOLUMN = (int*)calloc(w, sizeof(int));
if(discardCOLUMN == NULL){
fprintf(stderr, "memory allocation error.");
exit(1);
}
for(int i = 0; i < h; i++){
int flag = 0;
for(int j = 0; j < w; j++){
if(map[i][j]=='#') flag++;
}
if(flag==0) discardROW[i] = 1;
}
for(int i = 0; i < w; i++){
int flag = 0;
for(int j = 0; j < h; j++){
if(map[j][i]=='#') flag++;
}
if(flag==0) discardCOLUMN[i] = 1;
}
for(int i = 0; i < h; i++){
if(discardROW[i]==0){
for(int j = 0; j < w; j++){
if(discardCOLUMN[j]==0)printf("%c", map[i][j]);
}
printf("\n");
}
}
free(discardROW);
free(discardCOLUMN);
for(int i = 0; i < h; i++){
free(map[i]);
}
free(map);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132937/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132937/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@PI = dso_local local_unnamed_addr constant double 0x400921FB54442D18, align 8
@MOD = dso_local local_unnamed_addr constant i32 1000000007, align 4
@INF = dso_local local_unnamed_addr constant i32 1000000000, align 4
@.str = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [26 x i8] c"memory allocation error.\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@.str.3 = private unnamed_addr constant [25 x i8] c"memory allocation error.\00", align 1
; Function Attrs: 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
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
%cmp = icmp eq ptr %call1, null
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp4211 = icmp sgt i32 %0, 0
br i1 %cmp4211, label %for.body.lr.ph, label %for.cond.cleanup19
for.body.lr.ph: ; preds = %for.cond.preheader
%1 = load i32, ptr %w, align 4, !tbaa !5
%conv6 = sext i32 %1 to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.body
if.then: ; preds = %entry
%2 = load ptr, ptr @stderr, align 8, !tbaa !9
%3 = call i64 @fwrite(ptr nonnull @.str.1, i64 25, i64 1, ptr %2) #10
call void @exit(i32 noundef 1) #11
unreachable
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.cond16.preheader, label %for.body, !llvm.loop !11
for.cond16.preheader: ; preds = %for.cond
%4 = load i32, ptr %w, align 4
%5 = icmp sgt i32 %4, 0
%or.cond = select i1 %cmp4211, i1 %5, i1 false
br i1 %or.cond, label %for.cond21.preheader, label %for.cond.cleanup19
for.body: ; preds = %for.body.lr.ph, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond ]
%call7 = call noalias ptr @calloc(i64 noundef %conv6, i64 noundef 1) #9
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call7, ptr %arrayidx, align 8, !tbaa !9
%cmp10 = icmp eq ptr %call7, null
br i1 %cmp10, label %if.then12, label %for.cond
if.then12: ; preds = %for.body
%6 = load ptr, ptr @stderr, align 8, !tbaa !9
%7 = call i64 @fwrite(ptr nonnull @.str.1, i64 25, i64 1, ptr %6) #10
call void @exit(i32 noundef 1) #11
unreachable
for.cond21.preheader: ; preds = %for.cond16.preheader, %for.cond.cleanup24
%8 = phi i32 [ %12, %for.cond.cleanup24 ], [ %0, %for.cond16.preheader ]
%9 = phi i32 [ %13, %for.cond.cleanup24 ], [ %4, %for.cond16.preheader ]
%indvars.iv243 = phi i64 [ %indvars.iv.next244, %for.cond.cleanup24 ], [ 0, %for.cond16.preheader ]
%cmp22213 = icmp sgt i32 %9, 0
br i1 %cmp22213, label %for.body25.lr.ph, label %for.cond.cleanup24
for.body25.lr.ph: ; preds = %for.cond21.preheader
%arrayidx27 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv243
%10 = load ptr, ptr %arrayidx27, align 8, !tbaa !9
br label %for.body25
for.cond.cleanup19: ; preds = %for.cond.cleanup24, %for.cond.preheader, %for.cond16.preheader
%conv37.pre-phi = phi i64 [ %conv, %for.cond16.preheader ], [ %conv, %for.cond.preheader ], [ %14, %for.cond.cleanup24 ]
%11 = phi i32 [ %0, %for.cond16.preheader ], [ %0, %for.cond.preheader ], [ %12, %for.cond.cleanup24 ]
%call38 = call noalias ptr @calloc(i64 noundef %conv37.pre-phi, i64 noundef 4) #9
%cmp39 = icmp eq ptr %call38, null
br i1 %cmp39, label %if.then41, label %if.end43
for.cond.cleanup24.loopexit: ; preds = %for.body25
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %for.cond.cleanup24
for.cond.cleanup24: ; preds = %for.cond.cleanup24.loopexit, %for.cond21.preheader
%12 = phi i32 [ %.pre, %for.cond.cleanup24.loopexit ], [ %8, %for.cond21.preheader ]
%13 = phi i32 [ %15, %for.cond.cleanup24.loopexit ], [ %9, %for.cond21.preheader ]
%indvars.iv.next244 = add nuw nsw i64 %indvars.iv243, 1
%14 = sext i32 %12 to i64
%cmp17 = icmp slt i64 %indvars.iv.next244, %14
br i1 %cmp17, label %for.cond21.preheader, label %for.cond.cleanup19, !llvm.loop !13
for.body25: ; preds = %for.body25.lr.ph, %for.body25
%indvars.iv240 = phi i64 [ 0, %for.body25.lr.ph ], [ %indvars.iv.next241, %for.body25 ]
%arrayidx29 = getelementptr inbounds i8, ptr %10, i64 %indvars.iv240
%call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %arrayidx29)
%indvars.iv.next241 = add nuw nsw i64 %indvars.iv240, 1
%15 = load i32, ptr %w, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp22 = icmp slt i64 %indvars.iv.next241, %16
br i1 %cmp22, label %for.body25, label %for.cond.cleanup24.loopexit, !llvm.loop !15
if.then41: ; preds = %for.cond.cleanup19
%17 = load ptr, ptr @stderr, align 8, !tbaa !9
%18 = call i64 @fwrite(ptr nonnull @.str.3, i64 24, i64 1, ptr %17) #10
call void @exit(i32 noundef 1) #11
unreachable
if.end43: ; preds = %for.cond.cleanup19
%19 = load i32, ptr %w, align 4, !tbaa !5
%conv44 = sext i32 %19 to i64
%call45 = call noalias ptr @calloc(i64 noundef %conv44, i64 noundef 4) #9
%cmp46 = icmp eq ptr %call45, null
br i1 %cmp46, label %if.then48, label %for.cond52.preheader
for.cond52.preheader: ; preds = %if.end43
%cmp53221 = icmp sgt i32 %11, 0
%cmp59217 = icmp sgt i32 %19, 0
br i1 %cmp53221, label %for.cond58.preheader.lr.ph, label %for.cond86.preheader.thread
for.cond58.preheader.lr.ph: ; preds = %for.cond52.preheader
%wide.trip.count259 = zext i32 %11 to i64
br i1 %cmp59217, label %for.cond58.preheader.us.preheader, label %for.cond58.preheader.preheader
for.cond58.preheader.preheader: ; preds = %for.cond58.preheader.lr.ph
%min.iters.check = icmp ult i32 %11, 8
br i1 %min.iters.check, label %for.cond58.preheader.preheader328, label %vector.ph
vector.ph: ; preds = %for.cond58.preheader.preheader
%n.vec = and i64 %wide.trip.count259, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%20 = getelementptr inbounds i32, ptr %call38, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %20, align 4, !tbaa !5
%21 = getelementptr inbounds i32, ptr %20, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %21, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%22 = icmp eq i64 %index.next, %n.vec
br i1 %22, label %middle.block, label %vector.body, !llvm.loop !16
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count259
br i1 %cmp.n, label %for.cond86.preheader, label %for.cond58.preheader.preheader328
for.cond58.preheader.preheader328: ; preds = %for.cond58.preheader.preheader, %middle.block
%indvars.iv246.ph = phi i64 [ 0, %for.cond58.preheader.preheader ], [ %n.vec, %middle.block ]
br label %for.cond58.preheader
for.cond58.preheader.us.preheader: ; preds = %for.cond58.preheader.lr.ph
%wide.trip.count254 = zext i32 %19 to i64
%min.iters.check301 = icmp ult i32 %19, 8
%n.vec304 = and i64 %wide.trip.count254, 4294967288
%cmp.n306 = icmp eq i64 %n.vec304, %wide.trip.count254
br label %for.cond58.preheader.us
for.cond58.preheader.us: ; preds = %for.cond58.preheader.us.preheader, %if.end81.us
%indvars.iv256 = phi i64 [ 0, %for.cond58.preheader.us.preheader ], [ %indvars.iv.next257, %if.end81.us ]
%arrayidx64.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv256
%23 = load ptr, ptr %arrayidx64.us, align 8, !tbaa !9
br i1 %min.iters.check301, label %for.body62.us.preheader, label %vector.body307
vector.body307: ; preds = %for.cond58.preheader.us, %vector.body307
%index308 = phi i64 [ %index.next311, %vector.body307 ], [ 0, %for.cond58.preheader.us ]
%vec.phi = phi <4 x i32> [ %30, %vector.body307 ], [ zeroinitializer, %for.cond58.preheader.us ]
%vec.phi309 = phi <4 x i32> [ %31, %vector.body307 ], [ zeroinitializer, %for.cond58.preheader.us ]
%24 = getelementptr inbounds i8, ptr %23, i64 %index308
%wide.load = load <4 x i8>, ptr %24, align 1, !tbaa !19
%25 = getelementptr inbounds i8, ptr %24, i64 4
%wide.load310 = load <4 x i8>, ptr %25, align 1, !tbaa !19
%26 = icmp eq <4 x i8> %wide.load, <i8 35, i8 35, i8 35, i8 35>
%27 = icmp eq <4 x i8> %wide.load310, <i8 35, i8 35, i8 35, i8 35>
%28 = zext <4 x i1> %26 to <4 x i32>
%29 = zext <4 x i1> %27 to <4 x i32>
%30 = add <4 x i32> %vec.phi, %28
%31 = add <4 x i32> %vec.phi309, %29
%index.next311 = add nuw i64 %index308, 8
%32 = icmp eq i64 %index.next311, %n.vec304
br i1 %32, label %middle.block299, label %vector.body307, !llvm.loop !20
middle.block299: ; preds = %vector.body307
%bin.rdx = add <4 x i32> %31, %30
%33 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n306, label %for.cond58.for.cond.cleanup61_crit_edge.us, label %for.body62.us.preheader
for.body62.us.preheader: ; preds = %for.cond58.preheader.us, %middle.block299
%indvars.iv251.ph = phi i64 [ 0, %for.cond58.preheader.us ], [ %n.vec304, %middle.block299 ]
%flag.0218.us.ph = phi i32 [ 0, %for.cond58.preheader.us ], [ %33, %middle.block299 ]
br label %for.body62.us
if.then78.us: ; preds = %for.cond58.for.cond.cleanup61_crit_edge.us
%arrayidx80.us = getelementptr inbounds i32, ptr %call38, i64 %indvars.iv256
store i32 1, ptr %arrayidx80.us, align 4, !tbaa !5
br label %if.end81.us
if.end81.us: ; preds = %if.then78.us, %for.cond58.for.cond.cleanup61_crit_edge.us
%indvars.iv.next257 = add nuw nsw i64 %indvars.iv256, 1
%exitcond260.not = icmp eq i64 %indvars.iv.next257, %wide.trip.count259
br i1 %exitcond260.not, label %for.cond86.preheader, label %for.cond58.preheader.us, !llvm.loop !21
for.body62.us: ; preds = %for.body62.us.preheader, %for.body62.us
%indvars.iv251 = phi i64 [ %indvars.iv.next252, %for.body62.us ], [ %indvars.iv251.ph, %for.body62.us.preheader ]
%flag.0218.us = phi i32 [ %spec.select.us, %for.body62.us ], [ %flag.0218.us.ph, %for.body62.us.preheader ]
%arrayidx66.us = getelementptr inbounds i8, ptr %23, i64 %indvars.iv251
%34 = load i8, ptr %arrayidx66.us, align 1, !tbaa !19
%cmp68.us = icmp eq i8 %34, 35
%inc71.us = zext i1 %cmp68.us to i32
%spec.select.us = add nuw nsw i32 %flag.0218.us, %inc71.us
%indvars.iv.next252 = add nuw nsw i64 %indvars.iv251, 1
%exitcond255.not = icmp eq i64 %indvars.iv.next252, %wide.trip.count254
br i1 %exitcond255.not, label %for.cond58.for.cond.cleanup61_crit_edge.us, label %for.body62.us, !llvm.loop !22
for.cond58.for.cond.cleanup61_crit_edge.us: ; preds = %for.body62.us, %middle.block299
%spec.select.us.lcssa = phi i32 [ %33, %middle.block299 ], [ %spec.select.us, %for.body62.us ]
%cmp76.us = icmp eq i32 %spec.select.us.lcssa, 0
br i1 %cmp76.us, label %if.then78.us, label %if.end81.us
if.then48: ; preds = %if.end43
%35 = load ptr, ptr @stderr, align 8, !tbaa !9
%36 = call i64 @fwrite(ptr nonnull @.str.3, i64 24, i64 1, ptr %35) #10
call void @exit(i32 noundef 1) #11
unreachable
for.cond58.preheader: ; preds = %for.cond58.preheader.preheader328, %for.cond58.preheader
%indvars.iv246 = phi i64 [ %indvars.iv.next247, %for.cond58.preheader ], [ %indvars.iv246.ph, %for.cond58.preheader.preheader328 ]
%arrayidx80 = getelementptr inbounds i32, ptr %call38, i64 %indvars.iv246
store i32 1, ptr %arrayidx80, align 4, !tbaa !5
%indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1
%exitcond250.not = icmp eq i64 %indvars.iv.next247, %wide.trip.count259
br i1 %exitcond250.not, label %for.cond86.preheader, label %for.cond58.preheader, !llvm.loop !23
for.cond86.preheader: ; preds = %for.cond58.preheader, %if.end81.us, %middle.block
%cmp87227 = icmp sgt i32 %19, 0
br i1 %cmp87227, label %for.cond93.preheader.lr.ph, label %for.cond121.preheader
for.cond86.preheader.thread: ; preds = %for.cond52.preheader
br i1 %cmp59217, label %for.cond93.preheader.preheader, label %for.cond.cleanup161.critedge
for.cond93.preheader.lr.ph: ; preds = %for.cond86.preheader
br i1 %cmp53221, label %for.cond93.preheader.us.preheader, label %for.cond93.preheader.preheader
for.cond93.preheader.preheader: ; preds = %for.cond86.preheader.thread, %for.cond93.preheader.lr.ph
%wide.trip.count264 = zext i32 %19 to i64
%min.iters.check314 = icmp ult i32 %19, 8
br i1 %min.iters.check314, label %for.cond93.preheader.preheader323, label %vector.ph315
vector.ph315: ; preds = %for.cond93.preheader.preheader
%n.vec317 = and i64 %wide.trip.count264, 4294967288
br label %vector.body320
vector.body320: ; preds = %vector.body320, %vector.ph315
%index321 = phi i64 [ 0, %vector.ph315 ], [ %index.next322, %vector.body320 ]
%37 = getelementptr inbounds i32, ptr %call45, i64 %index321
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %37, align 4, !tbaa !5
%38 = getelementptr inbounds i32, ptr %37, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %38, align 4, !tbaa !5
%index.next322 = add nuw i64 %index321, 8
%39 = icmp eq i64 %index.next322, %n.vec317
br i1 %39, label %middle.block312, label %vector.body320, !llvm.loop !24
middle.block312: ; preds = %vector.body320
%cmp.n319 = icmp eq i64 %n.vec317, %wide.trip.count264
br i1 %cmp.n319, label %for.cond121.preheader, label %for.cond93.preheader.preheader323
for.cond93.preheader.preheader323: ; preds = %for.cond93.preheader.preheader, %middle.block312
%indvars.iv261.ph = phi i64 [ 0, %for.cond93.preheader.preheader ], [ %n.vec317, %middle.block312 ]
br label %for.cond93.preheader
for.cond93.preheader.us.preheader: ; preds = %for.cond93.preheader.lr.ph
%wide.trip.count274 = zext i32 %19 to i64
%xtraiter = and i64 %wide.trip.count259, 3
%40 = icmp ult i32 %11, 4
%unroll_iter = and i64 %wide.trip.count259, 4294967292
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond93.preheader.us
for.cond93.preheader.us: ; preds = %for.cond93.preheader.us.preheader, %if.end116.us
%indvars.iv271 = phi i64 [ 0, %for.cond93.preheader.us.preheader ], [ %indvars.iv.next272, %if.end116.us ]
br i1 %40, label %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa, label %for.body97.us
if.then113.us: ; preds = %for.cond93.for.cond.cleanup96_crit_edge.us
%arrayidx115.us = getelementptr inbounds i32, ptr %call45, i64 %indvars.iv271
store i32 1, ptr %arrayidx115.us, align 4, !tbaa !5
br label %if.end116.us
if.end116.us: ; preds = %if.then113.us, %for.cond93.for.cond.cleanup96_crit_edge.us
%indvars.iv.next272 = add nuw nsw i64 %indvars.iv271, 1
%exitcond275.not = icmp eq i64 %indvars.iv.next272, %wide.trip.count274
br i1 %exitcond275.not, label %for.cond121.preheader, label %for.cond93.preheader.us, !llvm.loop !25
for.body97.us: ; preds = %for.cond93.preheader.us, %for.body97.us
%indvars.iv266 = phi i64 [ %indvars.iv.next267.3, %for.body97.us ], [ 0, %for.cond93.preheader.us ]
%flag91.0224.us = phi i32 [ %spec.select210.us.3, %for.body97.us ], [ 0, %for.cond93.preheader.us ]
%niter = phi i64 [ %niter.next.3, %for.body97.us ], [ 0, %for.cond93.preheader.us ]
%arrayidx99.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv266
%41 = load ptr, ptr %arrayidx99.us, align 8, !tbaa !9
%arrayidx101.us = getelementptr inbounds i8, ptr %41, i64 %indvars.iv271
%42 = load i8, ptr %arrayidx101.us, align 1, !tbaa !19
%cmp103.us = icmp eq i8 %42, 35
%inc106.us = zext i1 %cmp103.us to i32
%spec.select210.us = add nuw nsw i32 %flag91.0224.us, %inc106.us
%indvars.iv.next267 = or i64 %indvars.iv266, 1
%arrayidx99.us.1 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next267
%43 = load ptr, ptr %arrayidx99.us.1, align 8, !tbaa !9
%arrayidx101.us.1 = getelementptr inbounds i8, ptr %43, i64 %indvars.iv271
%44 = load i8, ptr %arrayidx101.us.1, align 1, !tbaa !19
%cmp103.us.1 = icmp eq i8 %44, 35
%inc106.us.1 = zext i1 %cmp103.us.1 to i32
%spec.select210.us.1 = add nuw nsw i32 %spec.select210.us, %inc106.us.1
%indvars.iv.next267.1 = or i64 %indvars.iv266, 2
%arrayidx99.us.2 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next267.1
%45 = load ptr, ptr %arrayidx99.us.2, align 8, !tbaa !9
%arrayidx101.us.2 = getelementptr inbounds i8, ptr %45, i64 %indvars.iv271
%46 = load i8, ptr %arrayidx101.us.2, align 1, !tbaa !19
%cmp103.us.2 = icmp eq i8 %46, 35
%inc106.us.2 = zext i1 %cmp103.us.2 to i32
%spec.select210.us.2 = add nuw nsw i32 %spec.select210.us.1, %inc106.us.2
%indvars.iv.next267.2 = or i64 %indvars.iv266, 3
%arrayidx99.us.3 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next267.2
%47 = load ptr, ptr %arrayidx99.us.3, align 8, !tbaa !9
%arrayidx101.us.3 = getelementptr inbounds i8, ptr %47, i64 %indvars.iv271
%48 = load i8, ptr %arrayidx101.us.3, align 1, !tbaa !19
%cmp103.us.3 = icmp eq i8 %48, 35
%inc106.us.3 = zext i1 %cmp103.us.3 to i32
%spec.select210.us.3 = add nuw nsw i32 %spec.select210.us.2, %inc106.us.3
%indvars.iv.next267.3 = add nuw nsw i64 %indvars.iv266, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa, label %for.body97.us, !llvm.loop !26
for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa: ; preds = %for.body97.us, %for.cond93.preheader.us
%spec.select210.us.lcssa.ph = phi i32 [ undef, %for.cond93.preheader.us ], [ %spec.select210.us.3, %for.body97.us ]
%indvars.iv266.unr = phi i64 [ 0, %for.cond93.preheader.us ], [ %indvars.iv.next267.3, %for.body97.us ]
%flag91.0224.us.unr = phi i32 [ 0, %for.cond93.preheader.us ], [ %spec.select210.us.3, %for.body97.us ]
br i1 %lcmp.mod.not, label %for.cond93.for.cond.cleanup96_crit_edge.us, label %for.body97.us.epil
for.body97.us.epil: ; preds = %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa, %for.body97.us.epil
%indvars.iv266.epil = phi i64 [ %indvars.iv.next267.epil, %for.body97.us.epil ], [ %indvars.iv266.unr, %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa ]
%flag91.0224.us.epil = phi i32 [ %spec.select210.us.epil, %for.body97.us.epil ], [ %flag91.0224.us.unr, %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body97.us.epil ], [ 0, %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa ]
%arrayidx99.us.epil = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv266.epil
%49 = load ptr, ptr %arrayidx99.us.epil, align 8, !tbaa !9
%arrayidx101.us.epil = getelementptr inbounds i8, ptr %49, i64 %indvars.iv271
%50 = load i8, ptr %arrayidx101.us.epil, align 1, !tbaa !19
%cmp103.us.epil = icmp eq i8 %50, 35
%inc106.us.epil = zext i1 %cmp103.us.epil to i32
%spec.select210.us.epil = add nuw nsw i32 %flag91.0224.us.epil, %inc106.us.epil
%indvars.iv.next267.epil = add nuw nsw i64 %indvars.iv266.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.cond93.for.cond.cleanup96_crit_edge.us, label %for.body97.us.epil, !llvm.loop !27
for.cond93.for.cond.cleanup96_crit_edge.us: ; preds = %for.body97.us.epil, %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa
%spec.select210.us.lcssa = phi i32 [ %spec.select210.us.lcssa.ph, %for.cond93.for.cond.cleanup96_crit_edge.us.unr-lcssa ], [ %spec.select210.us.epil, %for.body97.us.epil ]
%cmp111.us = icmp eq i32 %spec.select210.us.lcssa, 0
br i1 %cmp111.us, label %if.then113.us, label %if.end116.us
for.cond93.preheader: ; preds = %for.cond93.preheader.preheader323, %for.cond93.preheader
%indvars.iv261 = phi i64 [ %indvars.iv.next262, %for.cond93.preheader ], [ %indvars.iv261.ph, %for.cond93.preheader.preheader323 ]
%arrayidx115 = getelementptr inbounds i32, ptr %call45, i64 %indvars.iv261
store i32 1, ptr %arrayidx115, align 4, !tbaa !5
%indvars.iv.next262 = add nuw nsw i64 %indvars.iv261, 1
%exitcond265.not = icmp eq i64 %indvars.iv.next262, %wide.trip.count264
br i1 %exitcond265.not, label %for.cond121.preheader, label %for.cond93.preheader, !llvm.loop !29
for.cond121.preheader: ; preds = %for.cond93.preheader, %if.end116.us, %middle.block312, %for.cond86.preheader
br i1 %cmp53221, label %for.body125, label %for.cond.cleanup161.critedge
for.cond.cleanup124.loopexit: ; preds = %for.inc154
%51 = icmp sgt i32 %61, 0
call void @free(ptr noundef %call38) #8
call void @free(ptr noundef %call45) #8
br i1 %51, label %for.body162, label %for.cond.cleanup161
for.body125: ; preds = %for.cond121.preheader, %for.inc154
%52 = phi i32 [ %61, %for.inc154 ], [ %11, %for.cond121.preheader ]
%indvars.iv279 = phi i64 [ %indvars.iv.next280, %for.inc154 ], [ 0, %for.cond121.preheader ]
%arrayidx127 = getelementptr inbounds i32, ptr %call38, i64 %indvars.iv279
%53 = load i32, ptr %arrayidx127, align 4, !tbaa !5
%cmp128 = icmp eq i32 %53, 0
br i1 %cmp128, label %for.cond132.preheader, label %for.inc154
for.cond132.preheader: ; preds = %for.body125
%54 = load i32, ptr %w, align 4, !tbaa !5
%cmp133229 = icmp sgt i32 %54, 0
br i1 %cmp133229, label %for.body136.lr.ph, label %for.cond.cleanup135
for.body136.lr.ph: ; preds = %for.cond132.preheader
%arrayidx143 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv279
br label %for.body136
for.cond.cleanup135: ; preds = %for.inc149, %for.cond132.preheader
%putchar = call i32 @putchar(i32 10)
%.pre286 = load i32, ptr %h, align 4, !tbaa !5
br label %for.inc154
for.body136: ; preds = %for.body136.lr.ph, %for.inc149
%55 = phi i32 [ %54, %for.body136.lr.ph ], [ %59, %for.inc149 ]
%indvars.iv276 = phi i64 [ 0, %for.body136.lr.ph ], [ %indvars.iv.next277, %for.inc149 ]
%arrayidx138 = getelementptr inbounds i32, ptr %call45, i64 %indvars.iv276
%56 = load i32, ptr %arrayidx138, align 4, !tbaa !5
%cmp139 = icmp eq i32 %56, 0
br i1 %cmp139, label %if.then141, label %for.inc149
if.then141: ; preds = %for.body136
%57 = load ptr, ptr %arrayidx143, align 8, !tbaa !9
%arrayidx145 = getelementptr inbounds i8, ptr %57, i64 %indvars.iv276
%58 = load i8, ptr %arrayidx145, align 1, !tbaa !19
%conv146 = sext i8 %58 to i32
%putchar209 = call i32 @putchar(i32 %conv146)
%.pre285 = load i32, ptr %w, align 4, !tbaa !5
br label %for.inc149
for.inc149: ; preds = %for.body136, %if.then141
%59 = phi i32 [ %55, %for.body136 ], [ %.pre285, %if.then141 ]
%indvars.iv.next277 = add nuw nsw i64 %indvars.iv276, 1
%60 = sext i32 %59 to i64
%cmp133 = icmp slt i64 %indvars.iv.next277, %60
br i1 %cmp133, label %for.body136, label %for.cond.cleanup135, !llvm.loop !30
for.inc154: ; preds = %for.body125, %for.cond.cleanup135
%61 = phi i32 [ %52, %for.body125 ], [ %.pre286, %for.cond.cleanup135 ]
%indvars.iv.next280 = add nuw nsw i64 %indvars.iv279, 1
%62 = sext i32 %61 to i64
%cmp122 = icmp slt i64 %indvars.iv.next280, %62
br i1 %cmp122, label %for.body125, label %for.cond.cleanup124.loopexit, !llvm.loop !31
for.cond.cleanup161.critedge: ; preds = %for.cond86.preheader.thread, %for.cond121.preheader
call void @free(ptr noundef %call38) #8
call void @free(ptr noundef %call45) #8
br label %for.cond.cleanup161
for.cond.cleanup161: ; preds = %for.body162, %for.cond.cleanup161.critedge, %for.cond.cleanup124.loopexit
call void @free(ptr noundef %call1) #8
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
for.body162: ; preds = %for.cond.cleanup124.loopexit, %for.body162
%indvars.iv282 = phi i64 [ %indvars.iv.next283, %for.body162 ], [ 0, %for.cond.cleanup124.loopexit ]
%arrayidx164 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv282
%63 = load ptr, ptr %arrayidx164, align 8, !tbaa !9
call void @free(ptr noundef %63) #8
%indvars.iv.next283 = add nuw nsw i64 %indvars.iv282, 1
%64 = load i32, ptr %h, align 4, !tbaa !5
%65 = sext i32 %64 to i64
%cmp159 = icmp slt i64 %indvars.iv.next283, %65
br i1 %cmp159, label %for.body162, label %for.cond.cleanup161, !llvm.loop !32
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: noreturn nounwind
declare void @exit(i32 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { cold }
attributes #11 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17, !18}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !12, !17, !18}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12, !18, !17}
!23 = distinct !{!23, !12, !18, !17}
!24 = distinct !{!24, !12, !17, !18}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.unroll.disable"}
!29 = distinct !{!29, !12, !18, !17}
!30 = distinct !{!30, !12}
!31 = distinct !{!31, !12}
!32 = distinct !{!32, !12}
|
/* ex7_3
bonbonc */
#include <stdio.h>
#include <stdlib.h>
int main(void){
int row,column,copied_row,flag,i,j,k;
scanf("%d %d",&row,&column);
copied_row = row;//行数をコピー
char **squares;
// 各行の配列へのポインタ分のメモリ領域を確保
squares = (char**)calloc(row, sizeof(char*));
if (squares == NULL){
exit(1);//エラー処理
}
// 各行の要素分のメモリ領域を確保
for ( i = 0; i < row; i++){
squares[i] = (char*)calloc(column, sizeof(char));
if (squares[i] == NULL){
exit(1);
}
}
for ( i = 0; i < row; i++){
for ( j = 0; j < column; j++){
scanf(" %c",&squares[i][j]);//入力を受け取る
}
}
//白のみの行を探索してその行を削除する
for ( i = 0; i < row; i++){
flag = 1;
for ( j = 0; j < column; j++){
if (squares[i][j] == '#'){
flag = 0;
}
}
//白のみだった場合
if (flag==1){
for (j = i;j < row-1;j++){
for ( k = 0; k < column; k++){
//行を上に平行移動
squares[j][k] = squares[j+1][k];
}
}
row -= 1;
i -= 1;
}
}
//白のみの列を探してその列を削除する
for ( i = 0; i < column; i++){
flag = 1;
for ( j = 0; j < row; j++){
if (squares[j][i] == '#'){
flag = 0;
}
}
//白のみの列だった場合
if (flag==1){
for ( j = i; j < column-1; j++){
for ( k = 0; k < row; k++){
squares[k][j] = squares[k][j+1];
}
}
column -= 1;
i -= 1;
}
}
for ( i = 0; i < row; i++){
for ( j = 0; j < column; j++){
printf("%c",squares[i][j]);//答えを出力
}
printf("\n");
}
for ( i = 0; i < row; i++){
free(squares[i]);//各行メモリ解放
}
free(squares);//メモリ解放
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_132980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_132980/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%row = alloca i32, align 4
%column = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %row) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %column) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %row, ptr noundef nonnull %column)
%0 = load i32, ptr %row, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #8
%cmp = icmp eq ptr %call1, null
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp3229 = icmp sgt i32 %0, 0
%.pre314.pre.pre = load i32, ptr %column, align 4, !tbaa !5
br i1 %cmp3229, label %for.body.lr.ph, label %for.cond83.preheader
for.body.lr.ph: ; preds = %for.cond.preheader
%conv5 = sext i32 %.pre314.pre.pre to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.body
if.then: ; preds = %entry
call void @exit(i32 noundef 1) #9
unreachable
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.cond13.preheader, label %for.body, !llvm.loop !9
for.cond13.preheader: ; preds = %for.cond
br i1 %cmp3229, label %for.cond17.preheader.lr.ph, label %for.cond83.preheader
for.cond17.preheader.lr.ph: ; preds = %for.cond13.preheader
%1 = icmp sgt i32 %.pre314.pre.pre, 0
br i1 %1, label %for.cond17.preheader, label %for.cond36.preheader.preheader
for.body: ; preds = %for.body.lr.ph, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.cond ]
%call6 = call noalias ptr @calloc(i64 noundef %conv5, i64 noundef 1) #8
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call6, ptr %arrayidx, align 8, !tbaa !11
%cmp9 = icmp eq ptr %call6, null
br i1 %cmp9, label %if.then11, label %for.cond
if.then11: ; preds = %for.body
call void @exit(i32 noundef 1) #9
unreachable
for.cond17.preheader: ; preds = %for.cond17.preheader.lr.ph, %for.inc29
%2 = phi i32 [ %7, %for.inc29 ], [ %0, %for.cond17.preheader.lr.ph ]
%3 = phi i32 [ %8, %for.inc29 ], [ %.pre314.pre.pre, %for.cond17.preheader.lr.ph ]
%indvars.iv276 = phi i64 [ %indvars.iv.next277, %for.inc29 ], [ 0, %for.cond17.preheader.lr.ph ]
%cmp18231 = icmp sgt i32 %3, 0
br i1 %cmp18231, label %for.body20.lr.ph, label %for.inc29
for.body20.lr.ph: ; preds = %for.cond17.preheader
%arrayidx22 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv276
%4 = load ptr, ptr %arrayidx22, align 8, !tbaa !11
br label %for.body20
for.cond32.preheader: ; preds = %for.inc29
%cmp33244 = icmp sgt i32 %7, 0
br i1 %cmp33244, label %for.cond36.preheader.preheader, label %for.cond83.preheader
for.cond36.preheader.preheader: ; preds = %for.cond17.preheader.lr.ph, %for.cond32.preheader
%.ph = phi i32 [ %0, %for.cond17.preheader.lr.ph ], [ %7, %for.cond32.preheader ]
%.ph365 = phi i32 [ %.pre314.pre.pre, %for.cond17.preheader.lr.ph ], [ %8, %for.cond32.preheader ]
br label %for.cond36.preheader
for.body20: ; preds = %for.body20.lr.ph, %for.body20
%indvars.iv273 = phi i64 [ 0, %for.body20.lr.ph ], [ %indvars.iv.next274, %for.body20 ]
%arrayidx24 = getelementptr inbounds i8, ptr %4, i64 %indvars.iv273
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx24)
%indvars.iv.next274 = add nuw nsw i64 %indvars.iv273, 1
%5 = load i32, ptr %column, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp18 = icmp slt i64 %indvars.iv.next274, %6
br i1 %cmp18, label %for.body20, label %for.inc29.loopexit, !llvm.loop !13
for.inc29.loopexit: ; preds = %for.body20
%.pre = load i32, ptr %row, align 4, !tbaa !5
br label %for.inc29
for.inc29: ; preds = %for.inc29.loopexit, %for.cond17.preheader
%7 = phi i32 [ %.pre, %for.inc29.loopexit ], [ %2, %for.cond17.preheader ]
%8 = phi i32 [ %5, %for.inc29.loopexit ], [ %3, %for.cond17.preheader ]
%indvars.iv.next277 = add nuw nsw i64 %indvars.iv276, 1
%9 = sext i32 %7 to i64
%cmp14 = icmp slt i64 %indvars.iv.next277, %9
br i1 %cmp14, label %for.cond17.preheader, label %for.cond32.preheader, !llvm.loop !14
for.cond36.preheader: ; preds = %for.cond36.preheader.preheader, %for.inc80
%10 = phi i32 [ %42, %for.inc80 ], [ %.ph, %for.cond36.preheader.preheader ]
%11 = phi i32 [ %43, %for.inc80 ], [ %.ph365, %for.cond36.preheader.preheader ]
%12 = phi i32 [ %44, %for.inc80 ], [ %.ph365, %for.cond36.preheader.preheader ]
%13 = phi i32 [ %45, %for.inc80 ], [ %.ph365, %for.cond36.preheader.preheader ]
%i.2245 = phi i32 [ %inc81, %for.inc80 ], [ 0, %for.cond36.preheader.preheader ]
%cmp37235 = icmp sgt i32 %13, 0
br i1 %cmp37235, label %for.body39.lr.ph, label %for.cond55.preheader
for.body39.lr.ph: ; preds = %for.cond36.preheader
%idxprom40 = sext i32 %i.2245 to i64
%arrayidx41 = getelementptr inbounds ptr, ptr %call1, i64 %idxprom40
%14 = load ptr, ptr %arrayidx41, align 8, !tbaa !11
%wide.trip.count282 = zext i32 %13 to i64
%min.iters.check = icmp ult i32 %13, 8
br i1 %min.iters.check, label %for.body39.preheader, label %vector.ph
vector.ph: ; preds = %for.body39.lr.ph
%n.vec = and i64 %wide.trip.count282, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %19, %vector.body ]
%vec.phi354 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %20, %vector.body ]
%15 = getelementptr inbounds i8, ptr %14, i64 %index
%wide.load = load <4 x i8>, ptr %15, align 1, !tbaa !16
%16 = getelementptr inbounds i8, ptr %15, i64 4
%wide.load355 = load <4 x i8>, ptr %16, align 1, !tbaa !16
%17 = icmp eq <4 x i8> %wide.load, <i8 35, i8 35, i8 35, i8 35>
%18 = icmp eq <4 x i8> %wide.load355, <i8 35, i8 35, i8 35, i8 35>
%19 = select <4 x i1> %17, <4 x i32> zeroinitializer, <4 x i32> %vec.phi
%20 = select <4 x i1> %18, <4 x i32> zeroinitializer, <4 x i32> %vec.phi354
%index.next = add nuw i64 %index, 8
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%rdx.select.cmp.not = icmp ne <4 x i32> %19, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp356358 = icmp ne <4 x i32> %20, <i32 1, i32 1, i32 1, i32 1>
%rdx.select.cmp356 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp356358
%22 = bitcast <4 x i1> %rdx.select.cmp356 to i4
%.not = icmp eq i4 %22, 0
%rdx.select357 = zext i1 %.not to i32
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count282
br i1 %cmp.n, label %for.end51, label %for.body39.preheader
for.body39.preheader: ; preds = %for.body39.lr.ph, %middle.block
%indvars.iv279.ph = phi i64 [ 0, %for.body39.lr.ph ], [ %n.vec, %middle.block ]
%flag.0237.ph = phi i32 [ 1, %for.body39.lr.ph ], [ %rdx.select357, %middle.block ]
br label %for.body39
for.cond83.preheader: ; preds = %for.inc80, %for.cond.preheader, %for.cond13.preheader, %for.cond32.preheader
%23 = phi i32 [ %7, %for.cond32.preheader ], [ %0, %for.cond13.preheader ], [ %0, %for.cond.preheader ], [ %42, %for.inc80 ]
%24 = phi i32 [ %8, %for.cond32.preheader ], [ %.pre314.pre.pre, %for.cond13.preheader ], [ %.pre314.pre.pre, %for.cond.preheader ], [ %43, %for.inc80 ]
%cmp84258 = icmp sgt i32 %24, 0
br i1 %cmp84258, label %for.cond87.preheader, label %for.cond136.preheader
for.body39: ; preds = %for.body39.preheader, %for.body39
%indvars.iv279 = phi i64 [ %indvars.iv.next280, %for.body39 ], [ %indvars.iv279.ph, %for.body39.preheader ]
%flag.0237 = phi i32 [ %spec.select, %for.body39 ], [ %flag.0237.ph, %for.body39.preheader ]
%arrayidx43 = getelementptr inbounds i8, ptr %14, i64 %indvars.iv279
%25 = load i8, ptr %arrayidx43, align 1, !tbaa !16
%cmp45 = icmp eq i8 %25, 35
%spec.select = select i1 %cmp45, i32 0, i32 %flag.0237
%indvars.iv.next280 = add nuw nsw i64 %indvars.iv279, 1
%exitcond283.not = icmp eq i64 %indvars.iv.next280, %wide.trip.count282
br i1 %exitcond283.not, label %for.end51, label %for.body39, !llvm.loop !20
for.end51: ; preds = %for.body39, %middle.block
%spec.select.lcssa = phi i32 [ %rdx.select357, %middle.block ], [ %spec.select, %for.body39 ]
%cmp52 = icmp eq i32 %spec.select.lcssa, 1
br i1 %cmp52, label %for.cond55.preheader, label %for.inc80
for.cond55.preheader: ; preds = %for.cond36.preheader, %for.end51
%sub240 = add nsw i32 %10, -1
%cmp56241 = icmp slt i32 %i.2245, %sub240
br i1 %cmp56241, label %for.cond59.preheader.lr.ph, label %for.end76
for.cond59.preheader.lr.ph: ; preds = %for.cond55.preheader
%26 = icmp sgt i32 %12, 0
br i1 %26, label %for.cond59.preheader.preheader, label %for.end76
for.cond59.preheader.preheader: ; preds = %for.cond59.preheader.lr.ph
%27 = sext i32 %i.2245 to i64
br label %for.cond59.preheader
for.cond59.preheader: ; preds = %for.cond59.preheader.preheader, %for.inc74
%28 = phi i32 [ %10, %for.cond59.preheader.preheader ], [ %36, %for.inc74 ]
%29 = phi i32 [ %11, %for.cond59.preheader.preheader ], [ %37, %for.inc74 ]
%indvars.iv287 = phi i64 [ %27, %for.cond59.preheader.preheader ], [ %30, %for.inc74 ]
%cmp60238 = icmp sgt i32 %29, 0
%30 = add nsw i64 %indvars.iv287, 1
br i1 %cmp60238, label %for.body62.lr.ph, label %for.inc74
for.body62.lr.ph: ; preds = %for.cond59.preheader
%arrayidx64 = getelementptr inbounds ptr, ptr %call1, i64 %30
%31 = load ptr, ptr %arrayidx64, align 8, !tbaa !11
%arrayidx68 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv287
%32 = load ptr, ptr %arrayidx68, align 8, !tbaa !11
br label %for.body62
for.body62: ; preds = %for.body62.lr.ph, %for.body62
%indvars.iv284 = phi i64 [ 0, %for.body62.lr.ph ], [ %indvars.iv.next285, %for.body62 ]
%arrayidx66 = getelementptr inbounds i8, ptr %31, i64 %indvars.iv284
%33 = load i8, ptr %arrayidx66, align 1, !tbaa !16
%arrayidx70 = getelementptr inbounds i8, ptr %32, i64 %indvars.iv284
store i8 %33, ptr %arrayidx70, align 1, !tbaa !16
%indvars.iv.next285 = add nuw nsw i64 %indvars.iv284, 1
%34 = load i32, ptr %column, align 4, !tbaa !5
%35 = sext i32 %34 to i64
%cmp60 = icmp slt i64 %indvars.iv.next285, %35
br i1 %cmp60, label %for.body62, label %for.inc74.loopexit, !llvm.loop !21
for.inc74.loopexit: ; preds = %for.body62
%.pre313 = load i32, ptr %row, align 4, !tbaa !5
br label %for.inc74
for.inc74: ; preds = %for.cond59.preheader, %for.inc74.loopexit
%36 = phi i32 [ %.pre313, %for.inc74.loopexit ], [ %28, %for.cond59.preheader ]
%37 = phi i32 [ %34, %for.inc74.loopexit ], [ %29, %for.cond59.preheader ]
%sub = add nsw i32 %36, -1
%38 = sext i32 %sub to i64
%cmp56 = icmp slt i64 %30, %38
br i1 %cmp56, label %for.cond59.preheader, label %for.end76, !llvm.loop !22
for.end76: ; preds = %for.inc74, %for.cond59.preheader.lr.ph, %for.cond55.preheader
%39 = phi i32 [ %11, %for.cond55.preheader ], [ %11, %for.cond59.preheader.lr.ph ], [ %37, %for.inc74 ]
%40 = phi i32 [ %12, %for.cond55.preheader ], [ %12, %for.cond59.preheader.lr.ph ], [ %37, %for.inc74 ]
%41 = phi i32 [ %13, %for.cond55.preheader ], [ %12, %for.cond59.preheader.lr.ph ], [ %37, %for.inc74 ]
%sub.lcssa = phi i32 [ %sub240, %for.cond55.preheader ], [ %sub240, %for.cond59.preheader.lr.ph ], [ %sub, %for.inc74 ]
store i32 %sub.lcssa, ptr %row, align 4, !tbaa !5
%sub78 = add nsw i32 %i.2245, -1
br label %for.inc80
for.inc80: ; preds = %for.end51, %for.end76
%42 = phi i32 [ %sub.lcssa, %for.end76 ], [ %10, %for.end51 ]
%43 = phi i32 [ %39, %for.end76 ], [ %11, %for.end51 ]
%44 = phi i32 [ %40, %for.end76 ], [ %12, %for.end51 ]
%45 = phi i32 [ %41, %for.end76 ], [ %13, %for.end51 ]
%i.3 = phi i32 [ %sub78, %for.end76 ], [ %i.2245, %for.end51 ]
%inc81 = add nsw i32 %i.3, 1
%cmp33 = icmp slt i32 %inc81, %42
br i1 %cmp33, label %for.cond36.preheader, label %for.cond83.preheader, !llvm.loop !23
for.cond87.preheader: ; preds = %for.cond83.preheader, %for.inc133
%46 = phi i32 [ %80, %for.inc133 ], [ %24, %for.cond83.preheader ]
%47 = phi i32 [ %81, %for.inc133 ], [ %23, %for.cond83.preheader ]
%48 = phi i32 [ %82, %for.inc133 ], [ %23, %for.cond83.preheader ]
%49 = phi i32 [ %83, %for.inc133 ], [ %23, %for.cond83.preheader ]
%i.4259 = phi i32 [ %inc134, %for.inc133 ], [ 0, %for.cond83.preheader ]
%cmp88247 = icmp sgt i32 %49, 0
br i1 %cmp88247, label %for.body90.lr.ph, label %for.cond106.preheader
for.body90.lr.ph: ; preds = %for.cond87.preheader
%idxprom93 = sext i32 %i.4259 to i64
%wide.trip.count294 = zext i32 %49 to i64
%xtraiter = and i64 %wide.trip.count294, 3
%50 = icmp ult i32 %49, 4
br i1 %50, label %for.end102.unr-lcssa, label %for.body90.lr.ph.new
for.body90.lr.ph.new: ; preds = %for.body90.lr.ph
%unroll_iter = and i64 %wide.trip.count294, 4294967292
br label %for.body90
for.cond136.preheader: ; preds = %for.inc133, %for.cond83.preheader
%51 = phi i32 [ %23, %for.cond83.preheader ], [ %81, %for.inc133 ]
%cmp137263 = icmp sgt i32 %51, 0
br i1 %cmp137263, label %for.cond140.preheader, label %for.end165
for.body90: ; preds = %for.body90, %for.body90.lr.ph.new
%indvars.iv291 = phi i64 [ 0, %for.body90.lr.ph.new ], [ %indvars.iv.next292.3, %for.body90 ]
%flag.2249 = phi i32 [ 1, %for.body90.lr.ph.new ], [ %spec.select228.3, %for.body90 ]
%niter = phi i64 [ 0, %for.body90.lr.ph.new ], [ %niter.next.3, %for.body90 ]
%arrayidx92 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv291
%52 = load ptr, ptr %arrayidx92, align 8, !tbaa !11
%arrayidx94 = getelementptr inbounds i8, ptr %52, i64 %idxprom93
%53 = load i8, ptr %arrayidx94, align 1, !tbaa !16
%cmp96 = icmp eq i8 %53, 35
%indvars.iv.next292 = or i64 %indvars.iv291, 1
%arrayidx92.1 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next292
%54 = load ptr, ptr %arrayidx92.1, align 8, !tbaa !11
%arrayidx94.1 = getelementptr inbounds i8, ptr %54, i64 %idxprom93
%55 = load i8, ptr %arrayidx94.1, align 1, !tbaa !16
%cmp96.1 = icmp eq i8 %55, 35
%indvars.iv.next292.1 = or i64 %indvars.iv291, 2
%arrayidx92.2 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next292.1
%56 = load ptr, ptr %arrayidx92.2, align 8, !tbaa !11
%arrayidx94.2 = getelementptr inbounds i8, ptr %56, i64 %idxprom93
%57 = load i8, ptr %arrayidx94.2, align 1, !tbaa !16
%cmp96.2 = icmp eq i8 %57, 35
%indvars.iv.next292.2 = or i64 %indvars.iv291, 3
%arrayidx92.3 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next292.2
%58 = load ptr, ptr %arrayidx92.3, align 8, !tbaa !11
%arrayidx94.3 = getelementptr inbounds i8, ptr %58, i64 %idxprom93
%59 = load i8, ptr %arrayidx94.3, align 1, !tbaa !16
%cmp96.3 = icmp eq i8 %59, 35
%60 = select i1 %cmp96.3, i1 true, i1 %cmp96.2
%61 = select i1 %60, i1 true, i1 %cmp96.1
%62 = select i1 %61, i1 true, i1 %cmp96
%spec.select228.3 = select i1 %62, i32 0, i32 %flag.2249
%indvars.iv.next292.3 = add nuw nsw i64 %indvars.iv291, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end102.unr-lcssa, label %for.body90, !llvm.loop !24
for.end102.unr-lcssa: ; preds = %for.body90, %for.body90.lr.ph
%spec.select228.lcssa.ph = phi i32 [ undef, %for.body90.lr.ph ], [ %spec.select228.3, %for.body90 ]
%indvars.iv291.unr = phi i64 [ 0, %for.body90.lr.ph ], [ %indvars.iv.next292.3, %for.body90 ]
%flag.2249.unr = phi i32 [ 1, %for.body90.lr.ph ], [ %spec.select228.3, %for.body90 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end102, label %for.body90.epil
for.body90.epil: ; preds = %for.end102.unr-lcssa, %for.body90.epil
%indvars.iv291.epil = phi i64 [ %indvars.iv.next292.epil, %for.body90.epil ], [ %indvars.iv291.unr, %for.end102.unr-lcssa ]
%flag.2249.epil = phi i32 [ %spec.select228.epil, %for.body90.epil ], [ %flag.2249.unr, %for.end102.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body90.epil ], [ 0, %for.end102.unr-lcssa ]
%arrayidx92.epil = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv291.epil
%63 = load ptr, ptr %arrayidx92.epil, align 8, !tbaa !11
%arrayidx94.epil = getelementptr inbounds i8, ptr %63, i64 %idxprom93
%64 = load i8, ptr %arrayidx94.epil, align 1, !tbaa !16
%cmp96.epil = icmp eq i8 %64, 35
%spec.select228.epil = select i1 %cmp96.epil, i32 0, i32 %flag.2249.epil
%indvars.iv.next292.epil = add nuw nsw i64 %indvars.iv291.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.end102, label %for.body90.epil, !llvm.loop !25
for.end102: ; preds = %for.body90.epil, %for.end102.unr-lcssa
%spec.select228.lcssa = phi i32 [ %spec.select228.lcssa.ph, %for.end102.unr-lcssa ], [ %spec.select228.epil, %for.body90.epil ]
%cmp103 = icmp eq i32 %spec.select228.lcssa, 1
br i1 %cmp103, label %for.cond106.preheader, label %for.inc133
for.cond106.preheader: ; preds = %for.cond87.preheader, %for.end102
%sub107253 = add nsw i32 %46, -1
%cmp108254 = icmp slt i32 %i.4259, %sub107253
br i1 %cmp108254, label %for.cond111.preheader.lr.ph, label %for.end129
for.cond111.preheader.lr.ph: ; preds = %for.cond106.preheader
%65 = icmp sgt i32 %48, 0
br i1 %65, label %for.cond111.preheader.preheader, label %for.end129
for.cond111.preheader.preheader: ; preds = %for.cond111.preheader.lr.ph
%66 = sext i32 %i.4259 to i64
br label %for.cond111.preheader
for.cond111.preheader: ; preds = %for.cond111.preheader.preheader, %for.inc127
%67 = phi i32 [ %46, %for.cond111.preheader.preheader ], [ %74, %for.inc127 ]
%68 = phi i32 [ %47, %for.cond111.preheader.preheader ], [ %75, %for.inc127 ]
%indvars.iv299 = phi i64 [ %66, %for.cond111.preheader.preheader ], [ %69, %for.inc127 ]
%cmp112251 = icmp sgt i32 %68, 0
%69 = add nsw i64 %indvars.iv299, 1
br i1 %cmp112251, label %for.body114, label %for.inc127
for.body114: ; preds = %for.cond111.preheader, %for.body114
%indvars.iv296 = phi i64 [ %indvars.iv.next297, %for.body114 ], [ 0, %for.cond111.preheader ]
%arrayidx116 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv296
%70 = load ptr, ptr %arrayidx116, align 8, !tbaa !11
%arrayidx119 = getelementptr inbounds i8, ptr %70, i64 %69
%71 = load i8, ptr %arrayidx119, align 1, !tbaa !16
%arrayidx123 = getelementptr inbounds i8, ptr %70, i64 %indvars.iv299
store i8 %71, ptr %arrayidx123, align 1, !tbaa !16
%indvars.iv.next297 = add nuw nsw i64 %indvars.iv296, 1
%72 = load i32, ptr %row, align 4, !tbaa !5
%73 = sext i32 %72 to i64
%cmp112 = icmp slt i64 %indvars.iv.next297, %73
br i1 %cmp112, label %for.body114, label %for.inc127.loopexit, !llvm.loop !27
for.inc127.loopexit: ; preds = %for.body114
%.pre315 = load i32, ptr %column, align 4, !tbaa !5
br label %for.inc127
for.inc127: ; preds = %for.cond111.preheader, %for.inc127.loopexit
%74 = phi i32 [ %.pre315, %for.inc127.loopexit ], [ %67, %for.cond111.preheader ]
%75 = phi i32 [ %72, %for.inc127.loopexit ], [ %68, %for.cond111.preheader ]
%sub107 = add nsw i32 %74, -1
%76 = sext i32 %sub107 to i64
%cmp108 = icmp slt i64 %69, %76
br i1 %cmp108, label %for.cond111.preheader, label %for.end129, !llvm.loop !28
for.end129: ; preds = %for.inc127, %for.cond111.preheader.lr.ph, %for.cond106.preheader
%77 = phi i32 [ %47, %for.cond106.preheader ], [ %47, %for.cond111.preheader.lr.ph ], [ %75, %for.inc127 ]
%78 = phi i32 [ %48, %for.cond106.preheader ], [ %48, %for.cond111.preheader.lr.ph ], [ %75, %for.inc127 ]
%79 = phi i32 [ %49, %for.cond106.preheader ], [ %48, %for.cond111.preheader.lr.ph ], [ %75, %for.inc127 ]
%sub107.lcssa = phi i32 [ %sub107253, %for.cond106.preheader ], [ %sub107253, %for.cond111.preheader.lr.ph ], [ %sub107, %for.inc127 ]
store i32 %sub107.lcssa, ptr %column, align 4, !tbaa !5
%sub131 = add nsw i32 %i.4259, -1
br label %for.inc133
for.inc133: ; preds = %for.end102, %for.end129
%80 = phi i32 [ %sub107.lcssa, %for.end129 ], [ %46, %for.end102 ]
%81 = phi i32 [ %77, %for.end129 ], [ %47, %for.end102 ]
%82 = phi i32 [ %78, %for.end129 ], [ %48, %for.end102 ]
%83 = phi i32 [ %79, %for.end129 ], [ %49, %for.end102 ]
%i.5 = phi i32 [ %sub131, %for.end129 ], [ %i.4259, %for.end102 ]
%inc134 = add nsw i32 %i.5, 1
%cmp84 = icmp slt i32 %inc134, %80
br i1 %cmp84, label %for.cond87.preheader, label %for.cond136.preheader, !llvm.loop !29
for.cond140.preheader: ; preds = %for.cond136.preheader, %for.end152
%indvars.iv306 = phi i64 [ %indvars.iv.next307, %for.end152 ], [ 0, %for.cond136.preheader ]
%84 = load i32, ptr %column, align 4, !tbaa !5
%cmp141261 = icmp sgt i32 %84, 0
br i1 %cmp141261, label %for.body143.lr.ph, label %for.end152
for.body143.lr.ph: ; preds = %for.cond140.preheader
%arrayidx145 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv306
%85 = load ptr, ptr %arrayidx145, align 8, !tbaa !11
br label %for.body143
for.cond157.preheader: ; preds = %for.end152
%86 = icmp sgt i32 %90, 0
br i1 %86, label %for.body160, label %for.end165
for.body143: ; preds = %for.body143.lr.ph, %for.body143
%indvars.iv303 = phi i64 [ 0, %for.body143.lr.ph ], [ %indvars.iv.next304, %for.body143 ]
%arrayidx147 = getelementptr inbounds i8, ptr %85, i64 %indvars.iv303
%87 = load i8, ptr %arrayidx147, align 1, !tbaa !16
%conv148 = sext i8 %87 to i32
%putchar227 = call i32 @putchar(i32 %conv148)
%indvars.iv.next304 = add nuw nsw i64 %indvars.iv303, 1
%88 = load i32, ptr %column, align 4, !tbaa !5
%89 = sext i32 %88 to i64
%cmp141 = icmp slt i64 %indvars.iv.next304, %89
br i1 %cmp141, label %for.body143, label %for.end152, !llvm.loop !30
for.end152: ; preds = %for.body143, %for.cond140.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next307 = add nuw nsw i64 %indvars.iv306, 1
%90 = load i32, ptr %row, align 4, !tbaa !5
%91 = sext i32 %90 to i64
%cmp137 = icmp slt i64 %indvars.iv.next307, %91
br i1 %cmp137, label %for.cond140.preheader, label %for.cond157.preheader, !llvm.loop !31
for.body160: ; preds = %for.cond157.preheader, %for.body160
%indvars.iv309 = phi i64 [ %indvars.iv.next310, %for.body160 ], [ 0, %for.cond157.preheader ]
%arrayidx162 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv309
%92 = load ptr, ptr %arrayidx162, align 8, !tbaa !11
call void @free(ptr noundef %92) #7
%indvars.iv.next310 = add nuw nsw i64 %indvars.iv309, 1
%93 = load i32, ptr %row, align 4, !tbaa !5
%94 = sext i32 %93 to i64
%cmp158 = icmp slt i64 %indvars.iv.next310, %94
br i1 %cmp158, label %for.body160, label %for.end165, !llvm.loop !32
for.end165: ; preds = %for.body160, %for.cond136.preheader, %for.cond157.preheader
call void @free(ptr noundef %call1) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %column) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %row) #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: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; 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 #6
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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree nounwind }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !15}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !19, !18}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !15}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.unroll.disable"}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10, !15}
!29 = distinct !{!29, !10}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
|
/* ex7_3
urah */
#include <stdio.h>
#include <stdlib.h>
int main(void){
int height, width;
int *row, *col;
char **matrix;
// 入力受け取り
scanf("%d\t%d", &height, &width);
// メモリ領域の確保
row = (int*)calloc(height, sizeof(int));
// エラーチェック
if (row == NULL){
exit(1);
}
// メモリ領域の確保
col = (int*)calloc(width, sizeof(int));
// エラーチェック
if (col == NULL){
exit(1);
}
// メモリ領域の確保
matrix = (char**)calloc(height, sizeof(char*));
// エラーチェック
if (matrix == NULL){
exit(1);
}
for (int i=0; i<height; i++){
// メモリ領域の確保
matrix[i] = (char*)calloc(width, sizeof(char));
// エラーチェック
if(matrix[i] == NULL){
exit(1);
}
}
// マス目の入力を受け取っていく
for (int i=0; i < height; i++){
for (int j=0; j < width; j++){
scanf(" %c", &matrix[i][j]);
}
}
// 黒いマスがある行または列は1にする
for (int i=0; i < height; i++){
for (int j=0; j < width; j++){
if (matrix[i][j] == '#'){
row[i] = 1;
col[j] = 1;
}
}
}
// 行も列も1であれば出力
for (int i=0; i < height; i++){
if (row[i] == 1){
for (int j=0; j < width; j++){
if (col[j] == 1){
printf("%c", matrix[i][j]);
}
}
printf("\n");
}
}
// メモリの解放
free(row);
free(col);
for (int i=0; i<height; i++){
free(matrix[i]);
}
free(matrix);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133022/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\09%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%height = alloca i32, align 4
%width = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width)
%0 = load i32, ptr %height, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #8
%cmp = icmp eq ptr %call1, null
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
call void @exit(i32 noundef 1) #9
unreachable
if.end: ; preds = %entry
%1 = load i32, ptr %width, align 4, !tbaa !5
%conv3 = sext i32 %1 to i64
%call4 = call noalias ptr @calloc(i64 noundef %conv3, i64 noundef 4) #8
%cmp5 = icmp eq ptr %call4, null
br i1 %cmp5, label %if.then7, label %if.end8
if.then7: ; preds = %if.end
call void @exit(i32 noundef 1) #9
unreachable
if.end8: ; preds = %if.end
%call10 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #8
%cmp11 = icmp eq ptr %call10, null
br i1 %cmp11, label %if.then13, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end8
%cmp15161 = icmp sgt i32 %0, 0
br i1 %cmp15161, label %for.body.preheader, label %for.cond.cleanup119.critedge
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %0 to i64
br label %for.body
if.then13: ; preds = %if.end8
call void @exit(i32 noundef 1) #9
unreachable
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.cond26.preheader, label %for.body, !llvm.loop !9
for.cond26.preheader: ; preds = %for.cond
br i1 %cmp15161, label %for.cond31.preheader.lr.ph, label %for.cond.cleanup119.critedge
for.cond31.preheader.lr.ph: ; preds = %for.cond26.preheader
%2 = icmp sgt i32 %1, 0
br i1 %2, label %for.cond31.preheader, label %for.body83.preheader
for.body83.preheader: ; preds = %for.cond54.for.cond.cleanup57_crit_edge.us, %for.cond54.preheader.lr.ph, %for.cond31.preheader.lr.ph
%.ph = phi i32 [ %11, %for.cond54.preheader.lr.ph ], [ %0, %for.cond31.preheader.lr.ph ], [ %11, %for.cond54.for.cond.cleanup57_crit_edge.us ]
br label %for.body83
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%call18 = call noalias ptr @calloc(i64 noundef %conv3, i64 noundef 1) #8
%arrayidx = getelementptr inbounds ptr, ptr %call10, i64 %indvars.iv
store ptr %call18, ptr %arrayidx, align 8, !tbaa !11
%cmp21 = icmp eq ptr %call18, null
br i1 %cmp21, label %if.then23, label %for.cond
if.then23: ; preds = %for.body
call void @exit(i32 noundef 1) #9
unreachable
for.cond31.preheader: ; preds = %for.cond31.preheader.lr.ph, %for.cond.cleanup34
%3 = phi i32 [ %11, %for.cond.cleanup34 ], [ %0, %for.cond31.preheader.lr.ph ]
%4 = phi i32 [ %12, %for.cond.cleanup34 ], [ %1, %for.cond31.preheader.lr.ph ]
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.cond.cleanup34 ], [ 0, %for.cond31.preheader.lr.ph ]
%cmp32163 = icmp sgt i32 %4, 0
br i1 %cmp32163, label %for.body35.lr.ph, label %for.cond.cleanup34
for.body35.lr.ph: ; preds = %for.cond31.preheader
%arrayidx37 = getelementptr inbounds ptr, ptr %call10, i64 %indvars.iv184
%5 = load ptr, ptr %arrayidx37, align 8, !tbaa !11
br label %for.body35
for.cond48.preheader: ; preds = %for.cond.cleanup34
%cmp49169 = icmp sgt i32 %11, 0
br i1 %cmp49169, label %for.cond54.preheader.lr.ph, label %for.cond.cleanup119.critedge
for.cond54.preheader.lr.ph: ; preds = %for.cond48.preheader
%cmp55167 = icmp sgt i32 %12, 0
br i1 %cmp55167, label %for.cond54.preheader.us.preheader, label %for.body83.preheader
for.cond54.preheader.us.preheader: ; preds = %for.cond54.preheader.lr.ph
%wide.trip.count195 = zext i32 %11 to i64
%wide.trip.count190 = zext i32 %12 to i64
%xtraiter = and i64 %wide.trip.count190, 1
%6 = icmp eq i32 %12, 1
%unroll_iter = and i64 %wide.trip.count190, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond54.preheader.us
for.cond54.preheader.us: ; preds = %for.cond54.preheader.us.preheader, %for.cond54.for.cond.cleanup57_crit_edge.us
%indvars.iv192 = phi i64 [ 0, %for.cond54.preheader.us.preheader ], [ %indvars.iv.next193, %for.cond54.for.cond.cleanup57_crit_edge.us ]
%arrayidx60.us = getelementptr inbounds ptr, ptr %call10, i64 %indvars.iv192
%7 = load ptr, ptr %arrayidx60.us, align 8, !tbaa !11
%arrayidx68.us = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv192
br i1 %6, label %for.cond54.for.cond.cleanup57_crit_edge.us.unr-lcssa, label %for.body58.us
for.body58.us: ; preds = %for.cond54.preheader.us, %for.inc72.us.1
%indvars.iv187 = phi i64 [ %indvars.iv.next188.1, %for.inc72.us.1 ], [ 0, %for.cond54.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc72.us.1 ], [ 0, %for.cond54.preheader.us ]
%arrayidx62.us = getelementptr inbounds i8, ptr %7, i64 %indvars.iv187
%8 = load i8, ptr %arrayidx62.us, align 1, !tbaa !13
%cmp64.us = icmp eq i8 %8, 35
br i1 %cmp64.us, label %if.then66.us, label %for.inc72.us
if.then66.us: ; preds = %for.body58.us
store i32 1, ptr %arrayidx68.us, align 4, !tbaa !5
%arrayidx70.us = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv187
store i32 1, ptr %arrayidx70.us, align 4, !tbaa !5
br label %for.inc72.us
for.inc72.us: ; preds = %if.then66.us, %for.body58.us
%indvars.iv.next188 = or i64 %indvars.iv187, 1
%arrayidx62.us.1 = getelementptr inbounds i8, ptr %7, i64 %indvars.iv.next188
%9 = load i8, ptr %arrayidx62.us.1, align 1, !tbaa !13
%cmp64.us.1 = icmp eq i8 %9, 35
br i1 %cmp64.us.1, label %if.then66.us.1, label %for.inc72.us.1
if.then66.us.1: ; preds = %for.inc72.us
store i32 1, ptr %arrayidx68.us, align 4, !tbaa !5
%arrayidx70.us.1 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv.next188
store i32 1, ptr %arrayidx70.us.1, align 4, !tbaa !5
br label %for.inc72.us.1
for.inc72.us.1: ; preds = %if.then66.us.1, %for.inc72.us
%indvars.iv.next188.1 = add nuw nsw i64 %indvars.iv187, 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.cond54.for.cond.cleanup57_crit_edge.us.unr-lcssa, label %for.body58.us, !llvm.loop !14
for.cond54.for.cond.cleanup57_crit_edge.us.unr-lcssa: ; preds = %for.inc72.us.1, %for.cond54.preheader.us
%indvars.iv187.unr = phi i64 [ 0, %for.cond54.preheader.us ], [ %indvars.iv.next188.1, %for.inc72.us.1 ]
br i1 %lcmp.mod.not, label %for.cond54.for.cond.cleanup57_crit_edge.us, label %for.body58.us.epil
for.body58.us.epil: ; preds = %for.cond54.for.cond.cleanup57_crit_edge.us.unr-lcssa
%arrayidx62.us.epil = getelementptr inbounds i8, ptr %7, i64 %indvars.iv187.unr
%10 = load i8, ptr %arrayidx62.us.epil, align 1, !tbaa !13
%cmp64.us.epil = icmp eq i8 %10, 35
br i1 %cmp64.us.epil, label %if.then66.us.epil, label %for.cond54.for.cond.cleanup57_crit_edge.us
if.then66.us.epil: ; preds = %for.body58.us.epil
store i32 1, ptr %arrayidx68.us, align 4, !tbaa !5
%arrayidx70.us.epil = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv187.unr
store i32 1, ptr %arrayidx70.us.epil, align 4, !tbaa !5
br label %for.cond54.for.cond.cleanup57_crit_edge.us
for.cond54.for.cond.cleanup57_crit_edge.us: ; preds = %for.body58.us.epil, %if.then66.us.epil, %for.cond54.for.cond.cleanup57_crit_edge.us.unr-lcssa
%indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
%exitcond196.not = icmp eq i64 %indvars.iv.next193, %wide.trip.count195
br i1 %exitcond196.not, label %for.body83.preheader, label %for.cond54.preheader.us, !llvm.loop !15
for.cond.cleanup34.loopexit: ; preds = %for.body35
%.pre = load i32, ptr %height, align 4, !tbaa !5
br label %for.cond.cleanup34
for.cond.cleanup34: ; preds = %for.cond.cleanup34.loopexit, %for.cond31.preheader
%11 = phi i32 [ %.pre, %for.cond.cleanup34.loopexit ], [ %3, %for.cond31.preheader ]
%12 = phi i32 [ %14, %for.cond.cleanup34.loopexit ], [ %4, %for.cond31.preheader ]
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%13 = sext i32 %11 to i64
%cmp27 = icmp slt i64 %indvars.iv.next185, %13
br i1 %cmp27, label %for.cond31.preheader, label %for.cond48.preheader, !llvm.loop !16
for.body35: ; preds = %for.body35.lr.ph, %for.body35
%indvars.iv181 = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next182, %for.body35 ]
%arrayidx39 = getelementptr inbounds i8, ptr %5, i64 %indvars.iv181
%call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx39)
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%14 = load i32, ptr %width, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp32 = icmp slt i64 %indvars.iv.next182, %15
br i1 %cmp32, label %for.body35, label %for.cond.cleanup34.loopexit, !llvm.loop !18
for.cond.cleanup82.loopexit: ; preds = %for.inc112
%16 = icmp sgt i32 %26, 0
call void @free(ptr noundef %call1) #7
call void @free(ptr noundef %call4) #7
br i1 %16, label %for.body120, label %for.cond.cleanup119
for.body83: ; preds = %for.body83.preheader, %for.inc112
%17 = phi i32 [ %26, %for.inc112 ], [ %.ph, %for.body83.preheader ]
%indvars.iv200 = phi i64 [ %indvars.iv.next201, %for.inc112 ], [ 0, %for.body83.preheader ]
%arrayidx85 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv200
%18 = load i32, ptr %arrayidx85, align 4, !tbaa !5
%cmp86 = icmp eq i32 %18, 1
br i1 %cmp86, label %for.cond90.preheader, label %for.inc112
for.cond90.preheader: ; preds = %for.body83
%19 = load i32, ptr %width, align 4, !tbaa !5
%cmp91171 = icmp sgt i32 %19, 0
br i1 %cmp91171, label %for.body94.lr.ph, label %for.cond.cleanup93
for.body94.lr.ph: ; preds = %for.cond90.preheader
%arrayidx101 = getelementptr inbounds ptr, ptr %call10, i64 %indvars.iv200
br label %for.body94
for.cond.cleanup93: ; preds = %for.inc107, %for.cond90.preheader
%putchar = call i32 @putchar(i32 10)
%.pre207 = load i32, ptr %height, align 4, !tbaa !5
br label %for.inc112
for.body94: ; preds = %for.body94.lr.ph, %for.inc107
%20 = phi i32 [ %19, %for.body94.lr.ph ], [ %24, %for.inc107 ]
%indvars.iv197 = phi i64 [ 0, %for.body94.lr.ph ], [ %indvars.iv.next198, %for.inc107 ]
%arrayidx96 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv197
%21 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%cmp97 = icmp eq i32 %21, 1
br i1 %cmp97, label %if.then99, label %for.inc107
if.then99: ; preds = %for.body94
%22 = load ptr, ptr %arrayidx101, align 8, !tbaa !11
%arrayidx103 = getelementptr inbounds i8, ptr %22, i64 %indvars.iv197
%23 = load i8, ptr %arrayidx103, align 1, !tbaa !13
%conv104 = sext i8 %23 to i32
%putchar160 = call i32 @putchar(i32 %conv104)
%.pre206 = load i32, ptr %width, align 4, !tbaa !5
br label %for.inc107
for.inc107: ; preds = %for.body94, %if.then99
%24 = phi i32 [ %20, %for.body94 ], [ %.pre206, %if.then99 ]
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%25 = sext i32 %24 to i64
%cmp91 = icmp slt i64 %indvars.iv.next198, %25
br i1 %cmp91, label %for.body94, label %for.cond.cleanup93, !llvm.loop !19
for.inc112: ; preds = %for.body83, %for.cond.cleanup93
%26 = phi i32 [ %17, %for.body83 ], [ %.pre207, %for.cond.cleanup93 ]
%indvars.iv.next201 = add nuw nsw i64 %indvars.iv200, 1
%27 = sext i32 %26 to i64
%cmp80 = icmp slt i64 %indvars.iv.next201, %27
br i1 %cmp80, label %for.body83, label %for.cond.cleanup82.loopexit, !llvm.loop !20
for.cond.cleanup119.critedge: ; preds = %for.cond48.preheader, %for.cond.preheader, %for.cond26.preheader
call void @free(ptr noundef %call1) #7
call void @free(ptr noundef %call4) #7
br label %for.cond.cleanup119
for.cond.cleanup119: ; preds = %for.body120, %for.cond.cleanup119.critedge, %for.cond.cleanup82.loopexit
call void @free(ptr noundef %call10) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height) #7
ret i32 0
for.body120: ; preds = %for.cond.cleanup82.loopexit, %for.body120
%indvars.iv203 = phi i64 [ %indvars.iv.next204, %for.body120 ], [ 0, %for.cond.cleanup82.loopexit ]
%arrayidx122 = getelementptr inbounds ptr, ptr %call10, i64 %indvars.iv203
%28 = load ptr, ptr %arrayidx122, align 8, !tbaa !11
call void @free(ptr noundef %28) #7
%indvars.iv.next204 = add nuw nsw i64 %indvars.iv203, 1
%29 = load i32, ptr %height, align 4, !tbaa !5
%30 = sext i32 %29 to i64
%cmp117 = icmp slt i64 %indvars.iv.next204, %30
br i1 %cmp117, label %for.body120, label %for.cond.cleanup119, !llvm.loop !21
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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: noreturn nounwind
declare void @exit(i32 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree nounwind }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
|
/* ex7_3
Graku */
#include<stdio.h>
#include<stdlib.h>
int main(void) {
int height, width;
char **table;
int *blank_rows, *blank_cols;
scanf("%d %d", &height, &width); //input
table = (char**)malloc(sizeof(char*) * height); //table[height]
for (int i = 0; i < height; ++i) { //table[height][width]
table[i] = (char*)malloc(width * sizeof(char));
}
blank_rows = (int*)calloc(height, sizeof(int));
blank_cols = (int*)calloc(width, sizeof(int));
for (int row = 0; row < height; ++row) { //input
for (int col = 0; col < width; ++col) {
scanf(" %c", &table[row][col]);
}
}
for (int row = 0; row < height; ++row) { //find blank rows
int flag = 0;
for (int col = 0; col < width; ++col) {
if ('#' == table[row][col]) { //not blank
flag = 1;
break;
}
}
blank_rows[row] = flag;
}
for (int col = 0; col < width; ++col) { //find blank columns
int flag = 0;
for (int row = 0; row < height; ++row) {
if ('#' == table[row][col]) { //not blank
flag = 1;
break;
}
}
blank_cols[col] = flag;
}
//output
for (int row = 0; row < height; row++) {
if (blank_rows[row]) { //if row is not blank
for (int col = 0; col < width; ++col) {
if (blank_cols[col]) { //if column is not blank
printf("%c", table[row][col]);
}
}
printf("\n");
}
}
//free memory
for (int i = 0; i < height; ++i) {
free(table[i]);
}
free(table);
free(blank_cols);
free(blank_rows);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133073/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133073/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%height = alloca i32, align 4
%width = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width)
%0 = load i32, ptr %height, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 3
%call1 = call noalias ptr @malloc(i64 noundef %mul) #8
%cmp179 = icmp sgt i32 %0, 0
%.pre = load i32, ptr %width, align 4, !tbaa !5
%conv3 = sext i32 %.pre to i64
br i1 %cmp179, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%call7 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9
%call9 = call noalias ptr @calloc(i64 noundef %conv3, i64 noundef 4) #9
br i1 %cmp179, label %for.cond15.preheader.lr.ph, label %for.cond.cleanup131
for.cond15.preheader.lr.ph: ; preds = %for.cond.cleanup
%1 = icmp sgt i32 %.pre, 0
br i1 %1, label %for.cond15.preheader, label %for.body96.preheader
for.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%call5 = call noalias ptr @malloc(i64 noundef %conv3) #8
%arrayidx = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv
store ptr %call5, ptr %arrayidx, align 8, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11
for.cond15.preheader: ; preds = %for.cond15.preheader.lr.ph, %for.cond.cleanup18
%2 = phi i32 [ %10, %for.cond.cleanup18 ], [ %0, %for.cond15.preheader.lr.ph ]
%3 = phi i32 [ %11, %for.cond.cleanup18 ], [ %.pre, %for.cond15.preheader.lr.ph ]
%indvars.iv211 = phi i64 [ %indvars.iv.next212, %for.cond.cleanup18 ], [ 0, %for.cond15.preheader.lr.ph ]
%cmp16181 = icmp sgt i32 %3, 0
br i1 %cmp16181, label %for.body19.lr.ph, label %for.cond.cleanup18
for.body19.lr.ph: ; preds = %for.cond15.preheader
%arrayidx21 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv211
%4 = load ptr, ptr %arrayidx21, align 8, !tbaa !9
br label %for.body19
for.cond32.preheader: ; preds = %for.cond.cleanup18
%cmp33189 = icmp sgt i32 %10, 0
br i1 %cmp33189, label %for.cond38.preheader.lr.ph, label %for.cond60.preheader
for.cond38.preheader.lr.ph: ; preds = %for.cond32.preheader
%cmp39185 = icmp sgt i32 %11, 0
br i1 %cmp39185, label %for.cond38.preheader.us.preheader, label %for.body96.preheader
for.cond38.preheader.us.preheader: ; preds = %for.cond38.preheader.lr.ph
%wide.trip.count225 = zext i32 %10 to i64
%wide.trip.count220 = zext i32 %11 to i64
%xtraiter = and i64 %wide.trip.count225, 1
%5 = icmp eq i32 %10, 1
br i1 %5, label %for.cond60.preheader.loopexit.unr-lcssa, label %for.cond38.preheader.us.preheader.new
for.cond38.preheader.us.preheader.new: ; preds = %for.cond38.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count225, 4294967294
br label %for.cond38.preheader.us
for.cond38.preheader.us: ; preds = %cleanup.us.1, %for.cond38.preheader.us.preheader.new
%indvars.iv222 = phi i64 [ 0, %for.cond38.preheader.us.preheader.new ], [ %indvars.iv.next223.1, %cleanup.us.1 ]
%niter = phi i64 [ 0, %for.cond38.preheader.us.preheader.new ], [ %niter.next.1, %cleanup.us.1 ]
%arrayidx44.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv222
%6 = load ptr, ptr %arrayidx44.us, align 8, !tbaa !9
br label %for.body42.us
for.cond38.us: ; preds = %for.body42.us
%indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1
%exitcond221.not = icmp eq i64 %indvars.iv.next218, %wide.trip.count220
br i1 %exitcond221.not, label %cleanup.us, label %for.body42.us, !llvm.loop !13
for.body42.us: ; preds = %for.cond38.preheader.us, %for.cond38.us
%indvars.iv217 = phi i64 [ 0, %for.cond38.preheader.us ], [ %indvars.iv.next218, %for.cond38.us ]
%arrayidx46.us = getelementptr inbounds i8, ptr %6, i64 %indvars.iv217
%7 = load i8, ptr %arrayidx46.us, align 1, !tbaa !14
%cmp48.us = icmp eq i8 %7, 35
br i1 %cmp48.us, label %cleanup.us, label %for.cond38.us
cleanup.us: ; preds = %for.cond38.us, %for.body42.us
%flag.0.us = phi i32 [ 1, %for.body42.us ], [ 0, %for.cond38.us ]
%arrayidx54.us = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv222
store i32 %flag.0.us, ptr %arrayidx54.us, align 4, !tbaa !5
%indvars.iv.next223 = or i64 %indvars.iv222, 1
%arrayidx44.us.1 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv.next223
%8 = load ptr, ptr %arrayidx44.us.1, align 8, !tbaa !9
br label %for.body42.us.1
for.body42.us.1: ; preds = %for.cond38.us.1, %cleanup.us
%indvars.iv217.1 = phi i64 [ 0, %cleanup.us ], [ %indvars.iv.next218.1, %for.cond38.us.1 ]
%arrayidx46.us.1 = getelementptr inbounds i8, ptr %8, i64 %indvars.iv217.1
%9 = load i8, ptr %arrayidx46.us.1, align 1, !tbaa !14
%cmp48.us.1 = icmp eq i8 %9, 35
br i1 %cmp48.us.1, label %cleanup.us.1, label %for.cond38.us.1
for.cond38.us.1: ; preds = %for.body42.us.1
%indvars.iv.next218.1 = add nuw nsw i64 %indvars.iv217.1, 1
%exitcond221.not.1 = icmp eq i64 %indvars.iv.next218.1, %wide.trip.count220
br i1 %exitcond221.not.1, label %cleanup.us.1, label %for.body42.us.1, !llvm.loop !13
cleanup.us.1: ; preds = %for.cond38.us.1, %for.body42.us.1
%flag.0.us.1 = phi i32 [ 1, %for.body42.us.1 ], [ 0, %for.cond38.us.1 ]
%arrayidx54.us.1 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv.next223
store i32 %flag.0.us.1, ptr %arrayidx54.us.1, align 4, !tbaa !5
%indvars.iv.next223.1 = add nuw nsw i64 %indvars.iv222, 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.cond60.preheader.loopexit.unr-lcssa, label %for.cond38.preheader.us, !llvm.loop !15
for.cond.cleanup18.loopexit: ; preds = %for.body19
%.pre249 = load i32, ptr %height, align 4, !tbaa !5
br label %for.cond.cleanup18
for.cond.cleanup18: ; preds = %for.cond.cleanup18.loopexit, %for.cond15.preheader
%10 = phi i32 [ %.pre249, %for.cond.cleanup18.loopexit ], [ %2, %for.cond15.preheader ]
%11 = phi i32 [ %13, %for.cond.cleanup18.loopexit ], [ %3, %for.cond15.preheader ]
%indvars.iv.next212 = add nuw nsw i64 %indvars.iv211, 1
%12 = sext i32 %10 to i64
%cmp11 = icmp slt i64 %indvars.iv.next212, %12
br i1 %cmp11, label %for.cond15.preheader, label %for.cond32.preheader, !llvm.loop !16
for.body19: ; preds = %for.body19.lr.ph, %for.body19
%indvars.iv208 = phi i64 [ 0, %for.body19.lr.ph ], [ %indvars.iv.next209, %for.body19 ]
%arrayidx23 = getelementptr inbounds i8, ptr %4, i64 %indvars.iv208
%call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx23)
%indvars.iv.next209 = add nuw nsw i64 %indvars.iv208, 1
%13 = load i32, ptr %width, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp16 = icmp slt i64 %indvars.iv.next209, %14
br i1 %cmp16, label %for.body19, label %for.cond.cleanup18.loopexit, !llvm.loop !18
for.cond60.preheader.loopexit.unr-lcssa: ; preds = %cleanup.us.1, %for.cond38.preheader.us.preheader
%indvars.iv222.unr = phi i64 [ 0, %for.cond38.preheader.us.preheader ], [ %indvars.iv.next223.1, %cleanup.us.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond60.preheader, label %for.cond38.preheader.us.epil
for.cond38.preheader.us.epil: ; preds = %for.cond60.preheader.loopexit.unr-lcssa
%arrayidx44.us.epil = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv222.unr
%15 = load ptr, ptr %arrayidx44.us.epil, align 8, !tbaa !9
br label %for.body42.us.epil
for.body42.us.epil: ; preds = %for.cond38.us.epil, %for.cond38.preheader.us.epil
%indvars.iv217.epil = phi i64 [ 0, %for.cond38.preheader.us.epil ], [ %indvars.iv.next218.epil, %for.cond38.us.epil ]
%arrayidx46.us.epil = getelementptr inbounds i8, ptr %15, i64 %indvars.iv217.epil
%16 = load i8, ptr %arrayidx46.us.epil, align 1, !tbaa !14
%cmp48.us.epil = icmp eq i8 %16, 35
br i1 %cmp48.us.epil, label %cleanup.us.epil, label %for.cond38.us.epil
for.cond38.us.epil: ; preds = %for.body42.us.epil
%indvars.iv.next218.epil = add nuw nsw i64 %indvars.iv217.epil, 1
%exitcond221.not.epil = icmp eq i64 %indvars.iv.next218.epil, %wide.trip.count220
br i1 %exitcond221.not.epil, label %cleanup.us.epil, label %for.body42.us.epil, !llvm.loop !13
cleanup.us.epil: ; preds = %for.cond38.us.epil, %for.body42.us.epil
%flag.0.us.epil = phi i32 [ 1, %for.body42.us.epil ], [ 0, %for.cond38.us.epil ]
%arrayidx54.us.epil = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv222.unr
store i32 %flag.0.us.epil, ptr %arrayidx54.us.epil, align 4, !tbaa !5
br label %for.cond60.preheader
for.cond60.preheader: ; preds = %cleanup.us.epil, %for.cond60.preheader.loopexit.unr-lcssa, %for.cond32.preheader
%cmp61195 = icmp sgt i32 %11, 0
br i1 %cmp61195, label %for.cond67.preheader.lr.ph, label %for.cond92.preheader
for.cond67.preheader.lr.ph: ; preds = %for.cond60.preheader
br i1 %cmp33189, label %for.cond67.preheader.us.preheader, label %for.cond.cleanup131
for.cond67.preheader.us.preheader: ; preds = %for.cond67.preheader.lr.ph
%wide.trip.count238 = zext i32 %11 to i64
%wide.trip.count233 = zext i32 %10 to i64
%xtraiter282 = and i64 %wide.trip.count238, 1
%17 = icmp eq i32 %11, 1
br i1 %17, label %for.cond92.preheader.loopexit.unr-lcssa, label %for.cond67.preheader.us.preheader.new
for.cond67.preheader.us.preheader.new: ; preds = %for.cond67.preheader.us.preheader
%unroll_iter284 = and i64 %wide.trip.count238, 4294967294
br label %for.cond67.preheader.us
for.cond67.preheader.us: ; preds = %cleanup83.us.1, %for.cond67.preheader.us.preheader.new
%indvars.iv235 = phi i64 [ 0, %for.cond67.preheader.us.preheader.new ], [ %indvars.iv.next236.1, %cleanup83.us.1 ]
%niter285 = phi i64 [ 0, %for.cond67.preheader.us.preheader.new ], [ %niter285.next.1, %cleanup83.us.1 ]
br label %for.body71.us
for.cond67.us: ; preds = %for.body71.us
%indvars.iv.next231 = add nuw nsw i64 %indvars.iv230, 1
%exitcond234.not = icmp eq i64 %indvars.iv.next231, %wide.trip.count233
br i1 %exitcond234.not, label %cleanup83.us, label %for.body71.us, !llvm.loop !19
for.body71.us: ; preds = %for.cond67.preheader.us, %for.cond67.us
%indvars.iv230 = phi i64 [ 0, %for.cond67.preheader.us ], [ %indvars.iv.next231, %for.cond67.us ]
%arrayidx73.us = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv230
%18 = load ptr, ptr %arrayidx73.us, align 8, !tbaa !9
%arrayidx75.us = getelementptr inbounds i8, ptr %18, i64 %indvars.iv235
%19 = load i8, ptr %arrayidx75.us, align 1, !tbaa !14
%cmp77.us = icmp eq i8 %19, 35
br i1 %cmp77.us, label %cleanup83.us, label %for.cond67.us
cleanup83.us: ; preds = %for.cond67.us, %for.body71.us
%flag65.0.us = phi i32 [ 1, %for.body71.us ], [ 0, %for.cond67.us ]
%arrayidx86.us = getelementptr inbounds i32, ptr %call9, i64 %indvars.iv235
store i32 %flag65.0.us, ptr %arrayidx86.us, align 4, !tbaa !5
%indvars.iv.next236 = or i64 %indvars.iv235, 1
br label %for.body71.us.1
for.body71.us.1: ; preds = %for.cond67.us.1, %cleanup83.us
%indvars.iv230.1 = phi i64 [ 0, %cleanup83.us ], [ %indvars.iv.next231.1, %for.cond67.us.1 ]
%arrayidx73.us.1 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv230.1
%20 = load ptr, ptr %arrayidx73.us.1, align 8, !tbaa !9
%arrayidx75.us.1 = getelementptr inbounds i8, ptr %20, i64 %indvars.iv.next236
%21 = load i8, ptr %arrayidx75.us.1, align 1, !tbaa !14
%cmp77.us.1 = icmp eq i8 %21, 35
br i1 %cmp77.us.1, label %cleanup83.us.1, label %for.cond67.us.1
for.cond67.us.1: ; preds = %for.body71.us.1
%indvars.iv.next231.1 = add nuw nsw i64 %indvars.iv230.1, 1
%exitcond234.not.1 = icmp eq i64 %indvars.iv.next231.1, %wide.trip.count233
br i1 %exitcond234.not.1, label %cleanup83.us.1, label %for.body71.us.1, !llvm.loop !19
cleanup83.us.1: ; preds = %for.cond67.us.1, %for.body71.us.1
%flag65.0.us.1 = phi i32 [ 1, %for.body71.us.1 ], [ 0, %for.cond67.us.1 ]
%arrayidx86.us.1 = getelementptr inbounds i32, ptr %call9, i64 %indvars.iv.next236
store i32 %flag65.0.us.1, ptr %arrayidx86.us.1, align 4, !tbaa !5
%indvars.iv.next236.1 = add nuw nsw i64 %indvars.iv235, 2
%niter285.next.1 = add i64 %niter285, 2
%niter285.ncmp.1 = icmp eq i64 %niter285.next.1, %unroll_iter284
br i1 %niter285.ncmp.1, label %for.cond92.preheader.loopexit.unr-lcssa, label %for.cond67.preheader.us, !llvm.loop !20
for.cond92.preheader.loopexit.unr-lcssa: ; preds = %cleanup83.us.1, %for.cond67.preheader.us.preheader
%indvars.iv235.unr = phi i64 [ 0, %for.cond67.preheader.us.preheader ], [ %indvars.iv.next236.1, %cleanup83.us.1 ]
%lcmp.mod283.not = icmp eq i64 %xtraiter282, 0
br i1 %lcmp.mod283.not, label %for.cond92.preheader, label %for.body71.us.epil
for.body71.us.epil: ; preds = %for.cond92.preheader.loopexit.unr-lcssa, %for.cond67.us.epil
%indvars.iv230.epil = phi i64 [ %indvars.iv.next231.epil, %for.cond67.us.epil ], [ 0, %for.cond92.preheader.loopexit.unr-lcssa ]
%arrayidx73.us.epil = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv230.epil
%22 = load ptr, ptr %arrayidx73.us.epil, align 8, !tbaa !9
%arrayidx75.us.epil = getelementptr inbounds i8, ptr %22, i64 %indvars.iv235.unr
%23 = load i8, ptr %arrayidx75.us.epil, align 1, !tbaa !14
%cmp77.us.epil = icmp eq i8 %23, 35
br i1 %cmp77.us.epil, label %cleanup83.us.epil, label %for.cond67.us.epil
for.cond67.us.epil: ; preds = %for.body71.us.epil
%indvars.iv.next231.epil = add nuw nsw i64 %indvars.iv230.epil, 1
%exitcond234.not.epil = icmp eq i64 %indvars.iv.next231.epil, %wide.trip.count233
br i1 %exitcond234.not.epil, label %cleanup83.us.epil, label %for.body71.us.epil, !llvm.loop !19
cleanup83.us.epil: ; preds = %for.cond67.us.epil, %for.body71.us.epil
%flag65.0.us.epil = phi i32 [ 1, %for.body71.us.epil ], [ 0, %for.cond67.us.epil ]
%arrayidx86.us.epil = getelementptr inbounds i32, ptr %call9, i64 %indvars.iv235.unr
store i32 %flag65.0.us.epil, ptr %arrayidx86.us.epil, align 4, !tbaa !5
br label %for.cond92.preheader
for.cond92.preheader: ; preds = %cleanup83.us.epil, %for.cond92.preheader.loopexit.unr-lcssa, %for.cond60.preheader
br i1 %cmp33189, label %for.body96.preheader, label %for.cond.cleanup131
for.body96.preheader: ; preds = %for.cond15.preheader.lr.ph, %for.cond38.preheader.lr.ph, %for.cond92.preheader
%.ph = phi i32 [ %0, %for.cond15.preheader.lr.ph ], [ %10, %for.cond38.preheader.lr.ph ], [ %10, %for.cond92.preheader ]
br label %for.body96
for.cond128.preheader: ; preds = %for.inc123
%24 = icmp sgt i32 %34, 0
br i1 %24, label %for.body132, label %for.cond.cleanup131
for.body96: ; preds = %for.body96.preheader, %for.inc123
%25 = phi i32 [ %34, %for.inc123 ], [ %.ph, %for.body96.preheader ]
%indvars.iv243 = phi i64 [ %indvars.iv.next244, %for.inc123 ], [ 0, %for.body96.preheader ]
%arrayidx98 = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv243
%26 = load i32, ptr %arrayidx98, align 4, !tbaa !5
%tobool.not = icmp eq i32 %26, 0
br i1 %tobool.not, label %for.inc123, label %for.cond101.preheader
for.cond101.preheader: ; preds = %for.body96
%27 = load i32, ptr %width, align 4, !tbaa !5
%cmp102197 = icmp sgt i32 %27, 0
br i1 %cmp102197, label %for.body105.lr.ph, label %for.cond.cleanup104
for.body105.lr.ph: ; preds = %for.cond101.preheader
%arrayidx111 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv243
br label %for.body105
for.cond.cleanup104: ; preds = %for.inc117, %for.cond101.preheader
%putchar = call i32 @putchar(i32 10)
%.pre251 = load i32, ptr %height, align 4, !tbaa !5
br label %for.inc123
for.body105: ; preds = %for.body105.lr.ph, %for.inc117
%28 = phi i32 [ %27, %for.body105.lr.ph ], [ %32, %for.inc117 ]
%indvars.iv240 = phi i64 [ 0, %for.body105.lr.ph ], [ %indvars.iv.next241, %for.inc117 ]
%arrayidx107 = getelementptr inbounds i32, ptr %call9, i64 %indvars.iv240
%29 = load i32, ptr %arrayidx107, align 4, !tbaa !5
%tobool108.not = icmp eq i32 %29, 0
br i1 %tobool108.not, label %for.inc117, label %if.then109
if.then109: ; preds = %for.body105
%30 = load ptr, ptr %arrayidx111, align 8, !tbaa !9
%arrayidx113 = getelementptr inbounds i8, ptr %30, i64 %indvars.iv240
%31 = load i8, ptr %arrayidx113, align 1, !tbaa !14
%conv114 = sext i8 %31 to i32
%putchar178 = call i32 @putchar(i32 %conv114)
%.pre250 = load i32, ptr %width, align 4, !tbaa !5
br label %for.inc117
for.inc117: ; preds = %for.body105, %if.then109
%32 = phi i32 [ %28, %for.body105 ], [ %.pre250, %if.then109 ]
%indvars.iv.next241 = add nuw nsw i64 %indvars.iv240, 1
%33 = sext i32 %32 to i64
%cmp102 = icmp slt i64 %indvars.iv.next241, %33
br i1 %cmp102, label %for.body105, label %for.cond.cleanup104, !llvm.loop !21
for.inc123: ; preds = %for.body96, %for.cond.cleanup104
%34 = phi i32 [ %25, %for.body96 ], [ %.pre251, %for.cond.cleanup104 ]
%indvars.iv.next244 = add nuw nsw i64 %indvars.iv243, 1
%35 = sext i32 %34 to i64
%cmp93 = icmp slt i64 %indvars.iv.next244, %35
br i1 %cmp93, label %for.body96, label %for.cond128.preheader, !llvm.loop !22
for.cond.cleanup131: ; preds = %for.body132, %for.cond.cleanup, %for.cond67.preheader.lr.ph, %for.cond92.preheader, %for.cond128.preheader
call void @free(ptr noundef %call1) #7
call void @free(ptr noundef %call9) #7
call void @free(ptr noundef %call7) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height) #7
ret i32 0
for.body132: ; preds = %for.cond128.preheader, %for.body132
%indvars.iv246 = phi i64 [ %indvars.iv.next247, %for.body132 ], [ 0, %for.cond128.preheader ]
%arrayidx134 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv246
%36 = load ptr, ptr %arrayidx134, align 8, !tbaa !9
call void @free(ptr noundef %36) #7
%indvars.iv.next247 = add nuw nsw i64 %indvars.iv246, 1
%37 = load i32, ptr %height, align 4, !tbaa !5
%38 = sext i32 %37 to i64
%cmp129 = icmp slt i64 %indvars.iv.next247, %38
br i1 %cmp129, label %for.body132, label %for.cond.cleanup131, !llvm.loop !23
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
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,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn 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 #5 = { 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 #6 = { nofree nounwind }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !12}
|
/*5_3 hightierra*/
#include <stdio.h>
#define LIMIT 100
int main(void){
int row,col,i,j,rowjudge[LIMIT]={0},coljudge[LIMIT]={0};
char matrix[LIMIT][LIMIT];
scanf("%d %d",&row,&col);
// 初期化
for(i=0; i<LIMIT; i++){
for(j=0; j<LIMIT; j++){
matrix[i][j]=0;
}
}
// 入力
for(i=0; i<row; i++){
for(j=0; j<col; j++){
scanf(" %c",&matrix[i][j]);
}
}
// 各行、各列に黒が1つでもあるかを判別
for(i=0; i<row; i++){
for(j=0; j<col; j++){
if(matrix[i][j]=='#'){
rowjudge[i]=1;
}
}
}
for(j=0; j<col; j++){
for(i=0; i<row; i++){
if(matrix[i][j]=='#'){
coljudge[j]=1;
}
}
}
// 黒が1つでもある行と列の重なる要素のみを出力
for(i=0; i<row; i++){
for(j=0; j<col; j++){
if(rowjudge[i]==1 && coljudge[j]==1){
printf("%c",matrix[i][j]);
}
}
if(rowjudge[i]==1){
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133116/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133116/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%row = alloca i32, align 4
%col = alloca i32, align 4
%rowjudge = alloca [100 x i32], align 16
%coljudge = alloca [100 x i32], align 16
%matrix = alloca [100 x [100 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %row) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %col) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %rowjudge) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %rowjudge, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %coljudge) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %coljudge, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %matrix) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %row, ptr noundef nonnull %col)
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(10000) %matrix, i8 0, i64 10000, i1 false), !tbaa !5
%0 = load i32, ptr %row, align 4, !tbaa !8
%cmp10146 = icmp sgt i32 %0, 0
br i1 %cmp10146, label %for.cond12.preheader.lr.ph, label %for.end107
for.cond12.preheader.lr.ph: ; preds = %entry
%.pre195.pre = load i32, ptr %col, align 4, !tbaa !8
%1 = icmp sgt i32 %.pre195.pre, 0
br i1 %1, label %for.cond12.preheader, label %for.cond75.preheader.preheader
for.cond12.preheader: ; preds = %for.cond12.preheader.lr.ph, %for.inc23
%2 = phi i32 [ %29, %for.inc23 ], [ %0, %for.cond12.preheader.lr.ph ]
%3 = phi i32 [ %30, %for.inc23 ], [ %.pre195.pre, %for.cond12.preheader.lr.ph ]
%indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.inc23 ], [ 0, %for.cond12.preheader.lr.ph ]
%cmp13144 = icmp sgt i32 %3, 0
br i1 %cmp13144, label %for.body14, label %for.inc23
for.cond26.preheader: ; preds = %for.inc23
%cmp27150 = icmp sgt i32 %29, 0
br i1 %cmp27150, label %for.cond29.preheader.lr.ph, label %for.cond46.preheader
for.cond29.preheader.lr.ph: ; preds = %for.cond26.preheader
%cmp30148 = icmp sgt i32 %30, 0
br i1 %cmp30148, label %for.cond29.preheader.us.preheader, label %for.cond75.preheader.preheader
for.cond29.preheader.us.preheader: ; preds = %for.cond29.preheader.lr.ph
%wide.trip.count177 = zext i32 %29 to i64
%wide.trip.count = zext i32 %30 to i64
%min.iters.check = icmp ult i32 %30, 8
%n.vec = and i64 %wide.trip.count, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br label %for.cond29.preheader.us
for.cond29.preheader.us: ; preds = %for.cond29.preheader.us.preheader, %for.cond29.for.inc43_crit_edge.us
%indvars.iv174 = phi i64 [ 0, %for.cond29.preheader.us.preheader ], [ %indvars.iv.next175, %for.cond29.for.inc43_crit_edge.us ]
%arrayidx39.us = getelementptr inbounds [100 x i32], ptr %rowjudge, i64 0, i64 %indvars.iv174
br i1 %min.iters.check, label %for.body31.us.preheader, label %vector.body
vector.body: ; preds = %for.cond29.preheader.us, %24
%index = phi i64 [ %index.next, %24 ], [ 0, %for.cond29.preheader.us ]
%4 = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv174, i64 %index
%wide.load = load <4 x i8>, ptr %4, align 4, !tbaa !5
%5 = getelementptr inbounds i8, ptr %4, i64 4
%wide.load235 = load <4 x i8>, ptr %5, align 4, !tbaa !5
%6 = icmp eq <4 x i8> %wide.load, <i8 35, i8 35, i8 35, i8 35>
%7 = icmp eq <4 x i8> %wide.load235, <i8 35, i8 35, i8 35, i8 35>
%8 = extractelement <4 x i1> %6, i64 0
%9 = extractelement <4 x i1> %6, i64 1
%10 = or i1 %8, %9
%11 = extractelement <4 x i1> %6, i64 2
%12 = or i1 %10, %11
%13 = extractelement <4 x i1> %6, i64 3
%14 = or i1 %12, %13
%15 = extractelement <4 x i1> %7, i64 0
%16 = or i1 %14, %15
%17 = extractelement <4 x i1> %7, i64 1
%18 = or i1 %16, %17
%19 = extractelement <4 x i1> %7, i64 2
%20 = or i1 %18, %19
%21 = extractelement <4 x i1> %7, i64 3
%22 = or i1 %20, %21
br i1 %22, label %23, label %24
23: ; preds = %vector.body
store i32 1, ptr %arrayidx39.us, align 4, !tbaa !8
br label %24
24: ; preds = %vector.body, %23
%index.next = add nuw i64 %index, 8
%25 = icmp eq i64 %index.next, %n.vec
br i1 %25, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %24
br i1 %cmp.n, label %for.cond29.for.inc43_crit_edge.us, label %for.body31.us.preheader
for.body31.us.preheader: ; preds = %for.cond29.preheader.us, %middle.block
%indvars.iv171.ph = phi i64 [ 0, %for.cond29.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body31.us
for.body31.us: ; preds = %for.body31.us.preheader, %for.inc40.us
%indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.inc40.us ], [ %indvars.iv171.ph, %for.body31.us.preheader ]
%arrayidx35.us = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv174, i64 %indvars.iv171
%26 = load i8, ptr %arrayidx35.us, align 1, !tbaa !5
%cmp36.us = icmp eq i8 %26, 35
br i1 %cmp36.us, label %if.then.us, label %for.inc40.us
if.then.us: ; preds = %for.body31.us
store i32 1, ptr %arrayidx39.us, align 4, !tbaa !8
br label %for.inc40.us
for.inc40.us: ; preds = %if.then.us, %for.body31.us
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%exitcond.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count
br i1 %exitcond.not, label %for.cond29.for.inc43_crit_edge.us, label %for.body31.us, !llvm.loop !14
for.cond29.for.inc43_crit_edge.us: ; preds = %for.inc40.us, %middle.block
%indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
%exitcond178.not = icmp eq i64 %indvars.iv.next175, %wide.trip.count177
br i1 %exitcond178.not, label %for.cond46.preheader, label %for.cond29.preheader.us, !llvm.loop !15
for.body14: ; preds = %for.cond12.preheader, %for.body14
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body14 ], [ 0, %for.cond12.preheader ]
%arrayidx18 = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv168, i64 %indvars.iv
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx18)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%27 = load i32, ptr %col, align 4, !tbaa !8
%28 = sext i32 %27 to i64
%cmp13 = icmp slt i64 %indvars.iv.next, %28
br i1 %cmp13, label %for.body14, label %for.inc23.loopexit, !llvm.loop !16
for.inc23.loopexit: ; preds = %for.body14
%.pre = load i32, ptr %row, align 4, !tbaa !8
br label %for.inc23
for.inc23: ; preds = %for.inc23.loopexit, %for.cond12.preheader
%29 = phi i32 [ %.pre, %for.inc23.loopexit ], [ %2, %for.cond12.preheader ]
%30 = phi i32 [ %27, %for.inc23.loopexit ], [ %3, %for.cond12.preheader ]
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%31 = sext i32 %29 to i64
%cmp10 = icmp slt i64 %indvars.iv.next169, %31
br i1 %cmp10, label %for.cond12.preheader, label %for.cond26.preheader, !llvm.loop !17
for.cond46.preheader: ; preds = %for.cond29.for.inc43_crit_edge.us, %for.cond26.preheader
%cmp47154 = icmp sgt i32 %30, 0
br i1 %cmp47154, label %for.cond50.preheader.lr.ph, label %for.cond71.preheader
for.cond50.preheader.lr.ph: ; preds = %for.cond46.preheader
br i1 %cmp27150, label %for.cond50.preheader.us.preheader, label %for.end107
for.cond50.preheader.us.preheader: ; preds = %for.cond50.preheader.lr.ph
%wide.trip.count187 = zext i32 %30 to i64
%wide.trip.count182 = zext i32 %29 to i64
%xtraiter = and i64 %wide.trip.count182, 1
%32 = icmp eq i32 %29, 1
%unroll_iter = and i64 %wide.trip.count182, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond50.preheader.us
for.cond50.preheader.us: ; preds = %for.cond50.preheader.us.preheader, %for.cond50.for.inc68_crit_edge.us
%indvars.iv184 = phi i64 [ 0, %for.cond50.preheader.us.preheader ], [ %indvars.iv.next185, %for.cond50.for.inc68_crit_edge.us ]
%arrayidx63.us = getelementptr inbounds [100 x i32], ptr %coljudge, i64 0, i64 %indvars.iv184
br i1 %32, label %for.cond50.for.inc68_crit_edge.us.unr-lcssa, label %for.body53.us
for.body53.us: ; preds = %for.cond50.preheader.us, %for.inc65.us.1
%indvars.iv179 = phi i64 [ %indvars.iv.next180.1, %for.inc65.us.1 ], [ 0, %for.cond50.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc65.us.1 ], [ 0, %for.cond50.preheader.us ]
%arrayidx57.us = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv179, i64 %indvars.iv184
%33 = load i8, ptr %arrayidx57.us, align 1, !tbaa !5
%cmp59.us = icmp eq i8 %33, 35
br i1 %cmp59.us, label %if.then61.us, label %for.inc65.us
if.then61.us: ; preds = %for.body53.us
store i32 1, ptr %arrayidx63.us, align 4, !tbaa !8
br label %for.inc65.us
for.inc65.us: ; preds = %if.then61.us, %for.body53.us
%indvars.iv.next180 = or i64 %indvars.iv179, 1
%arrayidx57.us.1 = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv.next180, i64 %indvars.iv184
%34 = load i8, ptr %arrayidx57.us.1, align 1, !tbaa !5
%cmp59.us.1 = icmp eq i8 %34, 35
br i1 %cmp59.us.1, label %if.then61.us.1, label %for.inc65.us.1
if.then61.us.1: ; preds = %for.inc65.us
store i32 1, ptr %arrayidx63.us, align 4, !tbaa !8
br label %for.inc65.us.1
for.inc65.us.1: ; preds = %if.then61.us.1, %for.inc65.us
%indvars.iv.next180.1 = add nuw nsw i64 %indvars.iv179, 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.cond50.for.inc68_crit_edge.us.unr-lcssa, label %for.body53.us, !llvm.loop !19
for.cond50.for.inc68_crit_edge.us.unr-lcssa: ; preds = %for.inc65.us.1, %for.cond50.preheader.us
%indvars.iv179.unr = phi i64 [ 0, %for.cond50.preheader.us ], [ %indvars.iv.next180.1, %for.inc65.us.1 ]
br i1 %lcmp.mod.not, label %for.cond50.for.inc68_crit_edge.us, label %for.body53.us.epil
for.body53.us.epil: ; preds = %for.cond50.for.inc68_crit_edge.us.unr-lcssa
%arrayidx57.us.epil = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv179.unr, i64 %indvars.iv184
%35 = load i8, ptr %arrayidx57.us.epil, align 1, !tbaa !5
%cmp59.us.epil = icmp eq i8 %35, 35
br i1 %cmp59.us.epil, label %if.then61.us.epil, label %for.cond50.for.inc68_crit_edge.us
if.then61.us.epil: ; preds = %for.body53.us.epil
store i32 1, ptr %arrayidx63.us, align 4, !tbaa !8
br label %for.cond50.for.inc68_crit_edge.us
for.cond50.for.inc68_crit_edge.us: ; preds = %for.body53.us.epil, %if.then61.us.epil, %for.cond50.for.inc68_crit_edge.us.unr-lcssa
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%exitcond188.not = icmp eq i64 %indvars.iv.next185, %wide.trip.count187
br i1 %exitcond188.not, label %for.cond71.preheader, label %for.cond50.preheader.us, !llvm.loop !20
for.cond71.preheader: ; preds = %for.cond50.for.inc68_crit_edge.us, %for.cond46.preheader
br i1 %cmp27150, label %for.cond75.preheader.preheader, label %for.end107
for.cond75.preheader.preheader: ; preds = %for.cond29.preheader.lr.ph, %for.cond12.preheader.lr.ph, %for.cond71.preheader
br label %for.cond75.preheader
for.cond75.preheader: ; preds = %for.cond75.preheader.preheader, %for.inc105
%indvars.iv192 = phi i64 [ %indvars.iv.next193, %for.inc105 ], [ 0, %for.cond75.preheader.preheader ]
%36 = load i32, ptr %col, align 4, !tbaa !8
%cmp76156 = icmp sgt i32 %36, 0
%arrayidx80 = getelementptr inbounds [100 x i32], ptr %rowjudge, i64 0, i64 %indvars.iv192
%37 = load i32, ptr %arrayidx80, align 4, !tbaa !8
%cmp81 = icmp eq i32 %37, 1
br i1 %cmp76156, label %for.body78.lr.ph, label %for.end97
for.body78.lr.ph: ; preds = %for.cond75.preheader
br i1 %cmp81, label %for.body78.us, label %for.inc105
for.body78.us: ; preds = %for.body78.lr.ph, %for.inc95.us
%38 = phi i32 [ %41, %for.inc95.us ], [ %36, %for.body78.lr.ph ]
%indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.inc95.us ], [ 0, %for.body78.lr.ph ]
%arrayidx84.us = getelementptr inbounds [100 x i32], ptr %coljudge, i64 0, i64 %indvars.iv189
%39 = load i32, ptr %arrayidx84.us, align 4, !tbaa !8
%cmp85.us = icmp eq i32 %39, 1
br i1 %cmp85.us, label %if.then87.us, label %for.inc95.us
if.then87.us: ; preds = %for.body78.us
%arrayidx91.us = getelementptr inbounds [100 x [100 x i8]], ptr %matrix, i64 0, i64 %indvars.iv192, i64 %indvars.iv189
%40 = load i8, ptr %arrayidx91.us, align 1, !tbaa !5
%conv92.us = sext i8 %40 to i32
%putchar141.us = call i32 @putchar(i32 %conv92.us)
%.pre196 = load i32, ptr %col, align 4, !tbaa !8
br label %for.inc95.us
for.inc95.us: ; preds = %if.then87.us, %for.body78.us
%41 = phi i32 [ %.pre196, %if.then87.us ], [ %38, %for.body78.us ]
%indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1
%42 = sext i32 %41 to i64
%cmp76.us = icmp slt i64 %indvars.iv.next190, %42
br i1 %cmp76.us, label %for.body78.us, label %if.then102, !llvm.loop !21
for.end97: ; preds = %for.cond75.preheader
br i1 %cmp81, label %if.then102, label %for.inc105
if.then102: ; preds = %for.inc95.us, %for.end97
%putchar = call i32 @putchar(i32 10)
br label %for.inc105
for.inc105: ; preds = %for.body78.lr.ph, %for.end97, %if.then102
%indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
%43 = load i32, ptr %row, align 4, !tbaa !8
%44 = sext i32 %43 to i64
%cmp72 = icmp slt i64 %indvars.iv.next193, %44
br i1 %cmp72, label %for.cond75.preheader, label %for.end107, !llvm.loop !22
for.end107: ; preds = %for.inc105, %entry, %for.cond50.preheader.lr.ph, %for.cond71.preheader
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %matrix) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %coljudge) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %rowjudge) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %col) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %row) #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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11, !18}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !11}
!22 = distinct !{!22, !11}
|
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#define prime 1000000007
int main()
{
int rem,flag=0,a,b,c,i;
scanf("%d %d %d",&a,&b,&c);
for(i=1;i<10000;i++)
{
if((i*a)<c)
{
rem=c%(i*a);
if((rem%b)==0)
{
flag=1;
break;
}
}
else
break;
}
for(i=1;i<10000;i++)
{
if((i*b)<c)
{
rem=c%(i*b);
if((rem%a)==0)
{
flag=1;
break;
}
}
else
break;
}
if((a==c)||(b==c))
flag=1;
if(flag==0)
printf("No\n");
else if(flag==1)
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13316/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13316/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4
br label %for.body
for.cond: ; preds = %if.then
%inc = add nuw nsw i32 %i.051, 1
%exitcond.not = icmp eq i32 %inc, 10000
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%i.051 = phi i32 [ 1, %entry ], [ %inc, %for.cond ]
%mul = mul nsw i32 %0, %i.051
%cmp1 = icmp slt i32 %mul, %1
br i1 %cmp1, label %if.then, label %for.end
if.then: ; preds = %for.body
%rem3 = srem i32 %1, %mul
%rem4 = srem i32 %rem3, %2
%cmp5 = icmp eq i32 %rem4, 0
br i1 %cmp5, label %for.end, label %for.cond
for.end: ; preds = %if.then, %for.body, %for.cond
%cmp2950 = phi i1 [ true, %for.body ], [ true, %for.cond ], [ false, %if.then ]
br label %for.body10
for.cond8: ; preds = %if.then13
%inc23 = add nuw nsw i32 %i.152, 1
%exitcond53.not = icmp eq i32 %inc23, 10000
br i1 %exitcond53.not, label %for.end24, label %for.body10, !llvm.loop !11
for.body10: ; preds = %for.end, %for.cond8
%i.152 = phi i32 [ 1, %for.end ], [ %inc23, %for.cond8 ]
%mul11 = mul nsw i32 %2, %i.152
%cmp12 = icmp slt i32 %mul11, %1
br i1 %cmp12, label %if.then13, label %for.end24
if.then13: ; preds = %for.body10
%rem15 = srem i32 %1, %mul11
%rem16 = srem i32 %rem15, %0
%cmp17 = icmp eq i32 %rem16, 0
br i1 %cmp17, label %if.then34, label %for.cond8
for.end24: ; preds = %for.body10, %for.cond8
%cmp25 = icmp ne i32 %0, %1
%cmp26 = icmp ne i32 %2, %1
%or.cond.not = select i1 %cmp25, i1 %cmp26, i1 false
%cmp29 = and i1 %cmp2950, %or.cond.not
br i1 %cmp29, label %if.end37, label %if.then34
if.then34: ; preds = %if.then13, %for.end24
br label %if.end37
if.end37: ; preds = %for.end24, %if.then34
%str.sink = phi ptr [ @str, %if.then34 ], [ @str.3, %for.end24 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
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"}
!11 = distinct !{!11, !10}
|
/* ex5_3
kohei_suzuki */
#include <stdio.h>
int main(void){
int height,width;
scanf("%d %d",&height,&width);
char square[height][width];
for(int i=0; i<height ;i++){
for(int j=0; j<width ;j++){
scanf(" %c",&square[i][j]);
}
}
int ture_row[height], ture_col[width];
//表示する行と表示する列を表す0,1列
for(int i=0; i<height; i++){
ture_row[i]=0;
for(int j=0; j<width; j++){
if(square[i][j] == '#'){
ture_row[i]=1;
}
}
}
for(int j=0; j<=width; j++){
ture_col[j]=0;
for(int i=0; i<height; i++){
if(square[i][j]=='#'){
ture_col[j]=1;
}
}
}
for(int i=0; i<height; i++){
if(ture_row[i] == 1){
for(int j=0; j<width; j++){
if(ture_col[j] == 1){
printf("%c",square[i][j]);
}
}
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133202/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133202/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%height = alloca i32, align 4
%width = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %height) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %width) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %height, ptr noundef nonnull %width)
%0 = load i32, ptr %height, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %width, align 4, !tbaa !5
%3 = zext i32 %2 to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i8, i64 %5, align 16
%6 = load i32, ptr %height, align 4, !tbaa !5
%cmp132 = icmp sgt i32 %6, 0
%.pre184 = load i32, ptr %width, align 4, !tbaa !5
br i1 %cmp132, label %for.cond1.preheader.lr.ph, label %for.cond40.preheader.thread
for.cond1.preheader.lr.ph: ; preds = %entry
%7 = icmp sgt i32 %.pre184, 0
br i1 %7, label %for.cond1.preheader, label %for.body17.lr.ph.thread
for.body17.lr.ph.thread: ; preds = %for.cond1.preheader.lr.ph
%8 = zext i32 %6 to i64
%vla11187 = alloca i32, i64 %8, align 16
%9 = zext i32 %.pre184 to i64
%vla12188 = alloca i32, i64 %9, align 16
br label %for.body17.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond.cleanup3
%10 = phi i32 [ %43, %for.cond.cleanup3 ], [ %6, %for.cond1.preheader.lr.ph ]
%11 = phi i32 [ %44, %for.cond.cleanup3 ], [ %.pre184, %for.cond1.preheader.lr.ph ]
%indvars.iv151 = phi i64 [ %indvars.iv.next152, %for.cond.cleanup3 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2130 = icmp sgt i32 %11, 0
br i1 %cmp2130, label %for.body4.lr.ph, label %for.cond.cleanup3
for.body4.lr.ph: ; preds = %for.cond1.preheader
%12 = mul nuw nsw i64 %indvars.iv151, %3
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %12
br label %for.body4
for.cond.cleanup: ; preds = %for.cond.cleanup3
%13 = zext i32 %43 to i64
%vla11 = alloca i32, i64 %13, align 16
%14 = zext i32 %44 to i64
%vla12 = alloca i32, i64 %14, align 16
%cmp15136 = icmp sgt i32 %43, 0
br i1 %cmp15136, label %for.body17.lr.ph, label %for.cond40.preheader
for.body17.lr.ph: ; preds = %for.cond.cleanup
%cmp22134 = icmp sgt i32 %44, 0
br i1 %cmp22134, label %for.body17.us.preheader, label %for.body17.preheader
for.body17.us.preheader: ; preds = %for.body17.lr.ph
%min.iters.check = icmp ult i32 %44, 8
%n.vec = and i64 %14, 4294967288
%cmp.n = icmp eq i64 %n.vec, %14
br label %for.body17.us
for.body17.preheader: ; preds = %for.body17.lr.ph.thread, %for.body17.lr.ph
%15 = phi i32 [ %.pre184, %for.body17.lr.ph.thread ], [ %44, %for.body17.lr.ph ]
%16 = phi i32 [ %6, %for.body17.lr.ph.thread ], [ %43, %for.body17.lr.ph ]
%17 = phi i64 [ %8, %for.body17.lr.ph.thread ], [ %13, %for.body17.lr.ph ]
%vla11191206 = phi ptr [ %vla11187, %for.body17.lr.ph.thread ], [ %vla11, %for.body17.lr.ph ]
%vla12193205 = phi ptr [ %vla12188, %for.body17.lr.ph.thread ], [ %vla12, %for.body17.lr.ph ]
%18 = shl nuw nsw i64 %17, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla11191206, i8 0, i64 %18, i1 false), !tbaa !5
br label %for.cond40.preheader
for.body17.us: ; preds = %for.body17.us.preheader, %for.cond21.for.cond.cleanup23_crit_edge.us
%indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.cond21.for.cond.cleanup23_crit_edge.us ], [ 0, %for.body17.us.preheader ]
%arrayidx19.us = getelementptr inbounds i32, ptr %vla11, i64 %indvars.iv160
store i32 0, ptr %arrayidx19.us, align 4, !tbaa !5
%19 = mul nuw nsw i64 %indvars.iv160, %3
%arrayidx26.us = getelementptr inbounds i8, ptr %vla, i64 %19
br i1 %min.iters.check, label %for.body24.us.preheader, label %vector.body
vector.body: ; preds = %for.body17.us, %40
%index = phi i64 [ %index.next, %40 ], [ 0, %for.body17.us ]
%20 = getelementptr inbounds i8, ptr %arrayidx26.us, i64 %index
%wide.load = load <4 x i8>, ptr %20, align 1, !tbaa !9
%21 = getelementptr inbounds i8, ptr %20, i64 4
%wide.load230 = load <4 x i8>, ptr %21, align 1, !tbaa !9
%22 = icmp eq <4 x i8> %wide.load, <i8 35, i8 35, i8 35, i8 35>
%23 = icmp eq <4 x i8> %wide.load230, <i8 35, i8 35, i8 35, i8 35>
%24 = extractelement <4 x i1> %22, i64 0
%25 = extractelement <4 x i1> %22, i64 1
%26 = or i1 %24, %25
%27 = extractelement <4 x i1> %22, i64 2
%28 = or i1 %26, %27
%29 = extractelement <4 x i1> %22, i64 3
%30 = or i1 %28, %29
%31 = extractelement <4 x i1> %23, i64 0
%32 = or i1 %30, %31
%33 = extractelement <4 x i1> %23, i64 1
%34 = or i1 %32, %33
%35 = extractelement <4 x i1> %23, i64 2
%36 = or i1 %34, %35
%37 = extractelement <4 x i1> %23, i64 3
%38 = or i1 %36, %37
br i1 %38, label %39, label %40
39: ; preds = %vector.body
store i32 1, ptr %arrayidx19.us, align 4, !tbaa !5
br label %40
40: ; preds = %vector.body, %39
%index.next = add nuw i64 %index, 8
%41 = icmp eq i64 %index.next, %n.vec
br i1 %41, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %40
br i1 %cmp.n, label %for.cond21.for.cond.cleanup23_crit_edge.us, label %for.body24.us.preheader
for.body24.us.preheader: ; preds = %for.body17.us, %middle.block
%indvars.iv157.ph = phi i64 [ 0, %for.body17.us ], [ %n.vec, %middle.block ]
br label %for.body24.us
for.body24.us: ; preds = %for.body24.us.preheader, %for.inc33.us
%indvars.iv157 = phi i64 [ %indvars.iv.next158, %for.inc33.us ], [ %indvars.iv157.ph, %for.body24.us.preheader ]
%arrayidx28.us = getelementptr inbounds i8, ptr %arrayidx26.us, i64 %indvars.iv157
%42 = load i8, ptr %arrayidx28.us, align 1, !tbaa !9
%cmp29.us = icmp eq i8 %42, 35
br i1 %cmp29.us, label %if.then.us, label %for.inc33.us
if.then.us: ; preds = %for.body24.us
store i32 1, ptr %arrayidx19.us, align 4, !tbaa !5
br label %for.inc33.us
for.inc33.us: ; preds = %if.then.us, %for.body24.us
%indvars.iv.next158 = add nuw nsw i64 %indvars.iv157, 1
%exitcond.not = icmp eq i64 %indvars.iv.next158, %14
br i1 %exitcond.not, label %for.cond21.for.cond.cleanup23_crit_edge.us, label %for.body24.us, !llvm.loop !14
for.cond21.for.cond.cleanup23_crit_edge.us: ; preds = %for.inc33.us, %middle.block
%indvars.iv.next161 = add nuw nsw i64 %indvars.iv160, 1
%exitcond164.not = icmp eq i64 %indvars.iv.next161, %13
br i1 %exitcond164.not, label %for.cond40.preheader, label %for.body17.us, !llvm.loop !15
for.cond.cleanup3.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %height, align 4, !tbaa !5
br label %for.cond.cleanup3
for.cond.cleanup3: ; preds = %for.cond.cleanup3.loopexit, %for.cond1.preheader
%43 = phi i32 [ %.pre, %for.cond.cleanup3.loopexit ], [ %10, %for.cond1.preheader ]
%44 = phi i32 [ %46, %for.cond.cleanup3.loopexit ], [ %11, %for.cond1.preheader ]
%indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1
%45 = sext i32 %43 to i64
%cmp = icmp slt i64 %indvars.iv.next152, %45
br i1 %cmp, label %for.cond1.preheader, label %for.cond.cleanup, !llvm.loop !16
for.body4: ; preds = %for.body4.lr.ph, %for.body4
%indvars.iv = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next, %for.body4 ]
%arrayidx6 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%46 = load i32, ptr %width, align 4, !tbaa !5
%47 = sext i32 %46 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %47
br i1 %cmp2, label %for.body4, label %for.cond.cleanup3.loopexit, !llvm.loop !18
for.cond40.preheader: ; preds = %for.cond21.for.cond.cleanup23_crit_edge.us, %for.body17.preheader, %for.cond.cleanup
%cmp15136194 = phi i1 [ true, %for.body17.preheader ], [ false, %for.cond.cleanup ], [ true, %for.cond21.for.cond.cleanup23_crit_edge.us ]
%vla12192 = phi ptr [ %vla12193205, %for.body17.preheader ], [ %vla12, %for.cond.cleanup ], [ %vla12, %for.cond21.for.cond.cleanup23_crit_edge.us ]
%vla11190 = phi ptr [ %vla11191206, %for.body17.preheader ], [ %vla11, %for.cond.cleanup ], [ %vla11, %for.cond21.for.cond.cleanup23_crit_edge.us ]
%48 = phi i64 [ %17, %for.body17.preheader ], [ %13, %for.cond.cleanup ], [ %13, %for.cond21.for.cond.cleanup23_crit_edge.us ]
%49 = phi i32 [ %16, %for.body17.preheader ], [ %43, %for.cond.cleanup ], [ %43, %for.cond21.for.cond.cleanup23_crit_edge.us ]
%50 = phi i32 [ %15, %for.body17.preheader ], [ %44, %for.cond.cleanup ], [ %44, %for.cond21.for.cond.cleanup23_crit_edge.us ]
%cmp41.not140 = icmp slt i32 %50, 0
br i1 %cmp41.not140, label %for.cond71.preheader, label %for.body44.lr.ph
for.cond40.preheader.thread: ; preds = %entry
%51 = zext i32 %.pre184 to i64
%vla12198 = alloca i32, i64 %51, align 16
%cmp41.not140210 = icmp slt i32 %.pre184, 0
br i1 %cmp41.not140210, label %for.cond.cleanup74, label %for.body44.preheader
for.body44.lr.ph: ; preds = %for.cond40.preheader
br i1 %cmp15136194, label %for.body44.us.preheader, label %for.body44.preheader
for.body44.preheader: ; preds = %for.cond40.preheader.thread, %for.body44.lr.ph
%vla12192213221 = phi ptr [ %vla12192, %for.body44.lr.ph ], [ %vla12198, %for.cond40.preheader.thread ]
%52 = phi i32 [ %50, %for.body44.lr.ph ], [ %.pre184, %for.cond40.preheader.thread ]
%53 = add nuw i32 %52, 1
%54 = zext i32 %53 to i64
%55 = shl nuw nsw i64 %54, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla12192213221, i8 0, i64 %55, i1 false), !tbaa !5
br label %for.cond.cleanup74
for.body44.us.preheader: ; preds = %for.body44.lr.ph
%56 = add nuw i32 %50, 1
%wide.trip.count176 = zext i32 %56 to i64
%min.iters.check250 = icmp ugt i64 %48, 11
%ident.check.not = icmp eq i32 %2, 1
%or.cond = select i1 %min.iters.check250, i1 %ident.check.not, i1 false
%57 = getelementptr i8, ptr %vla, i64 %48
%n.vec253 = and i64 %48, -8
%cmp.n255 = icmp eq i64 %48, %n.vec253
%xtraiter = and i64 %48, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.body44.us
for.body44.us: ; preds = %for.body44.us.preheader, %for.cond48.for.cond.cleanup51_crit_edge.us
%indvars.iv173 = phi i64 [ 0, %for.body44.us.preheader ], [ %indvars.iv.next174, %for.cond48.for.cond.cleanup51_crit_edge.us ]
%arrayidx46.us = getelementptr inbounds i32, ptr %vla12192, i64 %indvars.iv173
store i32 0, ptr %arrayidx46.us, align 4, !tbaa !5
%invariant.gep.us = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv173
br i1 %or.cond, label %vector.memcheck, label %for.body52.us.preheader
vector.memcheck: ; preds = %for.body44.us
%scevgep247 = getelementptr i8, ptr %57, i64 %indvars.iv173
%scevgep246 = getelementptr i8, ptr %vla, i64 %indvars.iv173
%58 = shl nuw nsw i64 %indvars.iv173, 2
%59 = add nuw i64 %58, 4
%scevgep245 = getelementptr i8, ptr %vla12192, i64 %59
%scevgep = getelementptr i8, ptr %vla12192, i64 %58
%bound0 = icmp ult ptr %scevgep, %scevgep247
%bound1 = icmp ult ptr %scevgep246, %scevgep245
%found.conflict = and i1 %bound0, %bound1
br i1 %found.conflict, label %for.body52.us.preheader, label %vector.body256
vector.body256: ; preds = %vector.memcheck, %81
%index257 = phi i64 [ %index.next276, %81 ], [ 0, %vector.memcheck ]
%60 = mul nuw nsw i64 %index257, %3
%61 = getelementptr inbounds i8, ptr %invariant.gep.us, i64 %60
%wide.load258 = load <4 x i8>, ptr %61, align 1, !tbaa !9, !alias.scope !19
%62 = getelementptr inbounds i8, ptr %61, i64 4
%wide.load259 = load <4 x i8>, ptr %62, align 1, !tbaa !9, !alias.scope !19
%63 = icmp eq <4 x i8> %wide.load258, <i8 35, i8 35, i8 35, i8 35>
%64 = icmp eq <4 x i8> %wide.load259, <i8 35, i8 35, i8 35, i8 35>
%65 = extractelement <4 x i1> %63, i64 0
%66 = extractelement <4 x i1> %63, i64 1
%67 = or i1 %65, %66
%68 = extractelement <4 x i1> %63, i64 2
%69 = or i1 %67, %68
%70 = extractelement <4 x i1> %63, i64 3
%71 = or i1 %69, %70
%72 = extractelement <4 x i1> %64, i64 0
%73 = or i1 %71, %72
%74 = extractelement <4 x i1> %64, i64 1
%75 = or i1 %73, %74
%76 = extractelement <4 x i1> %64, i64 2
%77 = or i1 %75, %76
%78 = extractelement <4 x i1> %64, i64 3
%79 = or i1 %77, %78
br i1 %79, label %80, label %81
80: ; preds = %vector.body256
store i32 1, ptr %arrayidx46.us, align 4, !tbaa !5, !alias.scope !22, !noalias !19
br label %81
81: ; preds = %vector.body256, %80
%index.next276 = add nuw i64 %index257, 8
%82 = icmp eq i64 %index.next276, %n.vec253
br i1 %82, label %middle.block248, label %vector.body256, !llvm.loop !24
middle.block248: ; preds = %81
br i1 %cmp.n255, label %for.cond48.for.cond.cleanup51_crit_edge.us, label %for.body52.us.preheader
for.body52.us.preheader: ; preds = %vector.memcheck, %for.body44.us, %middle.block248
%indvars.iv168.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %for.body44.us ], [ %n.vec253, %middle.block248 ]
%.neg = or i64 %indvars.iv168.ph, 1
br i1 %lcmp.mod.not, label %for.body52.us.prol.loopexit, label %for.body52.us.prol
for.body52.us.prol: ; preds = %for.body52.us.preheader
%83 = mul nuw nsw i64 %indvars.iv168.ph, %3
%gep.us.prol = getelementptr inbounds i8, ptr %invariant.gep.us, i64 %83
%84 = load i8, ptr %gep.us.prol, align 1, !tbaa !9
%cmp58.us.prol = icmp eq i8 %84, 35
br i1 %cmp58.us.prol, label %if.then60.us.prol, label %for.inc64.us.prol
if.then60.us.prol: ; preds = %for.body52.us.prol
store i32 1, ptr %arrayidx46.us, align 4, !tbaa !5
br label %for.inc64.us.prol
for.inc64.us.prol: ; preds = %if.then60.us.prol, %for.body52.us.prol
%indvars.iv.next169.prol = or i64 %indvars.iv168.ph, 1
br label %for.body52.us.prol.loopexit
for.body52.us.prol.loopexit: ; preds = %for.inc64.us.prol, %for.body52.us.preheader
%indvars.iv168.unr = phi i64 [ %indvars.iv168.ph, %for.body52.us.preheader ], [ %indvars.iv.next169.prol, %for.inc64.us.prol ]
%85 = icmp eq i64 %48, %.neg
br i1 %85, label %for.cond48.for.cond.cleanup51_crit_edge.us, label %for.body52.us
for.body52.us: ; preds = %for.body52.us.prol.loopexit, %for.inc64.us.1
%indvars.iv168 = phi i64 [ %indvars.iv.next169.1, %for.inc64.us.1 ], [ %indvars.iv168.unr, %for.body52.us.prol.loopexit ]
%86 = mul nuw nsw i64 %indvars.iv168, %3
%gep.us = getelementptr inbounds i8, ptr %invariant.gep.us, i64 %86
%87 = load i8, ptr %gep.us, align 1, !tbaa !9
%cmp58.us = icmp eq i8 %87, 35
br i1 %cmp58.us, label %if.then60.us, label %for.inc64.us
if.then60.us: ; preds = %for.body52.us
store i32 1, ptr %arrayidx46.us, align 4, !tbaa !5
br label %for.inc64.us
for.inc64.us: ; preds = %if.then60.us, %for.body52.us
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%88 = mul nuw nsw i64 %indvars.iv.next169, %3
%gep.us.1 = getelementptr inbounds i8, ptr %invariant.gep.us, i64 %88
%89 = load i8, ptr %gep.us.1, align 1, !tbaa !9
%cmp58.us.1 = icmp eq i8 %89, 35
br i1 %cmp58.us.1, label %if.then60.us.1, label %for.inc64.us.1
if.then60.us.1: ; preds = %for.inc64.us
store i32 1, ptr %arrayidx46.us, align 4, !tbaa !5
br label %for.inc64.us.1
for.inc64.us.1: ; preds = %if.then60.us.1, %for.inc64.us
%indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 2
%exitcond172.not.1 = icmp eq i64 %indvars.iv.next169.1, %48
br i1 %exitcond172.not.1, label %for.cond48.for.cond.cleanup51_crit_edge.us, label %for.body52.us, !llvm.loop !25
for.cond48.for.cond.cleanup51_crit_edge.us: ; preds = %for.body52.us.prol.loopexit, %for.inc64.us.1, %middle.block248
%indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
%exitcond177.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count176
br i1 %exitcond177.not, label %for.cond71.preheader, label %for.body44.us, !llvm.loop !26
for.cond71.preheader: ; preds = %for.cond48.for.cond.cleanup51_crit_edge.us, %for.cond40.preheader
br i1 %cmp15136194, label %for.body75, label %for.cond.cleanup74
for.cond.cleanup74: ; preds = %for.inc104, %for.body44.preheader, %for.cond40.preheader.thread, %for.cond71.preheader
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %width) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %height) #6
ret i32 0
for.body75: ; preds = %for.cond71.preheader, %for.inc104
%90 = phi i32 [ %99, %for.inc104 ], [ %49, %for.cond71.preheader ]
%indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.inc104 ], [ 0, %for.cond71.preheader ]
%arrayidx77 = getelementptr inbounds i32, ptr %vla11190, i64 %indvars.iv181
%91 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%cmp78 = icmp eq i32 %91, 1
br i1 %cmp78, label %for.cond82.preheader, label %for.inc104
for.cond82.preheader: ; preds = %for.body75
%92 = load i32, ptr %width, align 4, !tbaa !5
%cmp83142 = icmp sgt i32 %92, 0
br i1 %cmp83142, label %for.body86.lr.ph, label %for.cond.cleanup85
for.body86.lr.ph: ; preds = %for.cond82.preheader
%93 = mul nuw nsw i64 %indvars.iv181, %3
%arrayidx93 = getelementptr inbounds i8, ptr %vla, i64 %93
br label %for.body86
for.cond.cleanup85: ; preds = %for.inc99, %for.cond82.preheader
%putchar = call i32 @putchar(i32 10)
%.pre186 = load i32, ptr %height, align 4, !tbaa !5
br label %for.inc104
for.body86: ; preds = %for.body86.lr.ph, %for.inc99
%94 = phi i32 [ %92, %for.body86.lr.ph ], [ %97, %for.inc99 ]
%indvars.iv178 = phi i64 [ 0, %for.body86.lr.ph ], [ %indvars.iv.next179, %for.inc99 ]
%arrayidx88 = getelementptr inbounds i32, ptr %vla12192, i64 %indvars.iv178
%95 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%cmp89 = icmp eq i32 %95, 1
br i1 %cmp89, label %if.then91, label %for.inc99
if.then91: ; preds = %for.body86
%arrayidx95 = getelementptr inbounds i8, ptr %arrayidx93, i64 %indvars.iv178
%96 = load i8, ptr %arrayidx95, align 1, !tbaa !9
%conv96 = sext i8 %96 to i32
%putchar129 = call i32 @putchar(i32 %conv96)
%.pre185 = load i32, ptr %width, align 4, !tbaa !5
br label %for.inc99
for.inc99: ; preds = %for.body86, %if.then91
%97 = phi i32 [ %94, %for.body86 ], [ %.pre185, %if.then91 ]
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%98 = sext i32 %97 to i64
%cmp83 = icmp slt i64 %indvars.iv.next179, %98
br i1 %cmp83, label %for.body86, label %for.cond.cleanup85, !llvm.loop !27
for.inc104: ; preds = %for.body75, %for.cond.cleanup85
%99 = phi i32 [ %90, %for.body75 ], [ %.pre186, %for.cond.cleanup85 ]
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%100 = sext i32 %99 to i64
%cmp72 = icmp slt i64 %indvars.iv.next182, %100
br i1 %cmp72, label %for.body75, label %for.cond.cleanup74, !llvm.loop !28
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !11}
!19 = !{!20}
!20 = distinct !{!20, !21}
!21 = distinct !{!21, !"LVerDomain"}
!22 = !{!23}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !11, !12, !13}
!25 = distinct !{!25, !11, !12}
!26 = distinct !{!26, !11}
!27 = distinct !{!27, !11}
!28 = distinct !{!28, !11}
|
#include <unistd.h>
#include <stdlib.h>
void get_nums(int *array, char *s, int count)
{
int num;
int i;
i = 0;
while (s[i] && s[i] != 10)
{
if (s[i] != 32)
{
num = 0;
while ('0' <= s[i] && s[i] <= '9')
num = num * 10 + s[i++] - '0';
array[count++] = num;
continue;
}
i++;
}
}
char *get_string(char *tmp, int pass_flag)
{
int i;
int j;
int k;
int count;
char *new_arr;
count = 0;
i = 0;
while (count++ < pass_flag)
while (tmp[i++] != 10)
;
j = 0;
while (31 < tmp[i + j] && tmp[i + j] < 127)
j++;
if (!(new_arr = (char*)malloc(j + 1)))
return (0);
k = -1;
while (++k < j)
new_arr[k] = tmp[i + k];
new_arr[k] = 0;
return (new_arr);
}
char **get_strings(char *tmp, int pass_flag, int size)
{
int i;
int j;
int count;
char **new_arr;
if (!(new_arr = (char**)malloc(sizeof(char*) * (size + 1))))
return (0);
count = 0;
i = 0;
while (count++ < pass_flag)
while (tmp[i++] != 10)
;
j = -1;
while (++j < size)
if(!(new_arr[j] = get_string(&tmp[i], j)))
return (0);
new_arr[j] = 0;
return (new_arr);
}
void get_ans(int *nums, char **arr, int i, int *y)
{
int x[nums[0]];
int j;
while (++i < nums[0] && !(x[i] = 0))
{
j = -1;
while (++j < nums[1])
if (arr[i][j] == '.')
arr[i][j] == '.' ? x[i]++, y[j]++ : 0;
}
i = -1;
while (++i < nums[0])
{
if (x[i] == nums[1])
continue;
j = -1;
while (++j < nums[1])
{
if (y[j] == nums[0])
continue;
write(1, &arr[i][j], 1);
}
write(1, "\n", 1);
}
}
int main(void)
{
char s[10200];
int nums[2];
char **arr;
int i;
int *y;
if ((i = read(0, s, 10200)) == -1)
return (-1);
s[i] = 0;
get_nums(nums, s, 0);
arr = get_strings(s, 1, nums[0]);
if (!(y = (int*) malloc(sizeof(int) * nums[1])))
return (-1);
i = -1;
while (++i < nums[1])
y[i] = 0;
get_ans(nums, arr, -1 , y);
i = -1;
while (++i < nums[0])
free(arr[i]);
free(arr);
free(y);
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133246/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133246/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @get_nums(ptr nocapture noundef writeonly %array, ptr nocapture noundef readonly %s, i32 noundef %count) local_unnamed_addr #0 {
entry:
%0 = sext i32 %count to i64
br label %while.cond.outer
while.cond.outer: ; preds = %while.end, %entry
%indvars.iv56 = phi i64 [ %indvars.iv.next57, %while.end ], [ %0, %entry ]
%i.0.ph = phi i64 [ %i.1.lcssa, %while.end ], [ 0, %entry ]
%sext = shl i64 %i.0.ph, 32
%1 = ashr exact i64 %sext, 32
br label %while.cond
while.cond: ; preds = %while.cond.outer, %if.end
%indvars.iv = phi i64 [ %1, %while.cond.outer ], [ %indvars.iv.next, %if.end ]
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %2, label %while.cond10.preheader [
i8 0, label %while.end31
i8 10, label %while.end31
i8 32, label %if.end
]
while.cond10.preheader: ; preds = %while.cond
%sext59 = shl i64 %indvars.iv, 32
%idxprom1145 = ashr exact i64 %sext59, 32
%arrayidx1246 = getelementptr inbounds i8, ptr %s, i64 %idxprom1145
%3 = load i8, ptr %arrayidx1246, align 1, !tbaa !5
%4 = add i8 %3, -48
%or.cond47 = icmp ult i8 %4, 10
br i1 %or.cond47, label %while.body23, label %while.end
while.body23: ; preds = %while.cond10.preheader, %while.body23
%indvars.iv54 = phi i64 [ %indvars.iv.next55, %while.body23 ], [ %indvars.iv, %while.cond10.preheader ]
%5 = phi i8 [ %6, %while.body23 ], [ %3, %while.cond10.preheader ]
%num.048 = phi i32 [ %sub, %while.body23 ], [ 0, %while.cond10.preheader ]
%conv13 = zext i8 %5 to i32
%mul = mul nsw i32 %num.048, 10
%indvars.iv.next55 = add i64 %indvars.iv54, 1
%add = add i32 %mul, -48
%sub = add i32 %add, %conv13
%arrayidx12 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next55
%6 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%7 = add i8 %6, -48
%or.cond = icmp ult i8 %7, 10
br i1 %or.cond, label %while.body23, label %while.end, !llvm.loop !8
while.end: ; preds = %while.body23, %while.cond10.preheader
%num.0.lcssa = phi i32 [ 0, %while.cond10.preheader ], [ %sub, %while.body23 ]
%i.1.lcssa = phi i64 [ %indvars.iv, %while.cond10.preheader ], [ %indvars.iv.next55, %while.body23 ]
%indvars.iv.next57 = add i64 %indvars.iv56, 1
%arrayidx29 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv56
store i32 %num.0.lcssa, ptr %arrayidx29, align 4, !tbaa !10
br label %while.cond.outer, !llvm.loop !12
if.end: ; preds = %while.cond
%indvars.iv.next = add i64 %indvars.iv, 1
br label %while.cond, !llvm.loop !12
while.end31: ; preds = %while.cond, %while.cond
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 noalias ptr @get_string(ptr nocapture noundef readonly %tmp, i32 noundef %pass_flag) local_unnamed_addr #2 {
entry:
%cmp56 = icmp sgt i32 %pass_flag, 0
br i1 %cmp56, label %while.cond1.preheader.preheader, label %while.cond7.preheader
while.cond1.preheader.preheader: ; preds = %entry
%xtraiter = and i32 %pass_flag, 1
%0 = icmp eq i32 %pass_flag, 1
br i1 %0, label %while.cond7.preheader.loopexit.unr-lcssa, label %while.cond1.preheader.preheader.new
while.cond1.preheader.preheader.new: ; preds = %while.cond1.preheader.preheader
%unroll_iter = and i32 %pass_flag, -2
br label %while.cond1.preheader
while.cond1.preheader: ; preds = %while.end.1, %while.cond1.preheader.preheader.new
%i.057 = phi i64 [ 0, %while.cond1.preheader.preheader.new ], [ %indvars.iv.next.1, %while.end.1 ]
%niter = phi i32 [ 0, %while.cond1.preheader.preheader.new ], [ %niter.next.1, %while.end.1 ]
%sext = shl i64 %i.057, 32
%1 = ashr exact i64 %sext, 32
br label %while.cond1
while.cond7.preheader.loopexit.unr-lcssa.loopexit: ; preds = %while.end.1
%2 = shl i64 %indvars.iv.next.1, 32
%3 = ashr exact i64 %2, 32
br label %while.cond7.preheader.loopexit.unr-lcssa
while.cond7.preheader.loopexit.unr-lcssa: ; preds = %while.cond7.preheader.loopexit.unr-lcssa.loopexit, %while.cond1.preheader.preheader
%indvars.iv.next.lcssa.lcssa.ph = phi i64 [ undef, %while.cond1.preheader.preheader ], [ %indvars.iv.next.1, %while.cond7.preheader.loopexit.unr-lcssa.loopexit ]
%i.057.unr = phi i64 [ 0, %while.cond1.preheader.preheader ], [ %3, %while.cond7.preheader.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.cond7.preheader.loopexit, label %while.cond1.epil
while.cond1.epil: ; preds = %while.cond7.preheader.loopexit.unr-lcssa, %while.cond1.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %while.cond1.epil ], [ %i.057.unr, %while.cond7.preheader.loopexit.unr-lcssa ]
%indvars.iv.next.epil = add i64 %indvars.iv.epil, 1
%arrayidx.epil = getelementptr inbounds i8, ptr %tmp, i64 %indvars.iv.epil
%4 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%cmp3.not.epil = icmp eq i8 %4, 10
br i1 %cmp3.not.epil, label %while.cond7.preheader.loopexit, label %while.cond1.epil, !llvm.loop !13
while.cond7.preheader.loopexit: ; preds = %while.cond1.epil, %while.cond7.preheader.loopexit.unr-lcssa
%indvars.iv.next.lcssa.lcssa = phi i64 [ %indvars.iv.next.lcssa.lcssa.ph, %while.cond7.preheader.loopexit.unr-lcssa ], [ %indvars.iv.next.epil, %while.cond1.epil ]
%sext77 = shl i64 %indvars.iv.next.lcssa.lcssa, 32
%5 = ashr exact i64 %sext77, 32
br label %while.cond7.preheader
while.cond7.preheader: ; preds = %while.cond7.preheader.loopexit, %entry
%i.0.lcssa = phi i64 [ 0, %entry ], [ %5, %while.cond7.preheader.loopexit ]
%invariant.gep = getelementptr i8, ptr %tmp, i64 %i.0.lcssa
br label %while.cond7
while.cond1: ; preds = %while.cond1.preheader, %while.cond1
%indvars.iv = phi i64 [ %1, %while.cond1.preheader ], [ %indvars.iv.next, %while.cond1 ]
%indvars.iv.next = add i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %tmp, i64 %indvars.iv
%6 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp3.not = icmp eq i8 %6, 10
br i1 %cmp3.not, label %while.end, label %while.cond1, !llvm.loop !13
while.end: ; preds = %while.cond1
%sext.1 = shl i64 %indvars.iv.next, 32
%7 = ashr exact i64 %sext.1, 32
br label %while.cond1.1
while.cond1.1: ; preds = %while.cond1.1, %while.end
%indvars.iv.1 = phi i64 [ %7, %while.end ], [ %indvars.iv.next.1, %while.cond1.1 ]
%indvars.iv.next.1 = add i64 %indvars.iv.1, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %tmp, i64 %indvars.iv.1
%8 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp3.not.1 = icmp eq i8 %8, 10
br i1 %cmp3.not.1, label %while.end.1, label %while.cond1.1, !llvm.loop !13
while.end.1: ; preds = %while.cond1.1
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %while.cond7.preheader.loopexit.unr-lcssa.loopexit, label %while.cond1.preheader, !llvm.loop !14
while.cond7: ; preds = %while.cond7, %while.cond7.preheader
%indvars.iv71 = phi i32 [ %indvars.iv.next72, %while.cond7 ], [ -1, %while.cond7.preheader ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %while.cond7 ], [ 0, %while.cond7.preheader ]
%gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv64
%9 = load i8, ptr %gep, align 1, !tbaa !5
%10 = add i8 %9, -127
%or.cond = icmp ult i8 %10, -95
%indvars.iv.next65 = add nuw i64 %indvars.iv64, 1
%indvars.iv.next72 = add nsw i32 %indvars.iv71, 1
br i1 %or.cond, label %while.end21, label %while.cond7, !llvm.loop !15
while.end21: ; preds = %while.cond7
%add22 = add i64 %indvars.iv64, 1
%conv23 = and i64 %add22, 4294967295
%call = tail call noalias ptr @malloc(i64 noundef %conv23) #10
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %cleanup, label %while.cond24.preheader
while.cond24.preheader: ; preds = %while.end21
%11 = and i64 %indvars.iv64, 4294967295
%cmp2659.not = icmp eq i64 %11, 0
br i1 %cmp2659.not, label %while.end34, label %while.body28.preheader
while.body28.preheader: ; preds = %while.cond24.preheader
%scevgep = getelementptr i8, ptr %tmp, i64 %i.0.lcssa
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %call, ptr align 1 %scevgep, i64 %indvars.iv64, i1 false), !tbaa !5
%12 = add i32 %indvars.iv71, 1
%13 = sext i32 %12 to i64
br label %while.end34
while.end34: ; preds = %while.body28.preheader, %while.cond24.preheader
%inc25.lcssa = phi i64 [ 0, %while.cond24.preheader ], [ %13, %while.body28.preheader ]
%arrayidx36 = getelementptr inbounds i8, ptr %call, i64 %inc25.lcssa
store i8 0, ptr %arrayidx36, align 1, !tbaa !5
br label %cleanup
cleanup: ; preds = %while.end21, %while.end34
ret ptr %call
}
; 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 uwtable
define dso_local noalias ptr @get_strings(ptr nocapture noundef readonly %tmp, i32 noundef %pass_flag, i32 noundef %size) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %size, 1
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 3
%call = tail call noalias ptr @malloc(i64 noundef %mul) #10
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %cleanup, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%cmp39 = icmp sgt i32 %pass_flag, 0
br i1 %cmp39, label %while.cond2.preheader.preheader, label %while.cond9.preheader
while.cond2.preheader.preheader: ; preds = %while.cond.preheader
%xtraiter = and i32 %pass_flag, 1
%0 = icmp eq i32 %pass_flag, 1
br i1 %0, label %while.cond9.preheader.loopexit.unr-lcssa, label %while.cond2.preheader.preheader.new
while.cond2.preheader.preheader.new: ; preds = %while.cond2.preheader.preheader
%unroll_iter = and i32 %pass_flag, -2
br label %while.cond2.preheader
while.cond2.preheader: ; preds = %while.end.1, %while.cond2.preheader.preheader.new
%i.040 = phi i64 [ 0, %while.cond2.preheader.preheader.new ], [ %indvars.iv.next.1, %while.end.1 ]
%niter = phi i32 [ 0, %while.cond2.preheader.preheader.new ], [ %niter.next.1, %while.end.1 ]
%sext = shl i64 %i.040, 32
%1 = ashr exact i64 %sext, 32
br label %while.cond2
while.cond9.preheader.loopexit.unr-lcssa.loopexit: ; preds = %while.end.1
%2 = shl i64 %indvars.iv.next.1, 32
%3 = ashr exact i64 %2, 32
br label %while.cond9.preheader.loopexit.unr-lcssa
while.cond9.preheader.loopexit.unr-lcssa: ; preds = %while.cond9.preheader.loopexit.unr-lcssa.loopexit, %while.cond2.preheader.preheader
%indvars.iv.next.lcssa.lcssa.ph = phi i64 [ undef, %while.cond2.preheader.preheader ], [ %indvars.iv.next.1, %while.cond9.preheader.loopexit.unr-lcssa.loopexit ]
%i.040.unr = phi i64 [ 0, %while.cond2.preheader.preheader ], [ %3, %while.cond9.preheader.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %while.cond9.preheader.loopexit, label %while.cond2.epil
while.cond2.epil: ; preds = %while.cond9.preheader.loopexit.unr-lcssa, %while.cond2.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %while.cond2.epil ], [ %i.040.unr, %while.cond9.preheader.loopexit.unr-lcssa ]
%indvars.iv.next.epil = add i64 %indvars.iv.epil, 1
%arrayidx.epil = getelementptr inbounds i8, ptr %tmp, i64 %indvars.iv.epil
%4 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%cmp5.not.epil = icmp eq i8 %4, 10
br i1 %cmp5.not.epil, label %while.cond9.preheader.loopexit, label %while.cond2.epil, !llvm.loop !16
while.cond9.preheader.loopexit: ; preds = %while.cond2.epil, %while.cond9.preheader.loopexit.unr-lcssa
%indvars.iv.next.lcssa.lcssa = phi i64 [ %indvars.iv.next.lcssa.lcssa.ph, %while.cond9.preheader.loopexit.unr-lcssa ], [ %indvars.iv.next.epil, %while.cond2.epil ]
%sext54 = shl i64 %indvars.iv.next.lcssa.lcssa, 32
%5 = ashr exact i64 %sext54, 32
br label %while.cond9.preheader
while.cond9.preheader: ; preds = %while.cond9.preheader.loopexit, %while.cond.preheader
%i.0.lcssa = phi i64 [ 0, %while.cond.preheader ], [ %5, %while.cond9.preheader.loopexit ]
%cmp1142 = icmp sgt i32 %size, 0
br i1 %cmp1142, label %while.body13.lr.ph, label %cleanup.sink.split
while.body13.lr.ph: ; preds = %while.cond9.preheader
%arrayidx15 = getelementptr inbounds i8, ptr %tmp, i64 %i.0.lcssa
%wide.trip.count = zext i32 %size to i64
br label %while.body13
while.cond2: ; preds = %while.cond2.preheader, %while.cond2
%indvars.iv = phi i64 [ %1, %while.cond2.preheader ], [ %indvars.iv.next, %while.cond2 ]
%indvars.iv.next = add i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %tmp, i64 %indvars.iv
%6 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp5.not = icmp eq i8 %6, 10
br i1 %cmp5.not, label %while.end, label %while.cond2, !llvm.loop !16
while.end: ; preds = %while.cond2
%sext.1 = shl i64 %indvars.iv.next, 32
%7 = ashr exact i64 %sext.1, 32
br label %while.cond2.1
while.cond2.1: ; preds = %while.cond2.1, %while.end
%indvars.iv.1 = phi i64 [ %7, %while.end ], [ %indvars.iv.next.1, %while.cond2.1 ]
%indvars.iv.next.1 = add i64 %indvars.iv.1, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %tmp, i64 %indvars.iv.1
%8 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%cmp5.not.1 = icmp eq i8 %8, 10
br i1 %cmp5.not.1, label %while.end.1, label %while.cond2.1, !llvm.loop !16
while.end.1: ; preds = %while.cond2.1
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %while.cond9.preheader.loopexit.unr-lcssa.loopexit, label %while.cond2.preheader, !llvm.loop !17
while.body13: ; preds = %while.body13.lr.ph, %get_string.exit
%indvars.iv50 = phi i64 [ 0, %while.body13.lr.ph ], [ %indvars.iv.next51, %get_string.exit ]
%j.043 = phi i32 [ -1, %while.body13.lr.ph ], [ %indvars52, %get_string.exit ]
%indvars52 = trunc i64 %indvars.iv50 to i32
%cmp56.i = icmp sgt i32 %j.043, -1
br i1 %cmp56.i, label %while.cond1.preheader.i.preheader, label %while.cond7.preheader.i
while.cond1.preheader.i.preheader: ; preds = %while.body13
%xtraiter59 = and i64 %indvars.iv50, 1
%9 = icmp eq i64 %indvars.iv50, 1
br i1 %9, label %while.cond7.preheader.loopexit.i.unr-lcssa, label %while.cond1.preheader.i.preheader.new
while.cond1.preheader.i.preheader.new: ; preds = %while.cond1.preheader.i.preheader
%unroll_iter62 = and i64 %indvars.iv50, 9223372036854775806
br label %while.cond1.preheader.i
while.cond1.preheader.i: ; preds = %while.end.i.1, %while.cond1.preheader.i.preheader.new
%i.057.i = phi i64 [ 0, %while.cond1.preheader.i.preheader.new ], [ %indvars.iv.next.i.1, %while.end.i.1 ]
%niter63 = phi i64 [ 0, %while.cond1.preheader.i.preheader.new ], [ %niter63.next.1, %while.end.i.1 ]
%sext.i = shl i64 %i.057.i, 32
%10 = ashr exact i64 %sext.i, 32
br label %while.cond1.i
while.cond7.preheader.loopexit.i.unr-lcssa: ; preds = %while.end.i.1, %while.cond1.preheader.i.preheader
%indvars.iv.next.i.lcssa.lcssa.ph = phi i64 [ undef, %while.cond1.preheader.i.preheader ], [ %indvars.iv.next.i.1, %while.end.i.1 ]
%i.057.i.unr = phi i64 [ 0, %while.cond1.preheader.i.preheader ], [ %indvars.iv.next.i.1, %while.end.i.1 ]
%lcmp.mod60.not = icmp eq i64 %xtraiter59, 0
br i1 %lcmp.mod60.not, label %while.cond7.preheader.loopexit.i, label %while.cond1.preheader.i.epil
while.cond1.preheader.i.epil: ; preds = %while.cond7.preheader.loopexit.i.unr-lcssa
%sext.i.epil = shl i64 %i.057.i.unr, 32
%11 = ashr exact i64 %sext.i.epil, 32
br label %while.cond1.i.epil
while.cond1.i.epil: ; preds = %while.cond1.i.epil, %while.cond1.preheader.i.epil
%indvars.iv.i.epil = phi i64 [ %11, %while.cond1.preheader.i.epil ], [ %indvars.iv.next.i.epil, %while.cond1.i.epil ]
%indvars.iv.next.i.epil = add i64 %indvars.iv.i.epil, 1
%arrayidx.i.epil = getelementptr inbounds i8, ptr %arrayidx15, i64 %indvars.iv.i.epil
%12 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5
%cmp3.not.i.epil = icmp eq i8 %12, 10
br i1 %cmp3.not.i.epil, label %while.cond7.preheader.loopexit.i, label %while.cond1.i.epil, !llvm.loop !13
while.cond7.preheader.loopexit.i: ; preds = %while.cond1.i.epil, %while.cond7.preheader.loopexit.i.unr-lcssa
%indvars.iv.next.i.lcssa.lcssa = phi i64 [ %indvars.iv.next.i.lcssa.lcssa.ph, %while.cond7.preheader.loopexit.i.unr-lcssa ], [ %indvars.iv.next.i.epil, %while.cond1.i.epil ]
%sext77.i = shl i64 %indvars.iv.next.i.lcssa.lcssa, 32
%13 = ashr exact i64 %sext77.i, 32
br label %while.cond7.preheader.i
while.cond7.preheader.i: ; preds = %while.cond7.preheader.loopexit.i, %while.body13
%i.0.lcssa.i = phi i64 [ 0, %while.body13 ], [ %13, %while.cond7.preheader.loopexit.i ]
%invariant.gep.i = getelementptr i8, ptr %arrayidx15, i64 %i.0.lcssa.i
br label %while.cond7.i
while.cond1.i: ; preds = %while.cond1.i, %while.cond1.preheader.i
%indvars.iv.i = phi i64 [ %10, %while.cond1.preheader.i ], [ %indvars.iv.next.i, %while.cond1.i ]
%indvars.iv.next.i = add i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds i8, ptr %arrayidx15, i64 %indvars.iv.i
%14 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%cmp3.not.i = icmp eq i8 %14, 10
br i1 %cmp3.not.i, label %while.end.i, label %while.cond1.i, !llvm.loop !13
while.end.i: ; preds = %while.cond1.i
%sext.i.1 = shl i64 %indvars.iv.next.i, 32
%15 = ashr exact i64 %sext.i.1, 32
br label %while.cond1.i.1
while.cond1.i.1: ; preds = %while.cond1.i.1, %while.end.i
%indvars.iv.i.1 = phi i64 [ %15, %while.end.i ], [ %indvars.iv.next.i.1, %while.cond1.i.1 ]
%indvars.iv.next.i.1 = add i64 %indvars.iv.i.1, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %arrayidx15, i64 %indvars.iv.i.1
%16 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5
%cmp3.not.i.1 = icmp eq i8 %16, 10
br i1 %cmp3.not.i.1, label %while.end.i.1, label %while.cond1.i.1, !llvm.loop !13
while.end.i.1: ; preds = %while.cond1.i.1
%niter63.next.1 = add i64 %niter63, 2
%niter63.ncmp.1 = icmp eq i64 %niter63.next.1, %unroll_iter62
br i1 %niter63.ncmp.1, label %while.cond7.preheader.loopexit.i.unr-lcssa, label %while.cond1.preheader.i, !llvm.loop !14
while.cond7.i: ; preds = %while.cond7.i, %while.cond7.preheader.i
%indvars.iv71.i = phi i32 [ %indvars.iv.next72.i, %while.cond7.i ], [ -1, %while.cond7.preheader.i ]
%indvars.iv64.i = phi i64 [ %indvars.iv.next65.i, %while.cond7.i ], [ 0, %while.cond7.preheader.i ]
%gep.i = getelementptr i8, ptr %invariant.gep.i, i64 %indvars.iv64.i
%17 = load i8, ptr %gep.i, align 1, !tbaa !5
%18 = add i8 %17, -127
%or.cond.i = icmp ult i8 %18, -95
%indvars.iv.next65.i = add i64 %indvars.iv64.i, 1
%indvars.iv.next72.i = add i32 %indvars.iv71.i, 1
br i1 %or.cond.i, label %while.end21.i, label %while.cond7.i, !llvm.loop !15
while.end21.i: ; preds = %while.cond7.i
%conv23.i = and i64 %indvars.iv.next65.i, 4294967295
%call.i = tail call noalias ptr @malloc(i64 noundef %conv23.i) #10
%tobool.not.i = icmp eq ptr %call.i, null
br i1 %tobool.not.i, label %get_string.exit.thread, label %while.cond24.preheader.i
get_string.exit.thread: ; preds = %while.end21.i
%idxprom1736 = and i64 %indvars.iv50, 4294967295
br label %cleanup.sink.split
while.cond24.preheader.i: ; preds = %while.end21.i
%19 = and i64 %indvars.iv64.i, 4294967295
%cmp2659.not.i = icmp eq i64 %19, 0
br i1 %cmp2659.not.i, label %get_string.exit, label %while.body28.preheader.i
while.body28.preheader.i: ; preds = %while.cond24.preheader.i
tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %call.i, ptr align 1 %invariant.gep.i, i64 %indvars.iv64.i, i1 false), !tbaa !5
%20 = sext i32 %indvars.iv.next72.i to i64
br label %get_string.exit
get_string.exit: ; preds = %while.cond24.preheader.i, %while.body28.preheader.i
%inc25.lcssa.i = phi i64 [ 0, %while.cond24.preheader.i ], [ %20, %while.body28.preheader.i ]
%arrayidx36.i = getelementptr inbounds i8, ptr %call.i, i64 %inc25.lcssa.i
store i8 0, ptr %arrayidx36.i, align 1, !tbaa !5
%arrayidx18 = getelementptr inbounds ptr, ptr %call, i64 %indvars.iv50
store ptr %call.i, ptr %arrayidx18, align 8, !tbaa !18
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond53.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count
br i1 %exitcond53.not, label %while.end22.loopexit, label %while.body13, !llvm.loop !20
while.end22.loopexit: ; preds = %get_string.exit
%21 = sext i32 %size to i64
br label %cleanup.sink.split
cleanup.sink.split: ; preds = %while.cond9.preheader, %while.end22.loopexit, %get_string.exit.thread
%idxprom1736.sink = phi i64 [ %idxprom1736, %get_string.exit.thread ], [ 0, %while.cond9.preheader ], [ %21, %while.end22.loopexit ]
%retval.0.ph = phi ptr [ null, %get_string.exit.thread ], [ %call, %while.cond9.preheader ], [ %call, %while.end22.loopexit ]
%arrayidx1837 = getelementptr inbounds ptr, ptr %call, i64 %idxprom1736.sink
store ptr null, ptr %arrayidx1837, align 8, !tbaa !18
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %entry
%retval.0 = phi ptr [ null, %entry ], [ %retval.0.ph, %cleanup.sink.split ]
ret ptr %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @get_ans(ptr nocapture noundef readonly %nums, ptr nocapture noundef readonly %arr, i32 noundef %i, ptr nocapture noundef %y) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %nums, align 4, !tbaa !10
%1 = zext i32 %0 to i64
%vla = alloca i32, i64 %1, align 16
%inc85 = add nsw i32 %i, 1
%cmp86 = icmp slt i32 %inc85, %0
br i1 %cmp86, label %land.rhs.lr.ph, label %while.cond28.preheader
land.rhs.lr.ph: ; preds = %entry
%arrayidx5 = getelementptr inbounds i32, ptr %nums, i64 1
%2 = load i32, ptr %arrayidx5, align 4, !tbaa !10
%3 = icmp sgt i32 %2, 0
%4 = sext i32 %i to i64
br i1 %3, label %land.rhs.preheader, label %land.rhs.lr.ph.split.us
land.rhs.preheader: ; preds = %land.rhs.lr.ph
%5 = add nsw i64 %4, 1
br label %land.rhs
land.rhs.lr.ph.split.us: ; preds = %land.rhs.lr.ph
%6 = shl nsw i64 %4, 2
%7 = getelementptr i8, ptr %vla, i64 %6
%scevgep = getelementptr i8, ptr %7, i64 4
%8 = add i32 %i, 2
%smax = tail call i32 @llvm.smax.i32(i32 %0, i32 %8)
%9 = add i32 %smax, -2
%10 = sub i32 %9, %i
%11 = zext i32 %10 to i64
%12 = shl nuw nsw i64 %11, 2
%13 = add nuw nsw i64 %12, 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i8 0, i64 %13, i1 false), !tbaa !10
br label %while.cond28.preheader
while.cond.loopexit.loopexit: ; preds = %if.end
%.pre104 = load i32, ptr %nums, align 4, !tbaa !10
br label %while.cond.loopexit
while.cond.loopexit: ; preds = %while.cond.loopexit.loopexit, %land.rhs
%14 = phi i32 [ %.pre104, %while.cond.loopexit.loopexit ], [ %19, %land.rhs ]
%15 = phi i32 [ %27, %while.cond.loopexit.loopexit ], [ %20, %land.rhs ]
%16 = phi i32 [ %27, %while.cond.loopexit.loopexit ], [ %21, %land.rhs ]
%indvars.iv.next96 = add nsw i64 %indvars.iv95, 1
%17 = sext i32 %14 to i64
%cmp = icmp slt i64 %indvars.iv.next96, %17
br i1 %cmp, label %land.rhs, label %while.cond28.preheader, !llvm.loop !21
while.cond28.preheader: ; preds = %while.cond.loopexit, %land.rhs.lr.ph.split.us, %entry
%18 = phi i32 [ %0, %land.rhs.lr.ph.split.us ], [ %0, %entry ], [ %14, %while.cond.loopexit ]
%cmp3190 = icmp sgt i32 %18, 0
br i1 %cmp3190, label %while.body33.lr.ph, label %while.end60
while.body33.lr.ph: ; preds = %while.cond28.preheader
%arrayidx36 = getelementptr inbounds i32, ptr %nums, i64 1
br label %while.body33
land.rhs: ; preds = %land.rhs.preheader, %while.cond.loopexit
%19 = phi i32 [ %0, %land.rhs.preheader ], [ %14, %while.cond.loopexit ]
%20 = phi i32 [ %2, %land.rhs.preheader ], [ %15, %while.cond.loopexit ]
%21 = phi i32 [ %2, %land.rhs.preheader ], [ %16, %while.cond.loopexit ]
%indvars.iv95 = phi i64 [ %5, %land.rhs.preheader ], [ %indvars.iv.next96, %while.cond.loopexit ]
%arrayidx2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv95
store i32 0, ptr %arrayidx2, align 4, !tbaa !10
%cmp683 = icmp sgt i32 %21, 0
br i1 %cmp683, label %while.body7.lr.ph, label %while.cond.loopexit
while.body7.lr.ph: ; preds = %land.rhs
%arrayidx9 = getelementptr inbounds ptr, ptr %arr, i64 %indvars.iv95
%22 = load ptr, ptr %arrayidx9, align 8, !tbaa !18
br label %while.body7
while.body7: ; preds = %while.body7.lr.ph, %if.end
%23 = phi i32 [ %20, %while.body7.lr.ph ], [ %27, %if.end ]
%24 = phi i32 [ 0, %while.body7.lr.ph ], [ %28, %if.end ]
%indvars.iv = phi i64 [ 0, %while.body7.lr.ph ], [ %indvars.iv.next, %if.end ]
%arrayidx11 = getelementptr inbounds i8, ptr %22, i64 %indvars.iv
%25 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%cmp12 = icmp eq i8 %25, 46
br i1 %cmp12, label %cond.true, label %if.end
cond.true: ; preds = %while.body7
%inc23 = add nsw i32 %24, 1
store i32 %inc23, ptr %arrayidx2, align 4, !tbaa !10
%arrayidx25 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv
%26 = load i32, ptr %arrayidx25, align 4, !tbaa !10
%inc26 = add nsw i32 %26, 1
store i32 %inc26, ptr %arrayidx25, align 4, !tbaa !10
%.pre = load i32, ptr %arrayidx5, align 4, !tbaa !10
br label %if.end
if.end: ; preds = %cond.true, %while.body7
%27 = phi i32 [ %.pre, %cond.true ], [ %23, %while.body7 ]
%28 = phi i32 [ %inc23, %cond.true ], [ %24, %while.body7 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%29 = sext i32 %27 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %29
br i1 %cmp6, label %while.body7, label %while.cond.loopexit.loopexit, !llvm.loop !23
while.body33: ; preds = %while.body33.lr.ph, %while.cond28.backedge
%30 = phi i32 [ %18, %while.body33.lr.ph ], [ %39, %while.cond28.backedge ]
%indvars.iv101 = phi i64 [ 0, %while.body33.lr.ph ], [ %indvars.iv.next102, %while.cond28.backedge ]
%arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv101
%31 = load i32, ptr %arrayidx35, align 4, !tbaa !10
%32 = load i32, ptr %arrayidx36, align 4, !tbaa !10
%cmp37 = icmp eq i32 %31, %32
br i1 %cmp37, label %while.cond28.backedge, label %while.cond41.preheader
while.cond41.preheader: ; preds = %while.body33
%cmp4488 = icmp sgt i32 %32, 0
br i1 %cmp4488, label %while.body46.lr.ph, label %while.end58
while.body46.lr.ph: ; preds = %while.cond41.preheader
%arrayidx55 = getelementptr inbounds ptr, ptr %arr, i64 %indvars.iv101
br label %while.body46
while.body46: ; preds = %while.body46.lr.ph, %while.cond41.backedge
%33 = phi i32 [ %32, %while.body46.lr.ph ], [ %37, %while.cond41.backedge ]
%indvars.iv98 = phi i64 [ 0, %while.body46.lr.ph ], [ %indvars.iv.next99, %while.cond41.backedge ]
%arrayidx48 = getelementptr inbounds i32, ptr %y, i64 %indvars.iv98
%34 = load i32, ptr %arrayidx48, align 4, !tbaa !10
%35 = load i32, ptr %nums, align 4, !tbaa !10
%cmp50 = icmp eq i32 %34, %35
br i1 %cmp50, label %while.cond41.backedge, label %if.end53
if.end53: ; preds = %while.body46
%36 = load ptr, ptr %arrayidx55, align 8, !tbaa !18
%arrayidx57 = getelementptr inbounds i8, ptr %36, i64 %indvars.iv98
%call = tail call i64 @write(i32 noundef 1, ptr noundef %arrayidx57, i64 noundef 1) #11
%.pre105 = load i32, ptr %arrayidx36, align 4, !tbaa !10
br label %while.cond41.backedge
while.cond41.backedge: ; preds = %if.end53, %while.body46
%37 = phi i32 [ %.pre105, %if.end53 ], [ %33, %while.body46 ]
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%38 = sext i32 %37 to i64
%cmp44 = icmp slt i64 %indvars.iv.next99, %38
br i1 %cmp44, label %while.body46, label %while.end58, !llvm.loop !24
while.end58: ; preds = %while.cond41.backedge, %while.cond41.preheader
%call59 = tail call i64 @write(i32 noundef 1, ptr noundef nonnull @.str, i64 noundef 1) #11
%.pre106 = load i32, ptr %nums, align 4, !tbaa !10
br label %while.cond28.backedge
while.cond28.backedge: ; preds = %while.end58, %while.body33
%39 = phi i32 [ %.pre106, %while.end58 ], [ %30, %while.body33 ]
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%40 = sext i32 %39 to i64
%cmp31 = icmp slt i64 %indvars.iv.next102, %40
br i1 %cmp31, label %while.body33, label %while.end60, !llvm.loop !25
while.end60: ; preds = %while.cond28.backedge, %while.cond28.preheader
ret void
}
; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #4
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%s = alloca [10200 x i8], align 16
%nums = alloca [2 x i32], align 4
call void @llvm.lifetime.start.p0(i64 10200, ptr nonnull %s) #11
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %nums) #11
%call = call i64 @read(i32 noundef 0, ptr noundef nonnull %s, i64 noundef 10200) #11
%0 = and i64 %call, 4294967295
%cmp = icmp eq i64 %0, 4294967295
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%sext = shl i64 %call, 32
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [10200 x i8], ptr %s, i64 0, i64 %idxprom
store i8 0, ptr %arrayidx, align 1, !tbaa !5
br label %while.cond.outer.i
while.cond.outer.i: ; preds = %while.end.i, %if.end
%indvars.iv56.i = phi i64 [ %indvars.iv.next57.i, %while.end.i ], [ 0, %if.end ]
%i.0.ph.i = phi i64 [ %i.1.lcssa.i, %while.end.i ], [ 0, %if.end ]
%sext.i = shl i64 %i.0.ph.i, 32
%1 = ashr exact i64 %sext.i, 32
br label %while.cond.i
while.cond.i: ; preds = %if.end.i, %while.cond.outer.i
%indvars.iv.i = phi i64 [ %1, %while.cond.outer.i ], [ %indvars.iv.next.i, %if.end.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i
%2 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
switch i8 %2, label %while.cond10.preheader.i [
i8 0, label %get_nums.exit
i8 10, label %get_nums.exit
i8 32, label %if.end.i
]
while.cond10.preheader.i: ; preds = %while.cond.i
%sext59.i = shl i64 %indvars.iv.i, 32
%idxprom1145.i = ashr exact i64 %sext59.i, 32
%arrayidx1246.i = getelementptr inbounds i8, ptr %s, i64 %idxprom1145.i
%3 = load i8, ptr %arrayidx1246.i, align 1, !tbaa !5
%4 = add i8 %3, -48
%or.cond47.i = icmp ult i8 %4, 10
br i1 %or.cond47.i, label %while.body23.i, label %while.end.i
while.body23.i: ; preds = %while.cond10.preheader.i, %while.body23.i
%indvars.iv54.i = phi i64 [ %indvars.iv.next55.i, %while.body23.i ], [ %indvars.iv.i, %while.cond10.preheader.i ]
%5 = phi i8 [ %6, %while.body23.i ], [ %3, %while.cond10.preheader.i ]
%num.048.i = phi i32 [ %sub.i, %while.body23.i ], [ 0, %while.cond10.preheader.i ]
%conv13.i = zext i8 %5 to i32
%mul.i = mul nsw i32 %num.048.i, 10
%indvars.iv.next55.i = add i64 %indvars.iv54.i, 1
%add.i = add nsw i32 %conv13.i, -48
%sub.i = add i32 %add.i, %mul.i
%arrayidx12.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next55.i
%6 = load i8, ptr %arrayidx12.i, align 1, !tbaa !5
%7 = add i8 %6, -48
%or.cond.i = icmp ult i8 %7, 10
br i1 %or.cond.i, label %while.body23.i, label %while.end.i, !llvm.loop !8
while.end.i: ; preds = %while.body23.i, %while.cond10.preheader.i
%num.0.lcssa.i = phi i32 [ 0, %while.cond10.preheader.i ], [ %sub.i, %while.body23.i ]
%i.1.lcssa.i = phi i64 [ %indvars.iv.i, %while.cond10.preheader.i ], [ %indvars.iv.next55.i, %while.body23.i ]
%indvars.iv.next57.i = add i64 %indvars.iv56.i, 1
%arrayidx29.i = getelementptr inbounds i32, ptr %nums, i64 %indvars.iv56.i
store i32 %num.0.lcssa.i, ptr %arrayidx29.i, align 4, !tbaa !10
br label %while.cond.outer.i, !llvm.loop !12
if.end.i: ; preds = %while.cond.i
%indvars.iv.next.i = add i64 %indvars.iv.i, 1
br label %while.cond.i, !llvm.loop !12
get_nums.exit: ; preds = %while.cond.i, %while.cond.i
%8 = load i32, ptr %nums, align 4, !tbaa !10
%call6 = call ptr @get_strings(ptr noundef nonnull %s, i32 noundef 1, i32 noundef %8)
%arrayidx7 = getelementptr inbounds [2 x i32], ptr %nums, i64 0, i64 1
%9 = load i32, ptr %arrayidx7, align 4, !tbaa !10
%conv8 = sext i32 %9 to i64
%mul = shl nsw i64 %conv8, 2
%call9 = tail call noalias ptr @malloc(i64 noundef %mul) #10
%tobool.not = icmp eq ptr %call9, null
br i1 %tobool.not, label %cleanup, label %while.cond.preheader
while.cond.preheader: ; preds = %get_nums.exit
%cmp1340 = icmp sgt i32 %9, 0
br i1 %cmp1340, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %while.cond.preheader
%10 = zext i32 %9 to i64
%11 = shl nuw nsw i64 %10, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %call9, i8 0, i64 %11, i1 false), !tbaa !10
br label %while.end
while.end: ; preds = %while.body.preheader, %while.cond.preheader
call void @get_ans(ptr noundef nonnull %nums, ptr noundef %call6, i32 noundef -1, ptr noundef nonnull %call9)
%cmp2142 = icmp sgt i32 %8, 0
br i1 %cmp2142, label %while.body23.preheader, label %while.end26
while.body23.preheader: ; preds = %while.end
%wide.trip.count = zext i32 %8 to i64
br label %while.body23
while.body23: ; preds = %while.body23.preheader, %while.body23
%indvars.iv = phi i64 [ 0, %while.body23.preheader ], [ %indvars.iv.next, %while.body23 ]
%arrayidx25 = getelementptr inbounds ptr, ptr %call6, i64 %indvars.iv
%12 = load ptr, ptr %arrayidx25, align 8, !tbaa !18
tail call void @free(ptr noundef %12) #11
%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 %while.end26, label %while.body23, !llvm.loop !26
while.end26: ; preds = %while.body23, %while.end
tail call void @free(ptr noundef %call6) #11
tail call void @free(ptr noundef %call9) #11
br label %cleanup
cleanup: ; preds = %get_nums.exit, %entry, %while.end26
%retval.0 = phi i32 [ 0, %while.end26 ], [ -1, %entry ], [ -1, %get_nums.exit ]
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %nums) #11
call void @llvm.lifetime.end.p0(i64 10200, ptr nonnull %s) #11
ret i32 %retval.0
}
; Function Attrs: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #4
; 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: 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) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #9
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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = distinct !{!15, !9}
!16 = distinct !{!16, !9}
!17 = distinct !{!17, !9}
!18 = !{!19, !19, i64 0}
!19 = !{!"any pointer", !6, i64 0}
!20 = distinct !{!20, !9}
!21 = distinct !{!21, !9, !22}
!22 = !{!"llvm.loop.unswitch.partial.disable"}
!23 = distinct !{!23, !9}
!24 = distinct !{!24, !9}
!25 = distinct !{!25, !9}
!26 = distinct !{!26, !9}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <assert.h>
#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
#define TURN(a) (a==1?0:1)
#define SENTINEL 1000000007
typedef long long ll;
int main()
{
int h, w, i, j;
char s[100][100];
int maskh[100]={0}, maskw[100]={0};
scanf("%d %d",&h, &w);
for(i=0; i<h; i++) {
scanf("%s",&s[i]);
}
for(i=0; i<h; i++) {
for(j=0; j<w; j++) {
if(s[i][j]=='#') {
maskh[i] = 1;
maskw[j] = 1;
}
}
}
for(i=0; i<h; i++) {
if(maskh[i]==1) {
for(j=0; j<w; j++) {
if(maskw[j]==1)
printf("%c",s[i][j]);
}
puts("");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133297/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133297/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\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
%s = alloca [100 x [100 x i8]], align 16
%maskh = alloca [100 x i32], align 16
%maskw = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %maskh) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %maskh, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %maskw) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %maskw, i8 0, i64 400, i1 false)
%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
%cmp75 = icmp sgt i32 %0, 0
br i1 %cmp75, label %for.body, label %for.end56
for.cond2.preheader: ; preds = %for.body
%cmp379 = icmp sgt i32 %6, 0
br i1 %cmp379, label %for.cond5.preheader.lr.ph, label %for.end56
for.cond5.preheader.lr.ph: ; preds = %for.cond2.preheader
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp677 = icmp sgt i32 %1, 0
br i1 %cmp677, label %for.cond5.preheader.us.preheader, label %for.body27.preheader
for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph
%wide.trip.count94 = zext i32 %6 to i64
%wide.trip.count = zext i32 %1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i32 %1, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc21_crit_edge.us
%indvars.iv91 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next92, %for.cond5.for.inc21_crit_edge.us ]
%arrayidx15.us = getelementptr inbounds [100 x i32], ptr %maskh, i64 0, i64 %indvars.iv91
br i1 %2, label %for.cond5.for.inc21_crit_edge.us.unr-lcssa, label %for.body7.us
for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc18.us.1
%indvars.iv88 = phi i64 [ %indvars.iv.next89.1, %for.inc18.us.1 ], [ 0, %for.cond5.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc18.us.1 ], [ 0, %for.cond5.preheader.us ]
%arrayidx11.us = getelementptr inbounds [100 x [100 x i8]], ptr %s, i64 0, i64 %indvars.iv91, i64 %indvars.iv88
%3 = load i8, ptr %arrayidx11.us, align 2, !tbaa !9
%cmp12.us = icmp eq i8 %3, 35
br i1 %cmp12.us, label %if.then.us, label %for.inc18.us
if.then.us: ; preds = %for.body7.us
store i32 1, ptr %arrayidx15.us, align 4, !tbaa !5
%arrayidx17.us = getelementptr inbounds [100 x i32], ptr %maskw, i64 0, i64 %indvars.iv88
store i32 1, ptr %arrayidx17.us, align 8, !tbaa !5
br label %for.inc18.us
for.inc18.us: ; preds = %if.then.us, %for.body7.us
%indvars.iv.next89 = or i64 %indvars.iv88, 1
%arrayidx11.us.1 = getelementptr inbounds [100 x [100 x i8]], ptr %s, i64 0, i64 %indvars.iv91, i64 %indvars.iv.next89
%4 = load i8, ptr %arrayidx11.us.1, align 1, !tbaa !9
%cmp12.us.1 = icmp eq i8 %4, 35
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc18.us.1
if.then.us.1: ; preds = %for.inc18.us
store i32 1, ptr %arrayidx15.us, align 4, !tbaa !5
%arrayidx17.us.1 = getelementptr inbounds [100 x i32], ptr %maskw, i64 0, i64 %indvars.iv.next89
store i32 1, ptr %arrayidx17.us.1, align 4, !tbaa !5
br label %for.inc18.us.1
for.inc18.us.1: ; preds = %if.then.us.1, %for.inc18.us
%indvars.iv.next89.1 = add nuw nsw i64 %indvars.iv88, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond5.for.inc21_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !10
for.cond5.for.inc21_crit_edge.us.unr-lcssa: ; preds = %for.inc18.us.1, %for.cond5.preheader.us
%indvars.iv88.unr = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next89.1, %for.inc18.us.1 ]
br i1 %lcmp.mod.not, label %for.cond5.for.inc21_crit_edge.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond5.for.inc21_crit_edge.us.unr-lcssa
%arrayidx11.us.epil = getelementptr inbounds [100 x [100 x i8]], ptr %s, i64 0, i64 %indvars.iv91, i64 %indvars.iv88.unr
%5 = load i8, ptr %arrayidx11.us.epil, align 1, !tbaa !9
%cmp12.us.epil = icmp eq i8 %5, 35
br i1 %cmp12.us.epil, label %if.then.us.epil, label %for.cond5.for.inc21_crit_edge.us
if.then.us.epil: ; preds = %for.body7.us.epil
store i32 1, ptr %arrayidx15.us, align 4, !tbaa !5
%arrayidx17.us.epil = getelementptr inbounds [100 x i32], ptr %maskw, i64 0, i64 %indvars.iv88.unr
store i32 1, ptr %arrayidx17.us.epil, align 4, !tbaa !5
br label %for.cond5.for.inc21_crit_edge.us
for.cond5.for.inc21_crit_edge.us: ; preds = %for.body7.us.epil, %if.then.us.epil, %for.cond5.for.inc21_crit_edge.us.unr-lcssa
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count94
br i1 %exitcond95.not, label %for.cond24.preheader, label %for.cond5.preheader.us, !llvm.loop !12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x [100 x i8]], ptr %s, 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
%6 = load i32, ptr %h, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.cond24.preheader: ; preds = %for.cond5.for.inc21_crit_edge.us
br i1 %cmp379, label %for.body27.preheader, label %for.end56
for.body27.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.cond24.preheader
br label %for.body27
for.body27: ; preds = %for.body27.preheader, %for.inc54
%8 = phi i32 [ %16, %for.inc54 ], [ %6, %for.body27.preheader ]
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.inc54 ], [ 0, %for.body27.preheader ]
%arrayidx29 = getelementptr inbounds [100 x i32], ptr %maskh, i64 0, i64 %indvars.iv99
%9 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%cmp30 = icmp eq i32 %9, 1
br i1 %cmp30, label %for.cond33.preheader, label %for.inc54
for.cond33.preheader: ; preds = %for.body27
%10 = load i32, ptr %w, align 4, !tbaa !5
%cmp3481 = icmp sgt i32 %10, 0
br i1 %cmp3481, label %for.body36, label %for.end51
for.body36: ; preds = %for.cond33.preheader, %for.inc49
%11 = phi i32 [ %14, %for.inc49 ], [ %10, %for.cond33.preheader ]
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.inc49 ], [ 0, %for.cond33.preheader ]
%arrayidx38 = getelementptr inbounds [100 x i32], ptr %maskw, i64 0, i64 %indvars.iv96
%12 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%cmp39 = icmp eq i32 %12, 1
br i1 %cmp39, label %if.then41, label %for.inc49
if.then41: ; preds = %for.body36
%arrayidx45 = getelementptr inbounds [100 x [100 x i8]], ptr %s, i64 0, i64 %indvars.iv99, i64 %indvars.iv96
%13 = load i8, ptr %arrayidx45, align 1, !tbaa !9
%conv46 = sext i8 %13 to i32
%putchar74 = call i32 @putchar(i32 %conv46)
%.pre = load i32, ptr %w, align 4, !tbaa !5
br label %for.inc49
for.inc49: ; preds = %for.body36, %if.then41
%14 = phi i32 [ %11, %for.body36 ], [ %.pre, %if.then41 ]
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%15 = sext i32 %14 to i64
%cmp34 = icmp slt i64 %indvars.iv.next97, %15
br i1 %cmp34, label %for.body36, label %for.end51, !llvm.loop !14
for.end51: ; preds = %for.inc49, %for.cond33.preheader
%putchar = call i32 @putchar(i32 10)
%.pre102 = load i32, ptr %h, align 4, !tbaa !5
br label %for.inc54
for.inc54: ; preds = %for.body27, %for.end51
%16 = phi i32 [ %8, %for.body27 ], [ %.pre102, %for.end51 ]
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%17 = sext i32 %16 to i64
%cmp25 = icmp slt i64 %indvars.iv.next100, %17
br i1 %cmp25, label %for.body27, label %for.end56, !llvm.loop !15
for.end56: ; preds = %for.inc54, %entry, %for.cond2.preheader, %for.cond24.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %maskw) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %maskh) #5
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
ret i32 0
}
; 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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = !{!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}
|
#include<stdio.h>
int main()
{
int a,b,c,d=0,i,j,k=0,x;
scanf("%d %d %d",&a,&b,&c);
if(1<a<100&&1<b<100&&1<c<1000)
{
for(i=0;i<=c/a;i++)
{
for(j=0;j<=c/b;j++)
{
d=a*i+b*j;
if(d==c)
{ k=1;
break;}
}
}
if(k==1)
printf("Yes");
else
printf("No");
}
else
printf("Wrong input");
return 0;}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13334/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13334/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%cmp12.not42 = icmp slt i32 %div, 0
br i1 %cmp12.not42, label %if.else, label %for.cond14.preheader.lr.ph
for.cond14.preheader.lr.ph: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%div15 = sdiv i32 %0, %2
%cmp16.not39 = icmp slt i32 %div15, 0
br i1 %cmp16.not39, label %if.else, label %for.cond14.preheader.outer
for.cond14.preheader.outer: ; preds = %for.cond14.preheader.lr.ph, %for.inc23.thread
%3 = phi i1 [ true, %for.inc23.thread ], [ false, %for.cond14.preheader.lr.ph ]
%i.043.ph = phi i32 [ %inc2449, %for.inc23.thread ], [ 0, %for.cond14.preheader.lr.ph ]
br label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.cond14.preheader.outer, %for.inc23
%i.043 = phi i32 [ %inc24, %for.inc23 ], [ %i.043.ph, %for.cond14.preheader.outer ]
%mul = mul nsw i32 %1, %i.043
br label %for.body18
for.cond14: ; preds = %for.body18
%inc = add nuw i32 %j.040, 1
%exitcond.not = icmp eq i32 %j.040, %div15
br i1 %exitcond.not, label %for.inc23, label %for.body18, !llvm.loop !9
for.body18: ; preds = %for.cond14.preheader, %for.cond14
%j.040 = phi i32 [ 0, %for.cond14.preheader ], [ %inc, %for.cond14 ]
%mul19 = mul nsw i32 %2, %j.040
%add = add nsw i32 %mul19, %mul
%cmp20 = icmp eq i32 %add, %0
br i1 %cmp20, label %for.inc23.thread, label %for.cond14
for.inc23: ; preds = %for.cond14
%inc24 = add nuw i32 %i.043, 1
%exitcond46.not = icmp eq i32 %i.043, %div
br i1 %exitcond46.not, label %for.end25, label %for.cond14.preheader, !llvm.loop !11
for.inc23.thread: ; preds = %for.body18
%inc2449 = add nuw i32 %i.043, 1
%exitcond46.not50 = icmp eq i32 %i.043, %div
br i1 %exitcond46.not50, label %if.end34, label %for.cond14.preheader.outer, !llvm.loop !11
for.end25: ; preds = %for.inc23
br i1 %3, label %if.end34, label %if.else
if.else: ; preds = %for.cond14.preheader.lr.ph, %entry, %for.end25
br label %if.end34
if.end34: ; preds = %for.inc23.thread, %for.end25, %if.else
%.str.1.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.end25 ], [ @.str.1, %for.inc23.thread ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int h,w,i,j,k,l;
char a[100][100];
scanf("%d %d",&h,&w);
for (i=0;i<h;) {
for (j=k=0;j<w;j++) {
scanf(" %c",&a[i][j]);
if (a[i][j]=='#') k=1;
}
if (k==0) h--;
else i++;
}
for (j=k=0;j<w;j++) {
for (i=l=0;i<h;i++) {
a[i][k]=a[i][j];
if (a[i][k]=='#') l=1;
}
if (l==1) k++;
}
for (i=0;i<h;i++) {
for (j=0;j<k;j++) printf("%c",a[i][j]);
puts("");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133383/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133383/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\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
%a = alloca [100 x [100 x i8]], align 16
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 void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %a) #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
%cmp106 = icmp sgt i32 %0, 0
%.pre142 = load i32, ptr %w, align 4, !tbaa !5
br i1 %cmp106, label %for.cond1.preheader.lr.ph, label %for.cond19.preheader
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = icmp sgt i32 %.pre142, 0
br i1 %1, label %for.cond1.preheader, label %for.end75
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %if.end17
%2 = phi i32 [ %15, %if.end17 ], [ %.pre142, %for.cond1.preheader.lr.ph ]
%i.0107 = phi i32 [ %i.1, %if.end17 ], [ 0, %for.cond1.preheader.lr.ph ]
%cmp2103 = icmp sgt i32 %2, 0
br i1 %cmp2103, label %for.body3.lr.ph, label %if.then15
for.body3.lr.ph: ; preds = %for.cond1.preheader
%idxprom = sext i32 %i.0107 to i64
br label %for.body3
for.cond19.preheader: ; preds = %if.end17, %entry
%3 = phi i32 [ %.pre142, %entry ], [ %15, %if.end17 ]
%4 = phi i32 [ %0, %entry ], [ %16, %if.end17 ]
%cmp20113 = icmp sgt i32 %3, 0
%cmp24109 = icmp sgt i32 %4, 0
br i1 %cmp20113, label %for.cond23.preheader.lr.ph, label %for.cond55.preheader.thread148
for.cond23.preheader.lr.ph: ; preds = %for.cond19.preheader
br i1 %cmp24109, label %for.cond23.preheader.us.preheader, label %for.end75
for.cond23.preheader.us.preheader: ; preds = %for.cond23.preheader.lr.ph
%wide.trip.count132 = zext i32 %3 to i64
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %4, 1
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond23.preheader.us
for.cond23.preheader.us: ; preds = %for.cond23.preheader.us.preheader, %for.cond23.for.end46_crit_edge.us
%indvars.iv129 = phi i64 [ 0, %for.cond23.preheader.us.preheader ], [ %indvars.iv.next130, %for.cond23.for.end46_crit_edge.us ]
%k.2115.us = phi i32 [ 0, %for.cond23.preheader.us.preheader ], [ %spec.select102.us, %for.cond23.for.end46_crit_edge.us ]
%idxprom33.us = zext i32 %k.2115.us to i64
br i1 %5, label %for.cond23.for.end46_crit_edge.us.unr-lcssa, label %for.body26.us
for.body26.us: ; preds = %for.cond23.preheader.us, %for.body26.us
%indvars.iv126 = phi i64 [ %indvars.iv.next127.1, %for.body26.us ], [ 0, %for.cond23.preheader.us ]
%l.0111.us = phi i32 [ %spec.select101.us.1, %for.body26.us ], [ 0, %for.cond23.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.body26.us ], [ 0, %for.cond23.preheader.us ]
%arrayidx30.us = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv126, i64 %indvars.iv129
%6 = load i8, ptr %arrayidx30.us, align 1, !tbaa !9
%arrayidx34.us = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv126, i64 %idxprom33.us
store i8 %6, ptr %arrayidx34.us, align 1, !tbaa !9
%cmp40.us = icmp eq i8 %6, 35
%indvars.iv.next127 = or i64 %indvars.iv126, 1
%arrayidx30.us.1 = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv.next127, i64 %indvars.iv129
%7 = load i8, ptr %arrayidx30.us.1, align 1, !tbaa !9
%arrayidx34.us.1 = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv.next127, i64 %idxprom33.us
store i8 %7, ptr %arrayidx34.us.1, align 1, !tbaa !9
%cmp40.us.1 = icmp eq i8 %7, 35
%8 = select i1 %cmp40.us.1, i1 true, i1 %cmp40.us
%spec.select101.us.1 = select i1 %8, i32 1, i32 %l.0111.us
%indvars.iv.next127.1 = add nuw nsw i64 %indvars.iv126, 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.cond23.for.end46_crit_edge.us.unr-lcssa, label %for.body26.us, !llvm.loop !10
for.cond23.for.end46_crit_edge.us.unr-lcssa: ; preds = %for.body26.us, %for.cond23.preheader.us
%spec.select101.us.lcssa.ph = phi i32 [ undef, %for.cond23.preheader.us ], [ %spec.select101.us.1, %for.body26.us ]
%indvars.iv126.unr = phi i64 [ 0, %for.cond23.preheader.us ], [ %indvars.iv.next127.1, %for.body26.us ]
%l.0111.us.unr = phi i32 [ 0, %for.cond23.preheader.us ], [ %spec.select101.us.1, %for.body26.us ]
br i1 %lcmp.mod.not, label %for.cond23.for.end46_crit_edge.us, label %for.body26.us.epil
for.body26.us.epil: ; preds = %for.cond23.for.end46_crit_edge.us.unr-lcssa
%arrayidx30.us.epil = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv126.unr, i64 %indvars.iv129
%9 = load i8, ptr %arrayidx30.us.epil, align 1, !tbaa !9
%arrayidx34.us.epil = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv126.unr, i64 %idxprom33.us
store i8 %9, ptr %arrayidx34.us.epil, align 1, !tbaa !9
%cmp40.us.epil = icmp eq i8 %9, 35
%spec.select101.us.epil = select i1 %cmp40.us.epil, i32 1, i32 %l.0111.us.unr
br label %for.cond23.for.end46_crit_edge.us
for.cond23.for.end46_crit_edge.us: ; preds = %for.cond23.for.end46_crit_edge.us.unr-lcssa, %for.body26.us.epil
%spec.select101.us.lcssa = phi i32 [ %spec.select101.us.lcssa.ph, %for.cond23.for.end46_crit_edge.us.unr-lcssa ], [ %spec.select101.us.epil, %for.body26.us.epil ]
%cmp47.us = icmp eq i32 %spec.select101.us.lcssa, 1
%inc50.us = zext i1 %cmp47.us to i32
%spec.select102.us = add nuw nsw i32 %k.2115.us, %inc50.us
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%exitcond133.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count132
br i1 %exitcond133.not, label %for.cond55.preheader, label %for.cond23.preheader.us, !llvm.loop !12
for.body3: ; preds = %for.body3.lr.ph, %for.body3
%indvars.iv = phi i64 [ 0, %for.body3.lr.ph ], [ %indvars.iv.next, %for.body3 ]
%k.0105 = phi i32 [ 0, %for.body3.lr.ph ], [ %spec.select, %for.body3 ]
%arrayidx5 = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %idxprom, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%10 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%cmp11 = icmp eq i8 %10, 35
%spec.select = select i1 %cmp11, i32 1, i32 %k.0105
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %w, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp2, label %for.body3, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body3
%cmp13 = icmp eq i32 %spec.select, 0
br i1 %cmp13, label %if.then15, label %if.else
if.then15: ; preds = %for.cond1.preheader, %for.end
%13 = phi i32 [ %11, %for.end ], [ %2, %for.cond1.preheader ]
%14 = load i32, ptr %h, align 4, !tbaa !5
%dec = add nsw i32 %14, -1
store i32 %dec, ptr %h, align 4, !tbaa !5
br label %if.end17
if.else: ; preds = %for.end
%inc16 = add nsw i32 %i.0107, 1
%.pre = load i32, ptr %h, align 4, !tbaa !5
br label %if.end17
if.end17: ; preds = %if.else, %if.then15
%15 = phi i32 [ %13, %if.then15 ], [ %11, %if.else ]
%16 = phi i32 [ %dec, %if.then15 ], [ %.pre, %if.else ]
%i.1 = phi i32 [ %i.0107, %if.then15 ], [ %inc16, %if.else ]
%cmp = icmp slt i32 %i.1, %16
br i1 %cmp, label %for.cond1.preheader, label %for.cond19.preheader, !llvm.loop !14
for.cond55.preheader: ; preds = %for.cond23.for.end46_crit_edge.us
%cmp56120 = icmp sgt i32 %4, 0
br i1 %cmp56120, label %for.cond59.preheader.lr.ph, label %for.end75
for.cond55.preheader.thread148: ; preds = %for.cond19.preheader
br i1 %cmp24109, label %for.cond59.preheader.preheader, label %for.end75
for.cond59.preheader.lr.ph: ; preds = %for.cond55.preheader
%cmp60118.not = icmp eq i32 %spec.select102.us, 0
br i1 %cmp60118.not, label %for.cond59.preheader.preheader, label %for.cond59.preheader.us.preheader
for.cond59.preheader.preheader: ; preds = %for.cond55.preheader.thread148, %for.cond59.preheader.lr.ph
br label %for.cond59.preheader
for.cond59.preheader.us.preheader: ; preds = %for.cond59.preheader.lr.ph
%wide.trip.count137 = zext i32 %spec.select102.us to i64
br label %for.cond59.preheader.us
for.cond59.preheader.us: ; preds = %for.cond59.preheader.us.preheader, %for.cond59.for.end71_crit_edge.us
%indvars.iv139 = phi i64 [ 0, %for.cond59.preheader.us.preheader ], [ %indvars.iv.next140, %for.cond59.for.end71_crit_edge.us ]
br label %for.body62.us
for.body62.us: ; preds = %for.cond59.preheader.us, %for.body62.us
%indvars.iv134 = phi i64 [ 0, %for.cond59.preheader.us ], [ %indvars.iv.next135, %for.body62.us ]
%arrayidx66.us = getelementptr inbounds [100 x [100 x i8]], ptr %a, i64 0, i64 %indvars.iv139, i64 %indvars.iv134
%17 = load i8, ptr %arrayidx66.us, align 1, !tbaa !9
%conv67.us = sext i8 %17 to i32
%putchar100.us = call i32 @putchar(i32 %conv67.us)
%indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
%exitcond138.not = icmp eq i64 %indvars.iv.next135, %wide.trip.count137
br i1 %exitcond138.not, label %for.cond59.for.end71_crit_edge.us, label %for.body62.us, !llvm.loop !16
for.cond59.for.end71_crit_edge.us: ; preds = %for.body62.us
%putchar.us = call i32 @putchar(i32 10)
%indvars.iv.next140 = add nuw nsw i64 %indvars.iv139, 1
%18 = load i32, ptr %h, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp56.us = icmp slt i64 %indvars.iv.next140, %19
br i1 %cmp56.us, label %for.cond59.preheader.us, label %for.end75, !llvm.loop !17
for.cond59.preheader: ; preds = %for.cond59.preheader.preheader, %for.cond59.preheader
%i.3121 = phi i32 [ %inc74, %for.cond59.preheader ], [ 0, %for.cond59.preheader.preheader ]
%putchar = call i32 @putchar(i32 10)
%inc74 = add nuw nsw i32 %i.3121, 1
%20 = load i32, ptr %h, align 4, !tbaa !5
%cmp56 = icmp slt i32 %inc74, %20
br i1 %cmp56, label %for.cond59.preheader, label %for.end75, !llvm.loop !17
for.end75: ; preds = %for.cond59.for.end71_crit_edge.us, %for.cond59.preheader, %for.cond1.preheader.lr.ph, %for.cond23.preheader.lr.ph, %for.cond55.preheader.thread148, %for.cond55.preheader
call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %a) #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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!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}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
|
#include <stdio.h>
int main(void){
int h,w;
while (1){
scanf("%d %d",&h,&w);
if(h==0 && w==0){
break;
}else{
for (int i=0; i<h; i++){
for (int j=0; j<w; j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133433/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133433/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call21 = 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
%cmp22 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp123 = icmp eq i32 %1, 0
%or.cond24 = select i1 %cmp22, i1 %cmp123, i1 false
br i1 %or.cond24, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.cond.cleanup
%2 = phi i32 [ %4, %for.cond.cleanup ], [ %0, %entry ]
%cmp219 = icmp sgt i32 %2, 0
br i1 %cmp219, label %for.cond3.preheader, label %for.cond.cleanup
for.cond3.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup5
%i.020 = phi i32 [ %inc10, %for.cond.cleanup5 ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp417 = icmp sgt i32 %3, 0
br i1 %cmp417, label %for.body6, label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.cond.cleanup5, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%4 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.cleanup5: ; preds = %for.body6, %for.cond3.preheader
%putchar15 = call i32 @putchar(i32 10)
%inc10 = add nuw nsw i32 %i.020, 1
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc10, %6
br i1 %cmp2, label %for.cond3.preheader, label %for.cond.cleanup, !llvm.loop !9
for.body6: ; preds = %for.cond3.preheader, %for.body6
%j.018 = phi i32 [ %inc, %for.body6 ], [ 0, %for.cond3.preheader ]
%putchar16 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.018, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %7
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11
while.end: ; preds = %for.cond.cleanup, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int a, b, i, j;
while(1){
scanf("%d%d", &a, &b);
if(a == 0 && b ==0) break;
for(i =1; i <=a;i++){
for(j =1; j <=b;j++) printf("#");
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133477/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133477/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp2.not18 = icmp slt i32 %2, 1
br i1 %cmp2.not18, label %for.end10, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not16 = icmp slt i32 %3, 1
br i1 %cmp4.not16, label %for.end, label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.017, %4
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.019, %5
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
long long i,j,a,b,c,l;
scanf("%lld %lld %lld",&a,&b,&c);
for(i=0;i<10000;i++)
{
for(j=0;j<10000;j++)
{
l=a*i+b*j;
if(l==c)
{
goto Yes;
}
if(l>c)
break;
}
}
Yes:
if(l==c)
printf("yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13352/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13352/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%2 = load i64, ptr %c, align 8, !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.inc9.1, %entry
%i.026 = phi i64 [ 0, %entry ], [ %inc10.1, %for.inc9.1 ]
%mul = mul nsw i64 %0, %i.026
br label %for.body3
for.body3: ; preds = %if.end, %for.cond1.preheader
%j.025 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %if.end ]
%mul4 = mul nsw i64 %1, %j.025
%add = add nsw i64 %mul4, %mul
%cmp5 = icmp eq i64 %add, %2
br i1 %cmp5, label %if.end16, label %if.end
if.end: ; preds = %for.body3
%cmp6 = icmp sle i64 %add, %2
%inc = add nuw nsw i64 %j.025, 1
%cmp2 = icmp ult i64 %j.025, 9999
%or.cond = and i1 %cmp6, %cmp2
br i1 %or.cond, label %for.body3, label %for.inc9, !llvm.loop !9
for.inc9: ; preds = %if.end
%inc10 = or i64 %i.026, 1
%mul.1 = mul nsw i64 %0, %inc10
br label %for.body3.1
for.body3.1: ; preds = %if.end.1, %for.inc9
%j.025.1 = phi i64 [ 0, %for.inc9 ], [ %inc.1, %if.end.1 ]
%mul4.1 = mul nsw i64 %1, %j.025.1
%add.1 = add nsw i64 %mul4.1, %mul.1
%cmp5.1 = icmp eq i64 %add.1, %2
br i1 %cmp5.1, label %if.end16, label %if.end.1
if.end.1: ; preds = %for.body3.1
%cmp6.1 = icmp sle i64 %add.1, %2
%inc.1 = add nuw nsw i64 %j.025.1, 1
%cmp2.1 = icmp ult i64 %j.025.1, 9999
%or.cond.1 = and i1 %cmp6.1, %cmp2.1
br i1 %or.cond.1, label %for.body3.1, label %for.inc9.1, !llvm.loop !9
for.inc9.1: ; preds = %if.end.1
%inc10.1 = add nuw nsw i64 %i.026, 2
%exitcond.not.1 = icmp eq i64 %inc10.1, 10000
br i1 %exitcond.not.1, label %Yes, label %for.cond1.preheader, !llvm.loop !11
Yes: ; preds = %for.inc9.1
%cmp12 = icmp eq i64 %add.1, %2
%spec.select = select i1 %cmp12, ptr @.str.1, ptr @.str.2
br label %if.end16
if.end16: ; preds = %for.body3, %for.body3.1, %Yes
%.str.2.sink = phi ptr [ %spec.select, %Yes ], [ @.str.1, %for.body3.1 ], [ @.str.1, %for.body3 ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int h,w,i,j;
while(1){
scanf("%d %d",&h,&w);
if(h==0 && w==0) break;
for(i=0; i<h; i++){
for(j=0; j<w; j++){
printf("#");
}puts("");
}puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int a,b,i,k;
while(1){
scanf("%d %d",&a,&b);
if(a==0 && b==0)break;
for(i=0;i<a;i++){
for(k=0;k<b;k++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133606/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133606/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%k.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %k.017, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int H,W,i,j;
while(1){
scanf("%d %d",&H,&W);
if(H==0&&W==0) break;
for(i = 0;i<H;i++){
for(j = 0;j<W;j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133657/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133657/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main()
{
int t;
long long int r,g,b,w;
scanf("%d",&t);
for(;t>0;t--)
{
int odd=0;
scanf("%lld %lld %lld %lld",&r ,&g,&b,&w);
if(r%2==1)
odd++;
if(g%2==1)
odd++;
if(b%2==1)
odd++;
if(odd==3 && r>0 && b>0 && g>0)
printf("Yes\n");
else if(odd == 0 )
printf("Yes\n");
else if(odd==1 && w%2==0)
printf("Yes\n");
else if(odd==2 && w%2 ==1 &&(r>0 && b>0 && g>0))
printf("Yes\n");
else
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i8] c"%lld %lld %lld %lld\00", align 1
@str = 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: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%r = alloca i64, align 8
%g = alloca i64, align 8
%b = alloca i64, align 8
%w = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %g) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%.pr = load i32, ptr %t, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %.pr, 0
br i1 %cmp65, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end49
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %g, ptr noundef nonnull %b, ptr noundef nonnull %w)
%0 = load i64, ptr %r, align 8
%1 = and i64 %0, -9223372036854775807
%cmp2 = icmp eq i64 %1, 1
%spec.select = zext i1 %cmp2 to i32
%2 = load i64, ptr %g, align 8
%3 = and i64 %2, -9223372036854775807
%cmp4 = icmp eq i64 %3, 1
%inc6 = select i1 %cmp2, i32 2, i32 1
%odd.1 = select i1 %cmp4, i32 %inc6, i32 %spec.select
%4 = load i64, ptr %b, align 8
%5 = and i64 %4, -9223372036854775807
%cmp9 = icmp eq i64 %5, 1
%inc11 = zext i1 %cmp9 to i32
%odd.2 = add nuw nsw i32 %odd.1, %inc11
%cmp13 = icmp eq i32 %odd.2, 3
%cmp14 = icmp sgt i64 %0, 0
%or.cond = and i1 %cmp14, %cmp13
%cmp16 = icmp sgt i64 %4, 0
%or.cond50 = and i1 %cmp16, %or.cond
%cmp18 = icmp sgt i64 %2, 0
%or.cond51 = and i1 %cmp18, %or.cond50
br i1 %or.cond51, label %if.end49, label %if.else
if.else: ; preds = %for.body
switch i32 %odd.2, label %if.else44 [
i32 0, label %if.end49
i32 1, label %land.lhs.true26
i32 2, label %land.lhs.true33
]
land.lhs.true26: ; preds = %if.else
%6 = load i64, ptr %w, align 8, !tbaa !9
%7 = and i64 %6, 1
%cmp28 = icmp eq i64 %7, 0
br i1 %cmp28, label %if.end49, label %if.else44
land.lhs.true33: ; preds = %if.else
%8 = load i64, ptr %w, align 8, !tbaa !9
%9 = and i64 %8, -9223372036854775807
%cmp35 = icmp eq i64 %9, 1
%or.cond52 = and i1 %cmp14, %cmp35
%or.cond53 = and i1 %cmp16, %or.cond52
%or.cond54 = and i1 %cmp18, %or.cond53
br i1 %or.cond54, label %if.end49, label %if.else44
if.else44: ; preds = %land.lhs.true26, %if.else, %land.lhs.true33
br label %if.end49
if.end49: ; preds = %land.lhs.true33, %land.lhs.true26, %if.else, %for.body, %if.else44
%str.6.sink = phi ptr [ @str, %if.else44 ], [ @str.7, %for.body ], [ @str.7, %if.else ], [ @str.7, %land.lhs.true26 ], [ @str.7, %land.lhs.true33 ]
%puts63 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
%10 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %10, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%cmp = icmp sgt i32 %10, 1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %if.end49, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
char a = '#';
int h, w, i, ii, b;
scanf("%d %d", &h, &w);
for(b = 0; b < 1; b--)
{
if((h != 0)&&(w != 0))
{
for(i = 0; i < h; i++)
{
for(ii = 0; ii < w; ii++)
{
printf("%c", a);
}
printf("\n");
}
printf("\n");
scanf("%d %d", &h, &w);
}
else
{
break;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133743/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133743/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call1528 = 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
%cmp129 = icmp ne i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp230 = icmp ne i32 %1, 0
%or.cond31 = select i1 %cmp129, i1 %cmp230, i1 false
br i1 %or.cond31, label %for.cond3.preheader, label %for.end17
for.cond3.preheader: ; preds = %entry, %for.end13
%2 = phi i32 [ %6, %for.end13 ], [ %0, %entry ]
%cmp425 = icmp sgt i32 %2, 0
br i1 %cmp425, label %for.cond6.preheader, label %for.end13
for.cond6.preheader: ; preds = %for.cond3.preheader, %for.end
%i.026 = phi i32 [ %inc12, %for.end ], [ 0, %for.cond3.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp723 = icmp sgt i32 %3, 0
br i1 %cmp723, label %for.body8, label %for.end
for.body8: ; preds = %for.cond6.preheader, %for.body8
%ii.024 = phi i32 [ %inc, %for.body8 ], [ 0, %for.cond6.preheader ]
%putchar22 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %ii.024, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp7 = icmp slt i32 %inc, %4
br i1 %cmp7, label %for.body8, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body8, %for.cond6.preheader
%putchar21 = call i32 @putchar(i32 10)
%inc12 = add nuw nsw i32 %i.026, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc12, %5
br i1 %cmp4, label %for.cond6.preheader, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.end, %for.cond3.preheader
%putchar = call i32 @putchar(i32 10)
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp1 = icmp ne i32 %6, 0
%7 = load i32, ptr %w, align 4
%cmp2 = icmp ne i32 %7, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %for.cond3.preheader, label %for.end17
for.end17: ; preds = %for.end13, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int h,w,i,j;
while(1)
{
scanf("%d %d",&h,&w);
if((h==w) && (h==0)) break;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
printf("%s","#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133808/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133808/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4
%1 = load i32, ptr %w, align 4, !tbaa !5
%2 = or i32 %1, %0
%or.cond21 = icmp eq i32 %2, 0
br i1 %or.cond21, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%3 = phi i32 [ %7, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %3, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %4, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%5 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %5
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %6
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%7 = load i32, ptr %h, align 4
%8 = load i32, ptr %w, align 4, !tbaa !5
%9 = or i32 %8, %7
%or.cond = icmp eq i32 %9, 0
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int i, j, H, W;
while (1) {
scanf("%d %d", &H, &W);
if (H == 0 && W == 0) {
break;
}
for (i = 0; i < H; i++) {
for (j = 0; j < W; j++) {
putchar('#');
}
putchar('\n');
}
putchar('\n');
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133851/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133851/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %9, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%4 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call i32 @putc(i32 noundef 35, ptr noundef %4)
%inc = add nuw nsw i32 %j.017, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %5
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body5, %for.cond3.preheader
%6 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i14 = call i32 @putc(i32 noundef 10, ptr noundef %6)
%inc9 = add nuw nsw i32 %i.019, 1
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %7
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !13
for.end10: ; preds = %for.end, %for.cond.preheader
%8 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i15 = call i32 @putc(i32 noundef 10, ptr noundef %8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%9 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
int main(void){
int H,W,i,j;
scanf("%d %d",&H,&W);
while( H !=0 || W != 0){
for( j= 1 ; j<=H ; j++ ){
for( i= 1 ; i<=W ; i++ ){
printf("#");
}
printf("\n");
}
scanf("%d %d",&H,&W);
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133895/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133895/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%cmp21 = icmp ne i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp ne i32 %1, 0
%2 = select i1 %cmp21, i1 true, i1 %cmp122
br i1 %2, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %for.end10
%3 = phi i32 [ %7, %for.end10 ], [ %0, %entry ]
%cmp2.not19 = icmp slt i32 %3, 1
br i1 %cmp2.not19, label %for.end10, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%j.020 = phi i32 [ %inc9, %for.end ], [ 1, %for.cond.preheader ]
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not17 = icmp slt i32 %4, 1
br i1 %cmp4.not17, label %for.end, label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.018 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ]
%putchar16 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %i.018, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %i.018, %5
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar15 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %j.020, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %j.020, %6
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%putchar = call i32 @putchar(i32 10)
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp ne i32 %7, 0
%8 = load i32, ptr %W, align 4
%cmp1 = icmp ne i32 %8, 0
%9 = select i1 %cmp, i1 true, i1 %cmp1
br i1 %9, label %for.cond.preheader, label %while.end, !llvm.loop !12
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(){
int H, W, i, j;
while(1){
scanf("%d %d", &H, &W);
if(H == 0 && W == 0)
break;
else
for(i = 0;i < H;i++){
for(j = 0;j < W;j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133938/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133938/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end
%2 = phi i32 [ %6, %if.end ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %if.end
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %if.end, !llvm.loop !11
if.end: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main (void){
int H[1000];
int W[1000];
int i,j,k;
int lim=0;
while(1){
scanf("%d %d",&H[lim],&W[lim]);
if(H[lim]==0 && W[lim]==0){
break;
}
lim++;
}
for(k=0;k<lim;k++){
for(i=0;i<H[k];i++){
for(j=0;j<W[k];j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_133981/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_133981/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca [1000 x i32], align 16
%W = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %W) #4
br label %while.cond
while.cond: ; preds = %if.end, %entry
%indvars.iv51 = phi i32 [ %indvars.iv.next52, %if.end ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %H, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [1000 x i32], ptr %W, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %while.cond
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp7 = icmp eq i32 %1, 0
br i1 %cmp7, label %for.cond.preheader, label %if.end
for.cond.preheader: ; preds = %land.lhs.true
%2 = and i64 %indvars.iv, 4294967295
%cmp845.not = icmp eq i64 %2, 0
br i1 %cmp845.not, label %for.end28, label %for.cond9.preheader.preheader
for.cond9.preheader.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %indvars.iv51 to i64
br label %for.cond9.preheader
if.end: ; preds = %land.lhs.true, %while.cond
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next52 = add nuw i32 %indvars.iv51, 1
br label %while.cond
for.cond9.preheader: ; preds = %for.cond9.preheader.preheader, %for.end24
%indvars.iv48 = phi i64 [ 0, %for.cond9.preheader.preheader ], [ %indvars.iv.next49, %for.end24 ]
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %H, i64 0, i64 %indvars.iv48
%3 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp1243 = icmp sgt i32 %3, 0
br i1 %cmp1243, label %for.cond14.preheader.lr.ph, label %for.end24
for.cond14.preheader.lr.ph: ; preds = %for.cond9.preheader
%arrayidx16 = getelementptr inbounds [1000 x i32], ptr %W, i64 0, i64 %indvars.iv48
br label %for.cond14.preheader
for.cond14.preheader: ; preds = %for.cond14.preheader.lr.ph, %for.end
%i.044 = phi i32 [ 0, %for.cond14.preheader.lr.ph ], [ %inc23, %for.end ]
%4 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp1741 = icmp sgt i32 %4, 0
br i1 %cmp1741, label %for.body18, label %for.end
for.body18: ; preds = %for.cond14.preheader, %for.body18
%j.042 = phi i32 [ %inc20, %for.body18 ], [ 0, %for.cond14.preheader ]
%putchar40 = call i32 @putchar(i32 35)
%inc20 = add nuw nsw i32 %j.042, 1
%5 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp slt i32 %inc20, %5
br i1 %cmp17, label %for.body18, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body18, %for.cond14.preheader
%putchar39 = call i32 @putchar(i32 10)
%inc23 = add nuw nsw i32 %i.044, 1
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp slt i32 %inc23, %6
br i1 %cmp12, label %for.cond14.preheader, label %for.end24, !llvm.loop !11
for.end24: ; preds = %for.end, %for.cond9.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
%exitcond.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count
br i1 %exitcond.not, label %for.end28, label %for.cond9.preheader, !llvm.loop !12
for.end28: ; preds = %for.end24, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main()
{
int H;
int W;
int i,j;
while (1){
scanf("%d %d",&H,&W);
if(H==0 && W ==0) break;
for(i=0;i < H ;i++){
for(j = 0; j < W; j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134023/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134023/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<math.h>
int main(void){
int H,W,i,j;
for(;;){
scanf("%d %d",&H,&W);
if(H==0&&W==0){
break;
}
for(i=0;i<H;i++){
for(j=0;j<W;j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call22 = 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
%cmp23 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp124 = icmp eq i32 %1, 0
%or.cond25 = select i1 %cmp23, i1 %cmp124, i1 false
br i1 %or.cond25, label %for.end13, label %for.cond2.preheader
for.cond2.preheader: ; preds = %entry, %for.end11
%2 = phi i32 [ %6, %for.end11 ], [ %0, %entry ]
%cmp320 = icmp sgt i32 %2, 0
br i1 %cmp320, label %for.cond4.preheader, label %for.end11
for.cond4.preheader: ; preds = %for.cond2.preheader, %for.end
%i.021 = phi i32 [ %inc10, %for.end ], [ 0, %for.cond2.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp518 = icmp sgt i32 %3, 0
br i1 %cmp518, label %for.body6, label %for.end
for.body6: ; preds = %for.cond4.preheader, %for.body6
%j.019 = phi i32 [ %inc, %for.body6 ], [ 0, %for.cond4.preheader ]
%putchar17 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.019, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc, %4
br i1 %cmp5, label %for.body6, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body6, %for.cond4.preheader
%putchar16 = call i32 @putchar(i32 10)
%inc10 = add nuw nsw i32 %i.021, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc10, %5
br i1 %cmp3, label %for.cond4.preheader, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.end, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %for.end13, label %for.cond2.preheader
for.end13: ; preds = %for.end11, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int H,W,i,j;
while(1){
scanf("%d %d",&H,&W);
if(H==0 && W==0)return 0;
for(i=0 ; i<H ; i++){
for(j=0 ; j<W ;j++)
printf("#");
printf("\n");
}
printf("\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134175/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134175/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
if.then: ; preds = %for.end10, %entry
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
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %for.cond.preheader
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 H,W,i,j;
while(1){
scanf("%d %d",&H,&W);
if(H+W==0)break;
for(i=0;i<H;i++){
for(j=0;j<W;j++){
printf("#");
}printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134218/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134218/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call19 = 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 = load i32, ptr %W, align 4, !tbaa !5
%add20 = sub i32 0, %1
%cmp21 = icmp eq i32 %0, %add20
br i1 %cmp21, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end9
%2 = phi i32 [ %6, %for.end9 ], [ %0, %entry ]
%cmp117 = icmp sgt i32 %2, 0
br i1 %cmp117, label %for.cond2.preheader, label %for.end9
for.cond2.preheader: ; preds = %for.cond.preheader, %for.end
%i.018 = phi i32 [ %inc8, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp315 = icmp sgt i32 %3, 0
br i1 %cmp315, label %for.body4, label %for.end
for.body4: ; preds = %for.cond2.preheader, %for.body4
%j.016 = phi i32 [ %inc, %for.body4 ], [ 0, %for.cond2.preheader ]
%putchar14 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.016, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc, %4
br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body4, %for.cond2.preheader
%putchar13 = call i32 @putchar(i32 10)
%inc8 = add nuw nsw i32 %i.018, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp1 = icmp slt i32 %inc8, %5
br i1 %cmp1, label %for.cond2.preheader, label %for.end9, !llvm.loop !11
for.end9: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%7 = load i32, ptr %W, align 4, !tbaa !5
%add = sub i32 0, %7
%cmp = icmp eq i32 %6, %add
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end9, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void) {
int i, j, H, W;
while (scanf("%d %d", &H, &W) != EOF) {
if(H == 0 && W == 0) {
break;
}
for (i = 1; i <= H; i++) {
for (j = 1; j <= W; j++) {
printf("#");
}
putchar('\n');
}
putchar('\n');
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134311/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134311/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%cmp.not22 = icmp eq i32 %call21, -1
br i1 %cmp.not22, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end11
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp2 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body
%cmp3.not19 = icmp slt i32 %0, 1
br i1 %cmp3.not19, label %for.end11, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.cond.preheader, %for.end
%i.020 = phi i32 [ %inc10, %for.end ], [ 1, %for.cond.preheader ]
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp5.not17 = icmp slt i32 %2, 1
br i1 %cmp5.not17, label %for.end, label %for.body6
for.body6: ; preds = %for.cond4.preheader, %for.body6
%j.018 = phi i32 [ %inc, %for.body6 ], [ 1, %for.cond4.preheader ]
%3 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call noundef i32 @putc(i32 noundef 35, ptr noundef %3)
%inc = add nuw nsw i32 %j.018, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp5.not.not = icmp slt i32 %j.018, %4
br i1 %cmp5.not.not, label %for.body6, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body6, %for.cond4.preheader
%5 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i15 = call noundef i32 @putc(i32 noundef 10, ptr noundef %5)
%inc10 = add nuw nsw i32 %i.020, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp3.not.not = icmp slt i32 %i.020, %6
br i1 %cmp3.not.not, label %for.cond4.preheader, label %for.end11, !llvm.loop !13
for.end11: ; preds = %for.end, %for.cond.preheader
%7 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i16 = call noundef i32 @putc(i32 noundef 10, ptr noundef %7)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %for.end11, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main(void){
int i,j,a,b;
while(1){
scanf("%d %d",&a,&b);
if(a == 0 &&b==0){
break;
}
for(i=0;i<a;i++){
for(j=0;j<b;j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int h, w;
int i, j;
while(1){
scanf("%d %d ", &h, &w);
if(h==0&&w==0)break;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134399/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134399/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d %d \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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int H, W;
scanf("%d %d", &H, &W);
while (H != 0 && W != 0){
int i, j;
for(i = 0;i < H;i++){
for (j = 0;j < W; j++){
printf("#");
}
printf("\n");
}
printf("\n");
scanf("%d %d", &H, &W);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134449/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134449/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%cmp21 = icmp ne i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp ne i32 %1, 0
%2 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %2, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %for.end10
%3 = phi i32 [ %7, %for.end10 ], [ %0, %entry ]
%cmp219 = icmp sgt i32 %3, 0
br i1 %cmp219, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.020 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp417 = icmp sgt i32 %4, 0
br i1 %cmp417, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.018 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar16 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.018, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %5
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar15 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.020, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %6
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp ne i32 %7, 0
%8 = load i32, ptr %W, align 4
%cmp1 = icmp ne i32 %8, 0
%9 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %9, label %for.cond.preheader, label %while.end, !llvm.loop !12
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(){
int H,W;
scanf("%d %d",&H,&W);
while(!(H==0&&W==0)){
for(int i=0;i<H;i++){
for(int f=0;f<W;f++){
printf("#");
}
printf("\n");
}
printf("\n");
scanf("%d %d",&H,&W);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134492/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134492/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%cmp22 = icmp ne i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp123 = icmp ne i32 %1, 0
%.not24 = select i1 %cmp22, i1 true, i1 %cmp123
br i1 %.not24, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %for.cond.cleanup
%2 = phi i32 [ %4, %for.cond.cleanup ], [ %0, %entry ]
%cmp220 = icmp sgt i32 %2, 0
br i1 %cmp220, label %for.cond3.preheader, label %for.cond.cleanup
for.cond3.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup5
%i.021 = phi i32 [ %inc10, %for.cond.cleanup5 ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp418 = icmp sgt i32 %3, 0
br i1 %cmp418, label %for.body6, label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.cond.cleanup5, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp ne i32 %4, 0
%5 = load i32, ptr %W, align 4
%cmp1 = icmp ne i32 %5, 0
%.not = select i1 %cmp, i1 true, i1 %cmp1
br i1 %.not, label %for.cond.preheader, label %while.end, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.body6, %for.cond3.preheader
%putchar16 = call i32 @putchar(i32 10)
%inc10 = add nuw nsw i32 %i.021, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc10, %6
br i1 %cmp2, label %for.cond3.preheader, label %for.cond.cleanup, !llvm.loop !11
for.body6: ; preds = %for.cond3.preheader, %for.body6
%f.019 = phi i32 [ %inc, %for.body6 ], [ 0, %for.cond3.preheader ]
%putchar17 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %f.019, 1
%7 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %7
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !12
while.end: ; preds = %for.cond.cleanup, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include <stdlib.h>
int main()
{
int h, w, sum=0, min=1000000;
double p = 3.1415;
int max = 1-1000001;
while (1){
scanf("%d%d", &h, &w);
if(h==0 && w==0){
break;
}
else {
for (int i=0; i<h; i++){
for(int j=0; j<w; j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call21 = 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
%cmp22 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp123 = icmp eq i32 %1, 0
%or.cond24 = select i1 %cmp22, i1 %cmp123, i1 false
br i1 %or.cond24, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.cond.cleanup
%2 = phi i32 [ %4, %for.cond.cleanup ], [ %0, %entry ]
%cmp219 = icmp sgt i32 %2, 0
br i1 %cmp219, label %for.cond3.preheader, label %for.cond.cleanup
for.cond3.preheader: ; preds = %for.cond.preheader, %for.cond.cleanup5
%i.020 = phi i32 [ %inc10, %for.cond.cleanup5 ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp417 = icmp sgt i32 %3, 0
br i1 %cmp417, label %for.body6, label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.cond.cleanup5, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%4 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.cleanup5: ; preds = %for.body6, %for.cond3.preheader
%putchar15 = call i32 @putchar(i32 10)
%inc10 = add nuw nsw i32 %i.020, 1
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc10, %6
br i1 %cmp2, label %for.cond3.preheader, label %for.cond.cleanup, !llvm.loop !9
for.body6: ; preds = %for.cond3.preheader, %for.body6
%j.018 = phi i32 [ %inc, %for.body6 ], [ 0, %for.cond3.preheader ]
%putchar16 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.018, 1
%7 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %7
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11
while.end: ; preds = %for.cond.cleanup, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int i , j, W, H;
while(1){
scanf("%d %d", &W, &H);
if(W == 0 && H == 0){
break;
}
for(i = 0; i < W; i++){
for(j = 0; j < H; j++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134593/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%W = alloca i32, align 4
%H = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H)
%0 = load i32, ptr %W, align 4, !tbaa !5
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %H, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %H, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.017, 1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.019, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W, ptr noundef nonnull %H)
%6 = load i32, ptr %W, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %H, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 H,W,i,d;
while(1){
scanf("%d %d",&H,&W);
if(H==0 && W==0){
break;
}
for(i=0;i<H;i++){
for(d=0;d<W;d++){
printf("#");
}
putchar('\n');
}
putchar('\n');
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %9, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%d.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%4 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call noundef i32 @putc(i32 noundef 35, ptr noundef %4)
%inc = add nuw nsw i32 %d.017, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %5
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body5, %for.cond3.preheader
%6 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i14 = call noundef i32 @putc(i32 noundef 10, ptr noundef %6)
%inc9 = add nuw nsw i32 %i.019, 1
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %7
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !13
for.end10: ; preds = %for.end, %for.cond.preheader
%8 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i15 = call noundef i32 @putc(i32 noundef 10, ptr noundef %8)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%9 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main()
{
int n,k,a[110]={0},d,i,cnt,j;
scanf("%d%d",&n,&k);
for(j=0;j<k;j++)
{
scanf("%d",&i);
a[i]++;
}
d=k/n;
while(d>0)
{
cnt=0;
for(i=0;i<110;i++)cnt+=a[i]/d;
if(cnt>=n)break;
d--;
}
printf("%d",d);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13468/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13468/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [110 x i32], align 16
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(440) %a, i8 0, i64 440, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%j.022 = phi i32 [ %inc2, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%1 = load i32, ptr %i, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%inc2 = add nuw nsw i32 %j.022, 1
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp slt i32 %inc2, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%4 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %.lcssa, %4
%cmp325 = icmp sgt i32 %div, 0
br i1 %cmp325, label %for.cond4.preheader, label %while.end
for.cond4.preheader: ; preds = %for.end, %if.end
%d.026 = phi i32 [ %dec, %if.end ], [ %div, %for.end ]
br label %for.body6
for.body6: ; preds = %for.body6, %for.cond4.preheader
%indvars.iv = phi i64 [ 0, %for.cond4.preheader ], [ %indvars.iv.next.1, %for.body6 ]
%cnt.024 = phi i32 [ 0, %for.cond4.preheader ], [ %add.1, %for.body6 ]
%arrayidx8 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv
%5 = load i32, ptr %arrayidx8, align 8, !tbaa !5
%div9 = sdiv i32 %5, %d.026
%add = add nsw i32 %div9, %cnt.024
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx8.1 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv.next
%6 = load i32, ptr %arrayidx8.1, align 4, !tbaa !5
%div9.1 = sdiv i32 %6, %d.026
%add.1 = add nsw i32 %div9.1, %add
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 110
br i1 %exitcond.not.1, label %for.end12, label %for.body6, !llvm.loop !11
for.end12: ; preds = %for.body6
%cmp13.not = icmp slt i32 %add.1, %4
br i1 %cmp13.not, label %if.end, label %for.end12.while.end_crit_edge
if.end: ; preds = %for.end12
%dec = add nsw i32 %d.026, -1
%cmp3 = icmp sgt i32 %d.026, 1
br i1 %cmp3, label %for.cond4.preheader, label %while.cond.while.end_crit_edge, !llvm.loop !12
for.end12.while.end_crit_edge: ; preds = %for.end12
store i32 110, ptr %i, align 4, !tbaa !5
br label %while.end
while.cond.while.end_crit_edge: ; preds = %if.end
store i32 110, ptr %i, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %for.end12.while.end_crit_edge, %for.end
%d.0.lcssa = phi i32 [ %d.026, %for.end12.while.end_crit_edge ], [ 0, %while.cond.while.end_crit_edge ], [ %div, %for.end ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main()
{
int temp,n,sum,k,j,i,b;
scanf("%d %d",&n,&k);
char str[n];
scanf("%s",&str);
int arr[n];
for(i=0;i<n;i++)
{
arr[i]=str[i]-96;
}
for(i=0;i<n-1;i++)
{
for(j=0;j<n-i-1;j++)
{
if(arr[j]>arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
temp=1;i=1;sum=arr[0];b=0;
while(temp!=k)
{
if(arr[i]-arr[b]<2)
i++;
else {
sum=sum+arr[i];
b=i;
i++;
temp++;
}
if(i==n)
break;
}
if(temp!=k)
printf("-1");
else printf("%d",sum);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13473/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13473/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla2 = alloca i32, i64 %4, align 16
%cmp91 = icmp sgt i32 %3, 0
br i1 %cmp91, label %for.body.preheader, label %for.end37
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body.preheader119, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %4, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%5 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <4 x i8>, ptr %5, align 8, !tbaa !9
%6 = getelementptr inbounds i8, ptr %5, i64 4
%wide.load117 = load <4 x i8>, ptr %6, align 4, !tbaa !9
%7 = sext <4 x i8> %wide.load to <4 x i32>
%8 = sext <4 x i8> %wide.load117 to <4 x i32>
%9 = add nsw <4 x i32> %7, <i32 -96, i32 -96, i32 -96, i32 -96>
%10 = add nsw <4 x i32> %8, <i32 -96, i32 -96, i32 -96, i32 -96>
%11 = getelementptr inbounds i32, ptr %vla2, i64 %index
store <4 x i32> %9, ptr %11, align 16, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
store <4 x i32> %10, ptr %12, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %4
br i1 %cmp.n, label %for.cond5.preheader, label %for.body.preheader119
for.body.preheader119: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond5.preheader: ; preds = %for.body, %middle.block
%sub6 = add i32 %3, -1
%cmp795 = icmp sgt i32 %3, 1
br i1 %cmp795, label %for.cond10.preheader.preheader, label %for.end37
for.cond10.preheader.preheader: ; preds = %for.cond5.preheader
%invariant.gep = getelementptr i32, ptr %vla2, i64 1
br label %for.cond10.preheader
for.body: ; preds = %for.body.preheader119, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader119 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%14 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %14 to i32
%sub = add nsw i32 %conv, -96
%arrayidx4 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv
store i32 %sub, ptr %arrayidx4, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %4
br i1 %exitcond.not, label %for.cond5.preheader, label %for.body, !llvm.loop !14
for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.inc35
%indvars.iv101 = phi i32 [ %indvars.iv.next102, %for.inc35 ], [ %sub6, %for.cond10.preheader.preheader ]
%i.196 = phi i32 [ %inc36, %for.inc35 ], [ 0, %for.cond10.preheader.preheader ]
%15 = zext i32 %indvars.iv101 to i64
%16 = xor i32 %i.196, -1
%sub12 = add i32 %3, %16
%cmp1393 = icmp sgt i32 %sub12, 0
br i1 %cmp1393, label %for.body15.preheader, label %for.inc35
for.body15.preheader: ; preds = %for.cond10.preheader
%.pre = load i32, ptr %vla2, align 16, !tbaa !5
%xtraiter = and i64 %15, 1
%17 = icmp eq i32 %indvars.iv101, 1
br i1 %17, label %for.inc35.loopexit.unr-lcssa, label %for.body15.preheader.new
for.body15.preheader.new: ; preds = %for.body15.preheader
%unroll_iter = and i64 %15, 4294967294
br label %for.body15
for.body15: ; preds = %for.inc32.1, %for.body15.preheader.new
%18 = phi i32 [ %.pre, %for.body15.preheader.new ], [ %22, %for.inc32.1 ]
%indvars.iv98 = phi i64 [ 0, %for.body15.preheader.new ], [ %indvars.iv.next99.1, %for.inc32.1 ]
%niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.1, %for.inc32.1 ]
%indvars.iv.next99 = or i64 %indvars.iv98, 1
%arrayidx19 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next99
%19 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %18, %19
br i1 %cmp20, label %if.then, label %for.inc32
if.then: ; preds = %for.body15
%arrayidx17 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv98
store i32 %19, ptr %arrayidx17, align 8, !tbaa !5
store i32 %18, ptr %arrayidx19, align 4, !tbaa !5
br label %for.inc32
for.inc32: ; preds = %for.body15, %if.then
%20 = phi i32 [ %19, %for.body15 ], [ %18, %if.then ]
%indvars.iv.next99.1 = add nuw nsw i64 %indvars.iv98, 2
%arrayidx19.1 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next99.1
%21 = load i32, ptr %arrayidx19.1, align 8, !tbaa !5
%cmp20.1 = icmp sgt i32 %20, %21
br i1 %cmp20.1, label %if.then.1, label %for.inc32.1
if.then.1: ; preds = %for.inc32
%arrayidx17.1 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv.next99
store i32 %21, ptr %arrayidx17.1, align 4, !tbaa !5
store i32 %20, ptr %arrayidx19.1, align 8, !tbaa !5
br label %for.inc32.1
for.inc32.1: ; preds = %if.then.1, %for.inc32
%22 = phi i32 [ %21, %for.inc32 ], [ %20, %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.inc35.loopexit.unr-lcssa, label %for.body15, !llvm.loop !15
for.inc35.loopexit.unr-lcssa: ; preds = %for.inc32.1, %for.body15.preheader
%.unr = phi i32 [ %.pre, %for.body15.preheader ], [ %22, %for.inc32.1 ]
%indvars.iv98.unr = phi i64 [ 0, %for.body15.preheader ], [ %indvars.iv.next99.1, %for.inc32.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc35, label %for.body15.epil
for.body15.epil: ; preds = %for.inc35.loopexit.unr-lcssa
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv98.unr
%23 = load i32, ptr %gep, align 4, !tbaa !5
%cmp20.epil = icmp sgt i32 %.unr, %23
br i1 %cmp20.epil, label %if.then.epil, label %for.inc35
if.then.epil: ; preds = %for.body15.epil
%arrayidx17.epil = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv98.unr
store i32 %23, ptr %arrayidx17.epil, align 4, !tbaa !5
store i32 %.unr, ptr %gep, align 4, !tbaa !5
br label %for.inc35
for.inc35: ; preds = %for.inc35.loopexit.unr-lcssa, %if.then.epil, %for.body15.epil, %for.cond10.preheader
%inc36 = add nuw nsw i32 %i.196, 1
%indvars.iv.next102 = add i32 %indvars.iv101, -1
%exitcond105.not = icmp eq i32 %inc36, %sub6
br i1 %exitcond105.not, label %for.end37, label %for.cond10.preheader, !llvm.loop !16
for.end37: ; preds = %for.inc35, %entry, %for.cond5.preheader
%24 = load i32, ptr %vla2, align 16, !tbaa !5
%25 = load i32, ptr %k, align 4, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.body, %for.end37
%indvars.iv106 = phi i64 [ %indvars.iv.next107, %while.body ], [ 1, %for.end37 ]
%b.0 = phi i32 [ %b.1, %while.body ], [ 0, %for.end37 ]
%sum.0 = phi i32 [ %sum.1, %while.body ], [ %24, %for.end37 ]
%temp.0 = phi i32 [ %temp.1, %while.body ], [ 1, %for.end37 ]
%cmp39.not = icmp eq i32 %temp.0, %25
br i1 %cmp39.not, label %if.else64, label %while.body
while.body: ; preds = %while.cond
%arrayidx42 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv106
%26 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%idxprom43 = sext i32 %b.0 to i64
%arrayidx44 = getelementptr inbounds i32, ptr %vla2, i64 %idxprom43
%27 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%sub45 = sub nsw i32 %26, %27
%cmp46 = icmp sgt i32 %sub45, 1
%28 = trunc i64 %indvars.iv106 to i32
%b.1 = select i1 %cmp46, i32 %28, i32 %b.0
%add52 = select i1 %cmp46, i32 %26, i32 0
%sum.1 = add nsw i32 %add52, %sum.0
%inc54 = zext i1 %cmp46 to i32
%temp.1 = add nuw nsw i32 %temp.0, %inc54
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%cmp56 = icmp eq i64 %indvars.iv.next107, %4
br i1 %cmp56, label %while.end, label %while.cond, !llvm.loop !17
while.end: ; preds = %while.body
%cmp60.not = icmp eq i32 %temp.1, %25
br i1 %cmp60.not, label %if.else64, label %if.then62
if.then62: ; preds = %while.end
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end66
if.else64: ; preds = %while.cond, %while.end
%sum.2114 = phi i32 [ %sum.1, %while.end ], [ %sum.0, %while.cond ]
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sum.2114)
br label %if.end66
if.end66: ; preds = %if.else64, %if.then62
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
|
#include<stdio.h>
int main(void){
int x,y,i,j;
for(;;){
scanf("%d %d",&y,&x);
if(x+y==0) break;
for(i=0;i<y;i++){
for(j=0;j<x;j++)
printf("#");
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%add22 = sub i32 0, %1
%cmp23 = icmp eq i32 %0, %add22
br i1 %cmp23, label %for.end12, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %7, %for.end10 ], [ %1, %entry ]
%cmp219 = icmp sgt i32 %2, 0
br i1 %cmp219, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond1.preheader, %for.end
%i.020 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond1.preheader ]
%3 = load i32, ptr %x, align 4, !tbaa !5
%cmp417 = icmp sgt i32 %3, 0
br i1 %cmp417, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.018 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar16 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %j.018, 1
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar15 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %i.020, 1
%5 = load i32, ptr %y, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond1.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y, ptr noundef nonnull %x)
%6 = load i32, ptr %x, align 4, !tbaa !5
%7 = load i32, ptr %y, align 4, !tbaa !5
%add = sub i32 0, %7
%cmp = icmp eq i32 %6, %add
br i1 %cmp, label %for.end12, label %for.cond1.preheader
for.end12: ; preds = %for.end10, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int H,W,i,j;
while(1){
scanf("%d %d",&H,&W);
if(H == W && H == 0){
break;
}else{
for(j = 0; j < H ;j++){
for(i = 0; i < W;i++){
printf("#");
}
printf("\n");
}
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4
%1 = load i32, ptr %W, align 4, !tbaa !5
%2 = or i32 %1, %0
%or.cond21 = icmp eq i32 %2, 0
br i1 %or.cond21, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%3 = phi i32 [ %7, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %3, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%j.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %4, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %i.017, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %5
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %j.019, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %6
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%7 = load i32, ptr %H, align 4
%8 = load i32, ptr %W, align 4, !tbaa !5
%9 = or i32 %8, %7
%or.cond = icmp eq i32 %9, 0
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int j, i, H, W;
while (1){
scanf("%d%d" ,&H ,&W);
if(H == 0 && W == 0) break;
for ( j = 0; j < H; j++ ){
for(i = 0; i<W; i++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%call20 = 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
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end10
%2 = phi i32 [ %6, %for.end10 ], [ %0, %entry ]
%cmp218 = icmp sgt i32 %2, 0
br i1 %cmp218, label %for.cond3.preheader, label %for.end10
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%j.019 = phi i32 [ %inc9, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp416 = icmp sgt i32 %3, 0
br i1 %cmp416, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.017 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%putchar15 = call i32 @putchar(i32 35)
%inc = add nuw nsw i32 %i.017, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar14 = call i32 @putchar(i32 10)
%inc9 = add nuw nsw i32 %j.019, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc9, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end10, %entry
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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b) {
return *(int*)a - *(int*)b;
}
int main() {
int t;
scanf("%d", &t);
while(t--) {
int n, p, k, r = 0, *a, *b, i;
scanf("%d %d %d", &n, &p, &k);
a = malloc(n*sizeof(int));
b = malloc(n*sizeof(int));
for(i = 0; i < n; i++)
scanf("%d", &a[i]);
qsort(a, n, sizeof(int), cmp);
for(i = 0; i < n; i++)
if(i < k)
b[i] = a[i];
else
b[i] = b[i - k] + a[i];
for(i = n - 1; i >= 0; i--)
if(b[i] <= p) {
int t = (i + 1) % k > 1 ? (i + 1)/k*k + 1 : (i + 1), u = (i + 1) % k > 1 ? (i + 1) % k - 1 : 0, rem = p - b[i], j;
for(j = 0; j < u; j++)
if(a[j] <= rem) {
rem -= a[j];
t++;
}
if(t > r)
r = t;
}
printf("%d\n", r);
free(a);
free(b);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13491/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13491/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%p = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec144 = add nsw i32 %0, -1
store i32 %dec144, ptr %t, align 4, !tbaa !5
%tobool.not145 = icmp eq i32 %0, 0
br i1 %tobool.not145, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end85
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #8
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %p, ptr noundef nonnull %k)
%1 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %1 to i64
%mul = shl nsw i64 %conv, 2
%call2 = call noalias ptr @malloc(i64 noundef %mul) #9
%call5 = call noalias ptr @malloc(i64 noundef %mul) #9
%cmp128 = icmp sgt i32 %1, 0
br i1 %cmp128, 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 ]
%arrayidx = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %while.body
%conv8.pre-phi = phi i64 [ %conv, %while.body ], [ %3, %for.body ]
call void @qsort(ptr noundef %call2, i64 noundef %conv8.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #8
%4 = load i32, ptr %n, align 4, !tbaa !5
%.fr = freeze i32 %4
%cmp10130 = icmp sgt i32 %.fr, 0
br i1 %cmp10130, label %for.body12.lr.ph, label %for.end85
for.body12.lr.ph: ; preds = %for.end
%5 = load i32, ptr %k, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%wide.trip.count = zext i32 %.fr to i64
%xtraiter = and i64 %wide.trip.count, 1
%7 = icmp eq i32 %.fr, 1
br i1 %7, label %for.cond29.preheader.unr-lcssa, label %for.body12.lr.ph.new
for.body12.lr.ph.new: ; preds = %for.body12.lr.ph
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body12
for.cond29.preheader.unr-lcssa: ; preds = %for.inc25.1, %for.body12.lr.ph
%indvars.iv148.unr = phi i64 [ 0, %for.body12.lr.ph ], [ %indvars.iv.next149.1, %for.inc25.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond29.preheader, label %for.body12.epil
for.body12.epil: ; preds = %for.cond29.preheader.unr-lcssa
%cmp13.epil = icmp slt i64 %indvars.iv148.unr, %6
br i1 %cmp13.epil, label %if.then.epil, label %if.else.epil
if.else.epil: ; preds = %for.body12.epil
%8 = sub nsw i64 %indvars.iv148.unr, %6
%arrayidx20.epil = getelementptr inbounds i32, ptr %call5, i64 %8
%9 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5
%arrayidx22.epil = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv148.unr
%10 = load i32, ptr %arrayidx22.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %10, %9
br label %for.inc25.epil
if.then.epil: ; preds = %for.body12.epil
%arrayidx16.epil = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv148.unr
%11 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
br label %for.inc25.epil
for.inc25.epil: ; preds = %if.then.epil, %if.else.epil
%add.sink.epil = phi i32 [ %11, %if.then.epil ], [ %add.epil, %if.else.epil ]
%12 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv148.unr
store i32 %add.sink.epil, ptr %12, align 4
br label %for.cond29.preheader
for.cond29.preheader: ; preds = %for.cond29.preheader.unr-lcssa, %for.inc25.epil
br i1 %cmp10130, label %for.body32.lr.ph, label %for.end85
for.body32.lr.ph: ; preds = %for.cond29.preheader
%13 = load i32, ptr %p, align 4, !tbaa !5
%14 = load i32, ptr %k, align 4
%15 = zext i32 %.fr to i64
br label %for.body32
for.body12: ; preds = %for.inc25.1, %for.body12.lr.ph.new
%indvars.iv148 = phi i64 [ 0, %for.body12.lr.ph.new ], [ %indvars.iv.next149.1, %for.inc25.1 ]
%niter = phi i64 [ 0, %for.body12.lr.ph.new ], [ %niter.next.1, %for.inc25.1 ]
%cmp13 = icmp slt i64 %indvars.iv148, %6
br i1 %cmp13, label %if.then, label %if.else
if.then: ; preds = %for.body12
%arrayidx16 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv148
%16 = load i32, ptr %arrayidx16, align 4, !tbaa !5
br label %for.inc25
if.else: ; preds = %for.body12
%17 = sub nsw i64 %indvars.iv148, %6
%arrayidx20 = getelementptr inbounds i32, ptr %call5, i64 %17
%18 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%arrayidx22 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv148
%19 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%add = add nsw i32 %19, %18
br label %for.inc25
for.inc25: ; preds = %if.then, %if.else
%add.sink = phi i32 [ %16, %if.then ], [ %add, %if.else ]
%20 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv148
store i32 %add.sink, ptr %20, align 4
%indvars.iv.next149 = or i64 %indvars.iv148, 1
%cmp13.1 = icmp slt i64 %indvars.iv.next149, %6
br i1 %cmp13.1, label %if.then.1, label %if.else.1
if.else.1: ; preds = %for.inc25
%21 = sub nsw i64 %indvars.iv.next149, %6
%arrayidx20.1 = getelementptr inbounds i32, ptr %call5, i64 %21
%22 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5
%arrayidx22.1 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.next149
%23 = load i32, ptr %arrayidx22.1, align 4, !tbaa !5
%add.1 = add nsw i32 %23, %22
br label %for.inc25.1
if.then.1: ; preds = %for.inc25
%arrayidx16.1 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.next149
%24 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
br label %for.inc25.1
for.inc25.1: ; preds = %if.then.1, %if.else.1
%add.sink.1 = phi i32 [ %24, %if.then.1 ], [ %add.1, %if.else.1 ]
%25 = getelementptr inbounds i32, ptr %call5, i64 %indvars.iv.next149
store i32 %add.sink.1, ptr %25, align 4
%indvars.iv.next149.1 = add nuw nsw i64 %indvars.iv148, 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.preheader.unr-lcssa, label %for.body12, !llvm.loop !11
for.body32: ; preds = %for.body32.lr.ph, %for.inc83
%indvars.iv155 = phi i64 [ %15, %for.body32.lr.ph ], [ %indvars.iv.next156, %for.inc83 ]
%r.0141 = phi i32 [ 0, %for.body32.lr.ph ], [ %r.2, %for.inc83 ]
%indvars.iv.next156 = add nsw i64 %indvars.iv155, -1
%indvars = trunc i64 %indvars.iv.next156 to i32
%idxprom33 = and i64 %indvars.iv.next156, 4294967295
%arrayidx34 = getelementptr inbounds i32, ptr %call5, i64 %idxprom33
%26 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35.not = icmp sgt i32 %26, %13
br i1 %cmp35.not, label %for.inc83, label %if.then37
if.then37: ; preds = %for.body32
%27 = trunc i64 %indvars.iv155 to i32
%rem = srem i32 %27, %14
%cmp40 = icmp ugt i32 %rem, 1
%28 = trunc i64 %indvars.iv155 to i32
%29 = add i32 %28, 1
%add44 = sub i32 %29, %rem
%cond = select i1 %cmp40, i32 %add44, i32 %27
%spec.select = call i32 @llvm.usub.sat.i32(i32 %rem, i32 1)
%cmp62133 = icmp sgt i32 %spec.select, 0
br i1 %cmp62133, label %for.body64.preheader, label %for.end77
for.body64.preheader: ; preds = %if.then37
%sub60 = sub nsw i32 %13, %26
%30 = zext i32 %spec.select to i64
%xtraiter159 = and i64 %30, 1
%31 = icmp eq i32 %spec.select, 1
br i1 %31, label %for.end77.loopexit.unr-lcssa, label %for.body64.preheader.new
for.body64.preheader.new: ; preds = %for.body64.preheader
%unroll_iter162 = and i64 %30, 4294967294
br label %for.body64
for.body64: ; preds = %for.body64, %for.body64.preheader.new
%indvars.iv152 = phi i64 [ 0, %for.body64.preheader.new ], [ %indvars.iv.next153.1, %for.body64 ]
%rem57.0135 = phi i32 [ %sub60, %for.body64.preheader.new ], [ %rem57.1.1, %for.body64 ]
%t38.0134 = phi i32 [ %cond, %for.body64.preheader.new ], [ %t38.1.1, %for.body64 ]
%niter163 = phi i64 [ 0, %for.body64.preheader.new ], [ %niter163.next.1, %for.body64 ]
%arrayidx66 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv152
%32 = load i32, ptr %arrayidx66, align 4, !tbaa !5
%cmp67.not = icmp sle i32 %32, %rem57.0135
%inc73 = zext i1 %cmp67.not to i32
%t38.1 = add nsw i32 %t38.0134, %inc73
%sub72 = select i1 %cmp67.not, i32 %32, i32 0
%rem57.1 = sub nsw i32 %rem57.0135, %sub72
%indvars.iv.next153 = or i64 %indvars.iv152, 1
%arrayidx66.1 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.next153
%33 = load i32, ptr %arrayidx66.1, align 4, !tbaa !5
%cmp67.not.1 = icmp sle i32 %33, %rem57.1
%inc73.1 = zext i1 %cmp67.not.1 to i32
%t38.1.1 = add nsw i32 %t38.1, %inc73.1
%sub72.1 = select i1 %cmp67.not.1, i32 %33, i32 0
%rem57.1.1 = sub nsw i32 %rem57.1, %sub72.1
%indvars.iv.next153.1 = add nuw nsw i64 %indvars.iv152, 2
%niter163.next.1 = add i64 %niter163, 2
%niter163.ncmp.1.not = icmp eq i64 %niter163.next.1, %unroll_iter162
br i1 %niter163.ncmp.1.not, label %for.end77.loopexit.unr-lcssa, label %for.body64, !llvm.loop !12
for.end77.loopexit.unr-lcssa: ; preds = %for.body64, %for.body64.preheader
%t38.1.lcssa.ph = phi i32 [ undef, %for.body64.preheader ], [ %t38.1.1, %for.body64 ]
%indvars.iv152.unr = phi i64 [ 0, %for.body64.preheader ], [ %indvars.iv.next153.1, %for.body64 ]
%rem57.0135.unr = phi i32 [ %sub60, %for.body64.preheader ], [ %rem57.1.1, %for.body64 ]
%t38.0134.unr = phi i32 [ %cond, %for.body64.preheader ], [ %t38.1.1, %for.body64 ]
%lcmp.mod160.not = icmp eq i64 %xtraiter159, 0
br i1 %lcmp.mod160.not, label %for.end77, label %for.body64.epil
for.body64.epil: ; preds = %for.end77.loopexit.unr-lcssa
%arrayidx66.epil = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv152.unr
%34 = load i32, ptr %arrayidx66.epil, align 4, !tbaa !5
%cmp67.not.epil = icmp sle i32 %34, %rem57.0135.unr
%inc73.epil = zext i1 %cmp67.not.epil to i32
%t38.1.epil = add nsw i32 %t38.0134.unr, %inc73.epil
br label %for.end77
for.end77: ; preds = %for.body64.epil, %for.end77.loopexit.unr-lcssa, %if.then37
%t38.0.lcssa = phi i32 [ %cond, %if.then37 ], [ %t38.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %t38.1.epil, %for.body64.epil ]
%spec.select127 = call i32 @llvm.smax.i32(i32 %t38.0.lcssa, i32 %r.0141)
br label %for.inc83
for.inc83: ; preds = %for.body32, %for.end77
%r.2 = phi i32 [ %spec.select127, %for.end77 ], [ %r.0141, %for.body32 ]
%cmp30 = icmp sgt i32 %indvars, 0
br i1 %cmp30, label %for.body32, label %for.end85, !llvm.loop !13
for.end85: ; preds = %for.inc83, %for.end, %for.cond29.preheader
%r.0.lcssa = phi i32 [ 0, %for.cond29.preheader ], [ 0, %for.end ], [ %r.2, %for.inc83 ]
%call86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %r.0.lcssa)
call void @free(ptr noundef %call2) #8
call void @free(ptr noundef %call5) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
%35 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %35, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %35, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %for.end85, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
ll n;
char s[300010];
ll a[300010];
ll ans=INF;
int main(){
scanf("%lld\n%s",&n,s);
rep(i,0,n)a[i+1]=a[i]+(s[i]=='E');
rep(i,0,n)ans=min(ans,(i-a[i])+(a[n]-a[i+1]));
printf("%lld\n",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_134960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_134960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@ans = dso_local local_unnamed_addr global i64 4611686016279904256, align 8
@.str = private unnamed_addr constant [8 x i8] c"%lld\0A%s\00", align 1
@n = dso_local global i64 0, align 8
@s = dso_local global [300010 x i8] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [300010 x i64] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @s)
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp45 = icmp sgt i64 %0, 0
br i1 %cmp45, label %for.body.preheader, label %for.cond8.preheader.for.cond.cleanup11_crit_edge
for.body.preheader: ; preds = %entry
%.pre = load i64, ptr @a, align 16, !tbaa !5
%xtraiter = and i64 %0, 1
%1 = icmp eq i64 %0, 1
br i1 %1, label %for.cond8.preheader.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.cond8.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%.unr = phi i64 [ %.pre, %for.body.preheader ], [ %add.1, %for.body ]
%i.046.unr = phi i64 [ 0, %for.body.preheader ], [ %add5.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond8.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond8.preheader.unr-lcssa
%arrayidx1.epil = getelementptr inbounds [300010 x i8], ptr @s, i64 0, i64 %i.046.unr
%2 = load i8, ptr %arrayidx1.epil, align 1, !tbaa !9
%cmp2.epil = icmp eq i8 %2, 69
%conv4.epil = zext i1 %cmp2.epil to i64
%add.epil = add nsw i64 %.unr, %conv4.epil
%add5.epil = add nuw nsw i64 %i.046.unr, 1
%arrayidx6.epil = getelementptr inbounds [300010 x i64], ptr @a, i64 0, i64 %add5.epil
store i64 %add.epil, ptr %arrayidx6.epil, align 8, !tbaa !5
br label %for.cond8.preheader
for.cond8.preheader: ; preds = %for.cond8.preheader.unr-lcssa, %for.body.epil
br i1 %cmp45, label %for.body12.lr.ph, label %for.cond8.preheader.for.cond.cleanup11_crit_edge
for.cond8.preheader.for.cond.cleanup11_crit_edge: ; preds = %entry, %for.cond8.preheader
%.pre53 = load i64, ptr @ans, align 8, !tbaa !5
br label %for.cond.cleanup11
for.body12.lr.ph: ; preds = %for.cond8.preheader
%ans.promoted = load i64, ptr @ans, align 8, !tbaa !5
%arrayidx14 = getelementptr inbounds [300010 x i64], ptr @a, i64 0, i64 %0
%3 = load i64, ptr %arrayidx14, align 8, !tbaa !5
%.pre52 = load i64, ptr @a, align 16, !tbaa !5
%min.iters.check = icmp ult i64 %0, 4
br i1 %min.iters.check, label %for.body12.preheader, label %vector.ph
vector.ph: ; preds = %for.body12.lr.ph
%n.vec = and i64 %0, -4
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre52, i64 1
%minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %ans.promoted, i64 0
%minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %3, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 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 <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load56, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %15, %vector.body ]
%vec.phi55 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph ], [ %16, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%4 = or i64 %index, 1
%5 = getelementptr inbounds [300010 x i64], ptr @a, i64 0, i64 %4
%wide.load = load <2 x i64>, ptr %5, align 8, !tbaa !5
%6 = getelementptr inbounds i64, ptr %5, i64 2
%wide.load56 = load <2 x i64>, ptr %6, align 8, !tbaa !5
%7 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%8 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load56, <2 x i32> <i32 1, i32 2>
%9 = add <2 x i64> %vec.ind, %broadcast.splat
%10 = add <2 x i64> %step.add, %broadcast.splat
%11 = add <2 x i64> %7, %wide.load
%12 = add <2 x i64> %8, %wide.load56
%13 = sub <2 x i64> %9, %11
%14 = sub <2 x i64> %10, %12
%15 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %13)
%16 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi55, <2 x i64> %14)
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %15, <2 x i64> %16)
%18 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <2 x i64> %wide.load56, i64 1
br i1 %cmp.n, label %for.cond8.for.cond.cleanup11_crit_edge, label %for.body12.preheader
for.body12.preheader: ; preds = %for.body12.lr.ph, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre52, %for.body12.lr.ph ]
%i7.050.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body12.lr.ph ]
%.add184749.ph = phi i64 [ %18, %middle.block ], [ %ans.promoted, %for.body12.lr.ph ]
br label %for.body12
for.body: ; preds = %for.body, %for.body.preheader.new
%19 = phi i64 [ %.pre, %for.body.preheader.new ], [ %add.1, %for.body ]
%i.046 = phi i64 [ 0, %for.body.preheader.new ], [ %add5.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%arrayidx1 = getelementptr inbounds [300010 x i8], ptr @s, i64 0, i64 %i.046
%20 = load i8, ptr %arrayidx1, align 2, !tbaa !9
%cmp2 = icmp eq i8 %20, 69
%conv4 = zext i1 %cmp2 to i64
%add = add nsw i64 %19, %conv4
%add5 = or i64 %i.046, 1
%arrayidx6 = getelementptr inbounds [300010 x i64], ptr @a, i64 0, i64 %add5
store i64 %add, ptr %arrayidx6, align 8, !tbaa !5
%arrayidx1.1 = getelementptr inbounds [300010 x i8], ptr @s, i64 0, i64 %add5
%21 = load i8, ptr %arrayidx1.1, align 1, !tbaa !9
%cmp2.1 = icmp eq i8 %21, 69
%conv4.1 = zext i1 %cmp2.1 to i64
%add.1 = add nsw i64 %add, %conv4.1
%add5.1 = add nuw nsw i64 %i.046, 2
%arrayidx6.1 = getelementptr inbounds [300010 x i64], ptr @a, i64 0, i64 %add5.1
store i64 %add.1, ptr %arrayidx6.1, align 16, !tbaa !5
%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.cond8.preheader.unr-lcssa, label %for.body, !llvm.loop !14
for.cond8.for.cond.cleanup11_crit_edge: ; preds = %for.body12, %middle.block
%.add18.lcssa = phi i64 [ %18, %middle.block ], [ %.add18, %for.body12 ]
store i64 %.add18.lcssa, ptr @ans, align 8, !tbaa !5
br label %for.cond.cleanup11
for.cond.cleanup11: ; preds = %for.cond8.preheader.for.cond.cleanup11_crit_edge, %for.cond8.for.cond.cleanup11_crit_edge
%22 = phi i64 [ %.pre53, %for.cond8.preheader.for.cond.cleanup11_crit_edge ], [ %.add18.lcssa, %for.cond8.for.cond.cleanup11_crit_edge ]
%call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %22)
ret i32 0
for.body12: ; preds = %for.body12.preheader, %for.body12
%scalar.recur = phi i64 [ %23, %for.body12 ], [ %scalar.recur.ph, %for.body12.preheader ]
%i7.050 = phi i64 [ %add15, %for.body12 ], [ %i7.050.ph, %for.body12.preheader ]
%.add184749 = phi i64 [ %.add18, %for.body12 ], [ %.add184749.ph, %for.body12.preheader ]
%add15 = add nuw nsw i64 %i7.050, 1
%arrayidx16 = getelementptr inbounds [300010 x i64], ptr @a, i64 0, i64 %add15
%23 = load i64, ptr %arrayidx16, align 8, !tbaa !5
%24 = add i64 %i7.050, %3
%25 = add i64 %scalar.recur, %23
%add18 = sub i64 %24, %25
%.add18 = tail call i64 @llvm.smin.i64(i64 %.add184749, i64 %add18)
%exitcond51.not = icmp eq i64 %add15, %0
br i1 %exitcond51.not, label %for.cond8.for.cond.cleanup11_crit_edge, label %for.body12, !llvm.loop !15
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11, !13, !12}
|
#include <stdio.h>
void swap(int *a,int *b)
{
int t=*a;
*a=*b;
*b=t;
}
int main(void)
{
int t;
scanf("%d",&t);
while(t--)
{
int a,b,c,r;
scanf("%d %d %d %d",&a,&b,&c,&r);
if(a>b) swap(&a,&b);
if(!r || c+r<a || c-r>b) printf("%d\n",b-a);
else if(c-r<a && c+r>b) printf("0\n");
else if(c-r<a && c+r<=b) printf("%d\n",b-(c+r));
else if(c-r>=a && c+r>b) printf("%d\n",c-r-a);
else printf("%d\n",b-a-2*r);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [12 x i8] c"%d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: 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:
%t = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec48 = add nsw i32 %0, -1
store i32 %dec48, ptr %t, align 4, !tbaa !5
%tobool.not49 = icmp eq i32 %0, 0
br i1 %tobool.not49, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end42
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %r)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %1, %2
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %while.body
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %1, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%3 = phi i32 [ %1, %if.then ], [ %2, %while.body ]
%4 = phi i32 [ %2, %if.then ], [ %1, %while.body ]
%5 = load i32, ptr %r, align 4, !tbaa !5
%tobool2.not = icmp eq i32 %5, 0
br i1 %tobool2.not, label %if.then6, label %lor.lhs.false
lor.lhs.false: ; preds = %if.end
%6 = load i32, ptr %c, align 4, !tbaa !5
%add = add nsw i32 %6, %5
%cmp3 = icmp slt i32 %add, %4
br i1 %cmp3, label %if.then6, label %lor.lhs.false4
lor.lhs.false4: ; preds = %lor.lhs.false
%sub = sub nsw i32 %6, %5
%cmp5 = icmp sgt i32 %sub, %3
br i1 %cmp5, label %if.then6, label %if.else
if.then6: ; preds = %lor.lhs.false4, %lor.lhs.false, %if.end
%sub7 = sub nsw i32 %3, %4
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub7)
br label %if.end42
if.else: ; preds = %lor.lhs.false4
%cmp10 = icmp slt i32 %sub, %4
%cmp12 = icmp sgt i32 %add, %3
%or.cond = and i1 %cmp10, %cmp12
br i1 %or.cond, label %if.then13, label %if.else15
if.then13: ; preds = %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end42
if.else15: ; preds = %if.else
br i1 %cmp10, label %land.lhs.true18, label %land.lhs.true28
land.lhs.true18: ; preds = %if.else15
br i1 %cmp12, label %if.else35, label %if.then21
if.then21: ; preds = %land.lhs.true18
%sub23 = sub nsw i32 %3, %add
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub23)
br label %if.end42
land.lhs.true28: ; preds = %if.else15
br i1 %cmp12, label %if.then31, label %if.else35
if.then31: ; preds = %land.lhs.true28
%sub33 = sub nsw i32 %sub, %4
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub33)
br label %if.end42
if.else35: ; preds = %land.lhs.true18, %land.lhs.true28
%mul.neg = mul i32 %5, -2
%.neg47 = sub i32 %mul.neg, %4
%sub37 = add i32 %.neg47, %3
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub37)
br label %if.end42
if.end42: ; preds = %if.then13, %if.then31, %if.else35, %if.then21, %if.then6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
%7 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %7, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %7, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end42, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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"}
|
#include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b){
return *(int *)a - *(int *)b;
}
int main()
{
int N, M, x[100000], d[100000];
scanf("%d%d", &N, &M);
int lmax = 0, lmaxindex = -1;
for(int m=0; m<M; m++){
scanf("%d", x+m);
}
/* sort at x */
qsort(x, M, sizeof(int), cmp);
for(int m=1; m<M; m++){
d[m-1] = x[m] - x[m-1];
}
/* sort at d */
qsort(d, M-1, sizeof(int), cmp);
int res = 0;
for(int i=0; i<M-N; i++){
res += d[i];
}
printf("%d\n", res);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135053/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%x = alloca [100000 x i32], align 16
%d = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #6
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %d) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %M, align 4, !tbaa !5
%cmp44 = icmp sgt i32 %0, 0
br i1 %cmp44, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre63 = sext i32 %0 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre63, %entry.for.cond.cleanup_crit_edge ], [ %13, %for.body ]
call void @qsort(ptr noundef nonnull %x, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #6
%1 = load i32, ptr %M, align 4, !tbaa !5
%cmp546 = icmp sgt i32 %1, 1
br i1 %cmp546, label %for.body8.preheader, label %for.cond.cleanup7
for.body8.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %1 to i64
%.pre = load i32, ptr %x, align 16, !tbaa !5
%2 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %1, 9
br i1 %min.iters.check, label %for.body8.preheader81, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %2, -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.load64, %vector.body ]
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load64 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load64, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%7 = sub nsw <4 x i32> %wide.load, %5
%8 = sub nsw <4 x i32> %wide.load64, %6
%9 = getelementptr inbounds [100000 x i32], ptr %d, i64 0, i64 %index
store <4 x i32> %7, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> %8, ptr %10, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %2, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load64, i64 3
br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader81
for.body8.preheader81: ; preds = %for.body8.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body8.preheader ]
%indvars.iv54.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 ]
%add.ptr = getelementptr inbounds i32, ptr %x, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %M, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond.cleanup
%sub19 = add nsw i32 %1, -1
%conv20 = sext i32 %sub19 to i64
call void @qsort(ptr noundef nonnull %d, i64 noundef %conv20, i64 noundef 4, ptr noundef nonnull @cmp) #6
%14 = load i32, ptr %M, align 4, !tbaa !5
%15 = load i32, ptr %N, align 4, !tbaa !5
%sub22 = sub nsw i32 %14, %15
%cmp2349 = icmp sgt i32 %sub22, 0
br i1 %cmp2349, label %for.body26.preheader, label %for.cond.cleanup25
for.body26.preheader: ; preds = %for.cond.cleanup7
%wide.trip.count61 = zext i32 %sub22 to i64
%min.iters.check67 = icmp ult i32 %sub22, 8
br i1 %min.iters.check67, label %for.body26.preheader79, label %vector.ph68
vector.ph68: ; preds = %for.body26.preheader
%n.vec70 = and i64 %wide.trip.count61, 4294967288
br label %vector.body73
vector.body73: ; preds = %vector.body73, %vector.ph68
%index74 = phi i64 [ 0, %vector.ph68 ], [ %index.next78, %vector.body73 ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph68 ], [ %18, %vector.body73 ]
%vec.phi75 = phi <4 x i32> [ zeroinitializer, %vector.ph68 ], [ %19, %vector.body73 ]
%16 = getelementptr inbounds [100000 x i32], ptr %d, i64 0, i64 %index74
%wide.load76 = load <4 x i32>, ptr %16, align 16, !tbaa !5
%17 = getelementptr inbounds i32, ptr %16, i64 4
%wide.load77 = load <4 x i32>, ptr %17, align 16, !tbaa !5
%18 = add <4 x i32> %wide.load76, %vec.phi
%19 = add <4 x i32> %wide.load77, %vec.phi75
%index.next78 = add nuw i64 %index74, 8
%20 = icmp eq i64 %index.next78, %n.vec70
br i1 %20, label %middle.block65, label %vector.body73, !llvm.loop !14
middle.block65: ; preds = %vector.body73
%bin.rdx = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n72 = icmp eq i64 %n.vec70, %wide.trip.count61
br i1 %cmp.n72, label %for.cond.cleanup25, label %for.body26.preheader79
for.body26.preheader79: ; preds = %for.body26.preheader, %middle.block65
%indvars.iv58.ph = phi i64 [ 0, %for.body26.preheader ], [ %n.vec70, %middle.block65 ]
%res.050.ph = phi i32 [ 0, %for.body26.preheader ], [ %21, %middle.block65 ]
br label %for.body26
for.body8: ; preds = %for.body8.preheader81, %for.body8
%scalar.recur = phi i32 [ %22, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader81 ]
%indvars.iv54 = phi i64 [ %indvars.iv.next55, %for.body8 ], [ %indvars.iv54.ph, %for.body8.preheader81 ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %indvars.iv54
%22 = load i32, ptr %arrayidx, align 4, !tbaa !5
%23 = add nsw i64 %indvars.iv54, -1
%sub11 = sub nsw i32 %22, %scalar.recur
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr %d, i64 0, i64 %23
store i32 %sub11, ptr %arrayidx14, align 4, !tbaa !5
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !15
for.cond.cleanup25: ; preds = %for.body26, %middle.block65, %for.cond.cleanup7
%res.0.lcssa = phi i32 [ 0, %for.cond.cleanup7 ], [ %21, %middle.block65 ], [ %add, %for.body26 ]
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %res.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %x) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
for.body26: ; preds = %for.body26.preheader79, %for.body26
%indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.body26 ], [ %indvars.iv58.ph, %for.body26.preheader79 ]
%res.050 = phi i32 [ %add, %for.body26 ], [ %res.050.ph, %for.body26.preheader79 ]
%arrayidx28 = getelementptr inbounds [100000 x i32], ptr %d, i64 0, i64 %indvars.iv58
%24 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%add = add nsw i32 %24, %res.050
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond62.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count61
br i1 %exitcond62.not, label %for.cond.cleanup25, label %for.body26, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !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>
static int compare(const void* a, const void* b)
{
int aNum = *(int*)a;
int bNum = *(int*)b;
return aNum-bNum;
}
int main(void)
{
int n, m, x[10*10*10*10*10], i, ans=0, diff[10*10*10*10*10];
scanf("%d%d", &n, &m);
for(i=0;i<m;i++){
scanf("%d", &x[i]);
}
if(n>=m){
ans=0;
printf("%d\n", ans);
return 0;
}
qsort(x, m, sizeof(int), compare);
for(i=0;i<m-1;i++){
diff[i]=x[i+1]-x[i];
}
qsort(diff, m-1, sizeof(int), compare);
for(i=0;i<m-n;i++){
ans=ans+diff[i];
}
if(n==1){
ans=x[m-1]-x[0];
printf("%d\n", ans);
return 0;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135097/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135097/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%x = alloca [100000 x i32], align 16
%diff = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %diff) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, 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 [100000 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %m, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa62 = phi i32 [ %0, %entry ], [ %1, %for.body ]
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp2.not = icmp slt i32 %3, %.lcssa62
br i1 %cmp2.not, label %if.end, label %cleanup
if.end: ; preds = %for.end
%conv = sext i32 %.lcssa62 to i64
call void @qsort(ptr noundef nonnull %x, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @compare) #6
%4 = load i32, ptr %m, align 4, !tbaa !5
%sub = add i32 %4, -1
%cmp565 = icmp sgt i32 %4, 1
br i1 %cmp565, label %for.body7.preheader, label %for.end17
for.body7.preheader: ; preds = %if.end
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %x, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body7.preheader100, 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.load83, %vector.body ]
%5 = or i64 %index, 1
%6 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %5
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load83 = 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.load83, <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.load83, %9
%12 = getelementptr inbounds [100000 x i32], ptr %diff, i64 0, 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 !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load83, i64 3
br i1 %cmp.n, label %for.end17, label %for.body7.preheader100
for.body7.preheader100: ; preds = %for.body7.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body7.preheader ]
%indvars.iv75.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body7.preheader ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader100, %for.body7
%scalar.recur = phi i32 [ %15, %for.body7 ], [ %scalar.recur.ph, %for.body7.preheader100 ]
%indvars.iv75 = phi i64 [ %indvars.iv.next76, %for.body7 ], [ %indvars.iv75.ph, %for.body7.preheader100 ]
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %indvars.iv.next76
%15 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%sub12 = sub nsw i32 %15, %scalar.recur
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr %diff, i64 0, i64 %indvars.iv75
store i32 %sub12, ptr %arrayidx14, align 4, !tbaa !5
%exitcond.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count
br i1 %exitcond.not, label %for.end17, label %for.body7, !llvm.loop !14
for.end17: ; preds = %for.body7, %middle.block, %if.end
%conv20 = sext i32 %sub to i64
call void @qsort(ptr noundef nonnull %diff, i64 noundef %conv20, i64 noundef 4, ptr noundef nonnull @compare) #6
%16 = load i32, ptr %m, align 4, !tbaa !5
%17 = load i32, ptr %n, align 4, !tbaa !5
%sub22 = sub nsw i32 %16, %17
%cmp2368 = icmp sgt i32 %sub22, 0
br i1 %cmp2368, label %for.body25.preheader, label %for.end31
for.body25.preheader: ; preds = %for.end17
%wide.trip.count81 = zext i32 %sub22 to i64
%min.iters.check86 = icmp ult i32 %sub22, 8
br i1 %min.iters.check86, label %for.body25.preheader98, label %vector.ph87
vector.ph87: ; preds = %for.body25.preheader
%n.vec89 = and i64 %wide.trip.count81, 4294967288
br label %vector.body92
vector.body92: ; preds = %vector.body92, %vector.ph87
%index93 = phi i64 [ 0, %vector.ph87 ], [ %index.next97, %vector.body92 ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph87 ], [ %20, %vector.body92 ]
%vec.phi94 = phi <4 x i32> [ zeroinitializer, %vector.ph87 ], [ %21, %vector.body92 ]
%18 = getelementptr inbounds [100000 x i32], ptr %diff, i64 0, i64 %index93
%wide.load95 = load <4 x i32>, ptr %18, align 16, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
%wide.load96 = load <4 x i32>, ptr %19, align 16, !tbaa !5
%20 = add <4 x i32> %wide.load95, %vec.phi
%21 = add <4 x i32> %wide.load96, %vec.phi94
%index.next97 = add nuw i64 %index93, 8
%22 = icmp eq i64 %index.next97, %n.vec89
br i1 %22, label %middle.block84, label %vector.body92, !llvm.loop !15
middle.block84: ; preds = %vector.body92
%bin.rdx = add <4 x i32> %21, %20
%23 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n91 = icmp eq i64 %n.vec89, %wide.trip.count81
br i1 %cmp.n91, label %for.end31, label %for.body25.preheader98
for.body25.preheader98: ; preds = %for.body25.preheader, %middle.block84
%indvars.iv78.ph = phi i64 [ 0, %for.body25.preheader ], [ %n.vec89, %middle.block84 ]
%ans.070.ph = phi i32 [ 0, %for.body25.preheader ], [ %23, %middle.block84 ]
br label %for.body25
for.body25: ; preds = %for.body25.preheader98, %for.body25
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body25 ], [ %indvars.iv78.ph, %for.body25.preheader98 ]
%ans.070 = phi i32 [ %add28, %for.body25 ], [ %ans.070.ph, %for.body25.preheader98 ]
%arrayidx27 = getelementptr inbounds [100000 x i32], ptr %diff, i64 0, i64 %indvars.iv78
%24 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%add28 = add nsw i32 %24, %ans.070
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%exitcond82.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count81
br i1 %exitcond82.not, label %for.end31, label %for.body25, !llvm.loop !16
for.end31: ; preds = %for.body25, %middle.block84, %for.end17
%ans.0.lcssa = phi i32 [ 0, %for.end17 ], [ %23, %middle.block84 ], [ %add28, %for.body25 ]
%cmp32 = icmp eq i32 %17, 1
br i1 %cmp32, label %if.then34, label %cleanup
if.then34: ; preds = %for.end31
%sub35 = add nsw i32 %16, -1
%idxprom36 = sext i32 %sub35 to i64
%arrayidx37 = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %idxprom36
%25 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%26 = load i32, ptr %x, align 16, !tbaa !5
%sub39 = sub nsw i32 %25, %26
br label %cleanup
cleanup: ; preds = %for.end31, %for.end, %if.then34
%ans.0.lcssa.sink = phi i32 [ %sub39, %if.then34 ], [ 0, %for.end ], [ %ans.0.lcssa, %for.end31 ]
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %diff) #6
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %x) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define internal i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #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 "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10, !12, !13}
!16 = distinct !{!16, !10, !13, !12}
|
#include <stdio.h>
int main()
{
int t;
int p, q, a, b, c, d;
int x;
int arr[1001];
scanf("%d", &t);
for (int i = 0; i < t; i++)
{
scanf("%d%d%d%d", &p, &q, &c, &d);
a = p < q ? p : q;
b = p < q ? q : p;
if (c - d < a)
{
x = c + d<a ? b - a : c + d>b ? 0 : b - c - d;
}
else if (c - d < b)
{
x = c + d < b ? b - a - 2 * d : c - d - a;
}
else
{
x = b - a;
}
arr[i] = x;
}
for (int i = 0; i < t; i++)
{
printf("%d\n", arr[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13514/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13514/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%p = alloca i32, align 4
%q = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%arr = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #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 4004, ptr nonnull %arr) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body, label %for.cond.cleanup42
for.cond40.preheader: ; preds = %if.end38
%1 = icmp sgt i32 %8, 0
br i1 %1, label %for.body43, label %for.cond.cleanup42
for.body: ; preds = %entry, %if.end38
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end38 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %p, ptr noundef nonnull %q, ptr noundef nonnull %c, ptr noundef nonnull %d)
%2 = load i32, ptr %p, align 4
%3 = load i32, ptr %q, align 4
%cond = call i32 @llvm.smin.i32(i32 %2, i32 %3)
%cond7 = call i32 @llvm.smax.i32(i32 %2, i32 %3)
%4 = load i32, ptr %c, align 4, !tbaa !5
%5 = load i32, ptr %d, align 4, !tbaa !5
%sub = sub nsw i32 %4, %5
%cmp8 = icmp slt i32 %sub, %cond
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = add nsw i32 %5, %4
%cmp9 = icmp slt i32 %add, %cond
br i1 %cmp9, label %cond.true10, label %cond.false12
cond.true10: ; preds = %if.then
%sub11 = sub nsw i32 %cond7, %cond
br label %if.end38
cond.false12: ; preds = %if.then
%cmp14 = icmp sgt i32 %add, %cond7
%sub18 = sub i32 %cond7, %add
%spec.select = select i1 %cmp14, i32 0, i32 %sub18
br label %if.end38
if.else: ; preds = %for.body
%cmp24 = icmp slt i32 %sub, %cond7
br i1 %cmp24, label %if.then25, label %if.else36
if.then25: ; preds = %if.else
%add26 = add nsw i32 %5, %4
%cmp27 = icmp slt i32 %add26, %cond7
%6 = shl i32 %5, 1
%7 = add i32 %cond, %6
%sub30 = sub i32 %cond7, %7
%sub33 = sub nsw i32 %sub, %cond
%cond35 = select i1 %cmp27, i32 %sub30, i32 %sub33
br label %if.end38
if.else36: ; preds = %if.else
%sub37 = sub nsw i32 %cond7, %cond
br label %if.end38
if.end38: ; preds = %cond.false12, %cond.true10, %if.then25, %if.else36
%x.0 = phi i32 [ %cond35, %if.then25 ], [ %sub37, %if.else36 ], [ %sub11, %cond.true10 ], [ %spec.select, %cond.false12 ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %arr, i64 0, i64 %indvars.iv
store i32 %x.0, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %t, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond40.preheader, !llvm.loop !9
for.cond.cleanup42: ; preds = %for.body43, %entry, %for.cond40.preheader
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %arr) #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 %q) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body43: ; preds = %for.cond40.preheader, %for.body43
%indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body43 ], [ 0, %for.cond40.preheader ]
%arrayidx45 = getelementptr inbounds [1001 x i32], ptr %arr, i64 0, i64 %indvars.iv70
%10 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%11 = load i32, ptr %t, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp41 = icmp slt i64 %indvars.iv.next71, %12
br i1 %cmp41, label %for.body43, label %for.cond.cleanup42, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#define ZERO 0 /*0???????????????*/
#define ONE 1 /*1???????????????*/
#define TWO 2 /*2???????????????*/
#define THREE 3 /*3???????????????*/
#define FOUR 4 /*4???????????????*/
#define FIVE 5 /*5???????????????*/
#define HUNDRED 100 /*100???????????????*/
#define DICE_SURF 6 /*?????????????????¢??°*/
int main( void )
{
unsigned char ubW_Ddice[ HUNDRED ] [ DICE_SURF ]; /*?????????????????°?????????*/
unsigned char ubW_Dn; /*????????????????????°*/
unsigned char ubW_Dtrade; /*??????????\???¨?????°*/
unsigned char ubW_Dcalc; /*?¨??????¨?????°*/
unsigned char ubW_Fflug = ZERO; /*??¶????????´????????°*/
unsigned char ubW_Ci; /*????????????i*/
unsigned char ubW_Cj; /*????????????j*/
unsigned char ubW_Ck; /*????????????k*/
scanf("%d", &ubW_Dn); /*????????????????????°????????????*/
/*?????????????????°???????????????*/
for( ubW_Ci = ZERO; ubW_Ci < ubW_Dn; ubW_Ci++){
/*??¢?????°???????????????*/
for( ubW_Cj = ZERO; ubW_Cj < DICE_SURF; ubW_Cj++ ){
scanf("%d", &ubW_Ddice[ ubW_Ci ] [ ubW_Cj ] ); /*????????????n?????°???????????????*/
}
}
/*??????????????????????????´?????????*/
for( ubW_Ci = ZERO; ubW_Ci < ubW_Dn; ubW_Ci++){
/*??????????????????????????´?????????*/
for( ubW_Cj = ubW_Ci + ONE; ubW_Cj < ubW_Dn; ubW_Cj++){
/*??¢??????????????????????????????*/
for( ubW_Ck = ONE; ubW_Ck <= DICE_SURF; ubW_Ck++ ){
ubW_Dcalc = ubW_Ck % TWO; /*i%2??????switch??????????????????*/
/*????????¢??¨????????¢?????°?????????????????£????????¨????????¢????????????*/
switch( ubW_Dcalc ){
case ZERO: /*??¶??°???????????¢*/
ubW_Dtrade = ubW_Ddice[ ubW_Cj ] [ ZERO ]; /*1?????¢???????????¨?????°?????????*/
ubW_Ddice[ ubW_Cj ] [ ZERO ] = ubW_Ddice[ ubW_Cj] [ TWO ]; /*1?????¢???3?????¢????????????*/
ubW_Ddice[ ubW_Cj ] [ TWO ] = ubW_Ddice[ ubW_Cj] [ FIVE ]; /*3?????¢???6?????¢????????????*/
ubW_Ddice[ ubW_Cj ] [ FIVE ] = ubW_Ddice[ ubW_Cj] [ THREE ]; /*6?????¢???4?????¢????????????*/
ubW_Ddice[ ubW_Cj ] [ THREE ] = ubW_Dtrade; /*4?????¢???1?????¢????????????*/
break;
case ONE: /*?\???°???????????¢*/
ubW_Dtrade = ubW_Ddice[ ubW_Cj ] [ ZERO ]; /*1?????¢???????????¨?????°?????????*/
ubW_Ddice[ ubW_Cj ] [ ZERO ] = ubW_Ddice[ ubW_Cj ] [ ONE ]; /*1?????¢???2?????¢????????????*/
ubW_Ddice[ ubW_Cj ] [ ONE ] = ubW_Ddice[ ubW_Cj ] [ FIVE ]; /*2?????¢???6?????¢????????????*/
ubW_Ddice[ ubW_Cj ] [ FIVE ] = ubW_Ddice[ ubW_Cj ] [ FOUR ]; /*6?????¢???5?????¢????????????*/
ubW_Ddice[ ubW_Cj ] [ FOUR ] = ubW_Dtrade; /*5?????¢???1?????¢????????????*/
break;
default:
/*default?????????????????????????????\*/
break;
}
/*1?????¢??¨6?????¢????????´??????????????´???*/
if( ( ubW_Ddice[ ubW_Ci ] [ ZERO ] == ubW_Ddice[ ubW_Cj ] [ ZERO ] ) && ( ubW_Ddice[ ubW_Ci ] [ FIVE ] == ubW_Ddice[ ubW_Cj ] [ FIVE ] ) ){
/*2?????¢??¨3?????¢????????´??????????????´???*/
if( ( ubW_Ddice[ ubW_Ci ] [ ONE ] == ubW_Ddice[ ubW_Cj ] [ ONE ] ) && ( ubW_Ddice[ ubW_Ci ] [ TWO ] == ubW_Ddice[ ubW_Cj ] [ TWO ] ) ){
/*5?????¢??¨4?????¢????????´??????????????´???*/
if( ( ubW_Ddice[ ubW_Ci ] [ FOUR ] == ubW_Ddice[ ubW_Cj ] [ FOUR ] ) && ( ubW_Ddice[ ubW_Ci ] [ THREE ] == ubW_Ddice[ ubW_Cj ] [ THREE ] ) ){
printf("No\n"); /*?????´?????????????????§flug???true???*/
return ZERO;
}
else{
/* else?????????????????????????????\ */
}
}
/*?????????????????????2?????¢??¨?????????????????????3?????¢????????´???????????????????????????3?????¢??¨?????????????????????5?????¢????????´??????????????´???*/
else if( ( ubW_Ddice[ ubW_Ci ] [ ONE ] == ubW_Ddice[ ubW_Cj ] [ TWO ] ) && ( ubW_Ddice[ ubW_Ci ] [ TWO ] == ubW_Ddice[ ubW_Cj ] [ FOUR ] ) ){
/*?????????????????????5?????¢??¨?????????????????????4?????¢????????´???????????????????????????4?????¢??¨?????????????????????2?????¢????????´??????????????´???*/
if( ( ubW_Ddice[ ubW_Ci ] [ FOUR ] == ubW_Ddice[ ubW_Cj ] [ THREE ] ) && ( ubW_Ddice[ ubW_Ci ] [ THREE ] == ubW_Ddice[ ubW_Cj ] [ ONE ] ) ){
printf("No\n"); /*?????´?????????????????§flug???true???*/
return ZERO;
}
else{
/* else?????????????????????????????\ */
}
}
/*?????????????????????2?????¢??¨?????????????????????5?????¢????????´???????????????????????????3?????¢??¨?????????????????????4?????¢????????´??????????????´???*/
else if( ( ubW_Ddice[ ubW_Ci ] [ ONE ] == ubW_Ddice[ ubW_Cj ] [ FOUR ] ) && ( ubW_Ddice[ ubW_Ci ] [ TWO ] == ubW_Ddice[ ubW_Cj ] [ THREE ] ) ){
/*?????????????????????5?????¢??¨?????????????????????2?????¢????????´???????????????????????????4?????¢??¨?????????????????????3?????¢????????´??????????????´???*/
if( ( ubW_Ddice[ ubW_Ci ] [ FOUR ] == ubW_Ddice[ ubW_Cj ] [ ONE ] ) && ( ubW_Ddice[ ubW_Ci ] [ THREE ] == ubW_Ddice[ ubW_Cj ] [ TWO ] ) ){
printf("No\n"); /*?????´?????????????????§flug???true???*/
return ZERO;
}
else{
/* else?????????????????????????????\ */
}
}
/*?????????????????????2?????¢??¨?????????????????????4?????¢????????´???????????????????????????3?????¢??¨?????????????????????2?????¢????????´??????????????´???*/
else if( ( ubW_Ddice[ ubW_Ci ] [ ONE ] == ubW_Ddice[ ubW_Cj ] [ THREE ] ) && ( ubW_Ddice[ ubW_Ci ] [ TWO ] == ubW_Ddice[ ubW_Cj ] [ ONE ] ) ){
/*?????????????????????5?????¢??¨?????????????????????3?????¢????????´???????????????????????????4?????¢??¨?????????????????????5?????¢????????´??????????????´???*/
if( ( ubW_Ddice[ ubW_Ci ] [ FOUR ] == ubW_Ddice[ ubW_Cj ] [ TWO ] ) && ( ubW_Ddice[ ubW_Ci ] [ THREE ] == ubW_Ddice[ ubW_Cj ] [ FOUR ] ) ){
printf("No\n"); /*?????´?????????????????§flug???true???*/
return ZERO;
}
else{
/* else?????????????????????????????\ */
}
}
else{
/* else?????????????????????????????\ */
}
}
else{
/* else?????????????????????????????\ */
}
}/*??¢????????????????????????????????????*/
}/* ??????????????????????????´???????????????*/
}/*??????????????????????????´???????????????*/
printf("Yes\n");
return ZERO;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135190/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135190/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.6 = 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:
%ubW_Ddice = alloca [100 x [6 x i8]], align 16
%ubW_Dn = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %ubW_Ddice) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ubW_Dn) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ubW_Dn)
%0 = load i8, ptr %ubW_Dn, align 1, !tbaa !5
%cmp388.not = icmp eq i8 %0, 0
br i1 %cmp388.not, label %cleanup, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry, %for.cond3.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond3.preheader ], [ 0, %entry ]
%arrayidx9 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv, i64 0
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9)
%arrayidx9.1 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv, i64 1
%call10.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9.1)
%arrayidx9.2 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv, i64 2
%call10.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9.2)
%arrayidx9.3 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv, i64 3
%call10.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9.3)
%arrayidx9.4 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv, i64 4
%call10.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9.4)
%arrayidx9.5 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv, i64 5
%call10.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9.5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i8, ptr %ubW_Dn, align 1, !tbaa !5
%2 = zext i8 %1 to i64
%cmp = icmp ult i64 %indvars.iv.next, %2
br i1 %cmp, label %for.cond3.preheader, label %for.cond14.preheader, !llvm.loop !8
for.cond14.preheader: ; preds = %for.cond3.preheader
%cmp17394.not = icmp eq i8 %1, 0
br i1 %cmp17394.not, label %cleanup, label %for.cond22.preheader.preheader
for.cond22.preheader.preheader: ; preds = %for.cond14.preheader
%3 = zext i8 %1 to i64
br label %for.cond22.preheader
for.cond22.preheader: ; preds = %for.cond22.preheader.preheader, %for.inc307
%indvars.iv404 = phi i64 [ 0, %for.cond22.preheader.preheader ], [ %indvars.iv.next405, %for.inc307 ]
%indvars.iv399 = phi i64 [ 1, %for.cond22.preheader.preheader ], [ %indvars.iv.next400, %for.inc307 ]
%indvars.iv.next405 = add nuw nsw i64 %indvars.iv404, 1
%cmp25392 = icmp ult i64 %indvars.iv.next405, %3
br i1 %cmp25392, label %for.cond28.preheader.lr.ph, label %for.inc307
for.cond28.preheader.lr.ph: ; preds = %for.cond22.preheader
%arrayidx86 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv404
%arrayidx97 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv404, i64 5
%arrayidx107 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv404, i64 1
%arrayidx118 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv404, i64 2
%arrayidx271 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv404, i64 4
%arrayidx282 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv404, i64 3
br label %for.cond28.preheader
for.cond22.loopexit: ; preds = %for.inc301
%indvars.iv.next402 = add nuw nsw i64 %indvars.iv401, 1
%cmp25 = icmp ult i64 %indvars.iv.next402, %3
br i1 %cmp25, label %for.cond28.preheader, label %for.inc307, !llvm.loop !10
for.cond28.preheader: ; preds = %for.cond28.preheader.lr.ph, %for.cond22.loopexit
%indvars.iv401 = phi i64 [ %indvars.iv399, %for.cond28.preheader.lr.ph ], [ %indvars.iv.next402, %for.cond22.loopexit ]
%arrayidx90 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv401
%arrayidx66 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv401, i64 1
%arrayidx72 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv401, i64 5
%arrayidx78 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv401, i64 4
%arrayidx41 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv401, i64 2
%arrayidx53 = getelementptr inbounds [100 x [6 x i8]], ptr %ubW_Ddice, i64 0, i64 %indvars.iv401, i64 3
br label %for.body32
for.body32: ; preds = %for.cond28.preheader, %for.inc301
%ubW_Ck.0390 = phi i8 [ 1, %for.cond28.preheader ], [ %inc302, %for.inc301 ]
%4 = and i8 %ubW_Ck.0390, 1
%trunc.not = icmp eq i8 %4, 0
%5 = load i8, ptr %arrayidx90, align 2, !tbaa !5
br i1 %trunc.not, label %sw.bb, label %sw.bb60
sw.bb: ; preds = %for.body32
%6 = load i8, ptr %arrayidx41, align 2, !tbaa !5
store i8 %6, ptr %arrayidx90, align 2, !tbaa !5
%7 = load i8, ptr %arrayidx72, align 1, !tbaa !5
store i8 %7, ptr %arrayidx41, align 2, !tbaa !5
%8 = load i8, ptr %arrayidx53, align 1, !tbaa !5
store i8 %8, ptr %arrayidx72, align 1, !tbaa !5
store i8 %5, ptr %arrayidx53, align 1, !tbaa !5
br label %sw.epilog
sw.bb60: ; preds = %for.body32
%9 = load i8, ptr %arrayidx66, align 1, !tbaa !5
store i8 %9, ptr %arrayidx90, align 2, !tbaa !5
%10 = load i8, ptr %arrayidx72, align 1, !tbaa !5
store i8 %10, ptr %arrayidx66, align 1, !tbaa !5
%11 = load i8, ptr %arrayidx78, align 2, !tbaa !5
store i8 %11, ptr %arrayidx72, align 1, !tbaa !5
store i8 %5, ptr %arrayidx78, align 2, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %sw.bb60, %sw.bb
%12 = phi i8 [ %11, %sw.bb60 ], [ %8, %sw.bb ]
%13 = phi i8 [ %9, %sw.bb60 ], [ %6, %sw.bb ]
%14 = load i8, ptr %arrayidx86, align 2, !tbaa !5
%cmp93 = icmp eq i8 %14, %13
br i1 %cmp93, label %land.lhs.true, label %for.inc301
land.lhs.true: ; preds = %sw.epilog
%15 = load i8, ptr %arrayidx97, align 1, !tbaa !5
%cmp103 = icmp eq i8 %15, %12
br i1 %cmp103, label %if.then, label %for.inc301
if.then: ; preds = %land.lhs.true
%16 = load i8, ptr %arrayidx107, align 1, !tbaa !5
%17 = load i8, ptr %arrayidx66, align 1, !tbaa !5
%cmp113 = icmp eq i8 %16, %17
%.pre = load i8, ptr %arrayidx41, align 2, !tbaa !5
br i1 %cmp113, label %land.lhs.true115, label %if.then.if.else150_crit_edge
if.then.if.else150_crit_edge: ; preds = %if.then
%.pre408.pre = load i8, ptr %arrayidx78, align 2, !tbaa !5
br label %if.else150
land.lhs.true115: ; preds = %if.then
%18 = load i8, ptr %arrayidx118, align 2, !tbaa !5
%cmp124 = icmp eq i8 %18, %.pre
%.pre408.pre410 = load i8, ptr %arrayidx78, align 2, !tbaa !5
br i1 %cmp124, label %if.then126, label %if.else150
if.then126: ; preds = %land.lhs.true115
%19 = load i8, ptr %arrayidx271, align 2, !tbaa !5
%cmp135 = icmp eq i8 %19, %.pre408.pre410
br i1 %cmp135, label %land.lhs.true137, label %for.inc301
land.lhs.true137: ; preds = %if.then126
%20 = load i8, ptr %arrayidx282, align 1, !tbaa !5
%21 = load i8, ptr %arrayidx53, align 1, !tbaa !5
%cmp146 = icmp eq i8 %20, %21
br i1 %cmp146, label %cleanup, label %for.inc301
if.else150: ; preds = %if.then.if.else150_crit_edge, %land.lhs.true115
%.pre408 = phi i8 [ %.pre408.pre, %if.then.if.else150_crit_edge ], [ %.pre408.pre410, %land.lhs.true115 ]
%cmp159 = icmp eq i8 %16, %.pre
br i1 %cmp159, label %land.lhs.true161, label %if.else150.if.else198_crit_edge
if.else150.if.else198_crit_edge: ; preds = %if.else150
%.pre409.pre = load i8, ptr %arrayidx53, align 1, !tbaa !5
br label %if.else198
land.lhs.true161: ; preds = %if.else150
%22 = load i8, ptr %arrayidx118, align 2, !tbaa !5
%cmp170 = icmp eq i8 %22, %.pre408
%.pre409.pre412 = load i8, ptr %arrayidx53, align 1, !tbaa !5
br i1 %cmp170, label %if.then172, label %if.else198
if.then172: ; preds = %land.lhs.true161
%23 = load i8, ptr %arrayidx271, align 2, !tbaa !5
%cmp181 = icmp eq i8 %23, %.pre409.pre412
br i1 %cmp181, label %land.lhs.true183, label %for.inc301
land.lhs.true183: ; preds = %if.then172
%24 = load i8, ptr %arrayidx282, align 1, !tbaa !5
%cmp192 = icmp eq i8 %24, %17
br i1 %cmp192, label %cleanup, label %for.inc301
if.else198: ; preds = %if.else150.if.else198_crit_edge, %land.lhs.true161
%.pre409 = phi i8 [ %.pre409.pre, %if.else150.if.else198_crit_edge ], [ %.pre409.pre412, %land.lhs.true161 ]
%cmp207 = icmp eq i8 %16, %.pre408
br i1 %cmp207, label %land.lhs.true209, label %if.else246
land.lhs.true209: ; preds = %if.else198
%25 = load i8, ptr %arrayidx118, align 2, !tbaa !5
%cmp218 = icmp eq i8 %25, %.pre409
br i1 %cmp218, label %if.then220, label %if.else246
if.then220: ; preds = %land.lhs.true209
%26 = load i8, ptr %arrayidx271, align 2, !tbaa !5
%cmp229 = icmp eq i8 %26, %17
br i1 %cmp229, label %land.lhs.true231, label %for.inc301
land.lhs.true231: ; preds = %if.then220
%27 = load i8, ptr %arrayidx282, align 1, !tbaa !5
%cmp240 = icmp eq i8 %27, %.pre
br i1 %cmp240, label %cleanup, label %for.inc301
if.else246: ; preds = %land.lhs.true209, %if.else198
%cmp255 = icmp eq i8 %16, %.pre409
br i1 %cmp255, label %land.lhs.true257, label %for.inc301
land.lhs.true257: ; preds = %if.else246
%28 = load i8, ptr %arrayidx118, align 2, !tbaa !5
%cmp266 = icmp eq i8 %28, %17
br i1 %cmp266, label %if.then268, label %for.inc301
if.then268: ; preds = %land.lhs.true257
%29 = load i8, ptr %arrayidx271, align 2, !tbaa !5
%cmp277 = icmp eq i8 %29, %.pre
br i1 %cmp277, label %land.lhs.true279, label %for.inc301
land.lhs.true279: ; preds = %if.then268
%30 = load i8, ptr %arrayidx282, align 1, !tbaa !5
%cmp288 = icmp eq i8 %30, %.pre408
br i1 %cmp288, label %cleanup, label %for.inc301
for.inc301: ; preds = %if.then172, %land.lhs.true183, %if.then268, %land.lhs.true279, %land.lhs.true257, %if.else246, %land.lhs.true231, %if.then220, %land.lhs.true137, %if.then126, %land.lhs.true, %sw.epilog
%inc302 = add nuw nsw i8 %ubW_Ck.0390, 1
%exitcond.not = icmp eq i8 %inc302, 7
br i1 %exitcond.not, label %for.cond22.loopexit, label %for.body32, !llvm.loop !11
for.inc307: ; preds = %for.cond22.loopexit, %for.cond22.preheader
%indvars.iv.next400 = add nuw nsw i64 %indvars.iv399, 1
%exitcond407.not = icmp eq i64 %indvars.iv.next405, %3
br i1 %exitcond407.not, label %cleanup, label %for.cond22.preheader, !llvm.loop !12
cleanup: ; preds = %for.inc307, %land.lhs.true279, %land.lhs.true231, %land.lhs.true183, %land.lhs.true137, %for.cond14.preheader, %entry
%str.sink = phi ptr [ @str, %entry ], [ @str, %for.cond14.preheader ], [ @str.6, %land.lhs.true137 ], [ @str.6, %land.lhs.true183 ], [ @str.6, %land.lhs.true231 ], [ @str.6, %land.lhs.true279 ], [ @str, %for.inc307 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ubW_Dn) #4
call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %ubW_Ddice) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}
|
#include <stdio.h>
typedef struct dice{
int men[6];
} Dice;
int main(void)
{
Dice dice[100], dice_memo;
int n;
int ans = 1;
int i, j, k, l, m, r;
scanf("%d", &n);
for(i = 0; i < n; i++)
for(j = 0; j < 6; j++)
scanf("%d", &dice[i].men[j]);
for(i = 0; i < 6; i++)
dice_memo.men[i] = dice[0].men[i];
for(i = 0; i < n - 1; i++){
for(j = i + 1; j < n; j++){
for(k = 0; k < 4; k++){
for(m = 0; m < 4; m++){
for(r = 0; r < 4; r++){
if(dice[i].men[0] == dice[j].men[0] && dice[i].men[1] == dice[j].men[1] && dice[i].men[2] == dice[j].men[2] && dice[i].men[3] == dice[j].men[3] && dice[i].men[4] == dice[j].men[4] && dice[i].men[5] == dice[j].men[5])
ans = 0;
else{
dice_memo.men[0] = dice[i].men[1];
dice_memo.men[1] = dice[i].men[5];
dice_memo.men[5] = dice[i].men[4];
dice_memo.men[4] = dice[i].men[0];
}
for(l = 0; l < 6; l++)
dice[i].men[l] = dice_memo.men[l];
}
dice_memo.men[0] = dice[i].men[3];
dice_memo.men[3] = dice[i].men[5];
dice_memo.men[5] = dice[i].men[2];
dice_memo.men[2] = dice[i].men[0];
for(l = 0; l < 6; l++)
dice[i].men[l] = dice_memo.men[l];
}
dice_memo.men[1] = dice[i].men[2];
dice_memo.men[2] = dice[i].men[4];
dice_memo.men[4] = dice[i].men[3];
dice_memo.men[3] = dice[i].men[1];
for(l = 0; l < 6; l++)
dice[i].men[l] = dice_memo.men[l];
}
}
for(l = 0; l < 6; l++)
dice_memo.men[l] = dice[i + 1].men[l];
}
if(ans)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135233/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135233/source.c"
target datalayout = "e-m:e-p270: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.dice = type { [6 x i32] }
@.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:
%dice = alloca [100 x %struct.dice], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2400, ptr nonnull %dice) #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
%cmp306 = icmp sgt i32 %0, 0
br i1 %cmp306, label %for.cond1.preheader, label %if.end244
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x %struct.dice], ptr %dice, i64 0, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx5.1 = getelementptr inbounds [6 x i32], ptr %arrayidx, i64 0, i64 1
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [6 x i32], ptr %arrayidx, i64 0, i64 2
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [6 x i32], ptr %arrayidx, i64 0, i64 3
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [6 x i32], ptr %arrayidx, i64 0, i64 4
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [6 x i32], ptr %arrayidx, i64 0, i64 5
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !9
for.cond10.preheader: ; preds = %for.cond1.preheader
%cmp24323 = icmp sgt i32 %1, 1
br i1 %cmp24323, label %for.body25.lr.ph, label %if.end244
for.body25.lr.ph: ; preds = %for.cond10.preheader
%sub = add nsw i32 %1, -1
%dice_memo.sroa.29.0.dice.sroa_idx = getelementptr inbounds i8, ptr %dice, i64 20
%dice_memo.sroa.29.0.copyload = load i32, ptr %dice_memo.sroa.29.0.dice.sroa_idx, align 4, !tbaa !5
%dice_memo.sroa.24.0.dice.sroa_idx = getelementptr inbounds i8, ptr %dice, i64 16
%dice_memo.sroa.24.0.copyload = load i32, ptr %dice_memo.sroa.24.0.dice.sroa_idx, align 16, !tbaa !5
%dice_memo.sroa.22.0.dice.sroa_idx = getelementptr inbounds i8, ptr %dice, i64 12
%dice_memo.sroa.22.0.copyload = load i32, ptr %dice_memo.sroa.22.0.dice.sroa_idx, align 4, !tbaa !5
%dice_memo.sroa.20.0.dice.sroa_idx = getelementptr inbounds i8, ptr %dice, i64 8
%dice_memo.sroa.20.0.copyload = load i32, ptr %dice_memo.sroa.20.0.dice.sroa_idx, align 8, !tbaa !5
%dice_memo.sroa.15.0.dice.sroa_idx = getelementptr inbounds i8, ptr %dice, i64 4
%dice_memo.sroa.15.0.copyload = load i32, ptr %dice_memo.sroa.15.0.dice.sroa_idx, align 4, !tbaa !5
%3 = zext i32 %1 to i64
%wide.trip.count356 = zext i32 %sub to i64
%wide.trip.count = zext i32 %1 to i64
br label %for.body25
for.body25: ; preds = %for.body25.lr.ph, %for.cond222.preheader
%dice_memo.sroa.29.0 = phi i32 [ %dice_memo.sroa.29.0.copyload, %for.body25.lr.ph ], [ %dice_memo.sroa.29.0.copyload414, %for.cond222.preheader ]
%dice_memo.sroa.24.0 = phi i32 [ %dice_memo.sroa.24.0.copyload, %for.body25.lr.ph ], [ %dice_memo.sroa.24.0.copyload404, %for.cond222.preheader ]
%dice_memo.sroa.22.0 = phi i32 [ %dice_memo.sroa.22.0.copyload, %for.body25.lr.ph ], [ %dice_memo.sroa.22.0.copyload394, %for.cond222.preheader ]
%dice_memo.sroa.20.0 = phi i32 [ %dice_memo.sroa.20.0.copyload, %for.body25.lr.ph ], [ %dice_memo.sroa.20.0.copyload384, %for.cond222.preheader ]
%dice_memo.sroa.15.0 = phi i32 [ %dice_memo.sroa.15.0.copyload, %for.body25.lr.ph ], [ %dice_memo.sroa.15.0.copyload374, %for.cond222.preheader ]
%dice_memo.sroa.0.0.in = phi ptr [ %dice, %for.body25.lr.ph ], [ %scevgep351, %for.cond222.preheader ]
%indvars.iv345 = phi i64 [ 1, %for.body25.lr.ph ], [ %indvars.iv.next346, %for.cond222.preheader ]
%indvar = phi i64 [ 0, %for.body25.lr.ph ], [ %indvar.next, %for.cond222.preheader ]
%ans.0324 = phi i32 [ 1, %for.body25.lr.ph ], [ %ans.1.lcssa, %for.cond222.preheader ]
%4 = mul nuw nsw i64 %indvar, 24
%5 = getelementptr i8, ptr %dice, i64 %4
%scevgep351 = getelementptr i8, ptr %5, i64 24
%scevgep340 = getelementptr i8, ptr %dice, i64 %4
%indvar.next = add nuw nsw i64 %indvar, 1
%cmp27318 = icmp ult i64 %indvar.next, %3
br i1 %cmp27318, label %for.cond29.preheader.lr.ph, label %for.cond222.preheader
for.cond29.preheader.lr.ph: ; preds = %for.body25
%dice_memo.sroa.0.0 = load i32, ptr %dice_memo.sroa.0.0.in, align 4, !tbaa !5
%arrayidx39 = getelementptr inbounds [100 x %struct.dice], ptr %dice, i64 0, i64 %indvar
%arrayidx50 = getelementptr inbounds [6 x i32], ptr %arrayidx39, i64 0, i64 1
%arrayidx60 = getelementptr inbounds [6 x i32], ptr %arrayidx39, i64 0, i64 2
%arrayidx70 = getelementptr inbounds [6 x i32], ptr %arrayidx39, i64 0, i64 3
%arrayidx80 = getelementptr inbounds [6 x i32], ptr %arrayidx39, i64 0, i64 4
%arrayidx90 = getelementptr inbounds [6 x i32], ptr %arrayidx39, i64 0, i64 5
%.pre.pre.pre = load i32, ptr %arrayidx39, align 8, !tbaa !5
%.pre415.pre.pre.pre = load i32, ptr %arrayidx50, align 4, !tbaa !5
%dice_memo.sroa.15.0.scevgep.sroa_idx = getelementptr inbounds i8, ptr %scevgep340, i64 4
%dice_memo.sroa.20.0.scevgep.sroa_idx = getelementptr inbounds i8, ptr %scevgep340, i64 8
%dice_memo.sroa.22.0.scevgep.sroa_idx = getelementptr inbounds i8, ptr %scevgep340, i64 12
%dice_memo.sroa.24.0.scevgep.sroa_idx = getelementptr inbounds i8, ptr %scevgep340, i64 16
%dice_memo.sroa.29.0.scevgep.sroa_idx = getelementptr inbounds i8, ptr %scevgep340, i64 20
%arrayidx60.promoted = load i32, ptr %arrayidx60, align 8, !tbaa !5
%arrayidx70.promoted = load i32, ptr %arrayidx70, align 4, !tbaa !5
%arrayidx80.promoted = load i32, ptr %arrayidx80, align 8, !tbaa !5
%arrayidx90.promoted = load i32, ptr %arrayidx90, align 4, !tbaa !5
br label %for.cond29.preheader
for.cond222.preheader: ; preds = %for.inc219, %for.body25
%ans.1.lcssa = phi i32 [ %ans.0324, %for.body25 ], [ %ans.5.3, %for.inc219 ]
%dice_memo.sroa.15.0.scevgep351.sroa_idx = getelementptr i8, ptr %5, i64 28
%dice_memo.sroa.15.0.copyload374 = load i32, ptr %dice_memo.sroa.15.0.scevgep351.sroa_idx, align 4, !tbaa !5
%dice_memo.sroa.20.0.scevgep351.sroa_idx = getelementptr i8, ptr %5, i64 32
%dice_memo.sroa.20.0.copyload384 = load i32, ptr %dice_memo.sroa.20.0.scevgep351.sroa_idx, align 8, !tbaa !5
%dice_memo.sroa.22.0.scevgep351.sroa_idx = getelementptr i8, ptr %5, i64 36
%dice_memo.sroa.22.0.copyload394 = load i32, ptr %dice_memo.sroa.22.0.scevgep351.sroa_idx, align 4, !tbaa !5
%dice_memo.sroa.24.0.scevgep351.sroa_idx = getelementptr i8, ptr %5, i64 40
%dice_memo.sroa.24.0.copyload404 = load i32, ptr %dice_memo.sroa.24.0.scevgep351.sroa_idx, align 8, !tbaa !5
%dice_memo.sroa.29.0.scevgep351.sroa_idx = getelementptr i8, ptr %5, i64 44
%dice_memo.sroa.29.0.copyload414 = load i32, ptr %dice_memo.sroa.29.0.scevgep351.sroa_idx, align 4, !tbaa !5
%indvars.iv.next346 = add nuw nsw i64 %indvars.iv345, 1
%exitcond357.not = icmp eq i64 %indvar.next, %wide.trip.count356
br i1 %exitcond357.not, label %for.end239, label %for.body25, !llvm.loop !11
for.cond29.preheader: ; preds = %for.cond29.preheader.lr.ph, %for.inc219
%6 = phi i32 [ %arrayidx90.promoted, %for.cond29.preheader.lr.ph ], [ %20, %for.inc219 ]
%7 = phi i32 [ %arrayidx80.promoted, %for.cond29.preheader.lr.ph ], [ %54, %for.inc219 ]
%8 = phi i32 [ %arrayidx70.promoted, %for.cond29.preheader.lr.ph ], [ %56, %for.inc219 ]
%9 = phi i32 [ %arrayidx60.promoted, %for.cond29.preheader.lr.ph ], [ %55, %for.inc219 ]
%.pre415.pre.pre = phi i32 [ %.pre415.pre.pre.pre, %for.cond29.preheader.lr.ph ], [ %57, %for.inc219 ]
%.pre.pre = phi i32 [ %.pre.pre.pre, %for.cond29.preheader.lr.ph ], [ %19, %for.inc219 ]
%dice_memo.sroa.29.1 = phi i32 [ %dice_memo.sroa.29.0, %for.cond29.preheader.lr.ph ], [ %20, %for.inc219 ]
%dice_memo.sroa.24.1 = phi i32 [ %dice_memo.sroa.24.0, %for.cond29.preheader.lr.ph ], [ %54, %for.inc219 ]
%dice_memo.sroa.22.1 = phi i32 [ %dice_memo.sroa.22.0, %for.cond29.preheader.lr.ph ], [ %56, %for.inc219 ]
%dice_memo.sroa.20.1 = phi i32 [ %dice_memo.sroa.20.0, %for.cond29.preheader.lr.ph ], [ %55, %for.inc219 ]
%dice_memo.sroa.15.1 = phi i32 [ %dice_memo.sroa.15.0, %for.cond29.preheader.lr.ph ], [ %57, %for.inc219 ]
%dice_memo.sroa.0.1 = phi i32 [ %dice_memo.sroa.0.0, %for.cond29.preheader.lr.ph ], [ %19, %for.inc219 ]
%indvars.iv347 = phi i64 [ %indvars.iv345, %for.cond29.preheader.lr.ph ], [ %indvars.iv.next348, %for.inc219 ]
%ans.1319 = phi i32 [ %ans.0324, %for.cond29.preheader.lr.ph ], [ %ans.5.3, %for.inc219 ]
%arrayidx43 = getelementptr inbounds [100 x %struct.dice], ptr %dice, i64 0, i64 %indvars.iv347
%arrayidx54 = getelementptr inbounds [6 x i32], ptr %arrayidx43, i64 0, i64 1
%arrayidx64 = getelementptr inbounds [6 x i32], ptr %arrayidx43, i64 0, i64 2
%arrayidx74 = getelementptr inbounds [6 x i32], ptr %arrayidx43, i64 0, i64 3
%arrayidx84 = getelementptr inbounds [6 x i32], ptr %arrayidx43, i64 0, i64 4
%arrayidx94 = getelementptr inbounds [6 x i32], ptr %arrayidx43, i64 0, i64 5
br label %for.cond32.preheader
for.cond32.preheader: ; preds = %for.cond29.preheader, %for.end177
%10 = phi i32 [ %6, %for.cond29.preheader ], [ %20, %for.end177 ]
%11 = phi i32 [ %7, %for.cond29.preheader ], [ %54, %for.end177 ]
%12 = phi i32 [ %8, %for.cond29.preheader ], [ %56, %for.end177 ]
%13 = phi i32 [ %9, %for.cond29.preheader ], [ %55, %for.end177 ]
%.pre415.pre = phi i32 [ %.pre415.pre.pre, %for.cond29.preheader ], [ %57, %for.end177 ]
%.pre = phi i32 [ %.pre.pre, %for.cond29.preheader ], [ %19, %for.end177 ]
%dice_memo.sroa.29.2 = phi i32 [ %dice_memo.sroa.29.1, %for.cond29.preheader ], [ %20, %for.end177 ]
%dice_memo.sroa.24.2 = phi i32 [ %dice_memo.sroa.24.1, %for.cond29.preheader ], [ %54, %for.end177 ]
%dice_memo.sroa.22.2 = phi i32 [ %dice_memo.sroa.22.1, %for.cond29.preheader ], [ %56, %for.end177 ]
%dice_memo.sroa.20.2 = phi i32 [ %dice_memo.sroa.20.1, %for.cond29.preheader ], [ %55, %for.end177 ]
%dice_memo.sroa.15.2 = phi i32 [ %dice_memo.sroa.15.1, %for.cond29.preheader ], [ %57, %for.end177 ]
%dice_memo.sroa.0.2 = phi i32 [ %dice_memo.sroa.0.1, %for.cond29.preheader ], [ %19, %for.end177 ]
%k.0317 = phi i32 [ 0, %for.cond29.preheader ], [ %inc217, %for.end177 ]
%ans.2316 = phi i32 [ %ans.1319, %for.cond29.preheader ], [ %ans.5.3, %for.end177 ]
br label %for.cond35.preheader
for.cond35.preheader: ; preds = %for.cond32.preheader, %if.end.3
%14 = phi i32 [ %10, %for.cond32.preheader ], [ %20, %if.end.3 ]
%15 = phi i32 [ %11, %for.cond32.preheader ], [ %55, %if.end.3 ]
%16 = phi i32 [ %12, %for.cond32.preheader ], [ %54, %if.end.3 ]
%17 = phi i32 [ %13, %for.cond32.preheader ], [ %57, %if.end.3 ]
%.pre415 = phi i32 [ %.pre415.pre, %for.cond32.preheader ], [ %56, %if.end.3 ]
%18 = phi i32 [ %.pre, %for.cond32.preheader ], [ %19, %if.end.3 ]
%dice_memo.sroa.29.3 = phi i32 [ %dice_memo.sroa.29.2, %for.cond32.preheader ], [ %20, %if.end.3 ]
%dice_memo.sroa.24.3 = phi i32 [ %dice_memo.sroa.24.2, %for.cond32.preheader ], [ %55, %if.end.3 ]
%19 = phi i32 [ %dice_memo.sroa.22.2, %for.cond32.preheader ], [ %54, %if.end.3 ]
%20 = phi i32 [ %dice_memo.sroa.20.2, %for.cond32.preheader ], [ %57, %if.end.3 ]
%dice_memo.sroa.15.3 = phi i32 [ %dice_memo.sroa.15.2, %for.cond32.preheader ], [ %56, %if.end.3 ]
%dice_memo.sroa.0.3 = phi i32 [ %dice_memo.sroa.0.2, %for.cond32.preheader ], [ %19, %if.end.3 ]
%m.0314 = phi i32 [ 0, %for.cond32.preheader ], [ %inc176, %if.end.3 ]
%ans.3313 = phi i32 [ %ans.2316, %for.cond32.preheader ], [ %ans.5.3, %if.end.3 ]
%21 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%cmp46 = icmp eq i32 %18, %21
br i1 %cmp46, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %for.cond35.preheader
%22 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%cmp55 = icmp eq i32 %.pre415, %22
br i1 %cmp55, label %land.lhs.true56, label %if.else
land.lhs.true56: ; preds = %land.lhs.true
%23 = load i32, ptr %arrayidx64, align 8, !tbaa !5
%cmp65 = icmp eq i32 %17, %23
br i1 %cmp65, label %land.lhs.true66, label %if.else
land.lhs.true66: ; preds = %land.lhs.true56
%24 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%cmp75 = icmp eq i32 %16, %24
br i1 %cmp75, label %land.lhs.true76, label %if.else
land.lhs.true76: ; preds = %land.lhs.true66
%25 = load i32, ptr %arrayidx84, align 8, !tbaa !5
%cmp85 = icmp eq i32 %15, %25
br i1 %cmp85, label %land.lhs.true86, label %if.else
land.lhs.true86: ; preds = %land.lhs.true76
%26 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%cmp95 = icmp eq i32 %14, %26
br i1 %cmp95, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true86, %land.lhs.true76, %land.lhs.true66, %land.lhs.true56, %land.lhs.true, %for.cond35.preheader
br label %if.end
if.end: ; preds = %land.lhs.true86, %if.else
%27 = phi i32 [ %dice_memo.sroa.29.3, %land.lhs.true86 ], [ %15, %if.else ]
%28 = phi i32 [ %dice_memo.sroa.24.3, %land.lhs.true86 ], [ %18, %if.else ]
%29 = phi i32 [ %dice_memo.sroa.15.3, %land.lhs.true86 ], [ %14, %if.else ]
%dice_memo.sroa.0.4 = phi i32 [ %dice_memo.sroa.0.3, %land.lhs.true86 ], [ %.pre415, %if.else ]
%ans.5 = phi i32 [ 0, %land.lhs.true86 ], [ %ans.3313, %if.else ]
store i32 %dice_memo.sroa.0.4, ptr %scevgep340, align 8, !tbaa !5
store i32 %29, ptr %dice_memo.sroa.15.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %20, ptr %dice_memo.sroa.20.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %19, ptr %dice_memo.sroa.22.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %28, ptr %dice_memo.sroa.24.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %27, ptr %dice_memo.sroa.29.0.scevgep.sroa_idx, align 4, !tbaa !5
%30 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%cmp46.1 = icmp eq i32 %dice_memo.sroa.0.4, %30
br i1 %cmp46.1, label %land.lhs.true.1, label %if.else.1
land.lhs.true.1: ; preds = %if.end
%31 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%cmp55.1 = icmp eq i32 %29, %31
br i1 %cmp55.1, label %land.lhs.true56.1, label %if.else.1
land.lhs.true56.1: ; preds = %land.lhs.true.1
%32 = load i32, ptr %arrayidx64, align 8, !tbaa !5
%cmp65.1 = icmp eq i32 %20, %32
br i1 %cmp65.1, label %land.lhs.true66.1, label %if.else.1
land.lhs.true66.1: ; preds = %land.lhs.true56.1
%33 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%cmp75.1 = icmp eq i32 %19, %33
br i1 %cmp75.1, label %land.lhs.true76.1, label %if.else.1
land.lhs.true76.1: ; preds = %land.lhs.true66.1
%34 = load i32, ptr %arrayidx84, align 8, !tbaa !5
%cmp85.1 = icmp eq i32 %28, %34
br i1 %cmp85.1, label %land.lhs.true86.1, label %if.else.1
land.lhs.true86.1: ; preds = %land.lhs.true76.1
%35 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%cmp95.1 = icmp eq i32 %27, %35
br i1 %cmp95.1, label %if.end.1, label %if.else.1
if.else.1: ; preds = %land.lhs.true86.1, %land.lhs.true76.1, %land.lhs.true66.1, %land.lhs.true56.1, %land.lhs.true.1, %if.end
br label %if.end.1
if.end.1: ; preds = %if.else.1, %land.lhs.true86.1
%36 = phi i32 [ %27, %land.lhs.true86.1 ], [ %28, %if.else.1 ]
%37 = phi i32 [ %28, %land.lhs.true86.1 ], [ %dice_memo.sroa.0.4, %if.else.1 ]
%38 = phi i32 [ %29, %land.lhs.true86.1 ], [ %27, %if.else.1 ]
%dice_memo.sroa.0.5 = phi i32 [ %dice_memo.sroa.0.4, %land.lhs.true86.1 ], [ %29, %if.else.1 ]
%ans.5.1 = phi i32 [ 0, %land.lhs.true86.1 ], [ %ans.5, %if.else.1 ]
store i32 %dice_memo.sroa.0.5, ptr %scevgep340, align 8, !tbaa !5
store i32 %38, ptr %dice_memo.sroa.15.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %20, ptr %dice_memo.sroa.20.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %19, ptr %dice_memo.sroa.22.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %37, ptr %dice_memo.sroa.24.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %36, ptr %dice_memo.sroa.29.0.scevgep.sroa_idx, align 4, !tbaa !5
%39 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%cmp46.2 = icmp eq i32 %dice_memo.sroa.0.5, %39
br i1 %cmp46.2, label %land.lhs.true.2, label %if.else.2
land.lhs.true.2: ; preds = %if.end.1
%40 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%cmp55.2 = icmp eq i32 %38, %40
br i1 %cmp55.2, label %land.lhs.true56.2, label %if.else.2
land.lhs.true56.2: ; preds = %land.lhs.true.2
%41 = load i32, ptr %arrayidx64, align 8, !tbaa !5
%cmp65.2 = icmp eq i32 %20, %41
br i1 %cmp65.2, label %land.lhs.true66.2, label %if.else.2
land.lhs.true66.2: ; preds = %land.lhs.true56.2
%42 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%cmp75.2 = icmp eq i32 %19, %42
br i1 %cmp75.2, label %land.lhs.true76.2, label %if.else.2
land.lhs.true76.2: ; preds = %land.lhs.true66.2
%43 = load i32, ptr %arrayidx84, align 8, !tbaa !5
%cmp85.2 = icmp eq i32 %37, %43
br i1 %cmp85.2, label %land.lhs.true86.2, label %if.else.2
land.lhs.true86.2: ; preds = %land.lhs.true76.2
%44 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%cmp95.2 = icmp eq i32 %36, %44
br i1 %cmp95.2, label %if.end.2, label %if.else.2
if.else.2: ; preds = %land.lhs.true86.2, %land.lhs.true76.2, %land.lhs.true66.2, %land.lhs.true56.2, %land.lhs.true.2, %if.end.1
br label %if.end.2
if.end.2: ; preds = %if.else.2, %land.lhs.true86.2
%45 = phi i32 [ %36, %land.lhs.true86.2 ], [ %37, %if.else.2 ]
%46 = phi i32 [ %37, %land.lhs.true86.2 ], [ %dice_memo.sroa.0.5, %if.else.2 ]
%47 = phi i32 [ %38, %land.lhs.true86.2 ], [ %36, %if.else.2 ]
%dice_memo.sroa.0.6 = phi i32 [ %dice_memo.sroa.0.5, %land.lhs.true86.2 ], [ %38, %if.else.2 ]
%ans.5.2 = phi i32 [ 0, %land.lhs.true86.2 ], [ %ans.5.1, %if.else.2 ]
store i32 %dice_memo.sroa.0.6, ptr %scevgep340, align 8, !tbaa !5
store i32 %47, ptr %dice_memo.sroa.15.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %20, ptr %dice_memo.sroa.20.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %19, ptr %dice_memo.sroa.22.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %46, ptr %dice_memo.sroa.24.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %45, ptr %dice_memo.sroa.29.0.scevgep.sroa_idx, align 4, !tbaa !5
%48 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%cmp46.3 = icmp eq i32 %dice_memo.sroa.0.6, %48
br i1 %cmp46.3, label %land.lhs.true.3, label %if.else.3
land.lhs.true.3: ; preds = %if.end.2
%49 = load i32, ptr %arrayidx54, align 4, !tbaa !5
%cmp55.3 = icmp eq i32 %47, %49
br i1 %cmp55.3, label %land.lhs.true56.3, label %if.else.3
land.lhs.true56.3: ; preds = %land.lhs.true.3
%50 = load i32, ptr %arrayidx64, align 8, !tbaa !5
%cmp65.3 = icmp eq i32 %20, %50
br i1 %cmp65.3, label %land.lhs.true66.3, label %if.else.3
land.lhs.true66.3: ; preds = %land.lhs.true56.3
%51 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%cmp75.3 = icmp eq i32 %19, %51
br i1 %cmp75.3, label %land.lhs.true76.3, label %if.else.3
land.lhs.true76.3: ; preds = %land.lhs.true66.3
%52 = load i32, ptr %arrayidx84, align 8, !tbaa !5
%cmp85.3 = icmp eq i32 %46, %52
br i1 %cmp85.3, label %land.lhs.true86.3, label %if.else.3
land.lhs.true86.3: ; preds = %land.lhs.true76.3
%53 = load i32, ptr %arrayidx94, align 4, !tbaa !5
%cmp95.3 = icmp eq i32 %45, %53
br i1 %cmp95.3, label %if.end.3, label %if.else.3
if.else.3: ; preds = %land.lhs.true86.3, %land.lhs.true76.3, %land.lhs.true66.3, %land.lhs.true56.3, %land.lhs.true.3, %if.end.2
br label %if.end.3
if.end.3: ; preds = %if.else.3, %land.lhs.true86.3
%54 = phi i32 [ %45, %land.lhs.true86.3 ], [ %46, %if.else.3 ]
%55 = phi i32 [ %46, %land.lhs.true86.3 ], [ %dice_memo.sroa.0.6, %if.else.3 ]
%56 = phi i32 [ %47, %land.lhs.true86.3 ], [ %45, %if.else.3 ]
%57 = phi i32 [ %dice_memo.sroa.0.6, %land.lhs.true86.3 ], [ %47, %if.else.3 ]
%ans.5.3 = phi i32 [ 0, %land.lhs.true86.3 ], [ %ans.5.2, %if.else.3 ]
store i32 %19, ptr %scevgep340, align 8, !tbaa !5
store i32 %56, ptr %dice_memo.sroa.15.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %57, ptr %dice_memo.sroa.20.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %54, ptr %dice_memo.sroa.22.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %55, ptr %dice_memo.sroa.24.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %20, ptr %dice_memo.sroa.29.0.scevgep.sroa_idx, align 4, !tbaa !5
%inc176 = add nuw nsw i32 %m.0314, 1
%exitcond.not = icmp eq i32 %inc176, 4
br i1 %exitcond.not, label %for.end177, label %for.cond35.preheader, !llvm.loop !12
for.end177: ; preds = %if.end.3
store i32 %19, ptr %scevgep340, align 8, !tbaa !5
store i32 %57, ptr %dice_memo.sroa.15.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %55, ptr %dice_memo.sroa.20.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %56, ptr %dice_memo.sroa.22.0.scevgep.sroa_idx, align 4, !tbaa !5
store i32 %54, ptr %dice_memo.sroa.24.0.scevgep.sroa_idx, align 8, !tbaa !5
store i32 %20, ptr %dice_memo.sroa.29.0.scevgep.sroa_idx, align 4, !tbaa !5
%inc217 = add nuw nsw i32 %k.0317, 1
%exitcond344.not = icmp eq i32 %inc217, 4
br i1 %exitcond344.not, label %for.inc219, label %for.cond32.preheader, !llvm.loop !13
for.inc219: ; preds = %for.end177
%indvars.iv.next348 = add nuw nsw i64 %indvars.iv347, 1
%exitcond350.not = icmp eq i64 %indvars.iv.next348, %wide.trip.count
br i1 %exitcond350.not, label %for.cond222.preheader, label %for.cond29.preheader, !llvm.loop !14
for.end239: ; preds = %for.cond222.preheader
%58 = icmp eq i32 %ans.1.lcssa, 0
%spec.select = select i1 %58, ptr @str, ptr @str.3
br label %if.end244
if.end244: ; preds = %for.end239, %for.cond10.preheader, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str.3, %for.cond10.preheader ], [ %spec.select, %for.end239 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 2400, ptr nonnull %dice) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <string.h>
struct dice {
char N[6];
char num[6];
};
struct dice DICE[2] = { 1, 2, 3, 4, 5, 6, 4, 3, 0, 2, 1, 5 };
void check_a(int l1, int no, char *str);
void check_b(int l1, int no, char *str);
int check_c(int x1, int x2);
void rot(int no, char *str);
int main(void) {
int d[6][100];
int i, j, k, num, flag = 0;
DICE[1] = DICE[0]; //DICE[0]の初期化内容をDICE[1]へコピー
scanf("%d", &num); //ダイスの数の取得
if (num < 2) { num = 2; } //0以下の場合は0とする
if (num > 100) { num = 100; } //100以上の場合は100とする
getchar(); //改行の読み飛ばし
for (i = 0; i < num; i++) {
scanf("%d%d%d%d%d%d", &d[0][i], &d[1][i], &d[2][i], &d[3][i], &d[4][i], &d[5][i]);
getchar(); //改行の読み飛ばし
for (j = 0; j < 6; j++) { //6面の値の取得
if (d[j][i] < 0) { d[j][i] = 0; } //0以下の場合は0とする
if (d[j][i] > 100) { d[j][i] = 100; } //100以上の場合は100とする
}
}
for (i = 0; i < num - 1; i++) {
DICE[0].N[0] = d[0][i], DICE[0].N[1] = d[1][i], DICE[0].N[2] = d[2][i];
DICE[0].N[3] = d[3][i], DICE[0].N[4] = d[4][i], DICE[0].N[5] = d[5][i];
for (j = i + 1; j < num; j++) {
DICE[1].N[0] = d[0][j], DICE[1].N[1] = d[1][j], DICE[1].N[2] = d[2][j];
DICE[1].N[3] = d[3][j], DICE[1].N[4] = d[4][j], DICE[1].N[5] = d[5][j];
for (k = 0; k < 6; k++) { //一致不一致を6回試みる
if (k == 0) { flag = check_c(DICE[0].N[DICE[0].num[0]], DICE[0].N[DICE[0].num[2]]); }//1,3
if (k == 1) { flag = check_c(DICE[0].N[DICE[0].num[1]], DICE[0].N[DICE[0].num[5]]); }//2,6
if (k == 2) { flag = check_c(DICE[0].N[DICE[0].num[3]], DICE[0].N[DICE[0].num[4]]); }//4,5
if (k == 3) { flag = check_c(DICE[0].N[DICE[0].num[2]], DICE[0].N[DICE[0].num[0]]); }//3,1
if (k == 4) { flag = check_c(DICE[0].N[DICE[0].num[5]], DICE[0].N[DICE[0].num[1]]); }//6,2
if (k == 5) { flag = check_c(DICE[0].N[DICE[0].num[4]], DICE[0].N[DICE[0].num[3]]); }//5,4
if (flag == 1) { break; } //一致していた場合処理を中止
}
if (flag == 1) { break; } //一致していた場合ループを抜ける
}
if (flag == 1) { break; } //一致していた場合ループを抜ける
}
if (flag == 1) { //一致がひとつでもあった場合
printf("No\n");
}
else {
printf("Yes\n");
}
return 0;
}
int check_c(int x1, int x2) {
char str[100];
int i, flag = 1;
check_a(x1, 1, str); //ダイス1の上面の位置取得
rot(1, str); //
check_b(x2, 1, str); //ダイス1の前面の位置取得
rot(1, str); //
for (i = 0; i < 6; i++) {
if (DICE[0].N[DICE[0].num[i]] != DICE[1].N[DICE[1].num[i]]) { flag = 0; }
}
return flag;
}
void check_a(int l1, int no, char *str) {
int i, j = 0, k = 0;
for (i = 0; i < 6; i++) { //求めたい値が何番目に格納されているか調べる
if (l1 == DICE[no].N[i]) {
j = i;
break;
}
}
for (i = 0; i < 6; i++) { //上で一致した番号がダイスのどの位置にあるか調べる
if (j == DICE[no].num[i]) {
k = i;
break;
}
}
switch (k) {
case 0:
strcpy(str, "");
break;
case 1:
strcpy(str, "EN");
break;
case 2:
strcpy(str, "N");
break;
case 3:
strcpy(str, "WN");
break;
case 4:
strcpy(str, "NN");
break;
case 5:
strcpy(str, "S");
break;
default:
break;
}
}
void check_b(int l1, int no, char *str) {
int i, j = 0, k = 0;
for (i = 0; i < 6; i++) { //求めたい値が何番目に格納されているか調べる
if (l1 == DICE[no].N[i]) {
j = i;
break;
}
}
for (i = 0; i < 6; i++) { //上で一致した番号がダイスのどの位置にあるか調べる
if (j == DICE[no].num[i]) {
k = i;
break;
}
}
switch (k) {
case 0:
strcpy(str, "");
break;
case 1:
strcpy(str, "E");
break;
case 2:
strcpy(str, "");
break;
case 3:
strcpy(str, "W");
break;
case 4:
strcpy(str, "");
break;
case 5:
strcpy(str, "EE");
break;
default:
break;
}
}
void rot(int no, char *str) {
int i = 0, tmp = 0;
while (str[i] != '\0') {
switch (str[i]) {
case 'N':
tmp = DICE[no].num[5];
DICE[no].num[5] = DICE[no].num[0];
DICE[no].num[0] = DICE[no].num[2];
DICE[no].num[2] = DICE[no].num[4];
DICE[no].num[4] = tmp;
break;
case 'S':
tmp = DICE[no].num[5];
DICE[no].num[5] = DICE[no].num[4];
DICE[no].num[4] = DICE[no].num[2];
DICE[no].num[2] = DICE[no].num[0];
DICE[no].num[0] = tmp;
break;
case 'E':
tmp = DICE[no].num[5];
DICE[no].num[5] = DICE[no].num[3];
DICE[no].num[3] = DICE[no].num[2];
DICE[no].num[2] = DICE[no].num[1];
DICE[no].num[1] = tmp;
break;
case 'W':
tmp = DICE[no].num[5];
DICE[no].num[5] = DICE[no].num[1];
DICE[no].num[1] = DICE[no].num[2];
DICE[no].num[2] = DICE[no].num[3];
DICE[no].num[3] = tmp;
break;
default:
break;
}
i++;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135284/source.c"
target datalayout = "e-m:e-p270: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.dice = type { [6 x i8], [6 x i8] }
@DICE = dso_local local_unnamed_addr global [2 x %struct.dice] [%struct.dice { [6 x i8] c"\01\02\03\04\05\06", [6 x i8] c"\04\03\00\02\01\05" }, %struct.dice zeroinitializer], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [13 x i8] c"%d%d%d%d%d%d\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"EN\00", align 1
@.str.7 = private unnamed_addr constant [3 x i8] c"WN\00", align 1
@.str.8 = private unnamed_addr constant [3 x i8] c"NN\00", align 1
@.str.12 = private unnamed_addr constant [3 x i8] c"EE\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.13 = 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:
%d = alloca [6 x [100 x i32]], align 16
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 2400, ptr nonnull %d) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #8
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), ptr noundef nonnull align 16 dereferenceable(12) @DICE, i64 12, i1 false), !tbaa.struct !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !9
%cmp = icmp slt i32 %0, 2
br i1 %cmp, label %if.end.thread, label %if.end
if.end.thread: ; preds = %entry
store i32 2, ptr %num, align 4, !tbaa !9
br label %if.end3
if.end: ; preds = %entry
%cmp1 = icmp ugt i32 %0, 100
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 100, ptr %num, align 4, !tbaa !9
br label %if.end3
if.end3: ; preds = %if.end.thread, %if.then2, %if.end
%1 = load ptr, ptr @stdin, align 8, !tbaa !11
%call.i = call i32 @getc(ptr noundef %1)
%2 = load i32, ptr %num, align 4, !tbaa !9
%cmp5268 = icmp sgt i32 %2, 0
br i1 %cmp5268, label %for.body, label %if.end202
for.cond52.preheader: ; preds = %for.inc.5
%cmp53274 = icmp sgt i32 %10, 1
br i1 %cmp53274, label %for.body54, label %if.end202
for.body: ; preds = %if.end3, %for.inc.5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc.5 ], [ 0, %if.end3 ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv
%arrayidx9 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 1, i64 %indvars.iv
%arrayidx12 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 2, i64 %indvars.iv
%arrayidx15 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 3, i64 %indvars.iv
%arrayidx18 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 4, i64 %indvars.iv
%arrayidx21 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 5, i64 %indvars.iv
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx9, ptr noundef nonnull %arrayidx12, ptr noundef nonnull %arrayidx15, ptr noundef nonnull %arrayidx18, ptr noundef nonnull %arrayidx21)
%3 = load ptr, ptr @stdin, align 8, !tbaa !11
%call.i247 = call i32 @getc(ptr noundef %3)
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !9
%cmp31 = icmp slt i32 %4, 0
br i1 %cmp31, label %for.inc.sink.split, label %if.end37
if.end37: ; preds = %for.body
%cmp42 = icmp ugt i32 %4, 100
br i1 %cmp42, label %for.inc.sink.split, label %for.inc
for.inc.sink.split: ; preds = %if.end37, %for.body
%.sink = phi i32 [ 0, %for.body ], [ 100, %if.end37 ]
store i32 %.sink, ptr %arrayidx6, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.end37
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !9
%cmp31.1 = icmp slt i32 %5, 0
br i1 %cmp31.1, label %for.inc.1.sink.split, label %if.end37.1
if.end37.1: ; preds = %for.inc
%cmp42.1 = icmp ugt i32 %5, 100
br i1 %cmp42.1, label %for.inc.1.sink.split, label %for.inc.1
for.inc.1.sink.split: ; preds = %for.inc, %if.end37.1
%.sink288 = phi i32 [ 100, %if.end37.1 ], [ 0, %for.inc ]
store i32 %.sink288, ptr %arrayidx9, align 4, !tbaa !9
br label %for.inc.1
for.inc.1: ; preds = %for.inc.1.sink.split, %if.end37.1
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !9
%cmp31.2 = icmp slt i32 %6, 0
br i1 %cmp31.2, label %for.inc.2.sink.split, label %if.end37.2
if.end37.2: ; preds = %for.inc.1
%cmp42.2 = icmp ugt i32 %6, 100
br i1 %cmp42.2, label %for.inc.2.sink.split, label %for.inc.2
for.inc.2.sink.split: ; preds = %for.inc.1, %if.end37.2
%.sink289 = phi i32 [ 100, %if.end37.2 ], [ 0, %for.inc.1 ]
store i32 %.sink289, ptr %arrayidx12, align 4, !tbaa !9
br label %for.inc.2
for.inc.2: ; preds = %for.inc.2.sink.split, %if.end37.2
%7 = load i32, ptr %arrayidx15, align 4, !tbaa !9
%cmp31.3 = icmp slt i32 %7, 0
br i1 %cmp31.3, label %for.inc.3.sink.split, label %if.end37.3
if.end37.3: ; preds = %for.inc.2
%cmp42.3 = icmp ugt i32 %7, 100
br i1 %cmp42.3, label %for.inc.3.sink.split, label %for.inc.3
for.inc.3.sink.split: ; preds = %for.inc.2, %if.end37.3
%.sink290 = phi i32 [ 100, %if.end37.3 ], [ 0, %for.inc.2 ]
store i32 %.sink290, ptr %arrayidx15, align 4, !tbaa !9
br label %for.inc.3
for.inc.3: ; preds = %for.inc.3.sink.split, %if.end37.3
%8 = load i32, ptr %arrayidx18, align 4, !tbaa !9
%cmp31.4 = icmp slt i32 %8, 0
br i1 %cmp31.4, label %for.inc.4.sink.split, label %if.end37.4
if.end37.4: ; preds = %for.inc.3
%cmp42.4 = icmp ugt i32 %8, 100
br i1 %cmp42.4, label %for.inc.4.sink.split, label %for.inc.4
for.inc.4.sink.split: ; preds = %for.inc.3, %if.end37.4
%.sink291 = phi i32 [ 100, %if.end37.4 ], [ 0, %for.inc.3 ]
store i32 %.sink291, ptr %arrayidx18, align 4, !tbaa !9
br label %for.inc.4
for.inc.4: ; preds = %for.inc.4.sink.split, %if.end37.4
%9 = load i32, ptr %arrayidx21, align 4, !tbaa !9
%cmp31.5 = icmp slt i32 %9, 0
br i1 %cmp31.5, label %for.inc.5.sink.split, label %if.end37.5
if.end37.5: ; preds = %for.inc.4
%cmp42.5 = icmp ugt i32 %9, 100
br i1 %cmp42.5, label %for.inc.5.sink.split, label %for.inc.5
for.inc.5.sink.split: ; preds = %for.inc.4, %if.end37.5
%.sink292 = phi i32 [ 100, %if.end37.5 ], [ 0, %for.inc.4 ]
store i32 %.sink292, ptr %arrayidx21, align 4, !tbaa !9
br label %for.inc.5
for.inc.5: ; preds = %for.inc.5.sink.split, %if.end37.5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %num, align 4, !tbaa !9
%11 = sext i32 %10 to i64
%cmp5 = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp5, label %for.body, label %for.cond52.preheader, !llvm.loop !13
for.cond52.loopexit: ; preds = %for.inc180.5, %for.body54
%12 = phi i32 [ %14, %for.body54 ], [ %34, %for.inc180.5 ]
%sub = add nsw i32 %12, -1
%13 = sext i32 %sub to i64
%cmp53 = icmp slt i64 %indvars.iv.next284, %13
%indvars.iv.next279 = add nuw nsw i64 %indvars.iv278, 1
br i1 %cmp53, label %for.body54, label %if.end202, !llvm.loop !15
for.body54: ; preds = %for.cond52.preheader, %for.cond52.loopexit
%14 = phi i32 [ %12, %for.cond52.loopexit ], [ %10, %for.cond52.preheader ]
%indvars.iv283 = phi i64 [ %indvars.iv.next284, %for.cond52.loopexit ], [ 0, %for.cond52.preheader ]
%indvars.iv278 = phi i64 [ %indvars.iv.next279, %for.cond52.loopexit ], [ 1, %for.cond52.preheader ]
%arrayidx57 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv283
%15 = load i32, ptr %arrayidx57, align 4, !tbaa !9
%conv = trunc i32 %15 to i8
store i8 %conv, ptr @DICE, align 16, !tbaa !6
%arrayidx60 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 1, i64 %indvars.iv283
%16 = load i32, ptr %arrayidx60, align 4, !tbaa !9
%conv61 = trunc i32 %16 to i8
store i8 %conv61, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 0, i64 1), align 1, !tbaa !6
%arrayidx64 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 2, i64 %indvars.iv283
%17 = load i32, ptr %arrayidx64, align 4, !tbaa !9
%conv65 = trunc i32 %17 to i8
store i8 %conv65, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 0, i64 2), align 2, !tbaa !6
%arrayidx68 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 3, i64 %indvars.iv283
%18 = load i32, ptr %arrayidx68, align 4, !tbaa !9
%conv69 = trunc i32 %18 to i8
store i8 %conv69, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 0, i64 3), align 1, !tbaa !6
%arrayidx72 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 4, i64 %indvars.iv283
%19 = load i32, ptr %arrayidx72, align 4, !tbaa !9
%conv73 = trunc i32 %19 to i8
store i8 %conv73, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 0, i64 4), align 4, !tbaa !6
%arrayidx76 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 5, i64 %indvars.iv283
%20 = load i32, ptr %arrayidx76, align 4, !tbaa !9
%conv77 = trunc i32 %20 to i8
store i8 %conv77, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 0, i64 5), align 1, !tbaa !6
%indvars.iv.next284 = add nuw nsw i64 %indvars.iv283, 1
%21 = sext i32 %14 to i64
%cmp79271 = icmp slt i64 %indvars.iv.next284, %21
br i1 %cmp79271, label %for.body81, label %for.cond52.loopexit
for.body81: ; preds = %for.body54, %for.inc180.5
%indvars.iv280 = phi i64 [ %indvars.iv.next281, %for.inc180.5 ], [ %indvars.iv278, %for.body54 ]
%arrayidx84 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv280
%22 = load i32, ptr %arrayidx84, align 4, !tbaa !9
%conv85 = trunc i32 %22 to i8
store i8 %conv85, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), align 4, !tbaa !6
%arrayidx88 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 1, i64 %indvars.iv280
%23 = load i32, ptr %arrayidx88, align 4, !tbaa !9
%conv89 = trunc i32 %23 to i8
store i8 %conv89, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 1), align 1, !tbaa !6
%arrayidx92 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 2, i64 %indvars.iv280
%24 = load i32, ptr %arrayidx92, align 4, !tbaa !9
%conv93 = trunc i32 %24 to i8
store i8 %conv93, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 2), align 2, !tbaa !6
%arrayidx96 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 3, i64 %indvars.iv280
%25 = load i32, ptr %arrayidx96, align 4, !tbaa !9
%conv97 = trunc i32 %25 to i8
store i8 %conv97, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 3), align 1, !tbaa !6
%arrayidx100 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 4, i64 %indvars.iv280
%26 = load i32, ptr %arrayidx100, align 4, !tbaa !9
%conv101 = trunc i32 %26 to i8
store i8 %conv101, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 4), align 16, !tbaa !6
%arrayidx104 = getelementptr inbounds [6 x [100 x i32]], ptr %d, i64 0, i64 5, i64 %indvars.iv280
%27 = load i32, ptr %arrayidx104, align 4, !tbaa !9
%conv105 = trunc i32 %27 to i8
store i8 %conv105, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 5), align 1, !tbaa !6
%.sink297 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1), align 1, !tbaa !6
%idxprom124 = sext i8 %.sink297 to i64
%arrayidx125 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom124
%conv126.sink.in = load i8, ptr %arrayidx125, align 1, !tbaa !6
%conv126.sink = sext i8 %conv126.sink.in to i32
%.sink294 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 2), align 1, !tbaa !6
%idxprom127 = sext i8 %.sink294 to i64
%arrayidx128 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom127
%28 = load i8, ptr %arrayidx128, align 1, !tbaa !6
%conv129 = sext i8 %28 to i32
%call130 = call i32 @check_c(i32 noundef %conv126.sink, i32 noundef %conv129), !range !16
%cmp176.not = icmp eq i32 %call130, 0
br i1 %cmp176.not, label %if.end175.1, label %if.end202
if.end175.1: ; preds = %for.body81
%.sink297.1 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 1), align 1, !tbaa !6
%idxprom124.1 = sext i8 %.sink297.1 to i64
%arrayidx125.1 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom124.1
%conv126.sink.in.1 = load i8, ptr %arrayidx125.1, align 1, !tbaa !6
%conv126.sink.1 = sext i8 %conv126.sink.in.1 to i32
%.sink294.1 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 5), align 1, !tbaa !6
%idxprom127.1 = sext i8 %.sink294.1 to i64
%arrayidx128.1 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom127.1
%29 = load i8, ptr %arrayidx128.1, align 1, !tbaa !6
%conv129.1 = sext i8 %29 to i32
%call130.1 = call i32 @check_c(i32 noundef %conv126.sink.1, i32 noundef %conv129.1), !range !16
%cmp176.not.1 = icmp eq i32 %call130.1, 0
br i1 %cmp176.not.1, label %if.end175.2, label %if.end202
if.end175.2: ; preds = %if.end175.1
%.sink297.2 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 3), align 1, !tbaa !6
%idxprom124.2 = sext i8 %.sink297.2 to i64
%arrayidx125.2 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom124.2
%conv126.sink.in.2 = load i8, ptr %arrayidx125.2, align 1, !tbaa !6
%conv126.sink.2 = sext i8 %conv126.sink.in.2 to i32
%.sink294.2 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 4), align 1, !tbaa !6
%idxprom127.2 = sext i8 %.sink294.2 to i64
%arrayidx128.2 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom127.2
%30 = load i8, ptr %arrayidx128.2, align 1, !tbaa !6
%conv129.2 = sext i8 %30 to i32
%call130.2 = call i32 @check_c(i32 noundef %conv126.sink.2, i32 noundef %conv129.2), !range !16
%cmp176.not.2 = icmp eq i32 %call130.2, 0
br i1 %cmp176.not.2, label %if.end175.3, label %if.end202
if.end175.3: ; preds = %if.end175.2
%.sink297.3 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 2), align 1, !tbaa !6
%idxprom124.3 = sext i8 %.sink297.3 to i64
%arrayidx125.3 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom124.3
%conv126.sink.in.3 = load i8, ptr %arrayidx125.3, align 1, !tbaa !6
%conv126.sink.3 = sext i8 %conv126.sink.in.3 to i32
%.sink294.3 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1), align 1, !tbaa !6
%idxprom127.3 = sext i8 %.sink294.3 to i64
%arrayidx128.3 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom127.3
%31 = load i8, ptr %arrayidx128.3, align 1, !tbaa !6
%conv129.3 = sext i8 %31 to i32
%call130.3 = call i32 @check_c(i32 noundef %conv126.sink.3, i32 noundef %conv129.3), !range !16
%cmp176.not.3 = icmp eq i32 %call130.3, 0
br i1 %cmp176.not.3, label %if.end175.4, label %if.end202
if.end175.4: ; preds = %if.end175.3
%.sink297.4 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 5), align 1, !tbaa !6
%idxprom124.4 = sext i8 %.sink297.4 to i64
%arrayidx125.4 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom124.4
%conv126.sink.in.4 = load i8, ptr %arrayidx125.4, align 1, !tbaa !6
%conv126.sink.4 = sext i8 %conv126.sink.in.4 to i32
%.sink294.4 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 1), align 1, !tbaa !6
%idxprom127.4 = sext i8 %.sink294.4 to i64
%arrayidx128.4 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom127.4
%32 = load i8, ptr %arrayidx128.4, align 1, !tbaa !6
%conv129.4 = sext i8 %32 to i32
%call130.4 = call i32 @check_c(i32 noundef %conv126.sink.4, i32 noundef %conv129.4), !range !16
%cmp176.not.4 = icmp eq i32 %call130.4, 0
br i1 %cmp176.not.4, label %if.end175.5, label %if.end202
if.end175.5: ; preds = %if.end175.4
%.sink297.5 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 4), align 1, !tbaa !6
%idxprom124.5 = sext i8 %.sink297.5 to i64
%arrayidx125.5 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom124.5
%conv126.sink.in.5 = load i8, ptr %arrayidx125.5, align 1, !tbaa !6
%conv126.sink.5 = sext i8 %conv126.sink.in.5 to i32
%.sink294.5 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 3), align 1, !tbaa !6
%idxprom127.5 = sext i8 %.sink294.5 to i64
%arrayidx128.5 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom127.5
%33 = load i8, ptr %arrayidx128.5, align 1, !tbaa !6
%conv129.5 = sext i8 %33 to i32
%call130.5 = call i32 @check_c(i32 noundef %conv126.sink.5, i32 noundef %conv129.5), !range !16
%cmp176.not.5 = icmp eq i32 %call130.5, 0
br i1 %cmp176.not.5, label %for.inc180.5, label %if.end202
for.inc180.5: ; preds = %if.end175.5
%indvars.iv.next281 = add nuw nsw i64 %indvars.iv280, 1
%34 = load i32, ptr %num, align 4, !tbaa !9
%35 = trunc i64 %indvars.iv.next281 to i32
%cmp79 = icmp sgt i32 %34, %35
br i1 %cmp79, label %for.body81, label %for.cond52.loopexit, !llvm.loop !17
if.end202: ; preds = %for.cond52.loopexit, %for.body81, %if.end175.1, %if.end175.2, %if.end175.3, %if.end175.4, %if.end175.5, %for.cond52.preheader, %if.end3
%str.sink = phi ptr [ @str, %if.end3 ], [ @str, %for.cond52.preheader ], [ @str.13, %if.end175.5 ], [ @str.13, %if.end175.4 ], [ @str.13, %if.end175.3 ], [ @str.13, %if.end175.2 ], [ @str.13, %if.end175.1 ], [ @str.13, %for.body81 ], [ @str, %for.cond52.loopexit ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #8
call void @llvm.lifetime.end.p0(i64 2400, ptr nonnull %d) #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: 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
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @check_c(i32 noundef %x1, i32 noundef %x2) local_unnamed_addr #4 {
entry:
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #8
%0 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), align 4, !tbaa !6
%conv.i = sext i8 %0 to i32
%cmp3.i = icmp eq i32 %conv.i, %x1
br i1 %cmp3.i, label %for.end.i, label %for.inc.i
for.inc.i: ; preds = %entry
%1 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 1), align 1, !tbaa !6
%conv.1.i = sext i8 %1 to i32
%cmp3.1.i = icmp eq i32 %conv.1.i, %x1
br i1 %cmp3.1.i, label %for.end.i, label %for.inc.1.i
for.inc.1.i: ; preds = %for.inc.i
%2 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 2), align 2, !tbaa !6
%conv.2.i = sext i8 %2 to i32
%cmp3.2.i = icmp eq i32 %conv.2.i, %x1
br i1 %cmp3.2.i, label %for.end.i, label %for.inc.2.i
for.inc.2.i: ; preds = %for.inc.1.i
%3 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 3), align 1, !tbaa !6
%conv.3.i = sext i8 %3 to i32
%cmp3.3.i = icmp eq i32 %conv.3.i, %x1
br i1 %cmp3.3.i, label %for.end.i, label %for.inc.3.i
for.inc.3.i: ; preds = %for.inc.2.i
%4 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 4), align 16, !tbaa !6
%conv.4.i = sext i8 %4 to i32
%cmp3.4.i = icmp eq i32 %conv.4.i, %x1
br i1 %cmp3.4.i, label %for.end.i, label %for.inc.4.i
for.inc.4.i: ; preds = %for.inc.3.i
%5 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 5), align 1, !tbaa !6
%conv.5.i = sext i8 %5 to i32
%cmp3.5.i = icmp eq i32 %conv.5.i, %x1
%spec.select.i = select i1 %cmp3.5.i, i32 5, i32 0
br label %for.end.i
for.end.i: ; preds = %for.inc.4.i, %for.inc.3.i, %for.inc.2.i, %for.inc.1.i, %for.inc.i, %entry
%j.0.i = phi i32 [ 0, %entry ], [ 1, %for.inc.i ], [ 2, %for.inc.1.i ], [ 3, %for.inc.2.i ], [ 4, %for.inc.3.i ], [ %spec.select.i, %for.inc.4.i ]
%6 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 0), align 2, !tbaa !6
%conv13.i = sext i8 %6 to i32
%cmp14.i = icmp eq i32 %j.0.i, %conv13.i
br i1 %cmp14.i, label %sw.bb.i, label %for.inc18.i
for.inc18.i: ; preds = %for.end.i
%7 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 1), align 1, !tbaa !6
%conv13.1.i = sext i8 %7 to i32
%cmp14.1.i = icmp eq i32 %j.0.i, %conv13.1.i
br i1 %cmp14.1.i, label %sw.bb21.i, label %for.inc18.1.i
for.inc18.1.i: ; preds = %for.inc18.i
%8 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 2), align 4, !tbaa !6
%conv13.2.i = sext i8 %8 to i32
%cmp14.2.i = icmp eq i32 %j.0.i, %conv13.2.i
br i1 %cmp14.2.i, label %sw.bb23.i, label %for.inc18.2.i
for.inc18.2.i: ; preds = %for.inc18.1.i
%9 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 3), align 1, !tbaa !6
%conv13.3.i = sext i8 %9 to i32
%cmp14.3.i = icmp eq i32 %j.0.i, %conv13.3.i
br i1 %cmp14.3.i, label %sw.bb25.i, label %for.inc18.3.i
for.inc18.3.i: ; preds = %for.inc18.2.i
%10 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 4), align 2, !tbaa !6
%conv13.4.i = sext i8 %10 to i32
%cmp14.4.i = icmp eq i32 %j.0.i, %conv13.4.i
br i1 %cmp14.4.i, label %sw.bb27.i, label %for.inc18.4.i
for.inc18.4.i: ; preds = %for.inc18.3.i
%11 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 5), align 1, !tbaa !6
%conv13.5.i = sext i8 %11 to i32
%cmp14.5.i = icmp eq i32 %j.0.i, %conv13.5.i
br i1 %cmp14.5.i, label %sw.bb29.i, label %sw.bb.i
sw.bb.i: ; preds = %for.inc18.4.i, %for.end.i
store i8 0, ptr %str, align 16
br label %check_a.exit
sw.bb21.i: ; preds = %for.inc18.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.5, i64 3, i1 false) #8
br label %check_a.exit
sw.bb23.i: ; preds = %for.inc18.1.i
store i16 78, ptr %str, align 16
br label %check_a.exit
sw.bb25.i: ; preds = %for.inc18.2.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.7, i64 3, i1 false) #8
br label %check_a.exit
sw.bb27.i: ; preds = %for.inc18.3.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.8, i64 3, i1 false) #8
br label %check_a.exit
sw.bb29.i: ; preds = %for.inc18.4.i
store i16 83, ptr %str, align 16
br label %check_a.exit
check_a.exit: ; preds = %sw.bb.i, %sw.bb21.i, %sw.bb23.i, %sw.bb25.i, %sw.bb27.i, %sw.bb29.i
call void @rot(i32 noundef 1, ptr noundef nonnull %str)
%12 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), align 4, !tbaa !6
%conv.i16 = sext i8 %12 to i32
%cmp3.i17 = icmp eq i32 %conv.i16, %x2
br i1 %cmp3.i17, label %for.end.i34, label %for.inc.i18
for.inc.i18: ; preds = %check_a.exit
%13 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 1), align 1, !tbaa !6
%conv.1.i19 = sext i8 %13 to i32
%cmp3.1.i20 = icmp eq i32 %conv.1.i19, %x2
br i1 %cmp3.1.i20, label %for.end.i34, label %for.inc.1.i21
for.inc.1.i21: ; preds = %for.inc.i18
%14 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 2), align 2, !tbaa !6
%conv.2.i22 = sext i8 %14 to i32
%cmp3.2.i23 = icmp eq i32 %conv.2.i22, %x2
br i1 %cmp3.2.i23, label %for.end.i34, label %for.inc.2.i24
for.inc.2.i24: ; preds = %for.inc.1.i21
%15 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 3), align 1, !tbaa !6
%conv.3.i25 = sext i8 %15 to i32
%cmp3.3.i26 = icmp eq i32 %conv.3.i25, %x2
br i1 %cmp3.3.i26, label %for.end.i34, label %for.inc.3.i27
for.inc.3.i27: ; preds = %for.inc.2.i24
%16 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 4), align 16, !tbaa !6
%conv.4.i28 = sext i8 %16 to i32
%cmp3.4.i29 = icmp eq i32 %conv.4.i28, %x2
br i1 %cmp3.4.i29, label %for.end.i34, label %for.inc.4.i30
for.inc.4.i30: ; preds = %for.inc.3.i27
%17 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 0, i64 5), align 1, !tbaa !6
%conv.5.i31 = sext i8 %17 to i32
%cmp3.5.i32 = icmp eq i32 %conv.5.i31, %x2
%spec.select.i33 = select i1 %cmp3.5.i32, i32 5, i32 0
br label %for.end.i34
for.end.i34: ; preds = %for.inc.4.i30, %for.inc.3.i27, %for.inc.2.i24, %for.inc.1.i21, %for.inc.i18, %check_a.exit
%j.0.i35 = phi i32 [ 0, %check_a.exit ], [ 1, %for.inc.i18 ], [ 2, %for.inc.1.i21 ], [ 3, %for.inc.2.i24 ], [ 4, %for.inc.3.i27 ], [ %spec.select.i33, %for.inc.4.i30 ]
%18 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 0), align 2, !tbaa !6
%conv13.i36 = sext i8 %18 to i32
%cmp14.i37 = icmp eq i32 %j.0.i35, %conv13.i36
br i1 %cmp14.i37, label %sw.bb.i53, label %for.inc18.i38
for.inc18.i38: ; preds = %for.end.i34
%19 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 1), align 1, !tbaa !6
%conv13.1.i39 = sext i8 %19 to i32
%cmp14.1.i40 = icmp eq i32 %j.0.i35, %conv13.1.i39
br i1 %cmp14.1.i40, label %sw.bb21.i58, label %for.inc18.1.i41
for.inc18.1.i41: ; preds = %for.inc18.i38
%20 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 2), align 4, !tbaa !6
%conv13.2.i42 = sext i8 %20 to i32
%cmp14.2.i43 = icmp eq i32 %j.0.i35, %conv13.2.i42
br i1 %cmp14.2.i43, label %sw.bb23.i57, label %for.inc18.2.i44
for.inc18.2.i44: ; preds = %for.inc18.1.i41
%21 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 3), align 1, !tbaa !6
%conv13.3.i45 = sext i8 %21 to i32
%cmp14.3.i46 = icmp eq i32 %j.0.i35, %conv13.3.i45
br i1 %cmp14.3.i46, label %sw.bb25.i56, label %for.inc18.3.i47
for.inc18.3.i47: ; preds = %for.inc18.2.i44
%22 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 4), align 2, !tbaa !6
%conv13.4.i48 = sext i8 %22 to i32
%cmp14.4.i49 = icmp eq i32 %j.0.i35, %conv13.4.i48
br i1 %cmp14.4.i49, label %sw.bb27.i55, label %for.inc18.4.i50
for.inc18.4.i50: ; preds = %for.inc18.3.i47
%23 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 5), align 1, !tbaa !6
%conv13.5.i51 = sext i8 %23 to i32
%cmp14.5.i52 = icmp eq i32 %j.0.i35, %conv13.5.i51
br i1 %cmp14.5.i52, label %sw.bb29.i54, label %sw.bb.i53
sw.bb.i53: ; preds = %for.inc18.4.i50, %for.end.i34
store i8 0, ptr %str, align 16
br label %check_b.exit
sw.bb21.i58: ; preds = %for.inc18.i38
store i16 69, ptr %str, align 16
br label %check_b.exit
sw.bb23.i57: ; preds = %for.inc18.1.i41
store i8 0, ptr %str, align 16
br label %check_b.exit
sw.bb25.i56: ; preds = %for.inc18.2.i44
store i16 87, ptr %str, align 16
br label %check_b.exit
sw.bb27.i55: ; preds = %for.inc18.3.i47
store i8 0, ptr %str, align 16
br label %check_b.exit
sw.bb29.i54: ; preds = %for.inc18.4.i50
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.12, i64 3, i1 false) #8
br label %check_b.exit
check_b.exit: ; preds = %sw.bb.i53, %sw.bb21.i58, %sw.bb23.i57, %sw.bb25.i56, %sw.bb27.i55, %sw.bb29.i54
call void @rot(i32 noundef 1, ptr noundef nonnull %str)
%24 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 0), align 2, !tbaa !6
%idxprom4 = sext i8 %24 to i64
%arrayidx5 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom4
%25 = load i8, ptr %arrayidx5, align 1, !tbaa !6
%26 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 0), align 2, !tbaa !6
%idxprom8 = sext i8 %26 to i64
%arrayidx9 = getelementptr inbounds [6 x i8], ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), i64 0, i64 %idxprom8
%27 = load i8, ptr %arrayidx9, align 1, !tbaa !6
%cmp11.not = icmp eq i8 %25, %27
%28 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 1), align 1, !tbaa !6
%idxprom4.1 = sext i8 %28 to i64
%arrayidx5.1 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom4.1
%29 = load i8, ptr %arrayidx5.1, align 1, !tbaa !6
%30 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 1), align 1, !tbaa !6
%idxprom8.1 = sext i8 %30 to i64
%arrayidx9.1 = getelementptr inbounds [6 x i8], ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), i64 0, i64 %idxprom8.1
%31 = load i8, ptr %arrayidx9.1, align 1, !tbaa !6
%cmp11.not.1 = icmp eq i8 %29, %31
%32 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 2), align 8, !tbaa !6
%idxprom4.2 = sext i8 %32 to i64
%arrayidx5.2 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom4.2
%33 = load i8, ptr %arrayidx5.2, align 1, !tbaa !6
%34 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 2), align 4, !tbaa !6
%idxprom8.2 = sext i8 %34 to i64
%arrayidx9.2 = getelementptr inbounds [6 x i8], ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), i64 0, i64 %idxprom8.2
%35 = load i8, ptr %arrayidx9.2, align 1, !tbaa !6
%cmp11.not.2 = icmp eq i8 %33, %35
%36 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 3), align 1, !tbaa !6
%idxprom4.3 = sext i8 %36 to i64
%arrayidx5.3 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom4.3
%37 = load i8, ptr %arrayidx5.3, align 1, !tbaa !6
%38 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 3), align 1, !tbaa !6
%idxprom8.3 = sext i8 %38 to i64
%arrayidx9.3 = getelementptr inbounds [6 x i8], ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), i64 0, i64 %idxprom8.3
%39 = load i8, ptr %arrayidx9.3, align 1, !tbaa !6
%cmp11.not.3 = icmp eq i8 %37, %39
%40 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 4), align 2, !tbaa !6
%idxprom4.4 = sext i8 %40 to i64
%arrayidx5.4 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom4.4
%41 = load i8, ptr %arrayidx5.4, align 1, !tbaa !6
%42 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 4), align 2, !tbaa !6
%idxprom8.4 = sext i8 %42 to i64
%arrayidx9.4 = getelementptr inbounds [6 x i8], ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), i64 0, i64 %idxprom8.4
%43 = load i8, ptr %arrayidx9.4, align 1, !tbaa !6
%cmp11.not.4 = icmp eq i8 %41, %43
%44 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 0, i32 1, i64 5), align 1, !tbaa !6
%idxprom4.5 = sext i8 %44 to i64
%arrayidx5.5 = getelementptr inbounds [6 x i8], ptr @DICE, i64 0, i64 %idxprom4.5
%45 = load i8, ptr %arrayidx5.5, align 1, !tbaa !6
%46 = load i8, ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1, i32 1, i64 5), align 1, !tbaa !6
%idxprom8.5 = sext i8 %46 to i64
%arrayidx9.5 = getelementptr inbounds [6 x i8], ptr getelementptr inbounds ([2 x %struct.dice], ptr @DICE, i64 0, i64 1), i64 0, i64 %idxprom8.5
%47 = load i8, ptr %arrayidx9.5, align 1, !tbaa !6
%cmp11.not.5 = icmp eq i8 %45, %47
%48 = select i1 %cmp11.not.5, i1 %cmp11.not.4, i1 false
%49 = select i1 %48, i1 %cmp11.not.3, i1 false
%50 = select i1 %49, i1 %cmp11.not.2, i1 false
%51 = select i1 %50, i1 %cmp11.not.1, i1 false
%narrow = select i1 %51, i1 %cmp11.not, i1 false
%spec.select.5 = zext i1 %narrow to i32
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #8
ret i32 %spec.select.5
}
; 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(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @check_a(i32 noundef %l1, i32 noundef %no, ptr nocapture noundef writeonly %str) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %no to i64
%arrayidx = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 4, !tbaa !6
%conv = sext i8 %0 to i32
%cmp3 = icmp eq i32 %conv, %l1
br i1 %cmp3, label %for.end, label %for.inc
for.inc: ; preds = %entry
%arrayidx2.1 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 1
%1 = load i8, ptr %arrayidx2.1, align 1, !tbaa !6
%conv.1 = sext i8 %1 to i32
%cmp3.1 = icmp eq i32 %conv.1, %l1
br i1 %cmp3.1, label %for.end, label %for.inc.1
for.inc.1: ; preds = %for.inc
%arrayidx2.2 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 2
%2 = load i8, ptr %arrayidx2.2, align 2, !tbaa !6
%conv.2 = sext i8 %2 to i32
%cmp3.2 = icmp eq i32 %conv.2, %l1
br i1 %cmp3.2, label %for.end, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%arrayidx2.3 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 3
%3 = load i8, ptr %arrayidx2.3, align 1, !tbaa !6
%conv.3 = sext i8 %3 to i32
%cmp3.3 = icmp eq i32 %conv.3, %l1
br i1 %cmp3.3, label %for.end, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%arrayidx2.4 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 4
%4 = load i8, ptr %arrayidx2.4, align 4, !tbaa !6
%conv.4 = sext i8 %4 to i32
%cmp3.4 = icmp eq i32 %conv.4, %l1
br i1 %cmp3.4, label %for.end, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%arrayidx2.5 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 5
%5 = load i8, ptr %arrayidx2.5, align 1, !tbaa !6
%conv.5 = sext i8 %5 to i32
%cmp3.5 = icmp eq i32 %conv.5, %l1
%spec.select = select i1 %cmp3.5, i32 5, i32 0
br label %for.end
for.end: ; preds = %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%j.0 = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 3, %for.inc.2 ], [ 4, %for.inc.3 ], [ %spec.select, %for.inc.4 ]
%arrayidx12 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 0
%6 = load i8, ptr %arrayidx12, align 2, !tbaa !6
%conv13 = sext i8 %6 to i32
%cmp14 = icmp eq i32 %j.0, %conv13
br i1 %cmp14, label %sw.bb, label %for.inc18
for.inc18: ; preds = %for.end
%arrayidx12.1 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 1
%7 = load i8, ptr %arrayidx12.1, align 1, !tbaa !6
%conv13.1 = sext i8 %7 to i32
%cmp14.1 = icmp eq i32 %j.0, %conv13.1
br i1 %cmp14.1, label %sw.bb21, label %for.inc18.1
for.inc18.1: ; preds = %for.inc18
%arrayidx12.2 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 2
%8 = load i8, ptr %arrayidx12.2, align 4, !tbaa !6
%conv13.2 = sext i8 %8 to i32
%cmp14.2 = icmp eq i32 %j.0, %conv13.2
br i1 %cmp14.2, label %sw.bb23, label %for.inc18.2
for.inc18.2: ; preds = %for.inc18.1
%arrayidx12.3 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 3
%9 = load i8, ptr %arrayidx12.3, align 1, !tbaa !6
%conv13.3 = sext i8 %9 to i32
%cmp14.3 = icmp eq i32 %j.0, %conv13.3
br i1 %cmp14.3, label %sw.bb25, label %for.inc18.3
for.inc18.3: ; preds = %for.inc18.2
%arrayidx12.4 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 4
%10 = load i8, ptr %arrayidx12.4, align 2, !tbaa !6
%conv13.4 = sext i8 %10 to i32
%cmp14.4 = icmp eq i32 %j.0, %conv13.4
br i1 %cmp14.4, label %sw.bb27, label %for.inc18.4
for.inc18.4: ; preds = %for.inc18.3
%arrayidx12.5 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 5
%11 = load i8, ptr %arrayidx12.5, align 1, !tbaa !6
%conv13.5 = sext i8 %11 to i32
%cmp14.5 = icmp eq i32 %j.0, %conv13.5
br i1 %cmp14.5, label %sw.bb29, label %sw.bb
sw.bb: ; preds = %for.end, %for.inc18.4
store i8 0, ptr %str, align 1
br label %sw.epilog
sw.bb21: ; preds = %for.inc18
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.5, i64 3, i1 false) #8
br label %sw.epilog
sw.bb23: ; preds = %for.inc18.1
store i16 78, ptr %str, align 1
br label %sw.epilog
sw.bb25: ; preds = %for.inc18.2
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.7, i64 3, i1 false) #8
br label %sw.epilog
sw.bb27: ; preds = %for.inc18.3
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.8, i64 3, i1 false) #8
br label %sw.epilog
sw.bb29: ; preds = %for.inc18.4
store i16 83, ptr %str, align 1
br label %sw.epilog
sw.epilog: ; preds = %sw.bb29, %sw.bb27, %sw.bb25, %sw.bb23, %sw.bb21, %sw.bb
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @rot(i32 noundef %no, ptr nocapture noundef readonly %str) local_unnamed_addr #6 {
entry:
%0 = load i8, ptr %str, align 1, !tbaa !6
%cmp.not180 = icmp eq i8 %0, 0
br i1 %cmp.not180, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%idxprom109 = sext i32 %no to i64
%arrayidx112 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom109, i32 1, i64 5
%arrayidx117 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom109, i32 1, i64 1
%arrayidx125 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom109, i32 1, i64 2
%arrayidx133 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom109, i32 1, i64 3
%num41 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom109, i32 1
%arrayidx47 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom109, i32 1, i64 4
br label %while.body
while.body: ; preds = %while.body.lr.ph, %sw.epilog
%indvars.iv = phi i64 [ 0, %while.body.lr.ph ], [ %indvars.iv.next, %sw.epilog ]
%1 = phi i8 [ %0, %while.body.lr.ph ], [ %18, %sw.epilog ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 78, label %sw.bb
i32 83, label %sw.bb38
i32 69, label %sw.bb73
i32 87, label %sw.bb108
]
sw.bb: ; preds = %while.body
%2 = load i8, ptr %arrayidx112, align 1, !tbaa !6
%3 = load i8, ptr %num41, align 2, !tbaa !6
store i8 %3, ptr %arrayidx112, align 1, !tbaa !6
%4 = load i8, ptr %arrayidx125, align 4, !tbaa !6
store i8 %4, ptr %num41, align 2, !tbaa !6
%5 = load i8, ptr %arrayidx47, align 2, !tbaa !6
store i8 %5, ptr %arrayidx125, align 4, !tbaa !6
store i8 %2, ptr %arrayidx47, align 2, !tbaa !6
br label %sw.epilog
sw.bb38: ; preds = %while.body
%6 = load i8, ptr %arrayidx112, align 1, !tbaa !6
%7 = load i8, ptr %arrayidx47, align 2, !tbaa !6
store i8 %7, ptr %arrayidx112, align 1, !tbaa !6
%8 = load i8, ptr %arrayidx125, align 4, !tbaa !6
store i8 %8, ptr %arrayidx47, align 2, !tbaa !6
%9 = load i8, ptr %num41, align 2, !tbaa !6
store i8 %9, ptr %arrayidx125, align 4, !tbaa !6
store i8 %6, ptr %num41, align 2, !tbaa !6
br label %sw.epilog
sw.bb73: ; preds = %while.body
%10 = load i8, ptr %arrayidx112, align 1, !tbaa !6
%11 = load i8, ptr %arrayidx133, align 1, !tbaa !6
store i8 %11, ptr %arrayidx112, align 1, !tbaa !6
%12 = load i8, ptr %arrayidx125, align 4, !tbaa !6
store i8 %12, ptr %arrayidx133, align 1, !tbaa !6
%13 = load i8, ptr %arrayidx117, align 1, !tbaa !6
store i8 %13, ptr %arrayidx125, align 4, !tbaa !6
store i8 %10, ptr %arrayidx117, align 1, !tbaa !6
br label %sw.epilog
sw.bb108: ; preds = %while.body
%14 = load i8, ptr %arrayidx112, align 1, !tbaa !6
%15 = load i8, ptr %arrayidx117, align 1, !tbaa !6
store i8 %15, ptr %arrayidx112, align 1, !tbaa !6
%16 = load i8, ptr %arrayidx125, align 4, !tbaa !6
store i8 %16, ptr %arrayidx117, align 1, !tbaa !6
%17 = load i8, ptr %arrayidx133, align 1, !tbaa !6
store i8 %17, ptr %arrayidx125, align 4, !tbaa !6
store i8 %14, ptr %arrayidx133, align 1, !tbaa !6
br label %sw.epilog
sw.epilog: ; preds = %while.body, %sw.bb108, %sw.bb73, %sw.bb38, %sw.bb
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.next
%18 = load i8, ptr %arrayidx, align 1, !tbaa !6
%cmp.not = icmp eq i8 %18, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !18
while.end: ; preds = %sw.epilog, %entry
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @check_b(i32 noundef %l1, i32 noundef %no, ptr nocapture noundef writeonly %str) local_unnamed_addr #5 {
entry:
%idxprom = sext i32 %no to i64
%arrayidx = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 4, !tbaa !6
%conv = sext i8 %0 to i32
%cmp3 = icmp eq i32 %conv, %l1
br i1 %cmp3, label %for.end, label %for.inc
for.inc: ; preds = %entry
%arrayidx2.1 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 1
%1 = load i8, ptr %arrayidx2.1, align 1, !tbaa !6
%conv.1 = sext i8 %1 to i32
%cmp3.1 = icmp eq i32 %conv.1, %l1
br i1 %cmp3.1, label %for.end, label %for.inc.1
for.inc.1: ; preds = %for.inc
%arrayidx2.2 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 2
%2 = load i8, ptr %arrayidx2.2, align 2, !tbaa !6
%conv.2 = sext i8 %2 to i32
%cmp3.2 = icmp eq i32 %conv.2, %l1
br i1 %cmp3.2, label %for.end, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%arrayidx2.3 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 3
%3 = load i8, ptr %arrayidx2.3, align 1, !tbaa !6
%conv.3 = sext i8 %3 to i32
%cmp3.3 = icmp eq i32 %conv.3, %l1
br i1 %cmp3.3, label %for.end, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%arrayidx2.4 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 4
%4 = load i8, ptr %arrayidx2.4, align 4, !tbaa !6
%conv.4 = sext i8 %4 to i32
%cmp3.4 = icmp eq i32 %conv.4, %l1
br i1 %cmp3.4, label %for.end, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%arrayidx2.5 = getelementptr inbounds [6 x i8], ptr %arrayidx, i64 0, i64 5
%5 = load i8, ptr %arrayidx2.5, align 1, !tbaa !6
%conv.5 = sext i8 %5 to i32
%cmp3.5 = icmp eq i32 %conv.5, %l1
%spec.select = select i1 %cmp3.5, i32 5, i32 0
br label %for.end
for.end: ; preds = %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%j.0 = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 3, %for.inc.2 ], [ 4, %for.inc.3 ], [ %spec.select, %for.inc.4 ]
%arrayidx12 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 0
%6 = load i8, ptr %arrayidx12, align 2, !tbaa !6
%conv13 = sext i8 %6 to i32
%cmp14 = icmp eq i32 %j.0, %conv13
br i1 %cmp14, label %sw.bb, label %for.inc18
for.inc18: ; preds = %for.end
%arrayidx12.1 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 1
%7 = load i8, ptr %arrayidx12.1, align 1, !tbaa !6
%conv13.1 = sext i8 %7 to i32
%cmp14.1 = icmp eq i32 %j.0, %conv13.1
br i1 %cmp14.1, label %sw.bb21, label %for.inc18.1
for.inc18.1: ; preds = %for.inc18
%arrayidx12.2 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 2
%8 = load i8, ptr %arrayidx12.2, align 4, !tbaa !6
%conv13.2 = sext i8 %8 to i32
%cmp14.2 = icmp eq i32 %j.0, %conv13.2
br i1 %cmp14.2, label %sw.bb23, label %for.inc18.2
for.inc18.2: ; preds = %for.inc18.1
%arrayidx12.3 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 3
%9 = load i8, ptr %arrayidx12.3, align 1, !tbaa !6
%conv13.3 = sext i8 %9 to i32
%cmp14.3 = icmp eq i32 %j.0, %conv13.3
br i1 %cmp14.3, label %sw.bb25, label %for.inc18.3
for.inc18.3: ; preds = %for.inc18.2
%arrayidx12.4 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 4
%10 = load i8, ptr %arrayidx12.4, align 2, !tbaa !6
%conv13.4 = sext i8 %10 to i32
%cmp14.4 = icmp eq i32 %j.0, %conv13.4
br i1 %cmp14.4, label %sw.bb27, label %for.inc18.4
for.inc18.4: ; preds = %for.inc18.3
%arrayidx12.5 = getelementptr inbounds [2 x %struct.dice], ptr @DICE, i64 0, i64 %idxprom, i32 1, i64 5
%11 = load i8, ptr %arrayidx12.5, align 1, !tbaa !6
%conv13.5 = sext i8 %11 to i32
%cmp14.5 = icmp eq i32 %j.0, %conv13.5
br i1 %cmp14.5, label %sw.bb29, label %sw.bb
sw.bb: ; preds = %for.end, %for.inc18.4
store i8 0, ptr %str, align 1
br label %sw.epilog
sw.bb21: ; preds = %for.inc18
store i16 69, ptr %str, align 1
br label %sw.epilog
sw.bb23: ; preds = %for.inc18.1
store i8 0, ptr %str, align 1
br label %sw.epilog
sw.bb25: ; preds = %for.inc18.2
store i16 87, ptr %str, align 1
br label %sw.epilog
sw.bb27: ; preds = %for.inc18.3
store i8 0, ptr %str, align 1
br label %sw.epilog
sw.bb29: ; preds = %for.inc18.4
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %str, ptr noundef nonnull align 1 dereferenceable(3) @.str.12, i64 3, i1 false) #8
br label %sw.epilog
sw.epilog: ; preds = %sw.bb29, %sw.bb27, %sw.bb25, %sw.bb23, %sw.bb21, %sw.bb
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree 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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nosync nounwind willreturn 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 #6 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i64 0, i64 6, !6, i64 6, i64 6, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i32 0, i32 2}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
|
#include <stdio.h>
int rot[24][7] = {
{ 0,1,2,3,4,5,6 },{ 0,1,3,5,2,4,6 },{ 0,1,4,2,5,3,6 },{ 0,1,5,4,3,2,6 },
{ 0,2,6,3,4,1,5 },{ 0,2,3,1,6,4,5 },{ 0,2,1,4,3,6,5 },{ 0,2,4,6,1,3,5 },
{ 0,3,1,2,5,6,4 },{ 0,3,2,6,1,5,4 },{ 0,3,5,1,6,2,4 },{ 0,3,6,5,2,1,4 },
{ 0,4,1,5,2,6,3 },{ 0,4,2,1,6,5,3 },{ 0,4,5,6,1,2,3 },{ 0,4,6,2,5,1,3 },
{ 0,5,1,3,4,6,2 },{ 0,5,3,6,1,4,2 },{ 0,5,4,1,6,3,2 },{ 0,5,6,4,3,1,2 },
{ 0,6,2,4,3,5,1 },{ 0,6,3,2,5,4,1 },{ 0,6,5,3,4,2,1 },{ 0,6,4,5,2,3,1 } };
int assign[7];
int main(void)
{
int i, j, k, l;
int n;
int a[1002][7], b[7], dice[7];
scanf("%d", &n);
for (k = 0; k < n; k++){
for (i = 1; i <= 6; i++) scanf("%d", &a[k][i]);
}
for (k = 1; k < n; k++){
for (l = 0; l < k; l++){
for (j = 0; j < 24; j++) {
for (i = 1; i <= 6; i++) dice[i] = rot[j][i];
for (i = 1; i <= 6; i++) b[i] = a[l][dice[i]];
for (i = 1; ; i++) {
if (i > 6){
puts("No");
return 0;
}
if (a[k][i] != b[i]){
break;
}
}
}
}
}
puts("Yes");
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135327/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135327/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@rot = dso_local local_unnamed_addr global [24 x [7 x i32]] [[7 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6], [7 x i32] [i32 0, i32 1, i32 3, i32 5, i32 2, i32 4, i32 6], [7 x i32] [i32 0, i32 1, i32 4, i32 2, i32 5, i32 3, i32 6], [7 x i32] [i32 0, i32 1, i32 5, i32 4, i32 3, i32 2, i32 6], [7 x i32] [i32 0, i32 2, i32 6, i32 3, i32 4, i32 1, i32 5], [7 x i32] [i32 0, i32 2, i32 3, i32 1, i32 6, i32 4, i32 5], [7 x i32] [i32 0, i32 2, i32 1, i32 4, i32 3, i32 6, i32 5], [7 x i32] [i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5], [7 x i32] [i32 0, i32 3, i32 1, i32 2, i32 5, i32 6, i32 4], [7 x i32] [i32 0, i32 3, i32 2, i32 6, i32 1, i32 5, i32 4], [7 x i32] [i32 0, i32 3, i32 5, i32 1, i32 6, i32 2, i32 4], [7 x i32] [i32 0, i32 3, i32 6, i32 5, i32 2, i32 1, i32 4], [7 x i32] [i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3], [7 x i32] [i32 0, i32 4, i32 2, i32 1, i32 6, i32 5, i32 3], [7 x i32] [i32 0, i32 4, i32 5, i32 6, i32 1, i32 2, i32 3], [7 x i32] [i32 0, i32 4, i32 6, i32 2, i32 5, i32 1, i32 3], [7 x i32] [i32 0, i32 5, i32 1, i32 3, i32 4, i32 6, i32 2], [7 x i32] [i32 0, i32 5, i32 3, i32 6, i32 1, i32 4, i32 2], [7 x i32] [i32 0, i32 5, i32 4, i32 1, i32 6, i32 3, i32 2], [7 x i32] [i32 0, i32 5, i32 6, i32 4, i32 3, i32 1, i32 2], [7 x i32] [i32 0, i32 6, i32 2, i32 4, i32 3, i32 5, i32 1], [7 x i32] [i32 0, i32 6, i32 3, i32 2, i32 5, i32 4, i32 1], [7 x i32] [i32 0, i32 6, i32 5, i32 3, i32 4, i32 2, i32 1], [7 x i32] [i32 0, i32 6, i32 4, i32 5, i32 2, i32 3, i32 1]], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@assign = dso_local local_unnamed_addr global [7 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [1002 x [7 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 28056, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp102 = icmp sgt i32 %0, 0
br i1 %cmp102, label %for.cond1.preheader, label %cleanup
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ]
%arrayidx5 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%arrayidx5.1 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 2
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 3
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 4
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 5
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 6
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !9
for.cond10.preheader: ; preds = %for.cond1.preheader
%cmp11109 = icmp sgt i32 %1, 1
br i1 %cmp11109, label %for.cond13.preheader.preheader, label %cleanup
for.cond13.preheader.preheader: ; preds = %for.cond10.preheader
%wide.trip.count132 = zext i32 %1 to i64
br label %for.cond13.preheader
for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.inc66
%indvars.iv129 = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next130, %for.inc66 ]
%arrayidx51.phi.trans.insert.phi.trans.insert = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 1
%.pre.pre = load i32, ptr %arrayidx51.phi.trans.insert.phi.trans.insert, align 4, !tbaa !5
%arrayidx51.1 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 2
%arrayidx51.2 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 3
%arrayidx51.3 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 4
%arrayidx51.4 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 5
%arrayidx51.5 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv129, i64 6
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond13.preheader, %for.inc63
%indvars.iv125 = phi i64 [ 0, %for.cond13.preheader ], [ %indvars.iv.next126, %for.inc63 ]
br label %for.cond19.preheader
for.cond19.preheader: ; preds = %for.cond16.preheader, %for.inc60
%indvar = phi i64 [ 0, %for.cond16.preheader ], [ %indvar.next, %for.inc60 ]
%3 = mul nuw nsw i64 %indvar, 28
%4 = getelementptr i8, ptr @rot, i64 %3
%scevgep114 = getelementptr i8, ptr %4, i64 4
%dice.sroa.2.4.copyload = load i32, ptr %scevgep114, align 4, !tbaa !5
%dice.sroa.5.4.scevgep114.sroa_idx = getelementptr i8, ptr %4, i64 12
%dice.sroa.5.4.copyload = load i32, ptr %dice.sroa.5.4.scevgep114.sroa_idx, align 4, !tbaa !5
%dice.sroa.6.4.scevgep114.sroa_idx = getelementptr i8, ptr %4, i64 16
%dice.sroa.6.4.copyload = load i32, ptr %dice.sroa.6.4.scevgep114.sroa_idx, align 4, !tbaa !5
%dice.sroa.7.4.scevgep114.sroa_idx = getelementptr i8, ptr %4, i64 20
%dice.sroa.7.4.copyload = load i32, ptr %dice.sroa.7.4.scevgep114.sroa_idx, align 4, !tbaa !5
%dice.sroa.8.4.scevgep114.sroa_idx = getelementptr i8, ptr %4, i64 24
%dice.sroa.8.4.copyload = load i32, ptr %dice.sroa.8.4.scevgep114.sroa_idx, align 4, !tbaa !5
%idxprom38 = sext i32 %dice.sroa.2.4.copyload to i64
%arrayidx39 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv125, i64 %idxprom38
%5 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%idxprom38.2 = sext i32 %dice.sroa.5.4.copyload to i64
%arrayidx39.2 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv125, i64 %idxprom38.2
%6 = load i32, ptr %arrayidx39.2, align 4, !tbaa !5
%idxprom38.3 = sext i32 %dice.sroa.6.4.copyload to i64
%arrayidx39.3 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv125, i64 %idxprom38.3
%7 = load i32, ptr %arrayidx39.3, align 4, !tbaa !5
%idxprom38.4 = sext i32 %dice.sroa.7.4.copyload to i64
%arrayidx39.4 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv125, i64 %idxprom38.4
%8 = load i32, ptr %arrayidx39.4, align 4, !tbaa !5
%idxprom38.5 = sext i32 %dice.sroa.8.4.copyload to i64
%arrayidx39.5 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv125, i64 %idxprom38.5
%9 = load i32, ptr %arrayidx39.5, align 4, !tbaa !5
%cmp54.not = icmp eq i32 %.pre.pre, %5
br i1 %cmp54.not, label %for.cond45, label %for.inc60
for.cond45: ; preds = %for.cond19.preheader
%dice.sroa.4.4.scevgep114.sroa_idx = getelementptr i8, ptr %4, i64 8
%dice.sroa.4.4.copyload = load i32, ptr %dice.sroa.4.4.scevgep114.sroa_idx, align 4, !tbaa !5
%idxprom38.1 = sext i32 %dice.sroa.4.4.copyload to i64
%arrayidx39.1 = getelementptr inbounds [1002 x [7 x i32]], ptr %a, i64 0, i64 %indvars.iv125, i64 %idxprom38.1
%10 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx51.1, align 4, !tbaa !5
%cmp54.not.1 = icmp eq i32 %11, %10
br i1 %cmp54.not.1, label %for.cond45.1, label %for.inc60
for.cond45.1: ; preds = %for.cond45
%12 = load i32, ptr %arrayidx51.2, align 4, !tbaa !5
%cmp54.not.2 = icmp eq i32 %12, %6
br i1 %cmp54.not.2, label %for.cond45.2, label %for.inc60
for.cond45.2: ; preds = %for.cond45.1
%13 = load i32, ptr %arrayidx51.3, align 4, !tbaa !5
%cmp54.not.3 = icmp eq i32 %13, %7
br i1 %cmp54.not.3, label %for.cond45.3, label %for.inc60
for.cond45.3: ; preds = %for.cond45.2
%14 = load i32, ptr %arrayidx51.4, align 4, !tbaa !5
%cmp54.not.4 = icmp eq i32 %14, %8
br i1 %cmp54.not.4, label %for.cond45.4, label %for.inc60
for.cond45.4: ; preds = %for.cond45.3
%15 = load i32, ptr %arrayidx51.5, align 4, !tbaa !5
%cmp54.not.5 = icmp eq i32 %15, %9
br i1 %cmp54.not.5, label %cleanup, label %for.inc60
for.inc60: ; preds = %for.cond45.4, %for.cond45.3, %for.cond45.2, %for.cond45.1, %for.cond45, %for.cond19.preheader
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond.not = icmp eq i64 %indvar.next, 24
br i1 %exitcond.not, label %for.inc63, label %for.cond19.preheader, !llvm.loop !11
for.inc63: ; preds = %for.inc60
%indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
%exitcond128.not = icmp eq i64 %indvars.iv.next126, %indvars.iv129
br i1 %exitcond128.not, label %for.inc66, label %for.cond16.preheader, !llvm.loop !12
for.inc66: ; preds = %for.inc63
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%exitcond133.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count132
br i1 %exitcond133.not, label %cleanup, label %for.cond13.preheader, !llvm.loop !13
cleanup: ; preds = %for.inc66, %for.cond45.4, %for.cond10.preheader, %entry
%.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %for.cond10.preheader ], [ @.str.1, %for.cond45.4 ], [ @.str.2, %for.inc66 ]
%call69 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 28056, 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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int D[107][7],i,j,N;
int G[55][6]={
{1,2,3},{1,3,5},{1,5,4},{1,4,2},
{2,1,4},{2,4,6},{2,6,3},{2,3,1},
{3,1,2},{3,2,6},{3,6,5},{3,5,1},
{4,1,5},{4,2,1},{4,6,2},{4,5,6},
{5,1,3},{5,3,6},{5,4,1},{5,6,4},
{6,2,4},{6,4,5},{6,5,3},{6,3,2}};
int ch(int a,int b)
{
int i;
for(i=0;i<24;i++)
{
if(D[a][1]==D[b][G[i][0]]&&
D[a][2]==D[b][G[i][1]]&&
D[a][3]==D[b][G[i][2]]&&
D[a][6]==D[b][7-G[i][0]]&&
D[a][5]==D[b][7-G[i][1]]&&
D[a][4]==D[b][7-G[i][2]])
return 1;
}
return 0;
}
int main()
{
scanf("%d",&N);
for(i=0;i<N;i++)
for(j=1;j<=6;j++)
scanf("%d",&D[i][j]);
for(i=0;i<N;i++)
for(j=i+1;j<N;j++)
{
if(ch(i,j))
{
puts("No");
return 0;
}
}
puts("Yes");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@G = dso_local local_unnamed_addr global <{ [24 x [6 x i32]], [31 x [6 x i32]] }> <{ [24 x [6 x i32]] [[6 x i32] [i32 1, i32 2, i32 3, i32 0, i32 0, i32 0], [6 x i32] [i32 1, i32 3, i32 5, i32 0, i32 0, i32 0], [6 x i32] [i32 1, i32 5, i32 4, i32 0, i32 0, i32 0], [6 x i32] [i32 1, i32 4, i32 2, i32 0, i32 0, i32 0], [6 x i32] [i32 2, i32 1, i32 4, i32 0, i32 0, i32 0], [6 x i32] [i32 2, i32 4, i32 6, i32 0, i32 0, i32 0], [6 x i32] [i32 2, i32 6, i32 3, i32 0, i32 0, i32 0], [6 x i32] [i32 2, i32 3, i32 1, i32 0, i32 0, i32 0], [6 x i32] [i32 3, i32 1, i32 2, i32 0, i32 0, i32 0], [6 x i32] [i32 3, i32 2, i32 6, i32 0, i32 0, i32 0], [6 x i32] [i32 3, i32 6, i32 5, i32 0, i32 0, i32 0], [6 x i32] [i32 3, i32 5, i32 1, i32 0, i32 0, i32 0], [6 x i32] [i32 4, i32 1, i32 5, i32 0, i32 0, i32 0], [6 x i32] [i32 4, i32 2, i32 1, i32 0, i32 0, i32 0], [6 x i32] [i32 4, i32 6, i32 2, i32 0, i32 0, i32 0], [6 x i32] [i32 4, i32 5, i32 6, i32 0, i32 0, i32 0], [6 x i32] [i32 5, i32 1, i32 3, i32 0, i32 0, i32 0], [6 x i32] [i32 5, i32 3, i32 6, i32 0, i32 0, i32 0], [6 x i32] [i32 5, i32 4, i32 1, i32 0, i32 0, i32 0], [6 x i32] [i32 5, i32 6, i32 4, i32 0, i32 0, i32 0], [6 x i32] [i32 6, i32 2, i32 4, i32 0, i32 0, i32 0], [6 x i32] [i32 6, i32 4, i32 5, i32 0, i32 0, i32 0], [6 x i32] [i32 6, i32 5, i32 3, i32 0, i32 0, i32 0], [6 x i32] [i32 6, i32 3, i32 2, i32 0, i32 0, i32 0]], [31 x [6 x i32]] zeroinitializer }>, align 16
@D = dso_local global [107 x [7 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@N = dso_local global i32 0, align 4
@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"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @ch(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %a to i64
%arrayidx61 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 4
%arrayidx1 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 1
%0 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%idxprom2 = sext i32 %b to i64
%arrayidx12 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 2
%arrayidx24 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 3
%arrayidx36 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 6
%arrayidx48 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 5
br label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]
%arrayidx5 = getelementptr inbounds [55 x [6 x i32]], ptr @G, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx5, align 8, !tbaa !5
%idxprom7 = sext i32 %1 to i64
%arrayidx8 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom2, i64 %idxprom7
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %0, %2
br i1 %cmp9, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%3 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [55 x [6 x i32]], ptr @G, i64 0, i64 %indvars.iv, i64 1
%4 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%idxprom18 = sext i32 %4 to i64
%arrayidx19 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom2, i64 %idxprom18
%5 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %3, %5
br i1 %cmp20, label %land.lhs.true21, label %for.inc
land.lhs.true21: ; preds = %land.lhs.true
%6 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx29 = getelementptr inbounds [55 x [6 x i32]], ptr @G, i64 0, i64 %indvars.iv, i64 2
%7 = load i32, ptr %arrayidx29, align 8, !tbaa !5
%idxprom30 = sext i32 %7 to i64
%arrayidx31 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom2, i64 %idxprom30
%8 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp eq i32 %6, %8
br i1 %cmp32, label %land.lhs.true33, label %for.inc
land.lhs.true33: ; preds = %land.lhs.true21
%9 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%sub = sub nsw i32 7, %1
%idxprom42 = sext i32 %sub to i64
%arrayidx43 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom2, i64 %idxprom42
%10 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%cmp44 = icmp eq i32 %9, %10
br i1 %cmp44, label %land.lhs.true45, label %for.inc
land.lhs.true45: ; preds = %land.lhs.true33
%11 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%sub54 = sub nsw i32 7, %4
%idxprom55 = sext i32 %sub54 to i64
%arrayidx56 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom2, i64 %idxprom55
%12 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%cmp57 = icmp eq i32 %11, %12
br i1 %cmp57, label %land.lhs.true58, label %for.inc
land.lhs.true58: ; preds = %land.lhs.true45
%13 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%sub67 = sub nsw i32 7, %7
%idxprom68 = sext i32 %sub67 to i64
%arrayidx69 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom2, i64 %idxprom68
%14 = load i32, ptr %arrayidx69, align 4, !tbaa !5
%cmp70 = icmp eq i32 %13, %14
br i1 %cmp70, label %cleanup, label %for.inc
for.inc: ; preds = %for.body, %land.lhs.true, %land.lhs.true21, %land.lhs.true33, %land.lhs.true45, %land.lhs.true58
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 24
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9
cleanup: ; preds = %for.inc, %land.lhs.true58
%retval.0 = phi i32 [ 1, %land.lhs.true58 ], [ 0, %for.inc ]
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 @N)
store i32 0, ptr @i, align 4, !tbaa !5
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.cond1.preheader, label %for.end23
for.cond1.preheader: ; preds = %entry, %for.inc7
store i32 1, ptr @j, align 4, !tbaa !5
br label %for.body3
for.cond10.preheader: ; preds = %for.inc7
%cmp1140 = icmp sgt i32 %5, 0
br i1 %cmp1140, label %for.cond13.preheader.preheader, label %for.end23
for.cond13.preheader.preheader: ; preds = %for.cond10.preheader
%1 = zext i32 %5 to i64
%wide.trip.count53 = zext i32 %5 to i64
br label %for.cond13.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%storemerge2932 = phi i32 [ 1, %for.cond1.preheader ], [ %inc, %for.body3 ]
%2 = load i32, ptr @i, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%idxprom4 = sext i32 %storemerge2932 to i64
%arrayidx5 = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %idxprom, i64 %idxprom4
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%3 = load i32, ptr @j, align 4, !tbaa !5
%inc = add nsw i32 %3, 1
store i32 %inc, ptr @j, align 4, !tbaa !5
%cmp2 = icmp slt i32 %3, 6
br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !11
for.inc7: ; preds = %for.body3
%4 = load i32, ptr @i, align 4, !tbaa !5
%inc8 = add nsw i32 %4, 1
store i32 %inc8, ptr @i, align 4, !tbaa !5
%5 = load i32, ptr @N, align 4, !tbaa !5
%cmp = icmp slt i32 %inc8, %5
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !12
for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.inc21
%indvars.iv50 = phi i64 [ 0, %for.cond13.preheader.preheader ], [ %indvars.iv.next51, %for.inc21 ]
%indvars.iv = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next, %for.inc21 ]
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%cmp1436 = icmp ult i64 %indvars.iv.next51, %1
%6 = trunc i64 %indvars.iv.next51 to i32
br i1 %cmp1436, label %for.body15.lr.ph, label %for.inc21
for.body15.lr.ph: ; preds = %for.cond13.preheader
%arrayidx61.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv50, i64 4
%arrayidx1.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv50, i64 1
%7 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
%arrayidx12.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv50, i64 2
%arrayidx24.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv50, i64 3
%arrayidx36.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv50, i64 6
%arrayidx48.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv50, i64 5
br label %for.body15
for.body15: ; preds = %for.body15.lr.ph, %for.inc18
%indvars.iv47 = phi i64 [ %indvars.iv, %for.body15.lr.ph ], [ %indvars.iv.next48, %for.inc18 ]
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body15
%indvars.iv.i = phi i64 [ 0, %for.body15 ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx5.i = getelementptr inbounds [55 x [6 x i32]], ptr @G, i64 0, i64 %indvars.iv.i
%8 = load i32, ptr %arrayidx5.i, align 8, !tbaa !5
%idxprom7.i = sext i32 %8 to i64
%arrayidx8.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv47, i64 %idxprom7.i
%9 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5
%cmp9.i = icmp eq i32 %7, %9
br i1 %cmp9.i, label %land.lhs.true.i, label %for.inc.i
land.lhs.true.i: ; preds = %for.body.i
%10 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5
%arrayidx17.i = getelementptr inbounds [55 x [6 x i32]], ptr @G, i64 0, i64 %indvars.iv.i, i64 1
%11 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5
%idxprom18.i = sext i32 %11 to i64
%arrayidx19.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv47, i64 %idxprom18.i
%12 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
%cmp20.i = icmp eq i32 %10, %12
br i1 %cmp20.i, label %land.lhs.true21.i, label %for.inc.i
land.lhs.true21.i: ; preds = %land.lhs.true.i
%13 = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%arrayidx29.i = getelementptr inbounds [55 x [6 x i32]], ptr @G, i64 0, i64 %indvars.iv.i, i64 2
%14 = load i32, ptr %arrayidx29.i, align 8, !tbaa !5
%idxprom30.i = sext i32 %14 to i64
%arrayidx31.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv47, i64 %idxprom30.i
%15 = load i32, ptr %arrayidx31.i, align 4, !tbaa !5
%cmp32.i = icmp eq i32 %13, %15
br i1 %cmp32.i, label %land.lhs.true33.i, label %for.inc.i
land.lhs.true33.i: ; preds = %land.lhs.true21.i
%16 = load i32, ptr %arrayidx36.i, align 4, !tbaa !5
%sub.i = sub nsw i32 7, %8
%idxprom42.i = sext i32 %sub.i to i64
%arrayidx43.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv47, i64 %idxprom42.i
%17 = load i32, ptr %arrayidx43.i, align 4, !tbaa !5
%cmp44.i = icmp eq i32 %16, %17
br i1 %cmp44.i, label %land.lhs.true45.i, label %for.inc.i
land.lhs.true45.i: ; preds = %land.lhs.true33.i
%18 = load i32, ptr %arrayidx48.i, align 4, !tbaa !5
%sub54.i = sub nsw i32 7, %11
%idxprom55.i = sext i32 %sub54.i to i64
%arrayidx56.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv47, i64 %idxprom55.i
%19 = load i32, ptr %arrayidx56.i, align 4, !tbaa !5
%cmp57.i = icmp eq i32 %18, %19
br i1 %cmp57.i, label %land.lhs.true58.i, label %for.inc.i
land.lhs.true58.i: ; preds = %land.lhs.true45.i
%20 = load i32, ptr %arrayidx61.i, align 4, !tbaa !5
%sub67.i = sub nsw i32 7, %14
%idxprom68.i = sext i32 %sub67.i to i64
%arrayidx69.i = getelementptr inbounds [107 x [7 x i32]], ptr @D, i64 0, i64 %indvars.iv47, i64 %idxprom68.i
%21 = load i32, ptr %arrayidx69.i, align 4, !tbaa !5
%cmp70.i = icmp eq i32 %20, %21
br i1 %cmp70.i, label %if.then, label %for.inc.i
for.inc.i: ; preds = %land.lhs.true58.i, %land.lhs.true45.i, %land.lhs.true33.i, %land.lhs.true21.i, %land.lhs.true.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, 24
br i1 %exitcond.not.i, label %for.inc18, label %for.body.i, !llvm.loop !9
if.then: ; preds = %land.lhs.true58.i
%22 = trunc i64 %indvars.iv50 to i32
%23 = trunc i64 %indvars.iv47 to i32
store i32 %22, ptr @i, align 4, !tbaa !5
store i32 %23, ptr @j, align 4, !tbaa !5
br label %return
for.inc18: ; preds = %for.inc.i
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count53
br i1 %exitcond.not, label %for.inc21, label %for.body15, !llvm.loop !13
for.inc21: ; preds = %for.inc18, %for.cond13.preheader
%storemerge28.lcssa = phi i32 [ %6, %for.cond13.preheader ], [ %5, %for.inc18 ]
store i32 %storemerge28.lcssa, ptr @j, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond54.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count53
br i1 %exitcond54.not, label %for.end23, label %for.cond13.preheader, !llvm.loop !14
for.end23: ; preds = %for.inc21, %entry, %for.cond10.preheader
%storemerge27.lcssa = phi i32 [ 0, %for.cond10.preheader ], [ 0, %entry ], [ %5, %for.inc21 ]
store i32 %storemerge27.lcssa, ptr @i, align 4, !tbaa !5
br label %return
return: ; preds = %for.end23, %if.then
%.str.2.sink = phi ptr [ @.str.2, %for.end23 ], [ @.str.1, %if.then ]
%call24 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
typedef enum {
S = 0,
N,
W,
E
} cmd;
void showdice(int dice[7]) {
int i;
for (i = 1; i <= 6; ++i) {
printf("%d ", dice[i]);
}
printf("\n");
return;
}
void rotation(cmd command, int dice[7]) {
int tmp;
switch (command) {
case S:
tmp = dice[1];
dice[1] = dice[5];
dice[5] = dice[6];
dice[6] = dice[2];
dice[2] = tmp;
break;
case N:
tmp = dice[1];
dice[1] = dice[2];
dice[2] = dice[6];
dice[6] = dice[5];
dice[5] = tmp;
break;
case W:
tmp = dice[1];
dice[1] = dice[3];
dice[3] = dice[6];
dice[6] = dice[4];
dice[4] = tmp;
break;
case E:
tmp = dice[1];
dice[1] = dice[4];
dice[4] = dice[6];
dice[6] = dice[3];
dice[3] = tmp;
}
return;
}
void toFront(int front, int dice[7]) {
if (front == dice[1]) {
rotation(S, dice);
} else if(front == dice[2]) {
;
} else if (front == dice[3]) {
rotation(E, dice);
rotation(N, dice);
} else if (front == dice[4]) {
rotation(W, dice);
rotation(N, dice);
} else if (front == dice[5]) {
rotation(S, dice);
rotation(S, dice);
} else {
rotation(N, dice);
}
return;
}
int isMatch(int dice1[7], int dice2[7]) {
int i;
toFront(dice1[2], dice2);
for (i = 0; (i < 3) && dice1[1] != dice2[1] ; ++i) {
rotation(W, dice2);
}
if (dice1[1] != dice2[1]) return 0;
for (i = 3; i <= 6; ++i) {
if (dice1[i] != dice2[i]) return 0;
}
return 1;
}
int main(void) {
int i, j, n;
int dices[100][7] = {0};
scanf("%d", &n);
for (i = 0; i < n; ++i) {
for (j = 1; j <= 6; ++j) {
scanf("%d", &dices[i][j]);
}
}
for (i = 0; i < n; ++i) {
for (j = 0; j < n; ++j) {
if (i != j) {
if (isMatch(dices[i], dices[j])) {
printf("No\n");
return 0;
}
}
}
}
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @showdice(ptr nocapture noundef readonly %dice) local_unnamed_addr #0 {
entry:
%arrayidx = getelementptr inbounds i32, ptr %dice, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%arrayidx.1 = getelementptr inbounds i32, ptr %dice, i64 2
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%arrayidx.2 = getelementptr inbounds i32, ptr %dice, i64 3
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%arrayidx.3 = getelementptr inbounds i32, ptr %dice, i64 4
%3 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%arrayidx.4 = getelementptr inbounds i32, ptr %dice, i64 5
%4 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
%arrayidx.5 = getelementptr inbounds i32, ptr %dice, i64 6
%5 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rotation(i32 noundef %command, ptr nocapture noundef %dice) local_unnamed_addr #3 {
entry:
switch i32 %command, label %sw.epilog [
i32 0, label %sw.bb
i32 1, label %sw.bb8
i32 2, label %sw.bb17
i32 3, label %sw.bb26
]
sw.bb: ; preds = %entry
%arrayidx = getelementptr inbounds i32, ptr %dice, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx1 = getelementptr inbounds i32, ptr %dice, i64 5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds i32, ptr %dice, i64 6
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %dice, i64 2
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5, align 4, !tbaa !5
br label %sw.epilog
sw.bb8: ; preds = %entry
%arrayidx9 = getelementptr inbounds i32, ptr %dice, i64 1
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds i32, ptr %dice, i64 2
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %5, ptr %arrayidx9, align 4, !tbaa !5
%arrayidx12 = getelementptr inbounds i32, ptr %dice, i64 6
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
store i32 %6, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds i32, ptr %dice, i64 5
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %7, ptr %arrayidx12, align 4, !tbaa !5
store i32 %4, ptr %arrayidx14, align 4, !tbaa !5
br label %sw.epilog
sw.bb17: ; preds = %entry
%arrayidx18 = getelementptr inbounds i32, ptr %dice, i64 1
%8 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds i32, ptr %dice, i64 3
%9 = load i32, ptr %arrayidx19, align 4, !tbaa !5
store i32 %9, ptr %arrayidx18, align 4, !tbaa !5
%arrayidx21 = getelementptr inbounds i32, ptr %dice, i64 6
%10 = load i32, ptr %arrayidx21, align 4, !tbaa !5
store i32 %10, ptr %arrayidx19, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds i32, ptr %dice, i64 4
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
store i32 %11, ptr %arrayidx21, align 4, !tbaa !5
store i32 %8, ptr %arrayidx23, align 4, !tbaa !5
br label %sw.epilog
sw.bb26: ; preds = %entry
%arrayidx27 = getelementptr inbounds i32, ptr %dice, i64 1
%12 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%arrayidx28 = getelementptr inbounds i32, ptr %dice, i64 4
%13 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %13, ptr %arrayidx27, align 4, !tbaa !5
%arrayidx30 = getelementptr inbounds i32, ptr %dice, i64 6
%14 = load i32, ptr %arrayidx30, align 4, !tbaa !5
store i32 %14, ptr %arrayidx28, align 4, !tbaa !5
%arrayidx32 = getelementptr inbounds i32, ptr %dice, i64 3
%15 = load i32, ptr %arrayidx32, align 4, !tbaa !5
store i32 %15, ptr %arrayidx30, align 4, !tbaa !5
store i32 %12, ptr %arrayidx32, align 4, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %sw.bb26, %entry, %sw.bb17, %sw.bb8, %sw.bb
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @toFront(i32 noundef %front, ptr nocapture noundef %dice) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds i32, ptr %dice, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %front
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%arrayidx1.i = getelementptr inbounds i32, ptr %dice, i64 5
%1 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx3.i = getelementptr inbounds i32, ptr %dice, i64 6
%2 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1.i, align 4, !tbaa !5
%arrayidx5.i = getelementptr inbounds i32, ptr %dice, i64 2
%3 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %front, ptr %arrayidx5.i, align 4, !tbaa !5
br label %if.end20
if.else: ; preds = %entry
%arrayidx1 = getelementptr inbounds i32, ptr %dice, i64 2
%4 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp2 = icmp eq i32 %4, %front
br i1 %cmp2, label %if.end20, label %if.else4
if.else4: ; preds = %if.else
%arrayidx5 = getelementptr inbounds i32, ptr %dice, i64 3
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %5, %front
%arrayidx28.i = getelementptr inbounds i32, ptr %dice, i64 4
%6 = load i32, ptr %arrayidx28.i, align 4, !tbaa !5
br i1 %cmp6, label %if.then7, label %if.else8
if.then7: ; preds = %if.else4
%arrayidx30.i = getelementptr inbounds i32, ptr %dice, i64 6
%7 = load i32, ptr %arrayidx30.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx28.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5, align 4, !tbaa !5
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
store i32 %front, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx14.i = getelementptr inbounds i32, ptr %dice, i64 5
%8 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx30.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx14.i, align 4, !tbaa !5
br label %if.end20
if.else8: ; preds = %if.else4
%cmp10 = icmp eq i32 %6, %front
br i1 %cmp10, label %if.then11, label %if.else12
if.then11: ; preds = %if.else8
%arrayidx21.i = getelementptr inbounds i32, ptr %dice, i64 6
%9 = load i32, ptr %arrayidx21.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5, align 4, !tbaa !5
store i32 %0, ptr %arrayidx28.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
store i32 %front, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx14.i40 = getelementptr inbounds i32, ptr %dice, i64 5
%10 = load i32, ptr %arrayidx14.i40, align 4, !tbaa !5
store i32 %10, ptr %arrayidx21.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14.i40, align 4, !tbaa !5
br label %if.end20
if.else12: ; preds = %if.else8
%arrayidx13 = getelementptr inbounds i32, ptr %dice, i64 5
%11 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp eq i32 %11, %front
br i1 %cmp14, label %if.then15, label %if.else16
if.then15: ; preds = %if.else12
%arrayidx3.i43 = getelementptr inbounds i32, ptr %dice, i64 6
%12 = load i32, ptr %arrayidx3.i43, align 4, !tbaa !5
store i32 %12, ptr %arrayidx, align 4, !tbaa !5
store i32 %4, ptr %arrayidx13, align 4, !tbaa !5
store i32 %0, ptr %arrayidx3.i43, align 4, !tbaa !5
store i32 %front, ptr %arrayidx1, align 4, !tbaa !5
br label %if.end20
if.else16: ; preds = %if.else12
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
%arrayidx12.i51 = getelementptr inbounds i32, ptr %dice, i64 6
%13 = load i32, ptr %arrayidx12.i51, align 4, !tbaa !5
store i32 %13, ptr %arrayidx1, align 4, !tbaa !5
store i32 %11, ptr %arrayidx12.i51, align 4, !tbaa !5
store i32 %0, ptr %arrayidx13, align 4, !tbaa !5
br label %if.end20
if.end20: ; preds = %if.else, %if.then11, %if.else16, %if.then15, %if.then7, %if.then
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i32 @isMatch(ptr nocapture noundef readonly %dice1, ptr nocapture noundef %dice2) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds i32, ptr %dice1, i64 2
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx.i = getelementptr inbounds i32, ptr %dice2, i64 1
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.i = icmp eq i32 %1, %0
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %entry
%arrayidx1.i.i = getelementptr inbounds i32, ptr %dice2, i64 5
%2 = load i32, ptr %arrayidx1.i.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.i, align 4, !tbaa !5
%arrayidx3.i.i = getelementptr inbounds i32, ptr %dice2, i64 6
%3 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx1.i.i, align 4, !tbaa !5
%arrayidx5.i.i = getelementptr inbounds i32, ptr %dice2, i64 2
%4 = load i32, ptr %arrayidx5.i.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx3.i.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5.i.i, align 4, !tbaa !5
br label %toFront.exit
if.else.i: ; preds = %entry
%arrayidx1.i = getelementptr inbounds i32, ptr %dice2, i64 2
%5 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
%cmp2.i = icmp eq i32 %5, %0
br i1 %cmp2.i, label %toFront.exit, label %if.else4.i
if.else4.i: ; preds = %if.else.i
%arrayidx5.i = getelementptr inbounds i32, ptr %dice2, i64 3
%6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %6, %0
%arrayidx28.i.i = getelementptr inbounds i32, ptr %dice2, i64 4
%7 = load i32, ptr %arrayidx28.i.i, align 4, !tbaa !5
br i1 %cmp6.i, label %if.then7.i, label %if.else8.i
if.then7.i: ; preds = %if.else4.i
%arrayidx30.i.i = getelementptr inbounds i32, ptr %dice2, i64 6
%8 = load i32, ptr %arrayidx30.i.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx28.i.i, align 4, !tbaa !5
store i32 %1, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1.i, align 4, !tbaa !5
%arrayidx14.i.i = getelementptr inbounds i32, ptr %dice2, i64 5
%9 = load i32, ptr %arrayidx14.i.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx30.i.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx14.i.i, align 4, !tbaa !5
br label %toFront.exit
if.else8.i: ; preds = %if.else4.i
%cmp10.i = icmp eq i32 %7, %0
br i1 %cmp10.i, label %if.then11.i, label %if.else12.i
if.then11.i: ; preds = %if.else8.i
%arrayidx21.i.i = getelementptr inbounds i32, ptr %dice2, i64 6
%10 = load i32, ptr %arrayidx21.i.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %1, ptr %arrayidx28.i.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1.i, align 4, !tbaa !5
%arrayidx14.i40.i = getelementptr inbounds i32, ptr %dice2, i64 5
%11 = load i32, ptr %arrayidx14.i40.i, align 4, !tbaa !5
store i32 %11, ptr %arrayidx21.i.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx14.i40.i, align 4, !tbaa !5
br label %toFront.exit
if.else12.i: ; preds = %if.else8.i
%arrayidx13.i = getelementptr inbounds i32, ptr %dice2, i64 5
%12 = load i32, ptr %arrayidx13.i, align 4, !tbaa !5
%cmp14.i = icmp eq i32 %12, %0
br i1 %cmp14.i, label %if.then15.i, label %if.else16.i
if.then15.i: ; preds = %if.else12.i
%arrayidx3.i43.i = getelementptr inbounds i32, ptr %dice2, i64 6
%13 = load i32, ptr %arrayidx3.i43.i, align 4, !tbaa !5
store i32 %13, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx13.i, align 4, !tbaa !5
store i32 %1, ptr %arrayidx3.i43.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1.i, align 4, !tbaa !5
br label %toFront.exit
if.else16.i: ; preds = %if.else12.i
store i32 %5, ptr %arrayidx.i, align 4, !tbaa !5
%arrayidx12.i51.i = getelementptr inbounds i32, ptr %dice2, i64 6
%14 = load i32, ptr %arrayidx12.i51.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx1.i, align 4, !tbaa !5
store i32 %12, ptr %arrayidx12.i51.i, align 4, !tbaa !5
store i32 %1, ptr %arrayidx13.i, align 4, !tbaa !5
br label %toFront.exit
toFront.exit: ; preds = %if.then.i, %if.else.i, %if.then7.i, %if.then11.i, %if.then15.i, %if.else16.i
%15 = phi i32 [ %2, %if.then.i ], [ %1, %if.else.i ], [ %5, %if.then7.i ], [ %5, %if.then11.i ], [ %13, %if.then15.i ], [ %5, %if.else16.i ]
%arrayidx1 = getelementptr inbounds i32, ptr %dice1, i64 1
%arrayidx19.i = getelementptr inbounds i32, ptr %dice2, i64 3
%arrayidx21.i = getelementptr inbounds i32, ptr %dice2, i64 6
%arrayidx23.i = getelementptr inbounds i32, ptr %dice2, i64 4
%16 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp3.not = icmp eq i32 %16, %15
br i1 %cmp3.not, label %for.body9.preheader, label %for.body
for.body: ; preds = %toFront.exit
%17 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
store i32 %17, ptr %arrayidx.i, align 4, !tbaa !5
%18 = load i32, ptr %arrayidx21.i, align 4, !tbaa !5
store i32 %18, ptr %arrayidx19.i, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx23.i, align 4, !tbaa !5
store i32 %19, ptr %arrayidx21.i, align 4, !tbaa !5
store i32 %15, ptr %arrayidx23.i, align 4, !tbaa !5
%20 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp3.not.1 = icmp eq i32 %20, %17
br i1 %cmp3.not.1, label %for.body9.preheader, label %for.body.1
for.body.1: ; preds = %for.body
store i32 %18, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %19, ptr %arrayidx19.i, align 4, !tbaa !5
store i32 %15, ptr %arrayidx21.i, align 4, !tbaa !5
store i32 %17, ptr %arrayidx23.i, align 4, !tbaa !5
%21 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp3.not.2 = icmp eq i32 %21, %18
br i1 %cmp3.not.2, label %for.body9.preheader, label %for.end
for.end: ; preds = %for.body.1
store i32 %19, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %15, ptr %arrayidx19.i, align 4, !tbaa !5
store i32 %17, ptr %arrayidx21.i, align 4, !tbaa !5
store i32 %18, ptr %arrayidx23.i, align 4, !tbaa !5
%.pre = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp6.not = icmp eq i32 %.pre, %19
br i1 %cmp6.not, label %for.body9.preheader, label %cleanup
for.body9.preheader: ; preds = %toFront.exit, %for.body, %for.body.1, %for.end
%arrayidx10 = getelementptr inbounds i32, ptr %dice1, i64 3
%22 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
%cmp13.not = icmp eq i32 %22, %23
br i1 %cmp13.not, label %for.cond7, label %cleanup
for.cond7: ; preds = %for.body9.preheader
%arrayidx10.1 = getelementptr inbounds i32, ptr %dice1, i64 4
%24 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx23.i, align 4, !tbaa !5
%cmp13.not.1 = icmp eq i32 %24, %25
br i1 %cmp13.not.1, label %for.cond7.1, label %cleanup
for.cond7.1: ; preds = %for.cond7
%arrayidx10.2 = getelementptr inbounds i32, ptr %dice1, i64 5
%26 = load i32, ptr %arrayidx10.2, align 4, !tbaa !5
%arrayidx12.2 = getelementptr inbounds i32, ptr %dice2, i64 5
%27 = load i32, ptr %arrayidx12.2, align 4, !tbaa !5
%cmp13.not.2 = icmp eq i32 %26, %27
br i1 %cmp13.not.2, label %for.cond7.2, label %cleanup
for.cond7.2: ; preds = %for.cond7.1
%arrayidx10.3 = getelementptr inbounds i32, ptr %dice1, i64 6
%28 = load i32, ptr %arrayidx10.3, align 4, !tbaa !5
%29 = load i32, ptr %arrayidx21.i, align 4, !tbaa !5
%cmp13.not.3 = icmp eq i32 %28, %29
%spec.select = zext i1 %cmp13.not.3 to i32
br label %cleanup
cleanup: ; preds = %for.cond7.2, %for.body9.preheader, %for.cond7, %for.cond7.1, %for.end
%retval.0 = phi i32 [ 0, %for.end ], [ 0, %for.body9.preheader ], [ 0, %for.cond7 ], [ 0, %for.cond7.1 ], [ %spec.select, %for.cond7.2 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%dices = alloca [100 x [7 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 2800, ptr nonnull %dices) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2800) %dices, i8 0, i64 2800, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.cond1.preheader, label %cleanup
for.cond1.preheader: ; preds = %entry, %for.cond1.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond1.preheader ], [ 0, %entry ]
%arrayidx5 = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv, i64 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5)
%arrayidx5.1 = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv, i64 2
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv, i64 3
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv, i64 4
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv, i64 5
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv, i64 6
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !9
for.cond10.preheader: ; preds = %for.cond1.preheader
%cmp1154 = icmp sgt i32 %1, 0
br i1 %cmp1154, label %for.cond13.preheader.us.preheader, label %cleanup
for.cond13.preheader.us.preheader: ; preds = %for.cond10.preheader
%wide.trip.count65 = zext i32 %1 to i64
br label %for.cond13.preheader.us
for.cond13.preheader.us: ; preds = %for.cond13.preheader.us.preheader, %for.cond13.for.inc29_crit_edge.us
%indvars.iv62 = phi i64 [ 0, %for.cond13.preheader.us.preheader ], [ %indvars.iv.next63, %for.cond13.for.inc29_crit_edge.us ]
%arrayidx18.us = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv62
br label %for.body15.us
for.body15.us: ; preds = %for.cond13.preheader.us, %for.inc26.us
%indvars.iv59 = phi i64 [ 0, %for.cond13.preheader.us ], [ %indvars.iv.next60, %for.inc26.us ]
%cmp16.not.us = icmp eq i64 %indvars.iv62, %indvars.iv59
br i1 %cmp16.not.us, label %for.inc26.us, label %if.then.us
if.then.us: ; preds = %for.body15.us
%arrayidx20.us = getelementptr inbounds [100 x [7 x i32]], ptr %dices, i64 0, i64 %indvars.iv59
%call22.us = call i32 @isMatch(ptr noundef nonnull %arrayidx18.us, ptr noundef nonnull %arrayidx20.us), !range !11
%tobool.not.us = icmp eq i32 %call22.us, 0
br i1 %tobool.not.us, label %for.inc26.us, label %cleanup
for.inc26.us: ; preds = %if.then.us, %for.body15.us
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%exitcond.not = icmp eq i64 %indvars.iv.next60, %wide.trip.count65
br i1 %exitcond.not, label %for.cond13.for.inc29_crit_edge.us, label %for.body15.us, !llvm.loop !12
for.cond13.for.inc29_crit_edge.us: ; preds = %for.inc26.us
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
br i1 %exitcond66.not, label %cleanup, label %for.cond13.preheader.us, !llvm.loop !13
cleanup: ; preds = %for.cond13.for.inc29_crit_edge.us, %if.then.us, %for.cond10.preheader, %entry
%str.sink = phi ptr [ @str, %entry ], [ @str, %for.cond10.preheader ], [ @str.5, %if.then.us ], [ @str, %for.cond13.for.inc29_crit_edge.us ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 2800, ptr nonnull %dices) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{i32 0, i32 2}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
typedef int32_t i32;
typedef int64_t i64;
typedef struct RMQandRAQ {
i64 *add;
i64 *max;
i32 bit;
i32 size;
} RMQandRAQ;
RMQandRAQ* new_RMQandRAQ (const i32 n) {
i32 k = 0;
while ((1 << k) < n) ++k;
RMQandRAQ *s = (RMQandRAQ *) calloc (1, sizeof (RMQandRAQ));
s->add = (i64 *) calloc (2 << k, sizeof (i64));
s->max = (i64 *) calloc (2 << k, sizeof (i64));
s->bit = k;
s->size = 1 << k;
return s;
}
static inline i64 max (i64 a, i64 b) {
return a > b ? a : b;
}
static inline i64 eval (RMQandRAQ *s, i32 k) {
return s->add[k] + s->max[k];
}
void propagate (RMQandRAQ *s, i32 x) {
x += s->size;
for (i32 bit = s->bit; bit > 0; bit--) {
i32 k = x >> bit;
s->add[2 * k] += s->add[k];
s->add[2 * k + 1] += s->add[k];
s->add[k] = 0;
s->max[k] = max (eval (s, 2 * k), eval (s, 2 * k + 1));
}
}
void save (RMQandRAQ *s, i32 x) {
for (i32 k = (x + s->size) >> 1; k >= 1; k >>= 1) {
s->max[k] = max (eval (s, 2 * k), eval (s, 2 * k + 1));
}
}
void add (RMQandRAQ *s, i32 l, i32 r, i64 v) {
for (i32 x = l + s->size, y = r + s->size; x < y; x >>= 1, y >>= 1) {
if (x & 1) s->add[x++] += v;
if (y & 1) s->add[--y] += v;
}
save (s, l);
save (s, r - 1);
}
i64 find (RMQandRAQ *s, i32 l, i32 r) {
//propagate (s, l);
//propagate (s, r - 1);
i64 ans = 0;
for (l += s->size, r += s->size; l < r; l >>= 1, r >>= 1) {
if (l & 1) ans = max (ans, eval (s, l++));
if (r & 1) ans = max (ans, eval (s, --r));
}
return ans;
}
typedef struct node {
i32 l, v;
} node;
void run (void) {
i32 n, m;
scanf ("%" SCNi32 "%" SCNi32, &n, &m);
node **p = (node **) calloc (n + 1, sizeof (node *));
i32 *len = (i32 *) calloc (n + 1, sizeof (i32));
i32 *max_len = (i32 *) calloc (n + 1, sizeof (node));
for (i32 i = 0; i < m; ++i) {
i32 l, r, v;
scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32, &l, &r, &v);
if (len[r] == max_len[r]) {
max_len[r] = 2 * max_len[r] + 1;
p[r] = (node *) realloc (p[r], sizeof (node) * max_len[r]);
}
p[r][len[r]++] = (node) {l, v};
}
RMQandRAQ *s = new_RMQandRAQ (n + 1);
for (i32 i = 1; i <= n; ++i) {
i64 v = find (s, 0, i);
add (s, i, i + 1, v);
for (i32 j = 0; j < len[i]; ++j) {
add (s, p[i][j].l, i + 1, p[i][j].v);
}
}
printf ("%" PRIi64 "\n", find (s, 0, n + 1));
}
int main (void) {
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135471/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135471/source.c"
target datalayout = "e-m:e-p270: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.RMQandRAQ = type { ptr, ptr, i32, i32 }
%struct.node = type { i32, i32 }
@.str = private unnamed_addr constant [5 x i8] c"%i%i\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%i%i%i\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%li\0A\00", align 1
; Function Attrs: nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @new_RMQandRAQ(i32 noundef %n) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%k.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ]
%shl = shl nuw i32 1, %k.0
%cmp = icmp slt i32 %shl, %n
%inc = add nuw nsw i32 %k.0, 1
br i1 %cmp, label %while.cond, label %while.end, !llvm.loop !5
while.end: ; preds = %while.cond
%call = tail call noalias dereferenceable_or_null(24) ptr @calloc(i64 noundef 1, i64 noundef 24) #9
%shl1 = shl i32 2, %k.0
%conv = sext i32 %shl1 to i64
%call2 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
store ptr %call2, ptr %call, align 8, !tbaa !7
%call5 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
%max = getelementptr inbounds %struct.RMQandRAQ, ptr %call, i64 0, i32 1
store ptr %call5, ptr %max, align 8, !tbaa !13
%bit = getelementptr inbounds %struct.RMQandRAQ, ptr %call, i64 0, i32 2
store i32 %k.0, ptr %bit, align 8, !tbaa !14
%size = getelementptr inbounds %struct.RMQandRAQ, ptr %call, i64 0, i32 3
store i32 %shl, ptr %size, align 4, !tbaa !15
ret ptr %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @propagate(ptr nocapture noundef readonly %s, i32 noundef %x) local_unnamed_addr #3 {
entry:
%size = getelementptr inbounds %struct.RMQandRAQ, ptr %s, i64 0, i32 3
%0 = load i32, ptr %size, align 4, !tbaa !15
%add = add nsw i32 %0, %x
%bit1 = getelementptr inbounds %struct.RMQandRAQ, ptr %s, i64 0, i32 2
%1 = load i32, ptr %bit1, align 8, !tbaa !14
%cmp52 = icmp sgt i32 %1, 0
br i1 %cmp52, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%2 = load ptr, ptr %s, align 8, !tbaa !7
%3 = getelementptr i8, ptr %s, i64 8
%s.val47 = load ptr, ptr %3, align 8, !tbaa !13
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %for.body.lr.ph, %for.body
%bit.053 = phi i32 [ %1, %for.body.lr.ph ], [ %dec, %for.body ]
%shr = ashr i32 %add, %bit.053
%idxprom = sext i32 %shr to i64
%arrayidx = getelementptr inbounds i64, ptr %2, i64 %idxprom
%4 = load i64, ptr %arrayidx, align 8, !tbaa !16
%mul = shl nsw i32 %shr, 1
%idxprom4 = sext i32 %mul to i64
%arrayidx5 = getelementptr inbounds i64, ptr %2, i64 %idxprom4
%5 = load i64, ptr %arrayidx5, align 8, !tbaa !16
%add6 = add nsw i64 %5, %4
store i64 %add6, ptr %arrayidx5, align 8, !tbaa !16
%6 = load i64, ptr %arrayidx, align 8, !tbaa !16
%add12 = or i32 %mul, 1
%idxprom13 = sext i32 %add12 to i64
%arrayidx14 = getelementptr inbounds i64, ptr %2, i64 %idxprom13
%7 = load i64, ptr %arrayidx14, align 8, !tbaa !16
%add15 = add nsw i64 %7, %6
store i64 %add15, ptr %arrayidx14, align 8, !tbaa !16
store i64 0, ptr %arrayidx, align 8, !tbaa !16
%8 = load i64, ptr %arrayidx5, align 8, !tbaa !16
%arrayidx2.i = getelementptr inbounds i64, ptr %s.val47, i64 %idxprom4
%9 = load i64, ptr %arrayidx2.i, align 8, !tbaa !16
%add3.i = add nsw i64 %9, %8
%10 = load i64, ptr %arrayidx14, align 8, !tbaa !16
%arrayidx2.i50 = getelementptr inbounds i64, ptr %s.val47, i64 %idxprom13
%11 = load i64, ptr %arrayidx2.i50, align 8, !tbaa !16
%add3.i51 = add nsw i64 %11, %10
%cond.i = tail call i64 @llvm.smax.i64(i64 %add3.i, i64 %add3.i51)
%arrayidx25 = getelementptr inbounds i64, ptr %s.val47, i64 %idxprom
store i64 %cond.i, ptr %arrayidx25, align 8, !tbaa !16
%dec = add nsw i32 %bit.053, -1
%cmp = icmp ugt i32 %bit.053, 1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !18
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @save(ptr nocapture noundef readonly %s, i32 noundef %x) local_unnamed_addr #3 {
entry:
%size = getelementptr inbounds %struct.RMQandRAQ, ptr %s, i64 0, i32 3
%0 = load i32, ptr %size, align 4, !tbaa !15
%add = add nsw i32 %0, %x
%cmp20 = icmp sgt i32 %add, 1
br i1 %cmp20, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%s.val14 = load ptr, ptr %s, align 8, !tbaa !7
%1 = getelementptr i8, ptr %s, i64 8
%s.val15 = load ptr, ptr %1, align 8, !tbaa !13
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %for.body.lr.ph, %for.body
%k.021.in = phi i32 [ %add, %for.body.lr.ph ], [ %k.021, %for.body ]
%k.021 = lshr i32 %k.021.in, 1
%mul = and i32 %k.021.in, -2
%idxprom.i = zext i32 %mul to i64
%arrayidx.i = getelementptr inbounds i64, ptr %s.val14, i64 %idxprom.i
%2 = load i64, ptr %arrayidx.i, align 8, !tbaa !16
%arrayidx2.i = getelementptr inbounds i64, ptr %s.val15, i64 %idxprom.i
%3 = load i64, ptr %arrayidx2.i, align 8, !tbaa !16
%add3.i = add nsw i64 %3, %2
%add2 = or i32 %k.021.in, 1
%idxprom.i16 = zext i32 %add2 to i64
%arrayidx.i17 = getelementptr inbounds i64, ptr %s.val14, i64 %idxprom.i16
%4 = load i64, ptr %arrayidx.i17, align 8, !tbaa !16
%arrayidx2.i18 = getelementptr inbounds i64, ptr %s.val15, i64 %idxprom.i16
%5 = load i64, ptr %arrayidx2.i18, align 8, !tbaa !16
%add3.i19 = add nsw i64 %5, %4
%cond.i = tail call i64 @llvm.smax.i64(i64 %add3.i, i64 %add3.i19)
%idxprom = zext i32 %k.021 to i64
%arrayidx = getelementptr inbounds i64, ptr %s.val15, i64 %idxprom
store i64 %cond.i, ptr %arrayidx, align 8, !tbaa !16
%cmp.not = icmp ult i32 %k.021.in, 4
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !19
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @add(ptr nocapture noundef readonly %s, i32 noundef %l, i32 noundef %r, i64 noundef %v) local_unnamed_addr #3 {
entry:
%size = getelementptr inbounds %struct.RMQandRAQ, ptr %s, i64 0, i32 3
%0 = load i32, ptr %size, align 4, !tbaa !15
%add = add nsw i32 %0, %l
%add2 = add i32 %0, %r
%cmp52 = icmp slt i32 %l, %r
br i1 %cmp52, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%cmp20.i = icmp sgt i32 %add, 1
br i1 %cmp20.i, label %for.body.lr.ph.i, label %save.exit
for.body.lr.ph.i: ; preds = %for.cond.cleanup
%s.val14.i = load ptr, ptr %s, align 8, !tbaa !7
%1 = getelementptr i8, ptr %s, i64 8
%s.val15.i = load ptr, ptr %1, align 8, !tbaa !13
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i
%k.021.in.i = phi i32 [ %add, %for.body.lr.ph.i ], [ %k.021.i, %for.body.i ]
%k.021.i = lshr i32 %k.021.in.i, 1
%mul.i = and i32 %k.021.in.i, -2
%idxprom.i.i = zext i32 %mul.i to i64
%arrayidx.i.i = getelementptr inbounds i64, ptr %s.val14.i, i64 %idxprom.i.i
%2 = load i64, ptr %arrayidx.i.i, align 8, !tbaa !16
%arrayidx2.i.i = getelementptr inbounds i64, ptr %s.val15.i, i64 %idxprom.i.i
%3 = load i64, ptr %arrayidx2.i.i, align 8, !tbaa !16
%add3.i.i = add nsw i64 %3, %2
%add2.i = or i32 %k.021.in.i, 1
%idxprom.i16.i = zext i32 %add2.i to i64
%arrayidx.i17.i = getelementptr inbounds i64, ptr %s.val14.i, i64 %idxprom.i16.i
%4 = load i64, ptr %arrayidx.i17.i, align 8, !tbaa !16
%arrayidx2.i18.i = getelementptr inbounds i64, ptr %s.val15.i, i64 %idxprom.i16.i
%5 = load i64, ptr %arrayidx2.i18.i, align 8, !tbaa !16
%add3.i19.i = add nsw i64 %5, %4
%cond.i.i = tail call i64 @llvm.smax.i64(i64 %add3.i.i, i64 %add3.i19.i)
%idxprom.i = zext i32 %k.021.i to i64
%arrayidx.i = getelementptr inbounds i64, ptr %s.val15.i, i64 %idxprom.i
store i64 %cond.i.i, ptr %arrayidx.i, align 8, !tbaa !16
%cmp.not.i = icmp ult i32 %k.021.in.i, 4
br i1 %cmp.not.i, label %save.exit, label %for.body.i, !llvm.loop !19
save.exit: ; preds = %for.body.i, %for.cond.cleanup
%add.i29 = add i32 %add2, -1
%cmp20.i30 = icmp sgt i32 %add.i29, 1
br i1 %cmp20.i30, label %for.body.lr.ph.i31, label %save.exit51
for.body.lr.ph.i31: ; preds = %save.exit
%s.val14.i32 = load ptr, ptr %s, align 8, !tbaa !7
%6 = getelementptr i8, ptr %s, i64 8
%s.val15.i33 = load ptr, ptr %6, align 8, !tbaa !13
br label %for.body.i34
for.body.i34: ; preds = %for.body.i34, %for.body.lr.ph.i31
%k.021.in.i35 = phi i32 [ %add.i29, %for.body.lr.ph.i31 ], [ %k.021.i36, %for.body.i34 ]
%k.021.i36 = lshr i32 %k.021.in.i35, 1
%mul.i37 = and i32 %k.021.in.i35, -2
%idxprom.i.i38 = zext i32 %mul.i37 to i64
%arrayidx.i.i39 = getelementptr inbounds i64, ptr %s.val14.i32, i64 %idxprom.i.i38
%7 = load i64, ptr %arrayidx.i.i39, align 8, !tbaa !16
%arrayidx2.i.i40 = getelementptr inbounds i64, ptr %s.val15.i33, i64 %idxprom.i.i38
%8 = load i64, ptr %arrayidx2.i.i40, align 8, !tbaa !16
%add3.i.i41 = add nsw i64 %8, %7
%add2.i42 = or i32 %k.021.in.i35, 1
%idxprom.i16.i43 = zext i32 %add2.i42 to i64
%arrayidx.i17.i44 = getelementptr inbounds i64, ptr %s.val14.i32, i64 %idxprom.i16.i43
%9 = load i64, ptr %arrayidx.i17.i44, align 8, !tbaa !16
%arrayidx2.i18.i45 = getelementptr inbounds i64, ptr %s.val15.i33, i64 %idxprom.i16.i43
%10 = load i64, ptr %arrayidx2.i18.i45, align 8, !tbaa !16
%add3.i19.i46 = add nsw i64 %10, %9
%cond.i.i47 = tail call i64 @llvm.smax.i64(i64 %add3.i.i41, i64 %add3.i19.i46)
%idxprom.i48 = zext i32 %k.021.i36 to i64
%arrayidx.i49 = getelementptr inbounds i64, ptr %s.val15.i33, i64 %idxprom.i48
store i64 %cond.i.i47, ptr %arrayidx.i49, align 8, !tbaa !16
%cmp.not.i50 = icmp ult i32 %k.021.in.i35, 4
br i1 %cmp.not.i50, label %save.exit51, label %for.body.i34, !llvm.loop !19
save.exit51: ; preds = %for.body.i34, %save.exit
ret void
for.body: ; preds = %entry, %for.inc
%y.054 = phi i32 [ %shr13, %for.inc ], [ %add2, %entry ]
%x.053 = phi i32 [ %shr, %for.inc ], [ %add, %entry ]
%and = and i32 %x.053, 1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %for.body
%11 = load ptr, ptr %s, align 8, !tbaa !7
%inc = add nsw i32 %x.053, 1
%idxprom = sext i32 %x.053 to i64
%arrayidx = getelementptr inbounds i64, ptr %11, i64 %idxprom
%12 = load i64, ptr %arrayidx, align 8, !tbaa !16
%add4 = add nsw i64 %12, %v
store i64 %add4, ptr %arrayidx, align 8, !tbaa !16
br label %if.end
if.end: ; preds = %if.then, %for.body
%x.1 = phi i32 [ %inc, %if.then ], [ %x.053, %for.body ]
%and5 = and i32 %y.054, 1
%tobool6.not = icmp eq i32 %and5, 0
br i1 %tobool6.not, label %for.inc, label %if.then7
if.then7: ; preds = %if.end
%13 = load ptr, ptr %s, align 8, !tbaa !7
%dec = add nsw i32 %y.054, -1
%idxprom9 = sext i32 %dec to i64
%arrayidx10 = getelementptr inbounds i64, ptr %13, i64 %idxprom9
%14 = load i64, ptr %arrayidx10, align 8, !tbaa !16
%add11 = add nsw i64 %14, %v
store i64 %add11, ptr %arrayidx10, align 8, !tbaa !16
br label %for.inc
for.inc: ; preds = %if.end, %if.then7
%y.1 = phi i32 [ %dec, %if.then7 ], [ %y.054, %if.end ]
%shr = ashr i32 %x.1, 1
%shr13 = ashr i32 %y.1, 1
%cmp = icmp slt i32 %shr, %shr13
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !20
}
; Function Attrs: nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i64 @find(ptr nocapture noundef readonly %s, i32 noundef %l, i32 noundef %r) local_unnamed_addr #4 {
entry:
%cmp32 = icmp slt i32 %l, %r
br i1 %cmp32, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%size = getelementptr inbounds %struct.RMQandRAQ, ptr %s, i64 0, i32 3
%0 = load i32, ptr %size, align 4, !tbaa !15
%add2 = add nsw i32 %0, %r
%add = add nsw i32 %0, %l
%1 = getelementptr i8, ptr %s, i64 8
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%ans.035 = phi i64 [ 0, %for.body.lr.ph ], [ %ans.2, %for.inc ]
%r.addr.034 = phi i32 [ %add2, %for.body.lr.ph ], [ %shr10, %for.inc ]
%l.addr.033 = phi i32 [ %add, %for.body.lr.ph ], [ %shr, %for.inc ]
%and = and i32 %l.addr.033, 1
%tobool.not = icmp eq i32 %and, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %l.addr.033, 1
%s.val25 = load ptr, ptr %s, align 8, !tbaa !7
%s.val26 = load ptr, ptr %1, align 8, !tbaa !13
%idxprom.i = sext i32 %l.addr.033 to i64
%arrayidx.i = getelementptr inbounds i64, ptr %s.val25, i64 %idxprom.i
%2 = load i64, ptr %arrayidx.i, align 8, !tbaa !16
%arrayidx2.i = getelementptr inbounds i64, ptr %s.val26, i64 %idxprom.i
%3 = load i64, ptr %arrayidx2.i, align 8, !tbaa !16
%add3.i = add nsw i64 %3, %2
%cond.i = tail call i64 @llvm.smax.i64(i64 %ans.035, i64 %add3.i)
br label %if.end
if.end: ; preds = %if.then, %for.body
%l.addr.1 = phi i32 [ %inc, %if.then ], [ %l.addr.033, %for.body ]
%ans.1 = phi i64 [ %cond.i, %if.then ], [ %ans.035, %for.body ]
%and4 = and i32 %r.addr.034, 1
%tobool5.not = icmp eq i32 %and4, 0
br i1 %tobool5.not, label %for.inc, label %if.then6
if.then6: ; preds = %if.end
%dec = add nsw i32 %r.addr.034, -1
%s.val = load ptr, ptr %s, align 8, !tbaa !7
%s.val24 = load ptr, ptr %1, align 8, !tbaa !13
%idxprom.i27 = sext i32 %dec to i64
%arrayidx.i28 = getelementptr inbounds i64, ptr %s.val, i64 %idxprom.i27
%4 = load i64, ptr %arrayidx.i28, align 8, !tbaa !16
%arrayidx2.i29 = getelementptr inbounds i64, ptr %s.val24, i64 %idxprom.i27
%5 = load i64, ptr %arrayidx2.i29, align 8, !tbaa !16
%add3.i30 = add nsw i64 %5, %4
%cond.i31 = tail call i64 @llvm.smax.i64(i64 %ans.1, i64 %add3.i30)
br label %for.inc
for.inc: ; preds = %if.end, %if.then6
%r.addr.1 = phi i32 [ %dec, %if.then6 ], [ %r.addr.034, %if.end ]
%ans.2 = phi i64 [ %cond.i31, %if.then6 ], [ %ans.1, %if.end ]
%shr = ashr i32 %l.addr.1, 1
%shr10 = ashr i32 %r.addr.1, 1
%cmp = icmp slt i32 %shr, %shr10
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21
for.end: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.2, %for.inc ]
ret i64 %ans.0.lcssa
}
; Function Attrs: nounwind uwtable
define dso_local void @run() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%l = alloca i32, align 4
%r = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !22
%add = add nsw i32 %0, 1
%conv = sext i32 %add to i64
%call1 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
%call4 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #9
%call7 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
%1 = load i32, ptr %m, align 4, !tbaa !22
%cmp158 = icmp sgt i32 %1, 0
br i1 %cmp158, label %for.body, label %for.cond.cleanup
for.cond.cleanup.loopexit: ; preds = %if.end
%.pre173 = load i32, ptr %n, align 4, !tbaa !22
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%2 = phi i32 [ %.pre173, %for.cond.cleanup.loopexit ], [ %0, %entry ]
br label %while.cond.i
while.cond.i: ; preds = %while.cond.i, %for.cond.cleanup
%k.0.i = phi i32 [ 0, %for.cond.cleanup ], [ %inc.i, %while.cond.i ]
%shl.i = shl nuw i32 1, %k.0.i
%cmp.i.not = icmp sgt i32 %shl.i, %2
%inc.i = add nuw nsw i32 %k.0.i, 1
br i1 %cmp.i.not, label %new_RMQandRAQ.exit, label %while.cond.i, !llvm.loop !5
new_RMQandRAQ.exit: ; preds = %while.cond.i
%call.i = call noalias dereferenceable_or_null(24) ptr @calloc(i64 noundef 1, i64 noundef 24) #9
%shl1.i = shl i32 2, %k.0.i
%conv.i = sext i32 %shl1.i to i64
%call2.i = call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 8) #9
store ptr %call2.i, ptr %call.i, align 8, !tbaa !7
%call5.i = call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 8) #9
%max.i = getelementptr inbounds %struct.RMQandRAQ, ptr %call.i, i64 0, i32 1
store ptr %call5.i, ptr %max.i, align 8, !tbaa !13
%bit.i = getelementptr inbounds %struct.RMQandRAQ, ptr %call.i, i64 0, i32 2
store i32 %k.0.i, ptr %bit.i, align 8, !tbaa !14
%size.i = getelementptr inbounds %struct.RMQandRAQ, ptr %call.i, i64 0, i32 3
store i32 %shl.i, ptr %size.i, align 4, !tbaa !15
%cmp41.not162 = icmp slt i32 %2, 1
br i1 %cmp41.not162, label %for.cond.cleanup43, label %for.body44
for.body: ; preds = %entry, %if.end
%i.0159 = phi i32 [ %inc36, %if.end ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #10
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %l, ptr noundef nonnull %r, ptr noundef nonnull %v)
%3 = load i32, ptr %r, align 4, !tbaa !22
%idxprom = sext i32 %3 to i64
%arrayidx = getelementptr inbounds i32, ptr %call4, i64 %idxprom
%4 = load i32, ptr %arrayidx, align 4, !tbaa !22
%arrayidx11 = getelementptr inbounds i32, ptr %call7, i64 %idxprom
%5 = load i32, ptr %arrayidx11, align 4, !tbaa !22
%cmp12 = icmp eq i32 %4, %5
br i1 %cmp12, label %if.then, label %for.body.if.end_crit_edge
for.body.if.end_crit_edge: ; preds = %for.body
%arrayidx29.phi.trans.insert = getelementptr inbounds ptr, ptr %call1, i64 %idxprom
%.pre = load ptr, ptr %arrayidx29.phi.trans.insert, align 8, !tbaa !23
br label %if.end
if.then: ; preds = %for.body
%mul = shl nsw i32 %4, 1
%add16 = or i32 %mul, 1
store i32 %add16, ptr %arrayidx11, align 4, !tbaa !22
%arrayidx20 = getelementptr inbounds ptr, ptr %call1, i64 %idxprom
%6 = load ptr, ptr %arrayidx20, align 8, !tbaa !23
%conv23 = sext i32 %add16 to i64
%mul24 = shl nsw i64 %conv23, 3
%call25 = call ptr @realloc(ptr noundef %6, i64 noundef %mul24) #11
%7 = load i32, ptr %r, align 4, !tbaa !22
%idxprom26 = sext i32 %7 to i64
%arrayidx27 = getelementptr inbounds ptr, ptr %call1, i64 %idxprom26
store ptr %call25, ptr %arrayidx27, align 8, !tbaa !23
%arrayidx31.phi.trans.insert = getelementptr inbounds i32, ptr %call4, i64 %idxprom26
%.pre172 = load i32, ptr %arrayidx31.phi.trans.insert, align 4, !tbaa !22
br label %if.end
if.end: ; preds = %for.body.if.end_crit_edge, %if.then
%8 = phi i32 [ %.pre172, %if.then ], [ %4, %for.body.if.end_crit_edge ]
%9 = phi ptr [ %call25, %if.then ], [ %.pre, %for.body.if.end_crit_edge ]
%idxprom28.pre-phi = phi i64 [ %idxprom26, %if.then ], [ %idxprom, %for.body.if.end_crit_edge ]
%arrayidx31 = getelementptr inbounds i32, ptr %call4, i64 %idxprom28.pre-phi
%inc = add nsw i32 %8, 1
store i32 %inc, ptr %arrayidx31, align 4, !tbaa !22
%idxprom32 = sext i32 %8 to i64
%arrayidx33 = getelementptr inbounds %struct.node, ptr %9, i64 %idxprom32
%10 = load i32, ptr %l, align 4, !tbaa !22
%11 = load i32, ptr %v, align 4, !tbaa !22
store i32 %10, ptr %arrayidx33, align 4, !tbaa.struct !24
%.compoundliteral.sroa.2.0.arrayidx33.sroa_idx = getelementptr inbounds i8, ptr %arrayidx33, i64 4
store i32 %11, ptr %.compoundliteral.sroa.2.0.arrayidx33.sroa_idx, align 4, !tbaa.struct !25
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #10
%inc36 = add nuw nsw i32 %i.0159, 1
%12 = load i32, ptr %m, align 4, !tbaa !22
%cmp = icmp slt i32 %inc36, %12
br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit, !llvm.loop !26
for.cond40.loopexit: ; preds = %add.exit, %find.exit143
%13 = load i32, ptr %n, align 4, !tbaa !22
%14 = sext i32 %13 to i64
%cmp41.not.not = icmp slt i64 %indvars.iv166, %14
br i1 %cmp41.not.not, label %for.body44, label %for.cond.cleanup43, !llvm.loop !27
for.cond.cleanup43: ; preds = %for.cond40.loopexit, %new_RMQandRAQ.exit
%.lcssa = phi i32 [ %2, %new_RMQandRAQ.exit ], [ %13, %for.cond40.loopexit ]
%cmp32.i = icmp sgt i32 %.lcssa, -1
br i1 %cmp32.i, label %for.body.lr.ph.i, label %find.exit
for.body.lr.ph.i: ; preds = %for.cond.cleanup43
%add73 = add nuw i32 %shl.i, 1
%add2.i = add i32 %add73, %.lcssa
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i
%ans.035.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %ans.2.i, %for.inc.i ]
%r.addr.034.i = phi i32 [ %add2.i, %for.body.lr.ph.i ], [ %shr10.i, %for.inc.i ]
%l.addr.033.i = phi i32 [ %shl.i, %for.body.lr.ph.i ], [ %shr.i, %for.inc.i ]
%and.i = and i32 %l.addr.033.i, 1
%tobool.not.i = icmp eq i32 %and.i, 0
br i1 %tobool.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i102 = add nsw i32 %l.addr.033.i, 1
%idxprom.i.i = sext i32 %l.addr.033.i to i64
%arrayidx.i.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i.i
%15 = load i64, ptr %arrayidx.i.i, align 8, !tbaa !16
%arrayidx2.i.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i.i
%16 = load i64, ptr %arrayidx2.i.i, align 8, !tbaa !16
%add3.i.i = add nsw i64 %16, %15
%cond.i.i = call i64 @llvm.smax.i64(i64 %ans.035.i, i64 %add3.i.i)
br label %if.end.i
if.end.i: ; preds = %if.then.i, %for.body.i
%l.addr.1.i = phi i32 [ %inc.i102, %if.then.i ], [ %l.addr.033.i, %for.body.i ]
%ans.1.i = phi i64 [ %cond.i.i, %if.then.i ], [ %ans.035.i, %for.body.i ]
%and4.i = and i32 %r.addr.034.i, 1
%tobool5.not.i = icmp eq i32 %and4.i, 0
br i1 %tobool5.not.i, label %for.inc.i, label %if.then6.i
if.then6.i: ; preds = %if.end.i
%dec.i = add nsw i32 %r.addr.034.i, -1
%idxprom.i27.i = sext i32 %dec.i to i64
%arrayidx.i28.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i27.i
%17 = load i64, ptr %arrayidx.i28.i, align 8, !tbaa !16
%arrayidx2.i29.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i27.i
%18 = load i64, ptr %arrayidx2.i29.i, align 8, !tbaa !16
%add3.i30.i = add nsw i64 %18, %17
%cond.i31.i = call i64 @llvm.smax.i64(i64 %ans.1.i, i64 %add3.i30.i)
br label %for.inc.i
for.inc.i: ; preds = %if.then6.i, %if.end.i
%r.addr.1.i = phi i32 [ %dec.i, %if.then6.i ], [ %r.addr.034.i, %if.end.i ]
%ans.2.i = phi i64 [ %cond.i31.i, %if.then6.i ], [ %ans.1.i, %if.end.i ]
%shr.i = ashr i32 %l.addr.1.i, 1
%shr10.i = ashr i32 %r.addr.1.i, 1
%cmp.i103 = icmp slt i32 %shr.i, %shr10.i
br i1 %cmp.i103, label %for.body.i, label %find.exit, !llvm.loop !21
find.exit: ; preds = %for.inc.i, %for.cond.cleanup43
%ans.0.lcssa.i = phi i64 [ 0, %for.cond.cleanup43 ], [ %ans.2.i, %for.inc.i ]
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
ret void
for.body44: ; preds = %new_RMQandRAQ.exit, %for.cond40.loopexit
%indvars.iv166 = phi i64 [ %indvars.iv.next167, %for.cond40.loopexit ], [ 1, %new_RMQandRAQ.exit ]
%19 = trunc i64 %indvars.iv166 to i32
%20 = add i32 %shl.i, %19
br label %for.body.i107
for.body.i107: ; preds = %for.inc.i136, %for.body44
%ans.035.i108 = phi i64 [ 0, %for.body44 ], [ %ans.2.i138, %for.inc.i136 ]
%r.addr.034.i109 = phi i32 [ %20, %for.body44 ], [ %shr10.i140, %for.inc.i136 ]
%l.addr.033.i110 = phi i32 [ %shl.i, %for.body44 ], [ %shr.i139, %for.inc.i136 ]
%and.i111 = and i32 %l.addr.033.i110, 1
%tobool.not.i112 = icmp eq i32 %and.i111, 0
br i1 %tobool.not.i112, label %if.end.i122, label %if.then.i113
if.then.i113: ; preds = %for.body.i107
%inc.i114 = add nsw i32 %l.addr.033.i110, 1
%idxprom.i.i117 = sext i32 %l.addr.033.i110 to i64
%arrayidx.i.i118 = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i.i117
%21 = load i64, ptr %arrayidx.i.i118, align 8, !tbaa !16
%arrayidx2.i.i119 = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i.i117
%22 = load i64, ptr %arrayidx2.i.i119, align 8, !tbaa !16
%add3.i.i120 = add nsw i64 %22, %21
%cond.i.i121 = call i64 @llvm.smax.i64(i64 %ans.035.i108, i64 %add3.i.i120)
br label %if.end.i122
if.end.i122: ; preds = %if.then.i113, %for.body.i107
%l.addr.1.i123 = phi i32 [ %inc.i114, %if.then.i113 ], [ %l.addr.033.i110, %for.body.i107 ]
%ans.1.i124 = phi i64 [ %cond.i.i121, %if.then.i113 ], [ %ans.035.i108, %for.body.i107 ]
%and4.i125 = and i32 %r.addr.034.i109, 1
%tobool5.not.i126 = icmp eq i32 %and4.i125, 0
br i1 %tobool5.not.i126, label %for.inc.i136, label %if.then6.i127
if.then6.i127: ; preds = %if.end.i122
%dec.i128 = add nsw i32 %r.addr.034.i109, -1
%idxprom.i27.i131 = sext i32 %dec.i128 to i64
%arrayidx.i28.i132 = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i27.i131
%23 = load i64, ptr %arrayidx.i28.i132, align 8, !tbaa !16
%arrayidx2.i29.i133 = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i27.i131
%24 = load i64, ptr %arrayidx2.i29.i133, align 8, !tbaa !16
%add3.i30.i134 = add nsw i64 %24, %23
%cond.i31.i135 = call i64 @llvm.smax.i64(i64 %ans.1.i124, i64 %add3.i30.i134)
br label %for.inc.i136
for.inc.i136: ; preds = %if.then6.i127, %if.end.i122
%r.addr.1.i137 = phi i32 [ %dec.i128, %if.then6.i127 ], [ %r.addr.034.i109, %if.end.i122 ]
%ans.2.i138 = phi i64 [ %cond.i31.i135, %if.then6.i127 ], [ %ans.1.i124, %if.end.i122 ]
%shr.i139 = ashr i32 %l.addr.1.i123, 1
%shr10.i140 = ashr i32 %r.addr.1.i137, 1
%cmp.i141 = icmp slt i32 %shr.i139, %shr10.i140
br i1 %cmp.i141, label %for.body.i107, label %find.exit143, !llvm.loop !21
find.exit143: ; preds = %for.inc.i136
%indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1
%indvars = trunc i64 %indvars.iv.next167 to i32
%25 = trunc i64 %indvars.iv166 to i32
call void @add(ptr noundef nonnull %call.i, i32 noundef %25, i32 noundef %indvars, i64 noundef %ans.2.i138)
%arrayidx50 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv166
%26 = load i32, ptr %arrayidx50, align 4, !tbaa !22
%cmp51160 = icmp sgt i32 %26, 0
br i1 %cmp51160, label %for.body54.lr.ph, label %for.cond40.loopexit
for.body54.lr.ph: ; preds = %find.exit143
%arrayidx56 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv166
%27 = load ptr, ptr %arrayidx56, align 8, !tbaa !23
%cmp20.i30.i = icmp sgt i32 %20, 1
%wide.trip.count = zext i32 %26 to i64
%28 = trunc i64 %indvars.iv.next167 to i32
%29 = add i32 %shl.i, %28
br label %for.body54
for.body54: ; preds = %for.body54.lr.ph, %add.exit
%indvars.iv = phi i64 [ 0, %for.body54.lr.ph ], [ %indvars.iv.next, %add.exit ]
%arrayidx58 = getelementptr inbounds %struct.node, ptr %27, i64 %indvars.iv
%30 = load i32, ptr %arrayidx58, align 4, !tbaa !28
%v65 = getelementptr inbounds %struct.node, ptr %27, i64 %indvars.iv, i32 1
%31 = load i32, ptr %v65, align 4, !tbaa !30
%conv66 = sext i32 %31 to i64
%add.i = add nsw i32 %30, %shl.i
%32 = sext i32 %30 to i64
%cmp52.i.not = icmp slt i64 %indvars.iv166, %32
br i1 %cmp52.i.not, label %for.cond.cleanup.i, label %for.body.i148
for.cond.cleanup.i: ; preds = %for.inc.i155, %for.body54
%cmp20.i.i = icmp sgt i32 %add.i, 1
br i1 %cmp20.i.i, label %for.body.i.i, label %save.exit.i
for.body.i.i: ; preds = %for.cond.cleanup.i, %for.body.i.i
%k.021.in.i.i = phi i32 [ %k.021.i.i, %for.body.i.i ], [ %add.i, %for.cond.cleanup.i ]
%k.021.i.i = lshr i32 %k.021.in.i.i, 1
%mul.i.i = and i32 %k.021.in.i.i, 2147483646
%idxprom.i.i.i = zext i32 %mul.i.i to i64
%arrayidx.i.i.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i.i.i
%33 = load i64, ptr %arrayidx.i.i.i, align 8, !tbaa !16
%arrayidx2.i.i.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i.i.i
%34 = load i64, ptr %arrayidx2.i.i.i, align 8, !tbaa !16
%add3.i.i.i = add nsw i64 %34, %33
%add2.i.i = or i32 %k.021.in.i.i, 1
%idxprom.i16.i.i = zext i32 %add2.i.i to i64
%arrayidx.i17.i.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i16.i.i
%35 = load i64, ptr %arrayidx.i17.i.i, align 8, !tbaa !16
%arrayidx2.i18.i.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i16.i.i
%36 = load i64, ptr %arrayidx2.i18.i.i, align 8, !tbaa !16
%add3.i19.i.i = add nsw i64 %36, %35
%cond.i.i.i = call i64 @llvm.smax.i64(i64 %add3.i.i.i, i64 %add3.i19.i.i)
%idxprom.i.i146 = zext i32 %k.021.i.i to i64
%arrayidx.i.i147 = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i.i146
store i64 %cond.i.i.i, ptr %arrayidx.i.i147, align 8, !tbaa !16
%cmp.not.i.i = icmp ult i32 %k.021.in.i.i, 4
br i1 %cmp.not.i.i, label %save.exit.i, label %for.body.i.i, !llvm.loop !19
save.exit.i: ; preds = %for.body.i.i, %for.cond.cleanup.i
br i1 %cmp20.i30.i, label %for.body.i34.i, label %add.exit
for.body.i34.i: ; preds = %save.exit.i, %for.body.i34.i
%k.021.in.i35.i = phi i32 [ %k.021.i36.i, %for.body.i34.i ], [ %20, %save.exit.i ]
%k.021.i36.i = lshr i32 %k.021.in.i35.i, 1
%mul.i37.i = and i32 %k.021.in.i35.i, 2147483646
%idxprom.i.i38.i = zext i32 %mul.i37.i to i64
%arrayidx.i.i39.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i.i38.i
%37 = load i64, ptr %arrayidx.i.i39.i, align 8, !tbaa !16
%arrayidx2.i.i40.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i.i38.i
%38 = load i64, ptr %arrayidx2.i.i40.i, align 8, !tbaa !16
%add3.i.i41.i = add nsw i64 %38, %37
%add2.i42.i = or i32 %k.021.in.i35.i, 1
%idxprom.i16.i43.i = zext i32 %add2.i42.i to i64
%arrayidx.i17.i44.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i16.i43.i
%39 = load i64, ptr %arrayidx.i17.i44.i, align 8, !tbaa !16
%arrayidx2.i18.i45.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i16.i43.i
%40 = load i64, ptr %arrayidx2.i18.i45.i, align 8, !tbaa !16
%add3.i19.i46.i = add nsw i64 %40, %39
%cond.i.i47.i = call i64 @llvm.smax.i64(i64 %add3.i.i41.i, i64 %add3.i19.i46.i)
%idxprom.i48.i = zext i32 %k.021.i36.i to i64
%arrayidx.i49.i = getelementptr inbounds i64, ptr %call5.i, i64 %idxprom.i48.i
store i64 %cond.i.i47.i, ptr %arrayidx.i49.i, align 8, !tbaa !16
%cmp.not.i50.i = icmp ult i32 %k.021.in.i35.i, 4
br i1 %cmp.not.i50.i, label %add.exit, label %for.body.i34.i, !llvm.loop !19
for.body.i148: ; preds = %for.body54, %for.inc.i155
%y.054.i = phi i32 [ %shr13.i, %for.inc.i155 ], [ %29, %for.body54 ]
%x.053.i = phi i32 [ %shr.i156, %for.inc.i155 ], [ %add.i, %for.body54 ]
%and.i149 = and i32 %x.053.i, 1
%tobool.not.i150 = icmp eq i32 %and.i149, 0
br i1 %tobool.not.i150, label %if.end.i153, label %if.then.i151
if.then.i151: ; preds = %for.body.i148
%inc.i152 = add nsw i32 %x.053.i, 1
%idxprom.i = sext i32 %x.053.i to i64
%arrayidx.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom.i
%41 = load i64, ptr %arrayidx.i, align 8, !tbaa !16
%add4.i = add nsw i64 %41, %conv66
store i64 %add4.i, ptr %arrayidx.i, align 8, !tbaa !16
br label %if.end.i153
if.end.i153: ; preds = %if.then.i151, %for.body.i148
%x.1.i = phi i32 [ %inc.i152, %if.then.i151 ], [ %x.053.i, %for.body.i148 ]
%and5.i = and i32 %y.054.i, 1
%tobool6.not.i = icmp eq i32 %and5.i, 0
br i1 %tobool6.not.i, label %for.inc.i155, label %if.then7.i
if.then7.i: ; preds = %if.end.i153
%dec.i154 = add nsw i32 %y.054.i, -1
%idxprom9.i = sext i32 %dec.i154 to i64
%arrayidx10.i = getelementptr inbounds i64, ptr %call2.i, i64 %idxprom9.i
%42 = load i64, ptr %arrayidx10.i, align 8, !tbaa !16
%add11.i = add nsw i64 %42, %conv66
store i64 %add11.i, ptr %arrayidx10.i, align 8, !tbaa !16
br label %for.inc.i155
for.inc.i155: ; preds = %if.then7.i, %if.end.i153
%y.1.i = phi i32 [ %dec.i154, %if.then7.i ], [ %y.054.i, %if.end.i153 ]
%shr.i156 = ashr i32 %x.1.i, 1
%shr13.i = ashr i32 %y.1.i, 1
%cmp.i157 = icmp slt i32 %shr.i156, %shr13.i
br i1 %cmp.i157, label %for.body.i148, label %for.cond.cleanup.i, !llvm.loop !20
add.exit: ; preds = %for.body.i34.i, %save.exit.i
%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.cond40.loopexit, label %for.body54, !llvm.loop !31
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
attributes #0 = { nofree nounwind memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree 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 #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { nounwind }
attributes #11 = { nounwind allocsize(1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !9, i64 0}
!8 = !{!"RMQandRAQ", !9, i64 0, !9, i64 8, !12, i64 16, !12, i64 20}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!"int", !10, i64 0}
!13 = !{!8, !9, i64 8}
!14 = !{!8, !12, i64 16}
!15 = !{!8, !12, i64 20}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !10, i64 0}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6}
!22 = !{!12, !12, i64 0}
!23 = !{!9, !9, i64 0}
!24 = !{i64 0, i64 4, !22, i64 4, i64 4, !22}
!25 = !{i64 0, i64 4, !22}
!26 = distinct !{!26, !6}
!27 = distinct !{!27, !6}
!28 = !{!29, !12, i64 0}
!29 = !{!"node", !12, i64 0, !12, i64 4}
!30 = !{!29, !12, i64 4}
!31 = distinct !{!31, !6}
|
#include<stdio.h>
int main(){
int kaisuu ;
int N, X, T ;
scanf("%d %d %d", &N, &X, &T) ;
if ( N%X == 0 )
kaisuu = N/X ;
else
kaisuu = N/X + 1 ;
printf("%d", T * kaisuu ) ;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135536/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135536/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%X = alloca i32, align 4
%T = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %X, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %X, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %0, %1
%add = zext i1 %cmp to i32
%kaisuu.0 = add nsw i32 %div, %add
%2 = load i32, ptr %T, align 4, !tbaa !5
%mul = mul nsw i32 %2, %kaisuu.0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,i,j,x[100000],y[100000],a[100001]={0},b[100001]={0};
scanf("%d",&n);
for(i=0;i<n;++i)
{
scanf("%d%d",&x[i],&y[i]);
++a[x[i]];
++b[y[i]];
}
for(i=0;i<n;++i)
{
j=a[y[i]];
printf("%d %d\n",n-1+j,n-1-j);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13558/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13558/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%x = alloca [100000 x i32], align 16
%y = alloca [100000 x i32], align 16
%a = alloca [100001 x i32], align 16
%b = alloca [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %a) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %a, i8 0, i64 400004, i1 false)
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %b) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %b, i8 0, i64 400004, 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
%cmp36 = icmp sgt i32 %0, 0
br i1 %cmp36, label %for.body, label %for.end26
for.cond14.preheader: ; preds = %for.body
%cmp1538 = icmp sgt i32 %5, 0
br i1 %cmp1538, label %for.body16, label %for.end26
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr %y, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom6 = sext i32 %1 to i64
%arrayidx7 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom6
%2 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx7, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%idxprom10 = sext i32 %3 to i64
%arrayidx11 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %idxprom10
%4 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%inc12 = add nsw i32 %4, 1
store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond14.preheader, !llvm.loop !9
for.body16: ; preds = %for.cond14.preheader, %for.body16
%indvars.iv41 = phi i64 [ %indvars.iv.next42, %for.body16 ], [ 0, %for.cond14.preheader ]
%7 = phi i32 [ %10, %for.body16 ], [ %5, %for.cond14.preheader ]
%arrayidx18 = getelementptr inbounds [100000 x i32], ptr %y, i64 0, i64 %indvars.iv41
%8 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%idxprom19 = sext i32 %8 to i64
%arrayidx20 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %idxprom19
%9 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%sub = add nsw i32 %7, -1
%add = add nsw i32 %9, %sub
%sub22 = sub nsw i32 %sub, %9
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %sub22)
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp15 = icmp slt i64 %indvars.iv.next42, %11
br i1 %cmp15, label %for.body16, label %for.end26, !llvm.loop !11
for.end26: ; preds = %for.body16, %entry, %for.cond14.preheader
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %x) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int a[2000];
int i,j;
int n;
while(scanf("%d",&n)!=EOF)
{
int k;
int s=0;
scanf("%d",&k);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
{
if(a[i]+k<=5)
s++;
}
printf("%d\n",s/3);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [2000 x i32], align 16
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not28 = icmp eq i32 %call27, -1
br i1 %cmp.not28, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp221 = icmp sgt i32 %0, 0
br i1 %cmp221, label %for.body, label %for.end13
for.cond4.preheader: ; preds = %for.body
%cmp523 = icmp sgt i32 %14, 0
br i1 %cmp523, label %for.body6.lr.ph, label %for.end13
for.body6.lr.ph: ; preds = %for.cond4.preheader
%1 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %14 to i64
%min.iters.check = icmp ult i32 %14, 8
br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph
vector.ph: ; preds = %for.body6.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, 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 ], [ %10, %vector.body ]
%vec.phi36 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%2 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load37 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = add nsw <4 x i32> %broadcast.splat, %wide.load
%5 = add nsw <4 x i32> %broadcast.splat, %wide.load37
%6 = icmp slt <4 x i32> %4, <i32 6, i32 6, i32 6, i32 6>
%7 = icmp slt <4 x i32> %5, <i32 6, i32 6, i32 6, i32 6>
%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.phi36, %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.end13, label %for.body6.preheader
for.body6.preheader: ; preds = %for.body6.lr.ph, %middle.block
%indvars.iv31.ph = phi i64 [ 0, %for.body6.lr.ph ], [ %n.vec, %middle.block ]
%s.025.ph = phi i32 [ 0, %for.body6.lr.ph ], [ %13, %middle.block ]
br label %for.body6
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %15
br i1 %cmp2, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.body6 ], [ %indvars.iv31.ph, %for.body6.preheader ]
%s.025 = phi i32 [ %spec.select, %for.body6 ], [ %s.025.ph, %for.body6.preheader ]
%arrayidx8 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv31
%16 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%add = add nsw i32 %1, %16
%cmp9 = icmp slt i32 %add, 6
%inc10 = zext i1 %cmp9 to i32
%spec.select = add nuw nsw i32 %s.025, %inc10
%indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
%exitcond.not = icmp eq i64 %indvars.iv.next32, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %for.body6, !llvm.loop !14
for.end13: ; preds = %for.body6, %middle.block, %while.body, %for.cond4.preheader
%s.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %while.body ], [ %13, %middle.block ], [ %spec.select, %for.body6 ]
%div = sdiv i32 %s.0.lcssa, 3
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %for.end13, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main(){
int n,x,t;
scanf("%d %d %d\n",&n,&x,&t);
int time;
int a,d;
if(n<x) time = t;
else{
a = n/x;
time = a*t;
d = n%x;
if(d!=0) time = time + t;
}
printf("%d\n",time);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135673/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135673/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d %d %d\0A\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
%x = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%2 = load i32, ptr %t, align 4, !tbaa !5
br label %if.end3
if.else: ; preds = %entry
%div = sdiv i32 %0, %1
%3 = load i32, ptr %t, align 4, !tbaa !5
%mul = mul nsw i32 %3, %div
%rem = srem i32 %0, %1
%cmp1.not = icmp eq i32 %rem, 0
%add = select i1 %cmp1.not, i32 0, i32 %3
%spec.select = add nsw i32 %add, %mul
br label %if.end3
if.end3: ; preds = %if.else, %if.then
%time.0 = phi i32 [ %2, %if.then ], [ %spec.select, %if.else ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %time.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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, x, t;
int ans;
scanf("%d %d %d", &n, &x, &t);
if(n%x == 0){
ans = n / x * t;
} else {
ans = (n / x + 1) * t;
}
printf("%d", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%div = sdiv i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%2 = load i32, ptr %t, align 4, !tbaa !5
%mul = mul nsw i32 %2, %div
br label %if.end
if.else: ; preds = %entry
%add = add nsw i32 %div, 1
%3 = load i32, ptr %t, align 4, !tbaa !5
%mul2 = mul nsw i32 %add, %3
br label %if.end
if.end: ; preds = %if.else, %if.then
%ans.0 = phi i32 [ %mul, %if.then ], [ %mul2, %if.else ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,x,t,r;
scanf("%d %d %d",&n,&x,&t);
r=n/x;
if(n%x!=0){
r++;
}
printf("%d\n",r*t);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135767/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135767/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%div = sdiv i32 %0, %1
%rem = srem i32 %0, %1
%cmp.not = icmp ne i32 %rem, 0
%inc = zext i1 %cmp.not to i32
%spec.select = add nsw i32 %div, %inc
%2 = load i32, ptr %t, align 4, !tbaa !5
%mul = mul nsw i32 %spec.select, %2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 ceiling(int a, int b){
int i;
int temp = 0;
for(i = 0; temp < a; i++)
temp += b;
return i;
}
int main(void){
int n, x, t, a;
scanf("%d %d %d", &n, &x, &t);
a = ceiling(n, x);
printf("%d\n", a * t);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @ceiling(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i32 %a, 0
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%smax = tail call i32 @llvm.smax.i32(i32 %b, i32 %a)
%0 = add i32 %smax, -1
%1 = udiv i32 %0, %b
%2 = add i32 %1, 1
%min.iters.check = icmp ult i32 %2, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %2, -8
%ind.end = mul i32 %n.vec, %b
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi6 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%3 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1>
%4 = add <4 x i32> %vec.phi6, <i32 1, i32 1, i32 1, i32 1>
%index.next = add nuw i32 %index, 8
%5 = icmp eq i32 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !5
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %2, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%temp.05.ph = phi i32 [ 0, %for.body.preheader ], [ %ind.end, %middle.block ]
%i.04.ph = phi i32 [ 0, %for.body.preheader ], [ %6, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%temp.05 = phi i32 [ %add, %for.body ], [ %temp.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%add = add nsw i32 %temp.05, %b
%inc = add nuw nsw i32 %i.04, 1
%cmp = icmp slt i32 %add, %a
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %middle.block, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %6, %middle.block ], [ %inc, %for.body ]
ret i32 %i.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
%x = alloca i32, align 4
%t = 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 %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !10
%1 = load i32, ptr %x, align 4, !tbaa !10
%cmp3.i = icmp sgt i32 %0, 0
br i1 %cmp3.i, label %for.body.i.preheader, label %ceiling.exit
for.body.i.preheader: ; preds = %entry
%smax = call i32 @llvm.smax.i32(i32 %1, i32 %0)
%2 = add i32 %smax, -1
%3 = udiv i32 %2, %1
%4 = add i32 %3, 1
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body.i.preheader4, label %vector.ph
vector.ph: ; preds = %for.body.i.preheader
%n.vec = and i32 %4, -8
%ind.end = mul i32 %n.vec, %1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%vec.phi3 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ]
%5 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1>
%6 = add <4 x i32> %vec.phi3, <i32 1, i32 1, i32 1, i32 1>
%index.next = add nuw i32 %index, 8
%7 = icmp eq i32 %index.next, %n.vec
br i1 %7, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %6, %5
%8 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %4, %n.vec
br i1 %cmp.n, label %ceiling.exit, label %for.body.i.preheader4
for.body.i.preheader4: ; preds = %for.body.i.preheader, %middle.block
%temp.05.i.ph = phi i32 [ 0, %for.body.i.preheader ], [ %ind.end, %middle.block ]
%i.04.i.ph = phi i32 [ 0, %for.body.i.preheader ], [ %8, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader4, %for.body.i
%temp.05.i = phi i32 [ %add.i, %for.body.i ], [ %temp.05.i.ph, %for.body.i.preheader4 ]
%i.04.i = phi i32 [ %inc.i, %for.body.i ], [ %i.04.i.ph, %for.body.i.preheader4 ]
%add.i = add nsw i32 %temp.05.i, %1
%inc.i = add nuw nsw i32 %i.04.i, 1
%cmp.i = icmp slt i32 %add.i, %0
br i1 %cmp.i, label %for.body.i, label %ceiling.exit, !llvm.loop !15
ceiling.exit: ; preds = %for.body.i, %middle.block, %entry
%i.0.lcssa.i = phi i32 [ 0, %entry ], [ %8, %middle.block ], [ %inc.i, %for.body.i ]
%9 = load i32, ptr %t, align 4, !tbaa !10
%mul = mul nsw i32 %9, %i.0.lcssa.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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 @printf(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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6, !7, !8}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.isvectorized", i32 1}
!8 = !{!"llvm.loop.unroll.runtime.disable"}
!9 = distinct !{!9, !6, !8, !7}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C/C++ TBAA"}
!14 = distinct !{!14, !6, !7, !8}
!15 = distinct !{!15, !6, !8, !7}
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
int main()
{
int a, b, c,d=0;
scanf("%d%d%d", &a, &b, &c);
if (a % b != 0)
{
d = 1;
}
d = d + a / b;
printf("%d", d * c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, 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
%rem = srem i32 %0, %1
%cmp.not = icmp ne i32 %rem, 0
%spec.select = zext i1 %cmp.not to i32
%div = sdiv i32 %0, %1
%add = add nsw i32 %div, %spec.select
%2 = load i32, ptr %c, align 4, !tbaa !5
%mul = mul nsw i32 %add, %2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
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 a ,b ,c ;
scanf( "%d %d %d" ,&a ,&b ,&c ) ;
c -= a ;
b -= c ;
if( b < 0 )
{
puts( "NA" ) ;
}
else if( c < 0 )
{
puts( "0" ) ;
}
else
{
printf( "%d\n" ,c ) ;
}
return 0 ;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"0\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, 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 %c, align 4, !tbaa !5
%sub = sub nsw i32 %1, %0
store i32 %sub, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%sub1 = sub nsw i32 %2, %sub
store i32 %sub1, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %sub1, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end8
if.else: ; preds = %entry
%cmp3 = icmp slt i32 %sub, 0
br i1 %cmp3, label %if.then4, label %if.else6
if.then4: ; preds = %if.else
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end8
if.else6: ; preds = %if.else
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub)
br label %if.end8
if.end8: ; preds = %if.then4, %if.else6, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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;
scanf("%d %d %d",&a,&b,&c);
d=c-a;
if(a>=c){
printf("0\n");
}
else if(d<=b){
printf("%d\n",d);
}
else{
printf("NA\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135947/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135947/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NA\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%cmp.not = icmp slt i32 %1, %0
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %if.end7
if.else: ; preds = %entry
%2 = load i32, ptr %b, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %sub, %2
br i1 %cmp2.not, label %if.else5, label %if.then3
if.then3: ; preds = %if.else
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end7
if.else5: ; preds = %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end7
if.end7: ; preds = %if.then3, %if.else5, %if.then
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 n;
int flag = 0;
scanf("%d", &n);
for(int i = 1; i < 10; i++){
for(int j = 1; j < 10; j++){
if(i*j==n){
flag = 1;
goto out;
}
}
}
out:
if(flag) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_135998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_135998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%.off = add i32 %0, -1
%switch = icmp ult i32 %.off, 2
br i1 %switch, label %if.then11, label %for.cond1.1
for.cond1.1: ; preds = %entry
%1 = mul i32 %0, 954437177
%2 = mul i32 %0, -1227133513
%3 = insertelement <2 x i32> poison, i32 %0, i64 0
%4 = shufflevector <2 x i32> %3, <2 x i32> poison, <2 x i32> zeroinitializer
%5 = mul <2 x i32> %4, <i32 -1431655765, i32 -858993459>
%6 = extractelement <2 x i32> %5, i64 0
%exitcond = icmp eq i32 %6, 1
%cmp5.3 = icmp eq i32 %0, 4
%7 = extractelement <2 x i32> %5, i64 1
%exitcond30 = icmp eq i32 %7, 1
%cmp5.5 = icmp eq i32 %0, 6
%exitcond31 = icmp eq i32 %2, 1
%cmp5.7 = icmp eq i32 %0, 8
%exitcond32 = icmp eq i32 %1, 1
%exitcond.1 = icmp eq i32 %6, 2
%exitcond30.1 = icmp eq i32 %7, 2
%cmp5.5.1 = icmp eq i32 %0, 12
%exitcond31.1 = icmp eq i32 %2, 2
%cmp5.7.1 = icmp eq i32 %0, 16
%exitcond32.1 = icmp eq i32 %1, 2
%cmp5.2 = icmp eq i32 %0, 3
%exitcond.2 = icmp eq i32 %6, 3
%exitcond30.2 = icmp eq i32 %7, 3
%cmp5.5.2 = icmp eq i32 %0, 18
%exitcond31.2 = icmp eq i32 %2, 3
%cmp5.7.2 = icmp eq i32 %0, 24
%exitcond32.2 = icmp eq i32 %1, 3
%exitcond.3 = icmp eq i32 %6, 4
%exitcond30.3 = icmp eq i32 %7, 4
%exitcond31.3 = icmp eq i32 %2, 4
%8 = insertelement <8 x i32> poison, i32 %0, i64 0
%9 = insertelement <8 x i32> %8, i32 %1, i64 1
%10 = shufflevector <2 x i32> %5, <2 x i32> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%11 = shufflevector <8 x i32> %9, <8 x i32> %10, <8 x i32> <i32 0, i32 1, i32 8, i32 9, i32 poison, i32 poison, i32 poison, i32 poison>
%12 = shufflevector <8 x i32> %11, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 0, i32 2, i32 0, i32 3, i32 0>
%13 = icmp eq <8 x i32> %12, <i32 32, i32 4, i32 5, i32 10, i32 5, i32 20, i32 5, i32 30>
%exitcond31.4 = icmp eq i32 %2, 5
%cmp5.7.4 = icmp eq i32 %0, 40
%exitcond32.4 = icmp eq i32 %1, 5
%exitcond.5 = icmp eq i32 %6, 6
%14 = insertelement <8 x i32> %8, i32 %2, i64 1
%15 = insertelement <8 x i32> %14, i32 %1, i64 2
%16 = shufflevector <8 x i32> %15, <8 x i32> %10, <8 x i32> <i32 0, i32 1, i32 2, i32 8, i32 poison, i32 poison, i32 poison, i32 poison>
%17 = shufflevector <8 x i32> %16, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 2, i32 0, i32 0, i32 3, i32 0>
%18 = icmp eq <8 x i32> %17, <i32 36, i32 6, i32 48, i32 6, i32 7, i32 14, i32 7, i32 28>
%cmp5.5.6 = icmp eq i32 %0, 42
%exitcond31.6 = icmp eq i32 %2, 7
%cmp5.7.6 = icmp eq i32 %0, 56
%exitcond32.6 = icmp eq i32 %1, 7
%19 = icmp eq <2 x i32> %5, <i32 8, i32 8>
%exitcond31.7 = icmp eq i32 %2, 8
%cmp5.7.7 = icmp eq i32 %0, 64
%exitcond32.7 = icmp eq i32 %1, 8
%cmp5.8 = icmp eq i32 %0, 9
%exitcond.8 = icmp eq i32 %6, 9
%exitcond30.8 = icmp eq i32 %7, 9
%cmp5.5.8 = icmp eq i32 %0, 54
%exitcond31.8 = icmp eq i32 %2, 9
%cmp5.7.8 = icmp eq i32 %0, 72
%exitcond32.8 = icmp eq i32 %1, 9
%20 = or <8 x i1> %13, %18
%21 = bitcast <8 x i1> %20 to i8
%op.rdx = icmp ne i8 %21, 0
%op.rdx105 = or i1 %op.rdx, %cmp5.3
%op.rdx106 = or i1 %exitcond, %exitcond30
%op.rdx107 = or i1 %cmp5.5, %exitcond31
%op.rdx108 = or i1 %cmp5.7, %exitcond32
%op.rdx109 = or i1 %exitcond.1, %exitcond30.1
%op.rdx110 = or i1 %cmp5.5.1, %exitcond31.1
%op.rdx111 = or i1 %cmp5.7.1, %exitcond32.1
%op.rdx112 = or i1 %cmp5.2, %exitcond.2
%op.rdx113 = or i1 %exitcond30.2, %cmp5.5.2
%op.rdx114 = or i1 %exitcond31.2, %cmp5.7.2
%op.rdx115 = or i1 %exitcond32.2, %exitcond.3
%op.rdx116 = or i1 %exitcond30.3, %exitcond31.3
%op.rdx117 = or i1 %exitcond31.4, %cmp5.7.4
%op.rdx118 = or i1 %exitcond32.4, %exitcond.5
%22 = and i32 %7, -2
%op.rdx119 = icmp eq i32 %22, 6
%op.rdx120 = or i1 %cmp5.5.6, %exitcond31.6
%op.rdx121 = or i1 %cmp5.7.6, %exitcond32.6
%shift = shufflevector <2 x i1> %19, <2 x i1> poison, <2 x i32> <i32 1, i32 poison>
%23 = or <2 x i1> %19, %shift
%op.rdx122 = extractelement <2 x i1> %23, i64 0
%op.rdx123 = or i1 %exitcond31.7, %cmp5.7.7
%op.rdx124 = or i1 %exitcond32.7, %cmp5.8
%op.rdx125 = or i1 %exitcond.8, %exitcond30.8
%op.rdx126 = or i1 %cmp5.5.8, %exitcond31.8
%op.rdx127 = or i1 %cmp5.7.8, %exitcond32.8
%op.rdx128 = or i1 %op.rdx105, %op.rdx106
%op.rdx129 = or i1 %op.rdx107, %op.rdx108
%op.rdx130 = or i1 %op.rdx109, %op.rdx110
%op.rdx131 = or i1 %op.rdx111, %op.rdx112
%op.rdx132 = or i1 %op.rdx113, %op.rdx114
%op.rdx133 = or i1 %op.rdx115, %op.rdx116
%op.rdx134 = or i1 %op.rdx117, %op.rdx118
%op.rdx135 = or i1 %op.rdx119, %op.rdx120
%op.rdx136 = or i1 %op.rdx121, %op.rdx122
%op.rdx137 = or i1 %op.rdx123, %op.rdx124
%op.rdx138 = or i1 %op.rdx125, %op.rdx126
%op.rdx139 = or i1 %op.rdx128, %op.rdx129
%op.rdx140 = or i1 %op.rdx130, %op.rdx131
%op.rdx141 = or i1 %op.rdx132, %op.rdx133
%op.rdx142 = or i1 %op.rdx134, %op.rdx135
%op.rdx143 = or i1 %op.rdx136, %op.rdx137
%op.rdx144 = or i1 %op.rdx138, %op.rdx127
%op.rdx145 = or i1 %op.rdx139, %op.rdx140
%op.rdx146 = or i1 %op.rdx141, %op.rdx142
%op.rdx147 = or i1 %op.rdx143, %op.rdx144
%op.rdx148 = or i1 %op.rdx145, %op.rdx146
%op.rdx149 = or i1 %op.rdx148, %op.rdx147
br i1 %op.rdx149, label %if.then11, label %cleanup15
if.then11: ; preds = %entry, %for.cond1.1
br label %cleanup15
cleanup15: ; preds = %for.cond1.1, %if.then11
%str.3.sink = phi ptr [ @str.3, %if.then11 ], [ @str, %for.cond1.1 ]
%puts22 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#define maxn 2001
int cmp(const void *i, const void *j){
return *(int *)i - *(int *)j;
}
int main(void){
int n, k, i, kk = 0;
scanf("%d %d", &n, &k);
int * a;
a = (int*) malloc(n*sizeof(int));
for (i = 0; i < n; i++)
scanf("%d", &a[i]);
qsort(a, n, sizeof(int), cmp);
for (i = 0; i < n; i++)
if (5 - a[i] >= k)
kk++;
printf("%d", kk / 3);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13604/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13604/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %i, ptr nocapture noundef readonly %j) #0 {
entry:
%0 = load i32, ptr %i, align 4, !tbaa !5
%1 = load i32, ptr %j, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
%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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #8
%cmp26 = icmp sgt i32 %0, 0
br i1 %cmp26, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%conv4.pre-phi = phi i64 [ %conv, %entry ], [ %2, %for.body ]
call void @qsort(ptr noundef %call1, i64 noundef %conv4.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #7
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp628 = icmp sgt i32 %3, 0
br i1 %cmp628, label %for.body8.lr.ph, label %for.end16
for.body8.lr.ph: ; preds = %for.end
%4 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %4, 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 ], [ %13, %vector.body ]
%vec.phi37 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%5 = getelementptr inbounds i32, ptr %call1, i64 %index
%wide.load = load <4 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 4
%wide.load38 = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = sub nsw <4 x i32> <i32 5, i32 5, i32 5, i32 5>, %wide.load
%8 = sub nsw <4 x i32> <i32 5, i32 5, i32 5, i32 5>, %wide.load38
%9 = icmp sge <4 x i32> %7, %broadcast.splat
%10 = icmp sge <4 x i32> %8, %broadcast.splat
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi37, %12
%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 !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %14, %13
%16 = 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.end16.loopexit, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%indvars.iv34.ph = phi i64 [ 0, %for.body8.lr.ph ], [ %n.vec, %middle.block ]
%kk.029.ph = phi i32 [ 0, %for.body8.lr.ph ], [ %16, %middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.body8 ], [ %indvars.iv34.ph, %for.body8.preheader ]
%kk.029 = phi i32 [ %spec.select, %for.body8 ], [ %kk.029.ph, %for.body8.preheader ]
%arrayidx10 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv34
%17 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%sub = sub nsw i32 5, %17
%cmp11.not = icmp sge i32 %sub, %4
%inc13 = zext i1 %cmp11.not to i32
%spec.select = add nuw nsw i32 %kk.029, %inc13
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
br i1 %exitcond.not, label %for.end16.loopexit, label %for.body8, !llvm.loop !14
for.end16.loopexit: ; preds = %for.body8, %middle.block
%spec.select.lcssa = phi i32 [ %16, %middle.block ], [ %spec.select, %for.body8 ]
%18 = udiv i32 %spec.select.lcssa, 3
br label %for.end16
for.end16: ; preds = %for.end16.loopexit, %for.end
%kk.0.lcssa = phi i32 [ 0, %for.end ], [ %18, %for.end16.loopexit ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %kk.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress 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
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
/*
* kadai3_4
* kamecha
*/
#include<stdio.h>
int main(void){
int num;
scanf("%d", &num);
/*
* 1~9のどれかで割り切れたらOK
*/
int flag = 0; //どれかで割り切れたらflag = 1
for(int i = 1; i <= 9; i++){
if(num%i == 0){
/*
* 商が1~9だとOK
*/
int devided = num/i;
if(devided >= 1 && devided <= 9){
puts("Yes");
flag = 1;
break;
}
}
}
/*
* どれにも当てはまらなかった
*/
if(!flag) puts("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136083/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136083/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 {
if.then:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%1 = add i32 %0, -10
%or.cond = icmp ult i32 %1, -9
br i1 %or.cond, label %for.inc, label %cleanup7
for.inc: ; preds = %if.then
%2 = and i32 %0, 1
%cmp1.1 = icmp eq i32 %2, 0
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%div.1 = sdiv i32 %0, 2
%3 = add nsw i32 %div.1, -10
%or.cond.1 = icmp ult i32 %3, -9
br i1 %or.cond.1, label %for.inc.1, label %cleanup7
for.inc.1: ; preds = %if.then.1, %for.inc
%rem.2 = srem i32 %0, 3
%div.2 = sdiv i32 %0, 3
%cmp1.2 = icmp ne i32 %rem.2, 0
%4 = add nsw i32 %div.2, -10
%or.cond.2 = icmp ult i32 %4, -9
%or.cond21 = select i1 %cmp1.2, i1 true, i1 %or.cond.2
br i1 %or.cond21, label %for.inc.2, label %cleanup7
for.inc.2: ; preds = %for.inc.1
%5 = and i32 %0, 3
%cmp1.3 = icmp eq i32 %5, 0
br i1 %cmp1.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%div.3 = sdiv i32 %0, 4
%6 = add nsw i32 %div.3, -10
%or.cond.3 = icmp ult i32 %6, -9
br i1 %or.cond.3, label %for.inc.3, label %cleanup7
for.inc.3: ; preds = %if.then.3, %for.inc.2
%rem.4 = srem i32 %0, 5
%div.4 = sdiv i32 %0, 5
%cmp1.4 = icmp ne i32 %rem.4, 0
%7 = add nsw i32 %div.4, -10
%or.cond.4 = icmp ult i32 %7, -9
%or.cond22 = select i1 %cmp1.4, i1 true, i1 %or.cond.4
br i1 %or.cond22, label %for.inc.4, label %cleanup7
for.inc.4: ; preds = %for.inc.3
%rem.5 = srem i32 %0, 6
%div.5 = sdiv i32 %0, 6
%cmp1.5 = icmp ne i32 %rem.5, 0
%8 = add nsw i32 %div.5, -10
%or.cond.5 = icmp ult i32 %8, -9
%or.cond23 = select i1 %cmp1.5, i1 true, i1 %or.cond.5
br i1 %or.cond23, label %for.inc.5, label %cleanup7
for.inc.5: ; preds = %for.inc.4
%rem.6 = srem i32 %0, 7
%div.6 = sdiv i32 %0, 7
%cmp1.6 = icmp ne i32 %rem.6, 0
%9 = add nsw i32 %div.6, -10
%or.cond.6 = icmp ult i32 %9, -9
%or.cond24 = select i1 %cmp1.6, i1 true, i1 %or.cond.6
br i1 %or.cond24, label %for.inc.6, label %cleanup7
for.inc.6: ; preds = %for.inc.5
%10 = and i32 %0, 7
%cmp1.7 = icmp eq i32 %10, 0
br i1 %cmp1.7, label %if.then.7, label %for.inc.7
if.then.7: ; preds = %for.inc.6
%div.7 = sdiv i32 %0, 8
%11 = add nsw i32 %div.7, -10
%or.cond.7 = icmp ult i32 %11, -9
br i1 %or.cond.7, label %for.inc.7, label %cleanup7
for.inc.7: ; preds = %if.then.7, %for.inc.6
%rem.8 = srem i32 %0, 9
%div.8 = sdiv i32 %0, 9
%cmp1.8 = icmp ne i32 %rem.8, 0
%12 = add nsw i32 %div.8, -10
%or.cond.8 = icmp ult i32 %12, -9
%or.cond25 = select i1 %cmp1.8, i1 true, i1 %or.cond.8
br i1 %or.cond25, label %if.end10, label %cleanup7
cleanup7: ; preds = %for.inc.7, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.1, %if.then.7, %if.then.3, %if.then.1, %if.then
br label %if.end10
if.end10: ; preds = %for.inc.7, %cleanup7
%.str.1.sink = phi ptr [ @.str.1, %cleanup7 ], [ @.str.2, %for.inc.7 ]
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #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"}
|
/* ex3_2
moka223711 */
#include <stdio.h>
int main(void){
int N, d = 0;
scanf("%d", &N);
for(int i = 1; i <= 9; i++){
if(N % i == 0 && N / i <= 9){
d = 1;
break;
}
}
if(d){
printf("Yes");
}
else{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136126/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136126/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 {
land.lhs.true:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp2 = icmp slt i32 %0, 10
br i1 %cmp2, label %if.then3, label %for.inc
for.inc: ; preds = %land.lhs.true
%1 = and i32 %0, 1
%cmp1.1 = icmp eq i32 %1, 0
%cmp2.1 = icmp ult i32 %0, 20
%or.cond = and i1 %cmp1.1, %cmp2.1
br i1 %or.cond, label %if.then3, label %for.inc.1
for.inc.1: ; preds = %for.inc
%rem.213 = urem i32 %0, 3
%cmp1.2 = icmp eq i32 %rem.213, 0
%cmp2.2 = icmp ult i32 %0, 30
%or.cond18 = and i1 %cmp1.2, %cmp2.2
br i1 %or.cond18, label %if.then3, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%2 = and i32 %0, 3
%cmp1.3 = icmp eq i32 %2, 0
%cmp2.3 = icmp ult i32 %0, 40
%or.cond19 = and i1 %cmp1.3, %cmp2.3
br i1 %or.cond19, label %if.then3, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%rem.414 = urem i32 %0, 5
%cmp1.4 = icmp eq i32 %rem.414, 0
%cmp2.4 = icmp ult i32 %0, 50
%or.cond20 = and i1 %cmp1.4, %cmp2.4
br i1 %or.cond20, label %if.then3, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%rem.515 = urem i32 %0, 6
%cmp1.5 = icmp eq i32 %rem.515, 0
%cmp2.5 = icmp ult i32 %0, 60
%or.cond21 = and i1 %cmp1.5, %cmp2.5
br i1 %or.cond21, label %if.then3, label %for.inc.5
for.inc.5: ; preds = %for.inc.4
%rem.616 = urem i32 %0, 7
%cmp1.6 = icmp eq i32 %rem.616, 0
%cmp2.6 = icmp ult i32 %0, 70
%or.cond22 = and i1 %cmp1.6, %cmp2.6
br i1 %or.cond22, label %if.then3, label %for.inc.6
for.inc.6: ; preds = %for.inc.5
%3 = and i32 %0, 7
%cmp1.7 = icmp eq i32 %3, 0
%cmp2.7 = icmp ult i32 %0, 80
%or.cond23 = and i1 %cmp1.7, %cmp2.7
br i1 %or.cond23, label %if.then3, label %for.inc.7
for.inc.7: ; preds = %for.inc.6
%rem.817 = urem i32 %0, 9
%cmp1.8 = icmp eq i32 %rem.817, 0
%cmp2.8 = icmp ult i32 %0, 90
%or.cond24 = and i1 %cmp1.8, %cmp2.8
br i1 %or.cond24, label %if.then3, label %if.end6
if.then3: ; preds = %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %land.lhs.true
br label %if.end6
if.end6: ; preds = %for.inc.7, %if.then3
%.str.2.sink = phi ptr [ @.str.1, %if.then3 ], [ @.str.2, %for.inc.7 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include<math.h>
int main()
{
int b,m,n,i,j,k;
int a[2000];
while(scanf("%d%d",&n,&k)!=EOF)
{
m=0;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]+k<=5)
m++;
}
m=m/3;
printf("%d\n",m);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_13617/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_13617/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [2000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %a) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%cmp.not28 = icmp eq i32 %call27, -1
br i1 %cmp.not28, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end12
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp121 = icmp sgt i32 %0, 0
br i1 %cmp121, label %for.body, label %for.end12
for.cond3.preheader: ; preds = %for.body
%cmp423 = icmp sgt i32 %14, 0
br i1 %cmp423, label %for.body5.lr.ph, label %for.end12
for.body5.lr.ph: ; preds = %for.cond3.preheader
%1 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %14 to i64
%min.iters.check = icmp ult i32 %14, 8
br i1 %min.iters.check, label %for.body5.preheader, label %vector.ph
vector.ph: ; preds = %for.body5.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %1, 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 ], [ %10, %vector.body ]
%vec.phi36 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%2 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load37 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = add nsw <4 x i32> %broadcast.splat, %wide.load
%5 = add nsw <4 x i32> %broadcast.splat, %wide.load37
%6 = icmp slt <4 x i32> %4, <i32 6, i32 6, i32 6, i32 6>
%7 = icmp slt <4 x i32> %5, <i32 6, i32 6, i32 6, i32 6>
%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.phi36, %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.end12, label %for.body5.preheader
for.body5.preheader: ; preds = %for.body5.lr.ph, %middle.block
%indvars.iv31.ph = phi i64 [ 0, %for.body5.lr.ph ], [ %n.vec, %middle.block ]
%m.025.ph = phi i32 [ 0, %for.body5.lr.ph ], [ %13, %middle.block ]
br label %for.body5
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %15
br i1 %cmp1, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv31 = phi i64 [ %indvars.iv.next32, %for.body5 ], [ %indvars.iv31.ph, %for.body5.preheader ]
%m.025 = phi i32 [ %spec.select, %for.body5 ], [ %m.025.ph, %for.body5.preheader ]
%arrayidx7 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv31
%16 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %1, %16
%cmp8 = icmp slt i32 %add, 6
%inc9 = zext i1 %cmp8 to i32
%spec.select = add nuw nsw i32 %m.025, %inc9
%indvars.iv.next32 = add nuw nsw i64 %indvars.iv31, 1
%exitcond.not = icmp eq i64 %indvars.iv.next32, %wide.trip.count
br i1 %exitcond.not, label %for.end12, label %for.body5, !llvm.loop !14
for.end12: ; preds = %for.body5, %middle.block, %for.cond.preheader, %for.cond3.preheader
%m.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %for.cond.preheader ], [ %13, %middle.block ], [ %spec.select, %for.body5 ]
%div = sdiv i32 %m.0.lcssa, 3
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !15
while.end: ; preds = %for.end12, %entry
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void)
{
int n, i, f, s;
scanf("%d",&n);
f=0;s=0;
for(i=1;i<10;i++){
if((n % i == 0) && (n / i <= 9))
f=1;
}
if(f==1) printf("Yes\n");
else printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 {
for.inc:
%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
%cmp2 = icmp slt i32 %0, 10
%rem.2 = srem i32 %0, 3
%1 = and i32 %0, 3
%rem.4 = srem i32 %0, 5
%rem.5 = srem i32 %0, 6
%rem.6 = srem i32 %0, 7
%2 = insertelement <2 x i32> poison, i32 %0, i64 0
%3 = shufflevector <2 x i32> %2, <2 x i32> poison, <2 x i32> zeroinitializer
%4 = and <2 x i32> %3, <i32 1, i32 7>
%rem.8 = srem i32 %0, 9
%5 = shufflevector <2 x i32> %4, <2 x i32> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%6 = insertelement <8 x i32> %5, i32 %rem.8, i64 2
%7 = insertelement <8 x i32> %6, i32 %rem.6, i64 3
%8 = insertelement <8 x i32> %7, i32 %rem.5, i64 4
%9 = insertelement <8 x i32> %8, i32 %rem.4, i64 5
%10 = insertelement <8 x i32> %9, i32 %1, i64 6
%11 = insertelement <8 x i32> %10, i32 %rem.2, i64 7
%12 = icmp eq <8 x i32> %11, zeroinitializer
%13 = insertelement <8 x i32> poison, i32 %0, i64 0
%14 = shufflevector <8 x i32> %13, <8 x i32> poison, <8 x i32> zeroinitializer
%15 = icmp slt <8 x i32> %14, <i32 20, i32 80, i32 90, i32 70, i32 60, i32 50, i32 40, i32 30>
%16 = and <8 x i1> %12, %15
%17 = freeze <8 x i1> %16
%18 = bitcast <8 x i1> %17 to i8
%19 = icmp ne i8 %18, 0
%op.rdx = select i1 %19, i1 true, i1 %cmp2
%str.sink = select i1 %op.rdx, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int i,j,n,f=0;
scanf("%d",&n);
for(i=1;i<=9;i++){
for(j=1;j<=9;j++){
if(i*j==n){f=1;break;}
}
}
if(f==1)printf("Yes");
else printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136256/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136256/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
switch i32 %0, label %for.cond1.2.2 [
i32 1, label %for.cond1.1.2.thread100
i32 2, label %for.cond1.1.2.thread100
i32 3, label %if.end12
i32 4, label %for.cond1.1.2.thread100
i32 5, label %for.cond1.1.2.thread100
i32 6, label %if.end12
i32 7, label %for.cond1.1.2.thread100
i32 8, label %for.cond1.1.2.thread100
i32 9, label %if.end12
i32 10, label %for.cond1.1.2.thread100
i32 12, label %for.cond1.1.2.thread100
i32 14, label %for.cond1.1.2.thread100
i32 16, label %for.cond1.1.2.thread100
i32 18, label %for.cond1.1.2.thread100
]
for.cond1.1.2.thread100: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
br label %for.cond1.2.2
for.cond1.2.2: ; preds = %entry, %for.cond1.1.2.thread100
%spec.select = phi ptr [ @.str.1, %for.cond1.1.2.thread100 ], [ @.str.2, %entry ]
%switch.tableidx = add i32 %0, -4
%1 = icmp ult i32 %switch.tableidx, 60
br i1 %1, label %switch.hole_check, label %for.inc5.6
for.inc5.6: ; preds = %switch.hole_check, %for.cond1.2.2
switch i32 %0, label %for.inc5.8 [
i32 9, label %if.end12
i32 81, label %if.end12
i32 64, label %if.end12
i32 72, label %if.end12
]
for.inc5.8: ; preds = %for.inc5.6
br label %if.end12
switch.hole_check: ; preds = %for.cond1.2.2
%switch.maskindex = zext i32 %switch.tableidx to i64
%switch.shifted = lshr i64 582145577822936415, %switch.maskindex
%2 = and i64 %switch.shifted, 1
%switch.lobit.not = icmp eq i64 %2, 0
br i1 %switch.lobit.not, label %for.inc5.6, label %if.end12
if.end12: ; preds = %switch.hole_check, %for.inc5.8, %entry, %entry, %entry, %for.inc5.6, %for.inc5.6, %for.inc5.6, %for.inc5.6
%.str.2.sink = phi ptr [ @.str.1, %for.inc5.6 ], [ @.str.1, %for.inc5.6 ], [ @.str.1, %for.inc5.6 ], [ @.str.1, %for.inc5.6 ], [ @.str.1, %entry ], [ @.str.1, %entry ], [ @.str.1, %entry ], [ %spec.select, %for.inc5.8 ], [ @.str.1, %switch.hole_check ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
void s(){
int n;
scanf("%d", &n);
int a[n];
for(int i = 0; i < n; i++){
scanf("%d", &a[i]);
}
int mx=a[0];
for(int i = 1;i<n;i++){
mx=mx|a[i];
}
printf("%d\n",mx);
}
int main(){
int t;
scanf("%d",&t);
while(t--){
s();
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1363/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1363/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @s() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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
%cmp19 = icmp sgt i32 %3, 0
call void @llvm.assume(i1 %cmp19)
br label %for.body
for.cond.cleanup: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%cmp521 = icmp sgt i32 %12, 1
br i1 %cmp521, label %for.body7.preheader, label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %12 to i64
%4 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %12, 9
br i1 %min.iters.check, label %for.body7.preheader34, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %4, -8
%ind.end = or i64 %n.vec, 1
%5 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.pre, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %5, %vector.ph ], [ %8, %vector.body ]
%vec.phi32 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %6, align 4, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load33 = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = or <4 x i32> %wide.load, %vec.phi
%9 = or <4 x i32> %wide.load33, %vec.phi32
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = or <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond.cleanup6, label %for.body7.preheader34
for.body7.preheader34: ; preds = %for.body7.preheader, %middle.block
%indvars.iv27.ph = phi i64 [ 1, %for.body7.preheader ], [ %ind.end, %middle.block ]
%mx.022.ph = phi i32 [ %.pre, %for.body7.preheader ], [ %11, %middle.block ]
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
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp = icmp slt i64 %indvars.iv.next, %13
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup6: ; preds = %for.body7, %middle.block, %for.cond.cleanup
%mx.0.lcssa = phi i32 [ %.pre, %for.cond.cleanup ], [ %11, %middle.block ], [ %or, %for.body7 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mx.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret void
for.body7: ; preds = %for.body7.preheader34, %for.body7
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ %indvars.iv27.ph, %for.body7.preheader34 ]
%mx.022 = phi i32 [ %or, %for.body7 ], [ %mx.022.ph, %for.body7.preheader34 ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv27
%14 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%or = or i32 %14, %mx.022
%indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 1
%exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec1 = add nsw i32 %0, -1
store i32 %dec1, ptr %t, align 4, !tbaa !5
%tobool.not2 = icmp eq i32 %0, 0
br i1 %tobool.not2, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @s()
%1 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %1, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.or.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
for (int i = 1; i <= 9; ++i) {
if (n % i == 0 && n / i <= 9) {
printf("Yes\n");
return 0;
}
}
printf("No\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136342/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136342/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
land.lhs.true:
%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
%cmp2 = icmp slt i32 %0, 10
br i1 %cmp2, label %cleanup5, label %for.inc
for.inc: ; preds = %land.lhs.true
%1 = and i32 %0, 1
%cmp1.1 = icmp eq i32 %1, 0
%cmp2.1 = icmp ult i32 %0, 20
%or.cond = and i1 %cmp1.1, %cmp2.1
br i1 %or.cond, label %cleanup5, label %for.inc.1
for.inc.1: ; preds = %for.inc
%rem.212 = urem i32 %0, 3
%cmp1.2 = icmp eq i32 %rem.212, 0
%cmp2.2 = icmp ult i32 %0, 30
%or.cond17 = and i1 %cmp1.2, %cmp2.2
br i1 %or.cond17, label %cleanup5, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%2 = and i32 %0, 3
%cmp1.3 = icmp eq i32 %2, 0
%cmp2.3 = icmp ult i32 %0, 40
%or.cond18 = and i1 %cmp1.3, %cmp2.3
br i1 %or.cond18, label %cleanup5, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%rem.413 = urem i32 %0, 5
%cmp1.4 = icmp eq i32 %rem.413, 0
%cmp2.4 = icmp ult i32 %0, 50
%or.cond19 = and i1 %cmp1.4, %cmp2.4
br i1 %or.cond19, label %cleanup5, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%rem.514 = urem i32 %0, 6
%cmp1.5 = icmp eq i32 %rem.514, 0
%cmp2.5 = icmp ult i32 %0, 60
%or.cond20 = and i1 %cmp1.5, %cmp2.5
br i1 %or.cond20, label %cleanup5, label %for.inc.5
for.inc.5: ; preds = %for.inc.4
%rem.615 = urem i32 %0, 7
%cmp1.6 = icmp eq i32 %rem.615, 0
%cmp2.6 = icmp ult i32 %0, 70
%or.cond21 = and i1 %cmp1.6, %cmp2.6
br i1 %or.cond21, label %cleanup5, label %for.inc.6
for.inc.6: ; preds = %for.inc.5
%3 = and i32 %0, 7
%cmp1.7 = icmp eq i32 %3, 0
%cmp2.7 = icmp ult i32 %0, 80
%or.cond22 = and i1 %cmp1.7, %cmp2.7
br i1 %or.cond22, label %cleanup5, label %for.inc.7
for.inc.7: ; preds = %for.inc.6
%rem.816 = urem i32 %0, 9
%cmp1.8 = icmp eq i32 %rem.816, 0
%cmp2.8 = icmp ult i32 %0, 90
%or.cond23 = and i1 %cmp1.8, %cmp2.8
%spec.select = select i1 %or.cond23, ptr @str, ptr @str.3
br label %cleanup5
cleanup5: ; preds = %for.inc.7, %land.lhs.true, %for.inc, %for.inc.1, %for.inc.2, %for.inc.3, %for.inc.4, %for.inc.5, %for.inc.6
%str.sink = phi ptr [ @str, %for.inc.6 ], [ @str, %for.inc.5 ], [ @str, %for.inc.4 ], [ @str, %for.inc.3 ], [ @str, %for.inc.2 ], [ @str, %for.inc.1 ], [ @str, %for.inc ], [ @str, %land.lhs.true ], [ %spec.select, %for.inc.7 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int product;
int a, b;
scanf("%d", &product);
for(a=1; a<10; a++){
for(b=1; b<10; b++){
if(product == (a*b)){
printf("Yes");
return 0;
}
}
}
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136386/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%product = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %product) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %product)
%0 = load i32, ptr %product, align 4, !tbaa !5
%.off = add i32 %0, -1
%switch = icmp ult i32 %.off, 2
br i1 %switch, label %if.then, label %for.cond1.1
for.cond1.1: ; preds = %entry
%1 = mul i32 %0, 954437177
%2 = mul i32 %0, -1227133513
%3 = insertelement <2 x i32> poison, i32 %0, i64 0
%4 = shufflevector <2 x i32> %3, <2 x i32> poison, <2 x i32> zeroinitializer
%5 = mul <2 x i32> %4, <i32 -1431655765, i32 -858993459>
%6 = extractelement <2 x i32> %5, i64 0
%exitcond = icmp eq i32 %6, 1
%cmp4.3 = icmp eq i32 %0, 4
%7 = extractelement <2 x i32> %5, i64 1
%exitcond18 = icmp eq i32 %7, 1
%cmp4.5 = icmp eq i32 %0, 6
%exitcond19 = icmp eq i32 %2, 1
%cmp4.7 = icmp eq i32 %0, 8
%exitcond20 = icmp eq i32 %1, 1
%exitcond.1 = icmp eq i32 %6, 2
%exitcond18.1 = icmp eq i32 %7, 2
%cmp4.5.1 = icmp eq i32 %0, 12
%exitcond19.1 = icmp eq i32 %2, 2
%cmp4.7.1 = icmp eq i32 %0, 16
%exitcond20.1 = icmp eq i32 %1, 2
%cmp4.2 = icmp eq i32 %0, 3
%exitcond.2 = icmp eq i32 %6, 3
%exitcond18.2 = icmp eq i32 %7, 3
%cmp4.5.2 = icmp eq i32 %0, 18
%exitcond19.2 = icmp eq i32 %2, 3
%cmp4.7.2 = icmp eq i32 %0, 24
%exitcond20.2 = icmp eq i32 %1, 3
%exitcond.3 = icmp eq i32 %6, 4
%exitcond18.3 = icmp eq i32 %7, 4
%exitcond19.3 = icmp eq i32 %2, 4
%8 = insertelement <8 x i32> poison, i32 %0, i64 0
%9 = insertelement <8 x i32> %8, i32 %1, i64 1
%10 = shufflevector <2 x i32> %5, <2 x i32> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%11 = shufflevector <8 x i32> %9, <8 x i32> %10, <8 x i32> <i32 0, i32 1, i32 8, i32 9, i32 poison, i32 poison, i32 poison, i32 poison>
%12 = shufflevector <8 x i32> %11, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 0, i32 2, i32 0, i32 3, i32 0>
%13 = icmp eq <8 x i32> %12, <i32 32, i32 4, i32 5, i32 10, i32 5, i32 20, i32 5, i32 30>
%exitcond19.4 = icmp eq i32 %2, 5
%cmp4.7.4 = icmp eq i32 %0, 40
%exitcond20.4 = icmp eq i32 %1, 5
%exitcond.5 = icmp eq i32 %6, 6
%14 = insertelement <8 x i32> %8, i32 %2, i64 1
%15 = insertelement <8 x i32> %14, i32 %1, i64 2
%16 = shufflevector <8 x i32> %15, <8 x i32> %10, <8 x i32> <i32 0, i32 1, i32 2, i32 8, i32 poison, i32 poison, i32 poison, i32 poison>
%17 = shufflevector <8 x i32> %16, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 2, i32 0, i32 0, i32 3, i32 0>
%18 = icmp eq <8 x i32> %17, <i32 36, i32 6, i32 48, i32 6, i32 7, i32 14, i32 7, i32 28>
%cmp4.5.6 = icmp eq i32 %0, 42
%exitcond19.6 = icmp eq i32 %2, 7
%cmp4.7.6 = icmp eq i32 %0, 56
%exitcond20.6 = icmp eq i32 %1, 7
%19 = icmp eq <2 x i32> %5, <i32 8, i32 8>
%exitcond19.7 = icmp eq i32 %2, 8
%cmp4.7.7 = icmp eq i32 %0, 64
%exitcond20.7 = icmp eq i32 %1, 8
%cmp4.8 = icmp eq i32 %0, 9
%exitcond.8 = icmp eq i32 %6, 9
%exitcond18.8 = icmp eq i32 %7, 9
%cmp4.5.8 = icmp eq i32 %0, 54
%exitcond19.8 = icmp eq i32 %2, 9
%cmp4.7.8 = icmp eq i32 %0, 72
%exitcond20.8 = icmp eq i32 %1, 9
%20 = or <8 x i1> %13, %18
%21 = bitcast <8 x i1> %20 to i8
%op.rdx = icmp ne i8 %21, 0
%op.rdx93 = or i1 %op.rdx, %cmp4.3
%op.rdx94 = or i1 %exitcond, %exitcond18
%op.rdx95 = or i1 %cmp4.5, %exitcond19
%op.rdx96 = or i1 %cmp4.7, %exitcond20
%op.rdx97 = or i1 %exitcond.1, %exitcond18.1
%op.rdx98 = or i1 %cmp4.5.1, %exitcond19.1
%op.rdx99 = or i1 %cmp4.7.1, %exitcond20.1
%op.rdx100 = or i1 %cmp4.2, %exitcond.2
%op.rdx101 = or i1 %exitcond18.2, %cmp4.5.2
%op.rdx102 = or i1 %exitcond19.2, %cmp4.7.2
%op.rdx103 = or i1 %exitcond20.2, %exitcond.3
%op.rdx104 = or i1 %exitcond18.3, %exitcond19.3
%op.rdx105 = or i1 %exitcond19.4, %cmp4.7.4
%op.rdx106 = or i1 %exitcond20.4, %exitcond.5
%22 = and i32 %7, -2
%op.rdx107 = icmp eq i32 %22, 6
%op.rdx108 = or i1 %cmp4.5.6, %exitcond19.6
%op.rdx109 = or i1 %cmp4.7.6, %exitcond20.6
%shift = shufflevector <2 x i1> %19, <2 x i1> poison, <2 x i32> <i32 1, i32 poison>
%23 = or <2 x i1> %19, %shift
%op.rdx110 = extractelement <2 x i1> %23, i64 0
%op.rdx111 = or i1 %exitcond19.7, %cmp4.7.7
%op.rdx112 = or i1 %exitcond20.7, %cmp4.8
%op.rdx113 = or i1 %exitcond.8, %exitcond18.8
%op.rdx114 = or i1 %cmp4.5.8, %exitcond19.8
%op.rdx115 = or i1 %cmp4.7.8, %exitcond20.8
%op.rdx116 = or i1 %op.rdx93, %op.rdx94
%op.rdx117 = or i1 %op.rdx95, %op.rdx96
%op.rdx118 = or i1 %op.rdx97, %op.rdx98
%op.rdx119 = or i1 %op.rdx99, %op.rdx100
%op.rdx120 = or i1 %op.rdx101, %op.rdx102
%op.rdx121 = or i1 %op.rdx103, %op.rdx104
%op.rdx122 = or i1 %op.rdx105, %op.rdx106
%op.rdx123 = or i1 %op.rdx107, %op.rdx108
%op.rdx124 = or i1 %op.rdx109, %op.rdx110
%op.rdx125 = or i1 %op.rdx111, %op.rdx112
%op.rdx126 = or i1 %op.rdx113, %op.rdx114
%op.rdx127 = or i1 %op.rdx116, %op.rdx117
%op.rdx128 = or i1 %op.rdx118, %op.rdx119
%op.rdx129 = or i1 %op.rdx120, %op.rdx121
%op.rdx130 = or i1 %op.rdx122, %op.rdx123
%op.rdx131 = or i1 %op.rdx124, %op.rdx125
%op.rdx132 = or i1 %op.rdx126, %op.rdx115
%op.rdx133 = or i1 %op.rdx127, %op.rdx128
%op.rdx134 = or i1 %op.rdx129, %op.rdx130
%op.rdx135 = or i1 %op.rdx131, %op.rdx132
%op.rdx136 = or i1 %op.rdx133, %op.rdx134
%op.rdx137 = or i1 %op.rdx136, %op.rdx135
br i1 %op.rdx137, label %if.then, label %cleanup
if.then: ; preds = %entry, %for.cond1.1
br label %cleanup
cleanup: ; preds = %for.cond1.1, %if.then
%.str.2.sink = phi ptr [ @.str.1, %if.then ], [ @.str.2, %for.cond1.1 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %product) #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;
int n,flg=0;
scanf("%d",&n);
for(int i=1;i<10;i++){
for(int j=1;j<10;j++){
if(i*j==n)flg=1;
}
}
if(flg){
printf("Yes");
}else{
printf("No");
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@reltable.main = private unnamed_addr constant [79 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca 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
%.fr108 = freeze i32 %0
%1 = add i32 %.fr108, -1
%narrow = icmp ult i32 %1, 10
br i1 %narrow, label %if.end12, label %switch.early.test
switch.early.test: ; preds = %entry
%switch.tableidx = add i32 %.fr108, -3
%2 = icmp ult i32 %switch.tableidx, 79
br i1 %2, label %switch.lookup, label %if.end12
switch.lookup: ; preds = %switch.early.test
%3 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %3, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end12
if.end12: ; preds = %switch.early.test, %switch.lookup, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %reltable.intrinsic, %switch.lookup ], [ @.str.2, %switch.early.test ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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, i, j;
scanf("%d",&a);
for(i=1;i<10;i++){
for(j=1;j<10;j++){
b = i * j;
if(a==b){
printf("Yes");
return 0;
}
}
}
printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%.off = add i32 %0, -1
%switch = icmp ult i32 %.off, 2
br i1 %switch, label %if.then, label %for.cond1.1
for.cond1.1: ; preds = %entry
%1 = mul i32 %0, 954437177
%2 = mul i32 %0, -1227133513
%3 = insertelement <2 x i32> poison, i32 %0, i64 0
%4 = shufflevector <2 x i32> %3, <2 x i32> poison, <2 x i32> zeroinitializer
%5 = mul <2 x i32> %4, <i32 -1431655765, i32 -858993459>
%6 = extractelement <2 x i32> %5, i64 0
%exitcond = icmp eq i32 %6, 1
%cmp4.3 = icmp eq i32 %0, 4
%7 = extractelement <2 x i32> %5, i64 1
%exitcond19 = icmp eq i32 %7, 1
%cmp4.5 = icmp eq i32 %0, 6
%exitcond20 = icmp eq i32 %2, 1
%cmp4.7 = icmp eq i32 %0, 8
%exitcond21 = icmp eq i32 %1, 1
%exitcond.1 = icmp eq i32 %6, 2
%exitcond19.1 = icmp eq i32 %7, 2
%cmp4.5.1 = icmp eq i32 %0, 12
%exitcond20.1 = icmp eq i32 %2, 2
%cmp4.7.1 = icmp eq i32 %0, 16
%exitcond21.1 = icmp eq i32 %1, 2
%cmp4.2 = icmp eq i32 %0, 3
%exitcond.2 = icmp eq i32 %6, 3
%exitcond19.2 = icmp eq i32 %7, 3
%cmp4.5.2 = icmp eq i32 %0, 18
%exitcond20.2 = icmp eq i32 %2, 3
%cmp4.7.2 = icmp eq i32 %0, 24
%exitcond21.2 = icmp eq i32 %1, 3
%exitcond.3 = icmp eq i32 %6, 4
%exitcond19.3 = icmp eq i32 %7, 4
%exitcond20.3 = icmp eq i32 %2, 4
%8 = insertelement <8 x i32> poison, i32 %0, i64 0
%9 = insertelement <8 x i32> %8, i32 %1, i64 1
%10 = shufflevector <2 x i32> %5, <2 x i32> poison, <8 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
%11 = shufflevector <8 x i32> %9, <8 x i32> %10, <8 x i32> <i32 0, i32 1, i32 8, i32 9, i32 poison, i32 poison, i32 poison, i32 poison>
%12 = shufflevector <8 x i32> %11, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 0, i32 2, i32 0, i32 3, i32 0>
%13 = icmp eq <8 x i32> %12, <i32 32, i32 4, i32 5, i32 10, i32 5, i32 20, i32 5, i32 30>
%exitcond20.4 = icmp eq i32 %2, 5
%cmp4.7.4 = icmp eq i32 %0, 40
%exitcond21.4 = icmp eq i32 %1, 5
%exitcond.5 = icmp eq i32 %6, 6
%14 = insertelement <8 x i32> %8, i32 %2, i64 1
%15 = insertelement <8 x i32> %14, i32 %1, i64 2
%16 = shufflevector <8 x i32> %15, <8 x i32> %10, <8 x i32> <i32 0, i32 1, i32 2, i32 8, i32 poison, i32 poison, i32 poison, i32 poison>
%17 = shufflevector <8 x i32> %16, <8 x i32> poison, <8 x i32> <i32 0, i32 1, i32 0, i32 2, i32 0, i32 0, i32 3, i32 0>
%18 = icmp eq <8 x i32> %17, <i32 36, i32 6, i32 48, i32 6, i32 7, i32 14, i32 7, i32 28>
%cmp4.5.6 = icmp eq i32 %0, 42
%exitcond20.6 = icmp eq i32 %2, 7
%cmp4.7.6 = icmp eq i32 %0, 56
%exitcond21.6 = icmp eq i32 %1, 7
%19 = icmp eq <2 x i32> %5, <i32 8, i32 8>
%exitcond20.7 = icmp eq i32 %2, 8
%cmp4.7.7 = icmp eq i32 %0, 64
%exitcond21.7 = icmp eq i32 %1, 8
%cmp4.8 = icmp eq i32 %0, 9
%exitcond.8 = icmp eq i32 %6, 9
%exitcond19.8 = icmp eq i32 %7, 9
%cmp4.5.8 = icmp eq i32 %0, 54
%exitcond20.8 = icmp eq i32 %2, 9
%cmp4.7.8 = icmp eq i32 %0, 72
%exitcond21.8 = icmp eq i32 %1, 9
%20 = or <8 x i1> %13, %18
%21 = bitcast <8 x i1> %20 to i8
%op.rdx = icmp ne i8 %21, 0
%op.rdx94 = or i1 %op.rdx, %cmp4.3
%op.rdx95 = or i1 %exitcond, %exitcond19
%op.rdx96 = or i1 %cmp4.5, %exitcond20
%op.rdx97 = or i1 %cmp4.7, %exitcond21
%op.rdx98 = or i1 %exitcond.1, %exitcond19.1
%op.rdx99 = or i1 %cmp4.5.1, %exitcond20.1
%op.rdx100 = or i1 %cmp4.7.1, %exitcond21.1
%op.rdx101 = or i1 %cmp4.2, %exitcond.2
%op.rdx102 = or i1 %exitcond19.2, %cmp4.5.2
%op.rdx103 = or i1 %exitcond20.2, %cmp4.7.2
%op.rdx104 = or i1 %exitcond21.2, %exitcond.3
%op.rdx105 = or i1 %exitcond19.3, %exitcond20.3
%op.rdx106 = or i1 %exitcond20.4, %cmp4.7.4
%op.rdx107 = or i1 %exitcond21.4, %exitcond.5
%22 = and i32 %7, -2
%op.rdx108 = icmp eq i32 %22, 6
%op.rdx109 = or i1 %cmp4.5.6, %exitcond20.6
%op.rdx110 = or i1 %cmp4.7.6, %exitcond21.6
%shift = shufflevector <2 x i1> %19, <2 x i1> poison, <2 x i32> <i32 1, i32 poison>
%23 = or <2 x i1> %19, %shift
%op.rdx111 = extractelement <2 x i1> %23, i64 0
%op.rdx112 = or i1 %exitcond20.7, %cmp4.7.7
%op.rdx113 = or i1 %exitcond21.7, %cmp4.8
%op.rdx114 = or i1 %exitcond.8, %exitcond19.8
%op.rdx115 = or i1 %cmp4.5.8, %exitcond20.8
%op.rdx116 = or i1 %cmp4.7.8, %exitcond21.8
%op.rdx117 = or i1 %op.rdx94, %op.rdx95
%op.rdx118 = or i1 %op.rdx96, %op.rdx97
%op.rdx119 = or i1 %op.rdx98, %op.rdx99
%op.rdx120 = or i1 %op.rdx100, %op.rdx101
%op.rdx121 = or i1 %op.rdx102, %op.rdx103
%op.rdx122 = or i1 %op.rdx104, %op.rdx105
%op.rdx123 = or i1 %op.rdx106, %op.rdx107
%op.rdx124 = or i1 %op.rdx108, %op.rdx109
%op.rdx125 = or i1 %op.rdx110, %op.rdx111
%op.rdx126 = or i1 %op.rdx112, %op.rdx113
%op.rdx127 = or i1 %op.rdx114, %op.rdx115
%op.rdx128 = or i1 %op.rdx117, %op.rdx118
%op.rdx129 = or i1 %op.rdx119, %op.rdx120
%op.rdx130 = or i1 %op.rdx121, %op.rdx122
%op.rdx131 = or i1 %op.rdx123, %op.rdx124
%op.rdx132 = or i1 %op.rdx125, %op.rdx126
%op.rdx133 = or i1 %op.rdx127, %op.rdx116
%op.rdx134 = or i1 %op.rdx128, %op.rdx129
%op.rdx135 = or i1 %op.rdx130, %op.rdx131
%op.rdx136 = or i1 %op.rdx132, %op.rdx133
%op.rdx137 = or i1 %op.rdx134, %op.rdx135
%op.rdx138 = or i1 %op.rdx137, %op.rdx136
br i1 %op.rdx138, label %if.then, label %cleanup
if.then: ; preds = %entry, %for.cond1.1
br label %cleanup
cleanup: ; preds = %for.cond1.1, %if.then
%.str.2.sink = phi ptr [ @.str.1, %if.then ], [ @.str.2, %for.cond1.1 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 N,flag=0;
scanf("%d\n",&N);
for(int n=1;n<=9;n++){
for(int j=n;j<=9;j++){
if(n*j==N){
flag=1;
break;
}
}
}
if(flag==1)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
switch i32 %0, label %cleanup.1 [
i32 1, label %cleanup.1.thread91
i32 2, label %cleanup.1.thread91
i32 3, label %cleanup.1.thread91
i32 4, label %cleanup.1.thread
i32 5, label %cleanup.1.thread91
i32 6, label %cleanup.1.thread
i32 7, label %cleanup.1.thread91
i32 8, label %cleanup.1.thread
i32 9, label %for.cond1.4.4
i32 10, label %cleanup.1.thread
i32 12, label %cleanup.1.thread
i32 14, label %cleanup.1.thread
i32 16, label %cleanup.1.thread
i32 18, label %cleanup.1.thread
]
cleanup.1.thread: ; preds = %entry, %entry, %entry, %entry, %entry, %entry, %entry, %entry
%1 = mul i32 %0, -1431655765
br label %for.cond1.2
cleanup.1.thread91: ; preds = %entry, %entry, %entry, %entry, %entry
%2 = mul i32 %0, -1431655765
br label %for.cond1.2
cleanup.1: ; preds = %entry
%3 = mul i32 %0, -1431655765
%exitcond29 = icmp eq i32 %3, 3
br i1 %exitcond29, label %cleanup.2, label %for.cond1.2
for.cond1.2: ; preds = %cleanup.1.thread91, %cleanup.1.thread, %cleanup.1
%4 = phi i32 [ %1, %cleanup.1.thread ], [ %3, %cleanup.1 ], [ %2, %cleanup.1.thread91 ]
%5 = phi i1 [ true, %cleanup.1.thread ], [ false, %cleanup.1 ], [ true, %cleanup.1.thread91 ]
%.off = add i32 %4, -4
%switch = icmp ult i32 %.off, 6
%spec.select136 = or i1 %switch, %5
br label %cleanup.2
cleanup.2: ; preds = %for.cond1.2, %cleanup.1
%flag.1.2 = phi i1 [ true, %cleanup.1 ], [ %spec.select136, %for.cond1.2 ]
%6 = add i32 %0, -16
%7 = call i32 @llvm.fshl.i32(i32 %0, i32 %6, i32 30)
%switch130 = icmp ult i32 %7, 6
%8 = mul i32 %0, -858993459
br i1 %switch130, label %for.cond1.4, label %cleanup.3
cleanup.3: ; preds = %cleanup.2
%exitcond28 = icmp eq i32 %8, 5
br i1 %exitcond28, label %cleanup.4, label %for.cond1.4
for.cond1.4: ; preds = %cleanup.2, %cleanup.3
%flag.1.380 = phi i1 [ %flag.1.2, %cleanup.3 ], [ true, %cleanup.2 ]
%.off131 = add i32 %8, -6
%switch132 = icmp ult i32 %.off131, 4
br i1 %switch132, label %cleanup.4, label %for.cond1.4.4
for.cond1.4.4: ; preds = %for.cond1.4, %entry
%flag.1.380120123126129 = phi i1 [ true, %entry ], [ %flag.1.380, %for.cond1.4 ]
br label %cleanup.4
cleanup.4: ; preds = %for.cond1.4, %for.cond1.4.4, %cleanup.3
%flag.1.4 = phi i1 [ true, %cleanup.3 ], [ %flag.1.380120123126129, %for.cond1.4.4 ], [ true, %for.cond1.4 ]
%9 = add i32 %0, -36
%10 = call i32 @llvm.fshl.i32(i32 %0, i32 %9, i32 31)
switch i32 %10, label %cleanup.5 [
i32 0, label %cleanup.5.thread
i32 3, label %cleanup.5.thread
i32 6, label %cleanup.5.thread
i32 9, label %cleanup.5.thread
]
cleanup.5.thread: ; preds = %cleanup.4, %cleanup.4, %cleanup.4, %cleanup.4
%11 = mul i32 %0, -1227133513
br label %for.cond1.6
cleanup.5: ; preds = %cleanup.4
%12 = mul i32 %0, -1227133513
%exitcond27 = icmp eq i32 %12, 7
br i1 %exitcond27, label %cleanup.6, label %for.cond1.6
for.cond1.6: ; preds = %cleanup.5.thread, %cleanup.5
%13 = phi i32 [ %11, %cleanup.5.thread ], [ %12, %cleanup.5 ]
%flag.1.583 = phi i1 [ true, %cleanup.5.thread ], [ %flag.1.4, %cleanup.5 ]
%14 = and i32 %13, -2
%switch134 = icmp eq i32 %14, 8
%spec.select = or i1 %switch134, %flag.1.583
%15 = select i1 %spec.select, ptr @str.3, ptr @str
br label %cleanup.6
cleanup.6: ; preds = %for.cond1.6, %cleanup.5
%flag.1.6 = phi ptr [ @str.3, %cleanup.5 ], [ %15, %for.cond1.6 ]
switch i32 %0, label %cleanup.8 [
i32 64, label %if.end14
i32 72, label %if.end14
i32 81, label %if.end14
]
cleanup.8: ; preds = %cleanup.6
br label %if.end14
if.end14: ; preds = %cleanup.8, %cleanup.6, %cleanup.6, %cleanup.6
%str.sink = phi ptr [ @str.3, %cleanup.6 ], [ @str.3, %cleanup.6 ], [ @str.3, %cleanup.6 ], [ %flag.1.6, %cleanup.8 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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.fshl.i32(i32, i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int N=0;
scanf("%d",&N);
int count=0;
for(int i=1;i<10;i++){
for(int j=1;j<10;j++){
if(N==i*j){
count++;
}
}
}
if(count==0){
printf("No\n");
}else{
printf("Yes\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
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
%cmp5.4.4 = icmp eq i32 %0, 25
%inc.4.4 = zext i1 %cmp5.4.4 to i32
%cmp5.6.6 = icmp eq i32 %0, 49
%inc.6.6 = zext i1 %cmp5.6.6 to i32
%cmp5.7.7 = icmp eq i32 %0, 64
%inc.7.7 = zext i1 %cmp5.7.7 to i32
%1 = insertelement <32 x i32> poison, i32 %0, i64 0
%2 = shufflevector <32 x i32> %1, <32 x i32> poison, <32 x i32> zeroinitializer
%3 = icmp eq <32 x i32> %2, <i32 6, i32 12, i32 8, i32 24, i32 18, i32 4, i32 16, i32 9, i32 36, i32 2, i32 3, i32 5, i32 10, i32 15, i32 20, i32 30, i32 7, i32 14, i32 21, i32 28, i32 35, i32 42, i32 32, i32 40, i32 48, i32 56, i32 27, i32 45, i32 54, i32 63, i32 72, i32 1>
%4 = select <32 x i1> %3, <32 x i32> <i32 4, i32 4, i32 4, i32 4, i32 4, i32 3, i32 3, i32 3, i32 3, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 2, i32 1>, <32 x i32> zeroinitializer
%5 = call i32 @llvm.vector.reduce.add.v32i32(<32 x i32> %4)
%op.rdx = add i32 %5, %inc.4.4
%op.rdx49 = add nuw nsw i32 %inc.6.6, %inc.7.7
%op.rdx50 = add i32 %op.rdx, %op.rdx49
%cmp5.8.8 = icmp eq i32 %0, 81
%inc.8.8.neg = sext i1 %cmp5.8.8 to i32
%cmp10 = icmp eq i32 %op.rdx50, %inc.8.8.neg
%str.3.str = select i1 %cmp10, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #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.v32i32(<32 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"}
|
#include<stdio.h>
#include<stdlib.h>
typedef long long int int64;
const int mod=1000000007;
int *fact=NULL;
int *iFact=NULL;
void init(const int n){
fact=(int *)calloc(n+1,sizeof(int));
fact[0]=1;
for(int i=1;i<=n;i++) fact[i]=(int64)i*fact[i-1]%mod;
int t=1;
int a=fact[n];
while(a>1){
t=(int64)t*(mod-mod/a)%mod;
a=mod%a;
}
iFact=(int *)calloc(n+1,sizeof(int));
iFact[n]=t;
for(int i=n-1;i>=0;i--) iFact[i]=(int64)iFact[i+1]*(i+1)%mod;
}
int comb(int n,int k){
if(!(0<=k && k<=n)) return 0;
return (int64)fact[n]*iFact[k]%mod*iFact[n-k]%mod;
}
typedef struct point{
int x,y;
int way;
} point;
int calc(int k,point *p,int n){
if(p[k].way>=0) return p[k].way;
int local=comb(p[k].x+p[k].y-2,p[k].x-1);
for(int i=0;i<n;i++){
if(i==k) continue;
if(p[i].x<=p[k].x && p[i].y<=p[k].y){
int t=(int64)calc(i,p,n)*comb(p[k].x-p[i].x+p[k].y-p[i].y,p[k].x-p[i].x)%mod;
local=(local+mod-t)%mod;
}
}
p[k].way=local;
return local;
}
void run(void){
int h,w,n;
scanf("%d%d%d",&h,&w,&n);
init(h+w);
point *p=(point *)calloc(n+1,sizeof(point));
int i;
for(i=0;i<n;i++){
int r,c;
scanf("%d%d",&r,&c);
p[i]=(point){r,c,-1};
}
p[n]=(point){h,w,-1};
int ans=calc(n,p,n+1);
printf("%d\n",ans);
}
int main(void){
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136609/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136609/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.point = type { i32, i32, i32 }
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@fact = dso_local local_unnamed_addr global ptr null, align 8
@iFact = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind memory(readwrite, argmem: none) uwtable
define dso_local void @init(i32 noundef %n) local_unnamed_addr #0 {
entry:
%add = add i32 %n, 1
%conv = sext i32 %add to i64
%call = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #7
store ptr %call, ptr @fact, align 8, !tbaa !5
store i32 1, ptr %call, align 4, !tbaa !9
%cmp.not60 = icmp slt i32 %n, 1
br i1 %cmp.not60, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %add to i64
%0 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %0, 1
%1 = icmp eq i32 %add, 2
br i1 %1, label %for.cond.cleanup.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.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%conv4.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.1, %for.body ]
%indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%mul.epil = mul nsw i64 %conv4.unr, %indvars.iv.unr
%rem.epil = srem i64 %mul.epil, 1000000007
%conv5.epil = trunc i64 %rem.epil to i32
%arrayidx7.epil = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.unr
store i32 %conv5.epil, ptr %arrayidx7.epil, align 4, !tbaa !9
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry
%idxprom8 = sext i32 %n to i64
%arrayidx9 = getelementptr inbounds i32, ptr %call, i64 %idxprom8
%2 = load i32, ptr %arrayidx9, align 4, !tbaa !9
%cmp1062 = icmp sgt i32 %2, 1
br i1 %cmp1062, label %while.body, label %while.end
for.body: ; preds = %for.body, %for.body.preheader.new
%conv4 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.1, %for.body ]
%indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%mul = mul nsw i64 %conv4, %indvars.iv
%rem = srem i64 %mul, 1000000007
%conv5 = trunc i64 %rem to i32
%arrayidx7 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv
store i32 %conv5, ptr %arrayidx7, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%conv5.1 = trunc i64 %rem.1 to i32
%arrayidx7.1 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv.next
store i32 %conv5.1, ptr %arrayidx7.1, align 4, !tbaa !9
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !11
while.body: ; preds = %for.cond.cleanup, %while.body
%a.064 = phi i32 [ %rem18, %while.body ], [ %2, %for.cond.cleanup ]
%t.063 = phi i64 [ %rem16, %while.body ], [ 1, %for.cond.cleanup ]
%div = udiv i32 1000000007, %a.064
%sub13 = sub nuw nsw i32 1000000007, %div
%conv14 = zext i32 %sub13 to i64
%mul15 = mul nuw nsw i64 %t.063, %conv14
%rem16 = urem i64 %mul15, 1000000007
%rem18 = urem i32 1000000007, %a.064
%cmp10 = icmp ugt i32 %rem18, 1
br i1 %cmp10, label %while.body, label %while.end.loopexit, !llvm.loop !13
while.end.loopexit: ; preds = %while.body
%conv17 = trunc i64 %rem16 to i32
br label %while.end
while.end: ; preds = %while.end.loopexit, %for.cond.cleanup
%t.0.lcssa = phi i32 [ 1, %for.cond.cleanup ], [ %conv17, %while.end.loopexit ]
%call21 = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 4) #7
store ptr %call21, ptr @iFact, align 8, !tbaa !5
%arrayidx23 = getelementptr inbounds i32, ptr %call21, i64 %idxprom8
store i32 %t.0.lcssa, ptr %arrayidx23, align 4, !tbaa !9
%cmp2765 = icmp sgt i32 %n, 0
br i1 %cmp2765, label %for.body30.preheader, label %for.cond.cleanup29
for.body30.preheader: ; preds = %while.end
%3 = zext i32 %n to i64
%xtraiter72 = and i64 %3, 1
%lcmp.mod73.not = icmp eq i64 %xtraiter72, 0
br i1 %lcmp.mod73.not, label %for.body30.prol.loopexit, label %for.body30.prol
for.body30.prol: ; preds = %for.body30.preheader
%indvars.iv.next70.prol = add nsw i64 %3, -1
%arrayidx33.prol = getelementptr inbounds i32, ptr %call21, i64 %3
%4 = load i32, ptr %arrayidx33.prol, align 4, !tbaa !9
%conv34.prol = sext i32 %4 to i64
%mul37.prol = mul nsw i64 %3, %conv34.prol
%rem38.prol = srem i64 %mul37.prol, 1000000007
%conv39.prol = trunc i64 %rem38.prol to i32
%idxprom40.prol = and i64 %indvars.iv.next70.prol, 4294967295
%arrayidx41.prol = getelementptr inbounds i32, ptr %call21, i64 %idxprom40.prol
store i32 %conv39.prol, ptr %arrayidx41.prol, align 4, !tbaa !9
br label %for.body30.prol.loopexit
for.body30.prol.loopexit: ; preds = %for.body30.prol, %for.body30.preheader
%indvars.iv69.unr = phi i64 [ %3, %for.body30.preheader ], [ %indvars.iv.next70.prol, %for.body30.prol ]
%5 = icmp eq i32 %n, 1
br i1 %5, label %for.cond.cleanup29, label %for.body30
for.cond.cleanup29: ; preds = %for.body30.prol.loopexit, %for.body30, %while.end
ret void
for.body30: ; preds = %for.body30.prol.loopexit, %for.body30
%indvars.iv69 = phi i64 [ %indvars.iv.next70.1, %for.body30 ], [ %indvars.iv69.unr, %for.body30.prol.loopexit ]
%indvars.iv.next70 = add nsw i64 %indvars.iv69, -1
%arrayidx33 = getelementptr inbounds i32, ptr %call21, i64 %indvars.iv69
%6 = load i32, ptr %arrayidx33, align 4, !tbaa !9
%conv34 = sext i32 %6 to i64
%mul37 = mul nsw i64 %indvars.iv69, %conv34
%rem38 = srem i64 %mul37, 1000000007
%conv39 = trunc i64 %rem38 to i32
%idxprom40 = and i64 %indvars.iv.next70, 4294967295
%arrayidx41 = getelementptr inbounds i32, ptr %call21, i64 %idxprom40
store i32 %conv39, ptr %arrayidx41, align 4, !tbaa !9
%indvars.iv.next70.1 = add nsw i64 %indvars.iv69, -2
%arrayidx33.1 = getelementptr inbounds i32, ptr %call21, i64 %indvars.iv.next70
%7 = load i32, ptr %arrayidx33.1, align 4, !tbaa !9
%conv34.1 = sext i32 %7 to i64
%mul37.1 = mul nsw i64 %indvars.iv.next70, %conv34.1
%rem38.1 = srem i64 %mul37.1, 1000000007
%conv39.1 = trunc i64 %rem38.1 to i32
%idxprom40.1 = and i64 %indvars.iv.next70.1, 4294967295
%arrayidx41.1 = getelementptr inbounds i32, ptr %call21, i64 %idxprom40.1
store i32 %conv39.1, ptr %arrayidx41.1, align 4, !tbaa !9
%cmp27.1 = icmp ugt i64 %indvars.iv.next70, 1
br i1 %cmp27.1, label %for.body30, label %for.cond.cleanup29, !llvm.loop !14
}
; 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 #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @comb(i32 noundef %n, i32 noundef %k) local_unnamed_addr #3 {
entry:
%cmp = icmp slt i32 %k, 0
%cmp1.not = icmp sgt i32 %k, %n
%or.cond = or i1 %cmp, %cmp1.not
br i1 %or.cond, label %return, label %if.end
if.end: ; preds = %entry
%0 = load ptr, ptr @fact, align 8, !tbaa !5
%idxprom = zext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !9
%conv = sext i32 %1 to i64
%2 = load ptr, ptr @iFact, align 8, !tbaa !5
%idxprom2 = zext i32 %k to i64
%arrayidx3 = getelementptr inbounds i32, ptr %2, i64 %idxprom2
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !9
%conv4 = sext i32 %3 to i64
%mul = mul nsw i64 %conv4, %conv
%rem = srem i64 %mul, 1000000007
%sub = sub nsw i32 %n, %k
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds i32, ptr %2, i64 %idxprom5
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !9
%conv7 = sext i32 %4 to i64
%mul8 = mul nsw i64 %rem, %conv7
%rem9 = srem i64 %mul8, 1000000007
%conv10 = trunc i64 %rem9 to i32
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i32 [ %conv10, %if.end ], [ 0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @calc(i32 noundef %k, ptr nocapture noundef %p, i32 noundef %n) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %k to i64
%arrayidx = getelementptr inbounds %struct.point, ptr %p, i64 %idxprom
%way = getelementptr inbounds %struct.point, ptr %p, i64 %idxprom, i32 2
%0 = load i32, ptr %way, align 4, !tbaa !15
%cmp = icmp sgt i32 %0, -1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%1 = load i32, ptr %arrayidx, align 4, !tbaa !17
%y = getelementptr inbounds %struct.point, ptr %p, i64 %idxprom, i32 1
%2 = load i32, ptr %y, align 4, !tbaa !18
%add = add i32 %1, -2
%sub = add i32 %add, %2
%sub11 = add nsw i32 %1, -1
%cmp.i = icmp slt i32 %1, 1
%cmp1.not.i = icmp sgt i32 %sub11, %sub
%or.cond.i = or i1 %cmp.i, %cmp1.not.i
br i1 %or.cond.i, label %comb.exit, label %if.end.i
if.end.i: ; preds = %if.end
%3 = load ptr, ptr @fact, align 8, !tbaa !5
%idxprom.i = zext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %3, i64 %idxprom.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !9
%conv.i = sext i32 %4 to i64
%5 = load ptr, ptr @iFact, align 8, !tbaa !5
%idxprom2.i = zext i32 %sub11 to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %5, i64 %idxprom2.i
%6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !9
%conv4.i = sext i32 %6 to i64
%mul.i = mul nsw i64 %conv4.i, %conv.i
%rem.i = srem i64 %mul.i, 1000000007
%sub.i = sub nsw i32 %sub, %sub11
%idxprom5.i = sext i32 %sub.i to i64
%arrayidx6.i = getelementptr inbounds i32, ptr %5, i64 %idxprom5.i
%7 = load i32, ptr %arrayidx6.i, align 4, !tbaa !9
%conv7.i = sext i32 %7 to i64
%mul8.i = mul nsw i64 %rem.i, %conv7.i
%rem9.i = srem i64 %mul8.i, 1000000007
%conv10.i = trunc i64 %rem9.i to i32
br label %comb.exit
comb.exit: ; preds = %if.end, %if.end.i
%retval.0.i = phi i32 [ %conv10.i, %if.end.i ], [ 0, %if.end ]
%cmp12123 = icmp sgt i32 %n, 0
br i1 %cmp12123, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %comb.exit
%8 = zext i32 %k to i64
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %comb.exit
%local.0.lcssa = phi i32 [ %retval.0.i, %comb.exit ], [ %local.1, %for.inc ]
store i32 %local.0.lcssa, ptr %way, align 4, !tbaa !15
br label %return
for.body: ; preds = %for.body.preheader, %for.inc
%9 = phi i32 [ %2, %for.body.preheader ], [ %23, %for.inc ]
%10 = phi i32 [ %1, %for.body.preheader ], [ %24, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%local.0124 = phi i32 [ %retval.0.i, %for.body.preheader ], [ %local.1, %for.inc ]
%cmp13 = icmp eq i64 %indvars.iv, %8
br i1 %cmp13, label %for.inc, label %if.end15
if.end15: ; preds = %for.body
%arrayidx17 = getelementptr inbounds %struct.point, ptr %p, i64 %indvars.iv
%11 = load i32, ptr %arrayidx17, align 4, !tbaa !17
%cmp22.not = icmp sgt i32 %11, %10
br i1 %cmp22.not, label %for.inc, label %land.lhs.true
land.lhs.true: ; preds = %if.end15
%y25 = getelementptr inbounds %struct.point, ptr %p, i64 %indvars.iv, i32 1
%12 = load i32, ptr %y25, align 4, !tbaa !18
%cmp29.not = icmp sgt i32 %12, %9
br i1 %cmp29.not, label %for.inc, label %if.then30
if.then30: ; preds = %land.lhs.true
%13 = trunc i64 %indvars.iv to i32
%call31 = tail call i32 @calc(i32 noundef %13, ptr noundef nonnull %p, i32 noundef %n), !range !19
%conv = sext i32 %call31 to i64
%14 = load i32, ptr %arrayidx, align 4, !tbaa !17
%15 = load i32, ptr %arrayidx17, align 4, !tbaa !17
%sub38 = sub nsw i32 %14, %15
%16 = load i32, ptr %y, align 4, !tbaa !18
%add42 = add nsw i32 %sub38, %16
%17 = load i32, ptr %y25, align 4, !tbaa !18
%sub46 = sub i32 %add42, %17
%cmp.i102 = icmp slt i32 %sub38, 0
%cmp1.not.i103 = icmp sgt i32 %sub38, %sub46
%or.cond.i104 = or i1 %cmp.i102, %cmp1.not.i103
br i1 %or.cond.i104, label %comb.exit122, label %if.end.i105
if.end.i105: ; preds = %if.then30
%18 = load ptr, ptr @fact, align 8, !tbaa !5
%idxprom.i106 = zext i32 %sub46 to i64
%arrayidx.i107 = getelementptr inbounds i32, ptr %18, i64 %idxprom.i106
%19 = load i32, ptr %arrayidx.i107, align 4, !tbaa !9
%conv.i108 = sext i32 %19 to i64
%20 = load ptr, ptr @iFact, align 8, !tbaa !5
%idxprom2.i109 = zext i32 %sub38 to i64
%arrayidx3.i110 = getelementptr inbounds i32, ptr %20, i64 %idxprom2.i109
%21 = load i32, ptr %arrayidx3.i110, align 4, !tbaa !9
%conv4.i111 = sext i32 %21 to i64
%mul.i112 = mul nsw i64 %conv4.i111, %conv.i108
%rem.i113 = srem i64 %mul.i112, 1000000007
%sub.i114 = sub nsw i32 %sub46, %sub38
%idxprom5.i115 = sext i32 %sub.i114 to i64
%arrayidx6.i116 = getelementptr inbounds i32, ptr %20, i64 %idxprom5.i115
%22 = load i32, ptr %arrayidx6.i116, align 4, !tbaa !9
%conv7.i117 = sext i32 %22 to i64
%mul8.i118 = mul nsw i64 %rem.i113, %conv7.i117
%rem9.i119 = srem i64 %mul8.i118, 1000000007
br label %comb.exit122
comb.exit122: ; preds = %if.then30, %if.end.i105
%retval.0.i121 = phi i64 [ %rem9.i119, %if.end.i105 ], [ 0, %if.then30 ]
%mul = mul nsw i64 %retval.0.i121, %conv
%rem = srem i64 %mul, 1000000007
%conv56 = trunc i64 %rem to i32
%add57 = add nsw i32 %local.0124, 1000000007
%sub58 = sub i32 %add57, %conv56
%rem59 = srem i32 %sub58, 1000000007
br label %for.inc
for.inc: ; preds = %if.end15, %land.lhs.true, %comb.exit122, %for.body
%23 = phi i32 [ %9, %for.body ], [ %16, %comb.exit122 ], [ %9, %land.lhs.true ], [ %9, %if.end15 ]
%24 = phi i32 [ %10, %for.body ], [ %14, %comb.exit122 ], [ %10, %land.lhs.true ], [ %10, %if.end15 ]
%local.1 = phi i32 [ %local.0124, %for.body ], [ %rem59, %comb.exit122 ], [ %local.0124, %land.lhs.true ], [ %local.0124, %if.end15 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !20
return: ; preds = %entry, %for.cond.cleanup
%retval.0 = phi i32 [ %local.0.lcssa, %for.cond.cleanup ], [ %0, %entry ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @run() local_unnamed_addr #5 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%n = alloca i32, align 4
%r = alloca i32, align 4
%c = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %n)
%0 = load i32, ptr %h, align 4, !tbaa !9
%1 = load i32, ptr %w, align 4, !tbaa !9
%add = add nsw i32 %1, %0
%add.i = add i32 %add, 1
%conv.i = sext i32 %add.i to i64
%call.i = call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 4) #7
store ptr %call.i, ptr @fact, align 8, !tbaa !5
store i32 1, ptr %call.i, align 4, !tbaa !9
%cmp.not60.i = icmp slt i32 %add, 1
br i1 %cmp.not60.i, label %for.cond.cleanup.i, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %add.i to i64
%2 = add nsw i64 %wide.trip.count.i, -1
%xtraiter = and i64 %2, 1
%3 = icmp eq i32 %add.i, 2
br i1 %3, label %for.cond.cleanup.i.loopexit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %2, -2
br label %for.body.i
for.cond.cleanup.i.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%conv4.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %rem.i.1, %for.body.i ]
%indvars.iv.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup.i, label %for.body.i.epil
for.body.i.epil: ; preds = %for.cond.cleanup.i.loopexit.unr-lcssa
%mul.i.epil = mul nsw i64 %indvars.iv.i.unr, %conv4.i.unr
%rem.i.epil = srem i64 %mul.i.epil, 1000000007
%conv5.i.epil = trunc i64 %rem.i.epil to i32
%arrayidx7.i.epil = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i.unr
store i32 %conv5.i.epil, ptr %arrayidx7.i.epil, align 4, !tbaa !9
br label %for.cond.cleanup.i
for.cond.cleanup.i: ; preds = %for.body.i.epil, %for.cond.cleanup.i.loopexit.unr-lcssa, %entry
%idxprom8.i = sext i32 %add to i64
%arrayidx9.i = getelementptr inbounds i32, ptr %call.i, i64 %idxprom8.i
%4 = load i32, ptr %arrayidx9.i, align 4, !tbaa !9
%cmp1062.i = icmp sgt i32 %4, 1
br i1 %cmp1062.i, label %while.body.i, label %while.end.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%conv4.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %rem.i.1, %for.body.i ]
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ]
%mul.i = mul nsw i64 %indvars.iv.i, %conv4.i
%rem.i = srem i64 %mul.i, 1000000007
%conv5.i = trunc i64 %rem.i to i32
%arrayidx7.i = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i
store i32 %conv5.i, ptr %arrayidx7.i, align 4, !tbaa !9
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%mul.i.1 = mul nsw i64 %indvars.iv.next.i, %rem.i
%rem.i.1 = srem i64 %mul.i.1, 1000000007
%conv5.i.1 = trunc i64 %rem.i.1 to i32
%arrayidx7.i.1 = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.next.i
store i32 %conv5.i.1, ptr %arrayidx7.i.1, align 4, !tbaa !9
%indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.i.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !11
while.body.i: ; preds = %for.cond.cleanup.i, %while.body.i
%a.064.i = phi i32 [ %rem18.i, %while.body.i ], [ %4, %for.cond.cleanup.i ]
%t.063.i = phi i64 [ %rem16.i, %while.body.i ], [ 1, %for.cond.cleanup.i ]
%div.i = udiv i32 1000000007, %a.064.i
%sub13.i = sub nuw nsw i32 1000000007, %div.i
%conv14.i = zext i32 %sub13.i to i64
%mul15.i = mul nuw nsw i64 %t.063.i, %conv14.i
%rem16.i = urem i64 %mul15.i, 1000000007
%rem18.i = urem i32 1000000007, %a.064.i
%cmp10.i = icmp ugt i32 %rem18.i, 1
br i1 %cmp10.i, label %while.body.i, label %while.end.loopexit.i, !llvm.loop !13
while.end.loopexit.i: ; preds = %while.body.i
%conv17.i = trunc i64 %rem16.i to i32
br label %while.end.i
while.end.i: ; preds = %while.end.loopexit.i, %for.cond.cleanup.i
%t.0.lcssa.i = phi i32 [ 1, %for.cond.cleanup.i ], [ %conv17.i, %while.end.loopexit.i ]
%call21.i = call noalias ptr @calloc(i64 noundef %conv.i, i64 noundef 4) #7
store ptr %call21.i, ptr @iFact, align 8, !tbaa !5
%arrayidx23.i = getelementptr inbounds i32, ptr %call21.i, i64 %idxprom8.i
store i32 %t.0.lcssa.i, ptr %arrayidx23.i, align 4, !tbaa !9
%cmp2765.i = icmp sgt i32 %add, 0
br i1 %cmp2765.i, label %for.body30.preheader.i, label %init.exit
for.body30.preheader.i: ; preds = %while.end.i
%5 = zext i32 %add to i64
br label %for.body30.i
for.body30.i: ; preds = %for.body30.i, %for.body30.preheader.i
%indvars.iv69.i = phi i64 [ %5, %for.body30.preheader.i ], [ %indvars.iv.next70.i, %for.body30.i ]
%indvars.iv.next70.i = add nsw i64 %indvars.iv69.i, -1
%arrayidx33.i = getelementptr inbounds i32, ptr %call21.i, i64 %indvars.iv69.i
%6 = load i32, ptr %arrayidx33.i, align 4, !tbaa !9
%conv34.i = sext i32 %6 to i64
%mul37.i = mul nsw i64 %indvars.iv69.i, %conv34.i
%rem38.i = srem i64 %mul37.i, 1000000007
%conv39.i = trunc i64 %rem38.i to i32
%idxprom40.i = and i64 %indvars.iv.next70.i, 4294967295
%arrayidx41.i = getelementptr inbounds i32, ptr %call21.i, i64 %idxprom40.i
store i32 %conv39.i, ptr %arrayidx41.i, align 4, !tbaa !9
%cmp27.i = icmp ugt i64 %indvars.iv69.i, 1
br i1 %cmp27.i, label %for.body30.i, label %init.exit, !llvm.loop !14
init.exit: ; preds = %for.body30.i, %while.end.i
%7 = load i32, ptr %n, align 4, !tbaa !9
%add1 = add nsw i32 %7, 1
%conv = sext i32 %add1 to i64
%call2 = call noalias ptr @calloc(i64 noundef %conv, i64 noundef 12) #7
%cmp18 = icmp sgt i32 %7, 0
br i1 %cmp18, label %for.body, label %init.exit.for.end_crit_edge
init.exit.for.end_crit_edge: ; preds = %init.exit
%.pre24 = sext i32 %7 to i64
br label %for.end
for.body: ; preds = %init.exit, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %init.exit ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #8
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %c)
%arrayidx = getelementptr inbounds %struct.point, ptr %call2, i64 %indvars.iv
%8 = load i32, ptr %r, align 4, !tbaa !9
%9 = load i32, ptr %c, align 4, !tbaa !9
store i32 %8, ptr %arrayidx, align 4, !tbaa.struct !21
%.compoundliteral.sroa.2.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4
store i32 %9, ptr %.compoundliteral.sroa.2.0.arrayidx.sroa_idx, align 4, !tbaa.struct !22
%.compoundliteral.sroa.3.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8
store i32 -1, ptr %.compoundliteral.sroa.3.0.arrayidx.sroa_idx, align 4, !tbaa.struct !23
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #8
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%10 = load i32, ptr %n, align 4, !tbaa !9
%11 = sext i32 %10 to i64
%cmp = icmp slt i64 %indvars.iv.next, %11
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !24
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %h, align 4, !tbaa !9
%.pre22 = load i32, ptr %w, align 4, !tbaa !9
%.pre23 = add nsw i32 %10, 1
br label %for.end
for.end: ; preds = %init.exit.for.end_crit_edge, %for.end.loopexit
%idxprom5.pre-phi = phi i64 [ %.pre24, %init.exit.for.end_crit_edge ], [ %11, %for.end.loopexit ]
%add11.pre-phi = phi i32 [ %add1, %init.exit.for.end_crit_edge ], [ %.pre23, %for.end.loopexit ]
%12 = phi i32 [ %1, %init.exit.for.end_crit_edge ], [ %.pre22, %for.end.loopexit ]
%13 = phi i32 [ %0, %init.exit.for.end_crit_edge ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %7, %init.exit.for.end_crit_edge ], [ %10, %for.end.loopexit ]
%arrayidx6 = getelementptr inbounds %struct.point, ptr %call2, i64 %idxprom5.pre-phi
store i32 %13, ptr %arrayidx6, align 4, !tbaa.struct !21
%.compoundliteral7.sroa.2.0.arrayidx6.sroa_idx = getelementptr inbounds i8, ptr %arrayidx6, i64 4
store i32 %12, ptr %.compoundliteral7.sroa.2.0.arrayidx6.sroa_idx, align 4, !tbaa.struct !22
%.compoundliteral7.sroa.3.0.arrayidx6.sroa_idx = getelementptr inbounds i8, ptr %arrayidx6, i64 8
store i32 -1, ptr %.compoundliteral7.sroa.3.0.arrayidx6.sroa_idx, align 4, !tbaa.struct !23
%call12 = call i32 @calc(i32 noundef %.lcssa, ptr noundef %call2, i32 noundef %add11.pre-phi), !range !19
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call12)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
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 void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
tail call void @run()
ret i32 0
}
attributes #0 = { nofree nounwind memory(readwrite, argmem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree norecurse nosync 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 #4 = { 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 #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind allocsize(0,1) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !10, i64 8}
!16 = !{!"point", !10, i64 0, !10, i64 4, !10, i64 8}
!17 = !{!16, !10, i64 0}
!18 = !{!16, !10, i64 4}
!19 = !{i32 -1000000006, i32 -2147483648}
!20 = distinct !{!20, !12}
!21 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!22 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!23 = !{i64 0, i64 4, !9}
!24 = distinct !{!24, !12}
|
#include<stdio.h>
#include<stdbool.h>
#include<stdlib.h>
int compare(const void *a, const void *b) {
return *(int*)a - *(int*)b;
}
int sum(int *data, int n) {
int i;
int result = 0;
for (i = 0; i < n; i++) {
result += data[i];
}
return result;
}
int main(void) {
int n,i;
int result;
scanf("%d", &n);
int a[n];
for (i=0; i<n; i++) {
scanf("%d", &a[i]);
}
qsort(a, n, sizeof(int), compare);
result = sum(a,n);
if (result % 10 == 0) {
for (i=0; i<n; i++) {
if (a[i] % 10 != 0) {
result -= a[i];
break;
}
}
if (result == sum(a,n)) {
result = 0;
}
}
printf("%d\n", result);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136717/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136717/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @sum(ptr nocapture noundef readonly %data, i32 noundef %n) local_unnamed_addr #1 {
entry:
%cmp4 = icmp sgt i32 %n, 0
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader10, 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 ], [ %2, %vector.body ]
%vec.phi8 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i32, ptr %data, i64 %index
%wide.load = load <4 x i32>, ptr %0, align 4, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
%wide.load9 = load <4 x i32>, ptr %1, align 4, !tbaa !5
%2 = add <4 x i32> %wide.load, %vec.phi
%3 = add <4 x i32> %wide.load9, %vec.phi8
%index.next = add nuw i64 %index, 8
%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 <4 x i32> %3, %2
%5 = tail 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.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%result.06.ph = phi i32 [ 0, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader10, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader10 ]
%result.06 = phi i32 [ %add, %for.body ], [ %result.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i32, ptr %data, i64 %indvars.iv
%6 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %6, %result.06
%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, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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
%cmp49 = icmp sgt i32 %3, 0
br i1 %cmp49, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #8
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %6, 0
br i1 %cmp4.i, label %for.body.preheader.i, label %sum.exit47
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 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 ], [ %9, %vector.body ]
%vec.phi70 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%7 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load71 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = add <4 x i32> %wide.load, %vec.phi
%10 = add <4 x i32> %wide.load71, %vec.phi70
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %10, %9
%12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %sum.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
%result.06.i.ph = phi i32 [ 0, %for.body.preheader.i ], [ %12, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%result.06.i = phi i32 [ %add.i, %for.body.i ], [ %result.06.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%13 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%add.i = add nsw i32 %13, %result.06.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %sum.exit, label %for.body.i, !llvm.loop !16
sum.exit: ; preds = %for.body.i, %middle.block
%add.i.lcssa = phi i32 [ %12, %middle.block ], [ %add.i, %for.body.i ]
%rem = srem i32 %add.i.lcssa, 10
%cmp3 = icmp eq i32 %rem, 0
br i1 %cmp3, label %for.cond5.preheader, label %if.end25
for.cond5.preheader: ; preds = %sum.exit
br i1 %cmp4.i, label %for.body8.preheader, label %sum.exit47
for.body8.preheader: ; preds = %for.cond5.preheader
%wide.trip.count = zext i32 %6 to i64
br label %for.body8
for.cond5: ; preds = %for.body8
%indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
%exitcond.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count
br i1 %exitcond.not, label %for.end19, label %for.body8, !llvm.loop !17
for.body8: ; preds = %for.body8.preheader, %for.cond5
%indvars.iv56 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next57, %for.cond5 ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv56
%14 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%rem11 = srem i32 %14, 10
%cmp12.not = icmp eq i32 %rem11, 0
br i1 %cmp12.not, label %for.cond5, label %if.then14
if.then14: ; preds = %for.body8
%sub = sub nsw i32 %add.i.lcssa, %14
br label %for.end19
for.end19: ; preds = %for.cond5, %if.then14
%result.0 = phi i32 [ %sub, %if.then14 ], [ %add.i.lcssa, %for.cond5 ]
br i1 %cmp4.i, label %for.body.preheader.i38, label %sum.exit47
for.body.preheader.i38: ; preds = %for.end19
%wide.trip.count.i39 = zext i32 %6 to i64
%min.iters.check74 = icmp ult i32 %6, 8
br i1 %min.iters.check74, label %for.body.i40.preheader, label %vector.ph75
vector.ph75: ; preds = %for.body.preheader.i38
%n.vec77 = and i64 %wide.trip.count.i, 4294967288
br label %vector.body80
vector.body80: ; preds = %vector.body80, %vector.ph75
%index81 = phi i64 [ 0, %vector.ph75 ], [ %index.next86, %vector.body80 ]
%vec.phi82 = phi <4 x i32> [ zeroinitializer, %vector.ph75 ], [ %17, %vector.body80 ]
%vec.phi83 = phi <4 x i32> [ zeroinitializer, %vector.ph75 ], [ %18, %vector.body80 ]
%15 = getelementptr inbounds i32, ptr %vla, i64 %index81
%wide.load84 = load <4 x i32>, ptr %15, align 16, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 4
%wide.load85 = load <4 x i32>, ptr %16, align 16, !tbaa !5
%17 = add <4 x i32> %wide.load84, %vec.phi82
%18 = add <4 x i32> %wide.load85, %vec.phi83
%index.next86 = add nuw i64 %index81, 8
%19 = icmp eq i64 %index.next86, %n.vec77
br i1 %19, label %middle.block72, label %vector.body80, !llvm.loop !18
middle.block72: ; preds = %vector.body80
%bin.rdx87 = add <4 x i32> %18, %17
%20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx87)
%cmp.n79 = icmp eq i64 %n.vec77, %wide.trip.count.i
br i1 %cmp.n79, label %sum.exit47, label %for.body.i40.preheader
for.body.i40.preheader: ; preds = %for.body.preheader.i38, %middle.block72
%indvars.iv.i41.ph = phi i64 [ 0, %for.body.preheader.i38 ], [ %n.vec77, %middle.block72 ]
%result.06.i42.ph = phi i32 [ 0, %for.body.preheader.i38 ], [ %20, %middle.block72 ]
br label %for.body.i40
for.body.i40: ; preds = %for.body.i40.preheader, %for.body.i40
%indvars.iv.i41 = phi i64 [ %indvars.iv.next.i45, %for.body.i40 ], [ %indvars.iv.i41.ph, %for.body.i40.preheader ]
%result.06.i42 = phi i32 [ %add.i44, %for.body.i40 ], [ %result.06.i42.ph, %for.body.i40.preheader ]
%arrayidx.i43 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i41
%21 = load i32, ptr %arrayidx.i43, align 4, !tbaa !5
%add.i44 = add nsw i32 %21, %result.06.i42
%indvars.iv.next.i45 = add nuw nsw i64 %indvars.iv.i41, 1
%exitcond.not.i46 = icmp eq i64 %indvars.iv.next.i45, %wide.trip.count.i39
br i1 %exitcond.not.i46, label %sum.exit47, label %for.body.i40, !llvm.loop !19
sum.exit47: ; preds = %for.body.i40, %middle.block72, %for.end, %for.cond5.preheader, %for.end19
%result.065 = phi i32 [ %result.0, %for.end19 ], [ %add.i.lcssa, %for.cond5.preheader ], [ 0, %for.end ], [ %result.0, %middle.block72 ], [ %result.0, %for.body.i40 ]
%result.0.lcssa.i37 = phi i32 [ 0, %for.end19 ], [ 0, %for.cond5.preheader ], [ 0, %for.end ], [ %20, %middle.block72 ], [ %add.i44, %for.body.i40 ]
%cmp21 = icmp eq i32 %result.065, %result.0.lcssa.i37
%spec.select = select i1 %cmp21, i32 0, i32 %result.065
br label %if.end25
if.end25: ; preds = %sum.exit47, %sum.exit
%result.1 = phi i32 [ %add.i.lcssa, %sum.exit ], [ %spec.select, %sum.exit47 ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %result.1)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; 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.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 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 #2 = { mustprogress nocallback nofree nosync 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 = { 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 = { 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, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !11, !12}
!16 = distinct !{!16, !10, !12, !11}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !11, !12}
!19 = distinct !{!19, !10, !12, !11}
|
#include<stdio.h>
int main(){
int n,a,b,i,j;
long long v[50];
scanf("%d%d%d",&n,&a,&b);
for(i=0;i<n;i++)scanf("%lld",&v[i]);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(v[i]>v[j]){
long long tmp=v[i];
v[i]=v[j];
v[j]=tmp;
}
}
}
long long ans=0;
for(i=0;i<a;i++)ans+=v[i];
long long ai=v[a-1];
int num=0,anum=0,bnum=0;
for(i=0;i<n;i++){
if(ai==v[i]&&i<a)anum++;
if(ai==v[i]&&i<b)bnum++;
if(ai==v[i])num++;
}
long long ncm[101][101]={0};
long long anss=0;
ncm[0][0]=1;
for(i=1;i<101;i++){
for(j=0;j<101;j++){
if(j==0)ncm[i][j]=1;
else ncm[i][j]=ncm[i-1][j]+ncm[i-1][j-1];
}
}
if(v[0]==ai){
for(i=anum;i<=bnum;i++)anss+=ncm[num][i];
}else anss=ncm[num][anum];
if(ans%a==0)printf("%lld\n%lld\n",ans/a,anss);
else printf("%.9f\n%lld\n",ans/(float)a,anss);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136760/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136760/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [11 x i8] c"%lld\0A%lld\0A\00", align 1
@.str.3 = private unnamed_addr constant [11 x i8] c"%.9f\0A%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
%v = alloca [50 x i64], align 16
%ncm = alloca [101 x [101 x i64]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #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 400, ptr nonnull %v) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp187 = icmp sgt i32 %0, 0
br i1 %cmp187, label %for.body, label %for.cond27.preheader
for.cond2.preheader: ; preds = %for.body
%cmp3191 = icmp sgt i32 %8, 0
br i1 %cmp3191, label %for.cond5.preheader.us.preheader, label %for.cond27.preheader
for.cond5.preheader.us.preheader: ; preds = %for.cond2.preheader
%wide.trip.count219 = zext i32 %8 to i64
%xtraiter = and i64 %wide.trip.count219, 1
%1 = icmp eq i32 %8, 1
%unroll_iter = and i64 %wide.trip.count219, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us.preheader, %for.cond5.for.inc24_crit_edge.us
%indvars.iv216 = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvars.iv.next217, %for.cond5.for.inc24_crit_edge.us ]
%arrayidx9.us = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv216
br i1 %1, label %for.cond5.for.inc24_crit_edge.us.unr-lcssa, label %for.body7.us
for.body7.us: ; preds = %for.cond5.preheader.us, %for.inc21.us.1
%indvars.iv213 = phi i64 [ %indvars.iv.next214.1, %for.inc21.us.1 ], [ 0, %for.cond5.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc21.us.1 ], [ 0, %for.cond5.preheader.us ]
%2 = load i64, ptr %arrayidx9.us, align 8, !tbaa !9
%arrayidx11.us = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv213
%3 = load i64, ptr %arrayidx11.us, align 16, !tbaa !9
%cmp12.us = icmp sgt i64 %2, %3
br i1 %cmp12.us, label %if.then.us, label %for.inc21.us
if.then.us: ; preds = %for.body7.us
store i64 %3, ptr %arrayidx9.us, align 8, !tbaa !9
store i64 %2, ptr %arrayidx11.us, align 16, !tbaa !9
br label %for.inc21.us
for.inc21.us: ; preds = %if.then.us, %for.body7.us
%indvars.iv.next214 = or i64 %indvars.iv213, 1
%4 = load i64, ptr %arrayidx9.us, align 8, !tbaa !9
%arrayidx11.us.1 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv.next214
%5 = load i64, ptr %arrayidx11.us.1, align 8, !tbaa !9
%cmp12.us.1 = icmp sgt i64 %4, %5
br i1 %cmp12.us.1, label %if.then.us.1, label %for.inc21.us.1
if.then.us.1: ; preds = %for.inc21.us
store i64 %5, ptr %arrayidx9.us, align 8, !tbaa !9
store i64 %4, ptr %arrayidx11.us.1, align 8, !tbaa !9
br label %for.inc21.us.1
for.inc21.us.1: ; preds = %if.then.us.1, %for.inc21.us
%indvars.iv.next214.1 = add nuw nsw i64 %indvars.iv213, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond5.for.inc24_crit_edge.us.unr-lcssa, label %for.body7.us, !llvm.loop !11
for.cond5.for.inc24_crit_edge.us.unr-lcssa: ; preds = %for.inc21.us.1, %for.cond5.preheader.us
%indvars.iv213.unr = phi i64 [ 0, %for.cond5.preheader.us ], [ %indvars.iv.next214.1, %for.inc21.us.1 ]
br i1 %lcmp.mod.not, label %for.cond5.for.inc24_crit_edge.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond5.for.inc24_crit_edge.us.unr-lcssa
%6 = load i64, ptr %arrayidx9.us, align 8, !tbaa !9
%arrayidx11.us.epil = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv213.unr
%7 = load i64, ptr %arrayidx11.us.epil, align 8, !tbaa !9
%cmp12.us.epil = icmp sgt i64 %6, %7
br i1 %cmp12.us.epil, label %if.then.us.epil, label %for.cond5.for.inc24_crit_edge.us
if.then.us.epil: ; preds = %for.body7.us.epil
store i64 %7, ptr %arrayidx9.us, align 8, !tbaa !9
store i64 %6, ptr %arrayidx11.us.epil, align 8, !tbaa !9
br label %for.cond5.for.inc24_crit_edge.us
for.cond5.for.inc24_crit_edge.us: ; preds = %for.body7.us.epil, %if.then.us.epil, %for.cond5.for.inc24_crit_edge.us.unr-lcssa
%indvars.iv.next217 = add nuw nsw i64 %indvars.iv216, 1
%exitcond220.not = icmp eq i64 %indvars.iv.next217, %wide.trip.count219
br i1 %exitcond220.not, label %for.cond27.preheader, label %for.cond5.preheader.us, !llvm.loop !13
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !14
for.cond27.preheader: ; preds = %for.cond5.for.inc24_crit_edge.us, %entry, %for.cond2.preheader
%cmp3191249 = phi i1 [ false, %for.cond2.preheader ], [ false, %entry ], [ %cmp3191, %for.cond5.for.inc24_crit_edge.us ]
%.lcssa186248 = phi i32 [ %8, %for.cond2.preheader ], [ %0, %entry ], [ %8, %for.cond5.for.inc24_crit_edge.us ]
%10 = load i32, ptr %a, align 4
%cmp28193 = icmp sgt i32 %10, 0
br i1 %cmp28193, label %for.body29.preheader, label %for.end34
for.body29.preheader: ; preds = %for.cond27.preheader
%wide.trip.count224 = zext i32 %10 to i64
%min.iters.check = icmp ult i32 %10, 4
br i1 %min.iters.check, label %for.body29.preheader319, label %vector.ph
vector.ph: ; preds = %for.body29.preheader
%n.vec = and i64 %wide.trip.count224, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi250 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%11 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %index
%wide.load = load <2 x i64>, ptr %11, align 16, !tbaa !9
%12 = getelementptr inbounds i64, ptr %11, i64 2
%wide.load251 = load <2 x i64>, ptr %12, align 16, !tbaa !9
%13 = add <2 x i64> %wide.load, %vec.phi
%14 = add <2 x i64> %wide.load251, %vec.phi250
%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 !15
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %14, %13
%16 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count224
br i1 %cmp.n, label %for.end34, label %for.body29.preheader319
for.body29.preheader319: ; preds = %for.body29.preheader, %middle.block
%indvars.iv221.ph = phi i64 [ 0, %for.body29.preheader ], [ %n.vec, %middle.block ]
%ans.0194.ph = phi i64 [ 0, %for.body29.preheader ], [ %16, %middle.block ]
br label %for.body29
for.body29: ; preds = %for.body29.preheader319, %for.body29
%indvars.iv221 = phi i64 [ %indvars.iv.next222, %for.body29 ], [ %indvars.iv221.ph, %for.body29.preheader319 ]
%ans.0194 = phi i64 [ %add, %for.body29 ], [ %ans.0194.ph, %for.body29.preheader319 ]
%arrayidx31 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv221
%17 = load i64, ptr %arrayidx31, align 8, !tbaa !9
%add = add nsw i64 %17, %ans.0194
%indvars.iv.next222 = add nuw nsw i64 %indvars.iv221, 1
%exitcond225.not = icmp eq i64 %indvars.iv.next222, %wide.trip.count224
br i1 %exitcond225.not, label %for.end34, label %for.body29, !llvm.loop !18
for.end34: ; preds = %for.body29, %middle.block, %for.cond27.preheader
%ans.0.lcssa = phi i64 [ 0, %for.cond27.preheader ], [ %16, %middle.block ], [ %add, %for.body29 ]
%sub = add nsw i32 %10, -1
%idxprom35 = sext i32 %sub to i64
%arrayidx36 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %idxprom35
%18 = load i64, ptr %arrayidx36, align 8, !tbaa !9
br i1 %cmp3191249, label %for.body39.lr.ph, label %for.end63
for.body39.lr.ph: ; preds = %for.end34
%19 = load i32, ptr %b, align 4
%20 = sext i32 %19 to i64
%21 = sext i32 %10 to i64
%wide.trip.count229 = zext i32 %.lcssa186248 to i64
%min.iters.check254 = icmp ult i32 %.lcssa186248, 4
br i1 %min.iters.check254, label %for.body39.preheader, label %vector.ph255
vector.ph255: ; preds = %for.body39.lr.ph
%n.vec257 = and i64 %wide.trip.count229, 4294967292
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %18, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert271 = insertelement <2 x i64> poison, i64 %21, i64 0
%broadcast.splat272 = shufflevector <2 x i64> %broadcast.splatinsert271, <2 x i64> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert273 = insertelement <2 x i64> poison, i64 %20, i64 0
%broadcast.splat274 = shufflevector <2 x i64> %broadcast.splatinsert273, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body260
vector.body260: ; preds = %vector.body260, %vector.ph255
%index261 = phi i64 [ 0, %vector.ph255 ], [ %index.next275, %vector.body260 ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph255 ], [ %vec.ind.next, %vector.body260 ]
%vec.phi263 = phi <2 x i32> [ zeroinitializer, %vector.ph255 ], [ %40, %vector.body260 ]
%vec.phi264 = phi <2 x i32> [ zeroinitializer, %vector.ph255 ], [ %41, %vector.body260 ]
%vec.phi265 = phi <2 x i32> [ zeroinitializer, %vector.ph255 ], [ %32, %vector.body260 ]
%vec.phi266 = phi <2 x i32> [ zeroinitializer, %vector.ph255 ], [ %33, %vector.body260 ]
%vec.phi267 = phi <2 x i32> [ zeroinitializer, %vector.ph255 ], [ %44, %vector.body260 ]
%vec.phi268 = phi <2 x i32> [ zeroinitializer, %vector.ph255 ], [ %45, %vector.body260 ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%22 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %index261
%wide.load269 = load <2 x i64>, ptr %22, align 16, !tbaa !9
%23 = getelementptr inbounds i64, ptr %22, i64 2
%wide.load270 = load <2 x i64>, ptr %23, align 16, !tbaa !9
%24 = icmp eq <2 x i64> %broadcast.splat, %wide.load269
%25 = icmp eq <2 x i64> %broadcast.splat, %wide.load270
%26 = icmp slt <2 x i64> %vec.ind, %broadcast.splat272
%27 = icmp slt <2 x i64> %step.add, %broadcast.splat272
%28 = and <2 x i1> %26, %24
%29 = and <2 x i1> %27, %25
%30 = zext <2 x i1> %28 to <2 x i32>
%31 = zext <2 x i1> %29 to <2 x i32>
%32 = add <2 x i32> %vec.phi265, %30
%33 = add <2 x i32> %vec.phi266, %31
%34 = icmp slt <2 x i64> %vec.ind, %broadcast.splat274
%35 = icmp slt <2 x i64> %step.add, %broadcast.splat274
%36 = select <2 x i1> %24, <2 x i1> %34, <2 x i1> zeroinitializer
%37 = select <2 x i1> %25, <2 x i1> %35, <2 x i1> zeroinitializer
%38 = zext <2 x i1> %36 to <2 x i32>
%39 = zext <2 x i1> %37 to <2 x i32>
%40 = add <2 x i32> %vec.phi263, %38
%41 = add <2 x i32> %vec.phi264, %39
%42 = zext <2 x i1> %24 to <2 x i32>
%43 = zext <2 x i1> %25 to <2 x i32>
%44 = add <2 x i32> %vec.phi267, %42
%45 = add <2 x i32> %vec.phi268, %43
%index.next275 = add nuw i64 %index261, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%46 = icmp eq i64 %index.next275, %n.vec257
br i1 %46, label %middle.block252, label %vector.body260, !llvm.loop !19
middle.block252: ; preds = %vector.body260
%bin.rdx280 = add <2 x i32> %45, %44
%47 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx280)
%bin.rdx278 = add <2 x i32> %33, %32
%48 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx278)
%bin.rdx276 = add <2 x i32> %41, %40
%49 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx276)
%cmp.n259 = icmp eq i64 %n.vec257, %wide.trip.count229
br i1 %cmp.n259, label %for.end63.loopexit, label %for.body39.preheader
for.body39.preheader: ; preds = %for.body39.lr.ph, %middle.block252
%indvars.iv226.ph = phi i64 [ 0, %for.body39.lr.ph ], [ %n.vec257, %middle.block252 ]
%bnum.0202.ph = phi i32 [ 0, %for.body39.lr.ph ], [ %49, %middle.block252 ]
%anum.0201.ph = phi i32 [ 0, %for.body39.lr.ph ], [ %48, %middle.block252 ]
%num.0200.ph = phi i32 [ 0, %for.body39.lr.ph ], [ %47, %middle.block252 ]
br label %for.body39
for.body39: ; preds = %for.body39.preheader, %for.body39
%indvars.iv226 = phi i64 [ %indvars.iv.next227, %for.body39 ], [ %indvars.iv226.ph, %for.body39.preheader ]
%bnum.0202 = phi i32 [ %bnum.1, %for.body39 ], [ %bnum.0202.ph, %for.body39.preheader ]
%anum.0201 = phi i32 [ %anum.1, %for.body39 ], [ %anum.0201.ph, %for.body39.preheader ]
%num.0200 = phi i32 [ %num.1, %for.body39 ], [ %num.0200.ph, %for.body39.preheader ]
%arrayidx41 = getelementptr inbounds [50 x i64], ptr %v, i64 0, i64 %indvars.iv226
%50 = load i64, ptr %arrayidx41, align 8, !tbaa !9
%cmp42 = icmp eq i64 %18, %50
%cmp43 = icmp slt i64 %indvars.iv226, %21
%or.cond = and i1 %cmp43, %cmp42
%inc45 = zext i1 %or.cond to i32
%anum.1 = add nuw nsw i32 %anum.0201, %inc45
%cmp51 = icmp slt i64 %indvars.iv226, %20
%or.cond185 = select i1 %cmp42, i1 %cmp51, i1 false
%inc53 = zext i1 %or.cond185 to i32
%bnum.1 = add nuw nsw i32 %bnum.0202, %inc53
%inc59 = zext i1 %cmp42 to i32
%num.1 = add nuw nsw i32 %num.0200, %inc59
%indvars.iv.next227 = add nuw nsw i64 %indvars.iv226, 1
%exitcond230.not = icmp eq i64 %indvars.iv.next227, %wide.trip.count229
br i1 %exitcond230.not, label %for.end63.loopexit, label %for.body39, !llvm.loop !20
for.end63.loopexit: ; preds = %for.body39, %middle.block252
%anum.1.lcssa = phi i32 [ %48, %middle.block252 ], [ %anum.1, %for.body39 ]
%bnum.1.lcssa = phi i32 [ %49, %middle.block252 ], [ %bnum.1, %for.body39 ]
%num.1.lcssa = phi i32 [ %47, %middle.block252 ], [ %num.1, %for.body39 ]
%51 = zext i32 %num.1.lcssa to i64
br label %for.end63
for.end63: ; preds = %for.end63.loopexit, %for.end34
%num.0.lcssa = phi i64 [ 0, %for.end34 ], [ %51, %for.end63.loopexit ]
%anum.0.lcssa = phi i32 [ 0, %for.end34 ], [ %anum.1.lcssa, %for.end63.loopexit ]
%bnum.0.lcssa = phi i32 [ 0, %for.end34 ], [ %bnum.1.lcssa, %for.end63.loopexit ]
call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %ncm) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %ncm, i8 0, i64 81608, i1 false)
store i64 1, ptr %ncm, align 16, !tbaa !9
br label %for.body71.peel.next
for.body71.peel.next: ; preds = %for.inc98, %for.end63
%indvars.iv237 = phi i64 [ 1, %for.end63 ], [ %indvars.iv.next238, %for.inc98 ]
%52 = add nsw i64 %indvars.iv237, -1
%arrayidx75 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %indvars.iv237
store i64 1, ptr %arrayidx75, align 8, !tbaa !9
br label %vector.body286
vector.body286: ; preds = %vector.body286, %for.body71.peel.next
%index287 = phi i64 [ 0, %for.body71.peel.next ], [ %index.next290.1, %vector.body286 ]
%offset.idx = or i64 %index287, 1
%53 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %52, i64 %offset.idx
%wide.load288 = load <2 x i64>, ptr %53, align 8, !tbaa !9
%54 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %52, i64 %index287
%wide.load289 = load <2 x i64>, ptr %54, align 8, !tbaa !9
%55 = add nsw <2 x i64> %wide.load289, %wide.load288
%56 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %indvars.iv237, i64 %offset.idx
store <2 x i64> %55, ptr %56, align 8, !tbaa !9
%index.next290 = or i64 %index287, 2
%offset.idx.1 = or i64 %index287, 3
%57 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %52, i64 %offset.idx.1
%wide.load288.1 = load <2 x i64>, ptr %57, align 8, !tbaa !9
%58 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %52, i64 %index.next290
%wide.load289.1 = load <2 x i64>, ptr %58, align 8, !tbaa !9
%59 = add nsw <2 x i64> %wide.load289.1, %wide.load288.1
%60 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %indvars.iv237, i64 %offset.idx.1
store <2 x i64> %59, ptr %60, align 8, !tbaa !9
%index.next290.1 = add nuw nsw i64 %index287, 4
%61 = icmp eq i64 %index.next290.1, 100
br i1 %61, label %for.inc98, label %vector.body286, !llvm.loop !21
for.inc98: ; preds = %vector.body286
%indvars.iv.next238 = add nuw nsw i64 %indvars.iv237, 1
%exitcond241.not = icmp eq i64 %indvars.iv.next238, 101
br i1 %exitcond241.not, label %for.end100, label %for.body71.peel.next, !llvm.loop !23
for.end100: ; preds = %for.inc98
%62 = load i64, ptr %v, align 16, !tbaa !9
%cmp102 = icmp eq i64 %62, %18
br i1 %cmp102, label %for.cond104.preheader, label %if.else115
for.cond104.preheader: ; preds = %for.end100
%cmp105.not208 = icmp sgt i32 %anum.0.lcssa, %bnum.0.lcssa
br i1 %cmp105.not208, label %if.end120, label %for.body106.lr.ph
for.body106.lr.ph: ; preds = %for.cond104.preheader
%63 = sext i32 %anum.0.lcssa to i64
%64 = add nuw i32 %bnum.0.lcssa, 1
%65 = sub i32 %bnum.0.lcssa, %anum.0.lcssa
%66 = zext i32 %65 to i64
%67 = add nuw nsw i64 %66, 1
%min.iters.check293 = icmp ult i32 %65, 3
br i1 %min.iters.check293, label %for.body106.preheader, label %vector.ph294
vector.ph294: ; preds = %for.body106.lr.ph
%n.vec296 = and i64 %67, 8589934588
%ind.end = add nsw i64 %n.vec296, %63
br label %vector.body299
vector.body299: ; preds = %vector.body299, %vector.ph294
%index300 = phi i64 [ 0, %vector.ph294 ], [ %index.next306, %vector.body299 ]
%vec.phi301 = phi <2 x i64> [ zeroinitializer, %vector.ph294 ], [ %70, %vector.body299 ]
%vec.phi302 = phi <2 x i64> [ zeroinitializer, %vector.ph294 ], [ %71, %vector.body299 ]
%offset.idx303 = add i64 %index300, %63
%68 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %num.0.lcssa, i64 %offset.idx303
%wide.load304 = load <2 x i64>, ptr %68, align 8, !tbaa !9
%69 = getelementptr inbounds i64, ptr %68, i64 2
%wide.load305 = load <2 x i64>, ptr %69, align 8, !tbaa !9
%70 = add <2 x i64> %wide.load304, %vec.phi301
%71 = add <2 x i64> %wide.load305, %vec.phi302
%index.next306 = add nuw i64 %index300, 4
%72 = icmp eq i64 %index.next306, %n.vec296
br i1 %72, label %middle.block291, label %vector.body299, !llvm.loop !24
middle.block291: ; preds = %vector.body299
%bin.rdx307 = add <2 x i64> %71, %70
%73 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx307)
%cmp.n298 = icmp eq i64 %67, %n.vec296
br i1 %cmp.n298, label %if.end120, label %for.body106.preheader
for.body106.preheader: ; preds = %for.body106.lr.ph, %middle.block291
%indvars.iv242.ph = phi i64 [ %63, %for.body106.lr.ph ], [ %ind.end, %middle.block291 ]
%anss.0210.ph = phi i64 [ 0, %for.body106.lr.ph ], [ %73, %middle.block291 ]
br label %for.body106
for.body106: ; preds = %for.body106.preheader, %for.body106
%indvars.iv242 = phi i64 [ %indvars.iv.next243, %for.body106 ], [ %indvars.iv242.ph, %for.body106.preheader ]
%anss.0210 = phi i64 [ %add111, %for.body106 ], [ %anss.0210.ph, %for.body106.preheader ]
%arrayidx110 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %num.0.lcssa, i64 %indvars.iv242
%74 = load i64, ptr %arrayidx110, align 8, !tbaa !9
%add111 = add nsw i64 %74, %anss.0210
%indvars.iv.next243 = add nsw i64 %indvars.iv242, 1
%lftr.wideiv = trunc i64 %indvars.iv.next243 to i32
%exitcond245.not = icmp eq i32 %64, %lftr.wideiv
br i1 %exitcond245.not, label %if.end120, label %for.body106, !llvm.loop !25
if.else115: ; preds = %for.end100
%idxprom118 = sext i32 %anum.0.lcssa to i64
%arrayidx119 = getelementptr inbounds [101 x [101 x i64]], ptr %ncm, i64 0, i64 %num.0.lcssa, i64 %idxprom118
%75 = load i64, ptr %arrayidx119, align 8, !tbaa !9
br label %if.end120
if.end120: ; preds = %for.body106, %middle.block291, %for.cond104.preheader, %if.else115
%anss.1 = phi i64 [ %75, %if.else115 ], [ 0, %for.cond104.preheader ], [ %73, %middle.block291 ], [ %add111, %for.body106 ]
%conv = sext i32 %10 to i64
%rem = srem i64 %ans.0.lcssa, %conv
%div = sdiv i64 %ans.0.lcssa, %conv
%cmp121 = icmp eq i64 %rem, 0
br i1 %cmp121, label %if.then123, label %if.else126
if.then123: ; preds = %if.end120
%call125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div, i64 noundef %anss.1)
br label %if.end132
if.else126: ; preds = %if.end120
%conv127 = sitofp i64 %ans.0.lcssa to float
%conv128 = sitofp i32 %10 to float
%div129 = fdiv float %conv127, %conv128
%conv130 = fpext float %div129 to double
%call131 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %conv130, i64 noundef %anss.1)
br label %if.end132
if.end132: ; preds = %if.else126, %if.then123
call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %ncm) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %v) #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 %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !12, !17, !16}
!19 = distinct !{!19, !12, !16, !17}
!20 = distinct !{!20, !12, !17, !16}
!21 = distinct !{!21, !12, !22, !16, !17}
!22 = !{!"llvm.loop.peeled.count", i32 1}
!23 = distinct !{!23, !12}
!24 = distinct !{!24, !12, !16, !17}
!25 = distinct !{!25, !12, !17, !16}
|
#include <stdio.h>
#include <string.h>
int main()
{
char a[11];
char b[11];
char c[11];
scanf("%s %s %s", a, b, c);
int lena = strlen(a);
int lenb = strlen(b);
int lenc = strlen(c);
if(a[lena-1] == b[0] && b[lenb-1] == c[0])
{
printf("YES\n");
} else
{
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136803/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136803/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%s %s %s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [11 x i8], align 1
%b = alloca [11 x i8], align 1
%c = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%sub = shl i64 %call4, 32
%sext = add i64 %sub, -4294967296
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [11 x i8], ptr %a, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%1 = load i8, ptr %b, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #6
%sub15 = shl i64 %call6, 32
%sext25 = add i64 %sub15, -4294967296
%idxprom16 = ashr exact i64 %sext25, 32
%arrayidx17 = getelementptr inbounds [11 x i8], ptr %b, i64 0, i64 %idxprom16
%2 = load i8, ptr %arrayidx17, align 1, !tbaa !5
%3 = load i8, ptr %c, align 1, !tbaa !5
%cmp21 = icmp eq i8 %2, %3
br i1 %cmp21, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(void)
{
char A[10],B[10],C[10];
int a,b;
scanf("%s%s%s",A,B,C);
a = strlen(A);
b = strlen(B);
if((A[a-1] == B[0])&&(B[b-1] == C[0]))
printf("YES\n");
else
printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136847/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136847/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%s%s%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [10 x i8], align 1
%B = alloca [10 x i8], align 1
%C = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %C) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %A) #6
%sub = shl i64 %call4, 32
%sext = add i64 %sub, -4294967296
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [10 x i8], ptr %A, i64 0, i64 %idxprom
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%1 = load i8, ptr %B, align 1, !tbaa !5
%cmp = icmp eq i8 %0, %1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %B) #6
%sub12 = shl i64 %call6, 32
%sext22 = add i64 %sub12, -4294967296
%idxprom13 = ashr exact i64 %sext22, 32
%arrayidx14 = getelementptr inbounds [10 x i8], ptr %B, i64 0, i64 %idxprom13
%2 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%3 = load i8, ptr %C, align 1, !tbaa !5
%cmp18 = icmp eq i8 %2, %3
br i1 %cmp18, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %entry
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %C) #5
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main()
{
char a[102],b[102],c[102];
int s,d,f,g,h,j,k,len;
scanf("%s%s%s",a,b,c);
len=strlen(a);
for(s=0;s<len;s++){
if(s==len-1) {
d= a[s];
}
}
len=strlen(b);
for(j=0;j<len;j++) {
if (j ==0) {
f = b[j];
}
}
len=strlen(b);
for(j=0;j<len;j++) {
if (j==len-1) {
g= b[j];
}}
len=strlen(c);
for(k=0;k<len;k++) {
if (k ==0) {
h=c[k];
}}
if(d==f&&g==h){
printf("YES");
} else{
printf("NO");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136890/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%s%s%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [102 x i8], align 16
%b = alloca [102 x i8], align 16
%c = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %c) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6
%conv = trunc i64 %call4 to i32
%cmp88 = icmp sgt i32 %conv, 0
br i1 %cmp88, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub = add i64 %call4, 4294967295
%0 = and i64 %sub, 4294967295
%wide.trip.count = and i64 %call4, 4294967295
%arrayidx = getelementptr inbounds [102 x i8], ptr %a, i64 0, i64 %0
%1 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %call4, 3
%2 = icmp ult i64 %1, 3
br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.body: ; preds = %for.inc.3, %for.body.lr.ph.new
%indvars.iv = phi i64 [ 0, %for.body.lr.ph.new ], [ %indvars.iv.next.3, %for.inc.3 ]
%d.090 = phi i32 [ undef, %for.body.lr.ph.new ], [ %d.1.3, %for.inc.3 ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.inc.3 ]
%cmp6 = icmp eq i64 %indvars.iv, %0
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body
%3 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv8 = sext i8 %3 to i32
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%d.1 = phi i32 [ %conv8, %if.then ], [ %d.090, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%cmp6.1 = icmp eq i64 %indvars.iv.next, %0
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%4 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv8.1 = sext i8 %4 to i32
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%d.1.1 = phi i32 [ %conv8.1, %if.then.1 ], [ %d.1, %for.inc ]
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%cmp6.2 = icmp eq i64 %indvars.iv.next.1, %0
br i1 %cmp6.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
%5 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv8.2 = sext i8 %5 to i32
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%d.1.2 = phi i32 [ %conv8.2, %if.then.2 ], [ %d.1.1, %for.inc.1 ]
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%cmp6.3 = icmp eq i64 %indvars.iv.next.2, %0
br i1 %cmp6.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
%6 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv8.3 = sext i8 %6 to i32
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%d.1.3 = phi i32 [ %conv8.3, %if.then.3 ], [ %d.1.2, %for.inc.2 ]
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8
for.end.loopexit.unr-lcssa: ; preds = %for.inc.3, %for.body.lr.ph
%indvars.iv.unr = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next.3, %for.inc.3 ]
%d.090.unr = phi i32 [ undef, %for.body.lr.ph ], [ %d.1.3, %for.inc.3 ]
%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.inc.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.inc.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%d.090.epil = phi i32 [ %d.1.epil, %for.inc.epil ], [ %d.090.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.inc.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%cmp6.epil = icmp eq i64 %indvars.iv.epil, %0
br i1 %cmp6.epil, label %if.then.epil, label %for.inc.epil
if.then.epil: ; preds = %for.body.epil
%7 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv8.epil = sext i8 %7 to i32
br label %for.inc.epil
for.inc.epil: ; preds = %if.then.epil, %for.body.epil
%d.1.epil = phi i32 [ %conv8.epil, %if.then.epil ], [ %d.090.epil, %for.body.epil ]
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !10
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.inc.epil, %entry
%d.0.lcssa = phi i32 [ undef, %entry ], [ %d.090.unr, %for.end.loopexit.unr-lcssa ], [ %d.1.epil, %for.inc.epil ]
%call10 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #6
%conv11 = trunc i64 %call10 to i32
%cmp1391 = icmp sgt i32 %conv11, 0
br i1 %cmp1391, label %for.body15.lr.ph, label %for.end43
for.body15.lr.ph: ; preds = %for.end
%8 = load i8, ptr %b, align 16
%conv21 = sext i8 %8 to i32
%sub33 = add i64 %call10, 4294967295
%9 = and i64 %sub33, 4294967295
%wide.trip.count109 = and i64 %call10, 4294967295
%arrayidx38 = getelementptr inbounds [102 x i8], ptr %b, i64 0, i64 %9
%10 = add nsw i64 %wide.trip.count109, -1
%xtraiter120 = and i64 %call10, 3
%11 = icmp ult i64 %10, 3
br i1 %11, label %for.end43.loopexit.unr-lcssa, label %for.body15.lr.ph.new
for.body15.lr.ph.new: ; preds = %for.body15.lr.ph
%unroll_iter124 = sub nsw i64 %wide.trip.count109, %xtraiter120
br label %for.body32
for.body32: ; preds = %for.inc41.3, %for.body15.lr.ph.new
%indvars.iv106 = phi i64 [ 0, %for.body15.lr.ph.new ], [ %indvars.iv.next107.3, %for.inc41.3 ]
%g.096 = phi i32 [ undef, %for.body15.lr.ph.new ], [ %g.1.3, %for.inc41.3 ]
%niter125 = phi i64 [ 0, %for.body15.lr.ph.new ], [ %niter125.next.3, %for.inc41.3 ]
%cmp34 = icmp eq i64 %indvars.iv106, %9
br i1 %cmp34, label %if.then36, label %for.inc41
if.then36: ; preds = %for.body32
%12 = load i8, ptr %arrayidx38, align 1, !tbaa !5
%conv39 = sext i8 %12 to i32
br label %for.inc41
for.inc41: ; preds = %for.body32, %if.then36
%g.1 = phi i32 [ %conv39, %if.then36 ], [ %g.096, %for.body32 ]
%indvars.iv.next107 = or i64 %indvars.iv106, 1
%cmp34.1 = icmp eq i64 %indvars.iv.next107, %9
br i1 %cmp34.1, label %if.then36.1, label %for.inc41.1
if.then36.1: ; preds = %for.inc41
%13 = load i8, ptr %arrayidx38, align 1, !tbaa !5
%conv39.1 = sext i8 %13 to i32
br label %for.inc41.1
for.inc41.1: ; preds = %if.then36.1, %for.inc41
%g.1.1 = phi i32 [ %conv39.1, %if.then36.1 ], [ %g.1, %for.inc41 ]
%indvars.iv.next107.1 = or i64 %indvars.iv106, 2
%cmp34.2 = icmp eq i64 %indvars.iv.next107.1, %9
br i1 %cmp34.2, label %if.then36.2, label %for.inc41.2
if.then36.2: ; preds = %for.inc41.1
%14 = load i8, ptr %arrayidx38, align 1, !tbaa !5
%conv39.2 = sext i8 %14 to i32
br label %for.inc41.2
for.inc41.2: ; preds = %if.then36.2, %for.inc41.1
%g.1.2 = phi i32 [ %conv39.2, %if.then36.2 ], [ %g.1.1, %for.inc41.1 ]
%indvars.iv.next107.2 = or i64 %indvars.iv106, 3
%cmp34.3 = icmp eq i64 %indvars.iv.next107.2, %9
br i1 %cmp34.3, label %if.then36.3, label %for.inc41.3
if.then36.3: ; preds = %for.inc41.2
%15 = load i8, ptr %arrayidx38, align 1, !tbaa !5
%conv39.3 = sext i8 %15 to i32
br label %for.inc41.3
for.inc41.3: ; preds = %if.then36.3, %for.inc41.2
%g.1.3 = phi i32 [ %conv39.3, %if.then36.3 ], [ %g.1.2, %for.inc41.2 ]
%indvars.iv.next107.3 = add nuw nsw i64 %indvars.iv106, 4
%niter125.next.3 = add i64 %niter125, 4
%niter125.ncmp.3 = icmp eq i64 %niter125.next.3, %unroll_iter124
br i1 %niter125.ncmp.3, label %for.end43.loopexit.unr-lcssa, label %for.body32, !llvm.loop !12
for.end43.loopexit.unr-lcssa: ; preds = %for.inc41.3, %for.body15.lr.ph
%indvars.iv106.unr = phi i64 [ 0, %for.body15.lr.ph ], [ %indvars.iv.next107.3, %for.inc41.3 ]
%g.096.unr = phi i32 [ undef, %for.body15.lr.ph ], [ %g.1.3, %for.inc41.3 ]
%lcmp.mod122.not = icmp eq i64 %xtraiter120, 0
br i1 %lcmp.mod122.not, label %for.end43, label %for.body32.epil
for.body32.epil: ; preds = %for.end43.loopexit.unr-lcssa, %for.inc41.epil
%indvars.iv106.epil = phi i64 [ %indvars.iv.next107.epil, %for.inc41.epil ], [ %indvars.iv106.unr, %for.end43.loopexit.unr-lcssa ]
%g.096.epil = phi i32 [ %g.1.epil, %for.inc41.epil ], [ %g.096.unr, %for.end43.loopexit.unr-lcssa ]
%epil.iter121 = phi i64 [ %epil.iter121.next, %for.inc41.epil ], [ 0, %for.end43.loopexit.unr-lcssa ]
%cmp34.epil = icmp eq i64 %indvars.iv106.epil, %9
br i1 %cmp34.epil, label %if.then36.epil, label %for.inc41.epil
if.then36.epil: ; preds = %for.body32.epil
%16 = load i8, ptr %arrayidx38, align 1, !tbaa !5
%conv39.epil = sext i8 %16 to i32
br label %for.inc41.epil
for.inc41.epil: ; preds = %if.then36.epil, %for.body32.epil
%g.1.epil = phi i32 [ %conv39.epil, %if.then36.epil ], [ %g.096.epil, %for.body32.epil ]
%indvars.iv.next107.epil = add nuw nsw i64 %indvars.iv106.epil, 1
%epil.iter121.next = add i64 %epil.iter121, 1
%epil.iter121.cmp.not = icmp eq i64 %epil.iter121.next, %xtraiter120
br i1 %epil.iter121.cmp.not, label %for.end43, label %for.body32.epil, !llvm.loop !13
for.end43: ; preds = %for.end43.loopexit.unr-lcssa, %for.inc41.epil, %for.end
%f.0.lcssa114 = phi i32 [ undef, %for.end ], [ %conv21, %for.inc41.epil ], [ %conv21, %for.end43.loopexit.unr-lcssa ]
%g.0.lcssa = phi i32 [ undef, %for.end ], [ %g.096.unr, %for.end43.loopexit.unr-lcssa ], [ %g.1.epil, %for.inc41.epil ]
%call45 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %c) #6
%conv46 = trunc i64 %call45 to i32
%cmp4899 = icmp sgt i32 %conv46, 0
%17 = load i8, ptr %c, align 16
%conv56 = sext i8 %17 to i32
%cmp61 = icmp eq i32 %d.0.lcssa, %f.0.lcssa114
%cmp63118 = icmp eq i32 %g.0.lcssa, %conv56
%cmp63 = select i1 %cmp4899, i1 %cmp63118, i1 undef
%or.cond = select i1 %cmp61, i1 %cmp63, i1 false
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !11}
|
#include <stdio.h>
int main(){
char a[10], b[10], c[10];
int i=0, j=0;
scanf("%s %s %s", a, b, c);
while(a[i] != '\0'){
i++;
}
while(b[j] != '\0'){
j++;
}
if(a[i-1] == b[0] && b[j-1] == c[0])
printf("YES\n");
else
printf("NO\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_136933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_136933/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%s %s %s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [10 x i8], align 1
%b = alloca [10 x i8], align 1
%c = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10 x i8], ptr %a, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.cond4, label %while.cond, !llvm.loop !8
while.cond4: ; preds = %while.cond, %while.cond4
%indvars.iv36 = phi i64 [ %indvars.iv.next37, %while.cond4 ], [ 0, %while.cond ]
%arrayidx6 = getelementptr inbounds [10 x i8], ptr %b, i64 0, i64 %indvars.iv36
%1 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%cmp8.not = icmp eq i8 %1, 0
%indvars.iv.next37 = add nuw i64 %indvars.iv36, 1
br i1 %cmp8.not, label %while.end12, label %while.cond4, !llvm.loop !10
while.end12: ; preds = %while.cond4
%sub = shl i64 %indvars.iv, 32
%sext = add i64 %sub, -4294967296
%idxprom13 = ashr exact i64 %sext, 32
%arrayidx14 = getelementptr inbounds [10 x i8], ptr %a, i64 0, i64 %idxprom13
%2 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%3 = load i8, ptr %b, align 1, !tbaa !5
%cmp18 = icmp eq i8 %2, %3
br i1 %cmp18, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %while.end12
%sub20 = shl i64 %indvars.iv36, 32
%sext39 = add i64 %sub20, -4294967296
%idxprom21 = ashr exact i64 %sext39, 32
%arrayidx22 = getelementptr inbounds [10 x i8], ptr %b, i64 0, i64 %idxprom21
%4 = load i8, ptr %arrayidx22, align 1, !tbaa !5
%5 = load i8, ptr %c, align 1, !tbaa !5
%cmp26 = icmp eq i8 %4, %5
br i1 %cmp26, label %if.end, label %if.else
if.else: ; preds = %land.lhs.true, %while.end12
br label %if.end
if.end: ; preds = %land.lhs.true, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.