Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char s[100];
int count,flg=0,counthoji;
char tmp;
char ans[]="KIHBR";
scanf("%s",s);
for(count=0;s[count]!='\0';count++){
if(s[count]=='A'&&s[count+1]=='A'){
printf("NO");
return 0;
}
if(s[count-1]=='I'&&s[count]=='A'&&s[count+1]=='H'){
printf("NO");
return 0;
}
if(s[count-1]=='K'&&s[count]=='A'&&s[count+1]=='I'){
printf("NO");
return 0;
}
}
for(;;){
flg=0;
for(count=0;s[count]!='\0';count++){
if(s[count]=='A'){s[count]='0';flg=1;counthoji=count;break;}
}
if(flg==0){break;}
for(count=counthoji;;count++){
s[count]=s[count+1];
if(s[count]=='\0'){break;}
}
}
if(strcmp(s,ans) == 0){printf("YES");}
else{printf("NO");}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239094/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239094/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.ans = private unnamed_addr constant [6 x i8] c"KIHBR\00", align 1
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 0, label %for.cond57
i8 65, label %land.lhs.true
]
land.lhs.true: ; preds = %for.cond
%1 = add i64 %indvars.iv, 1
%idxprom7 = and i64 %1, 4294967295
%arrayidx8 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom7
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10 = icmp eq i8 %2, 65
br i1 %cmp10, label %cleanup, label %if.end.thread
if.end.thread: ; preds = %land.lhs.true
%3 = add nsw i64 %indvars.iv, -1
%arrayidx14131 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %3
%4 = load i8, ptr %arrayidx14131, align 1, !tbaa !5
switch i8 %4, label %for.inc [
i8 73, label %land.lhs.true24
i8 75, label %land.lhs.true46
]
land.lhs.true24: ; preds = %if.end.thread
%arrayidx27 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom7
%5 = load i8, ptr %arrayidx27, align 1, !tbaa !5
%cmp29 = icmp eq i8 %5, 72
br i1 %cmp29, label %cleanup, label %for.inc
land.lhs.true46: ; preds = %if.end.thread
%arrayidx49 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom7
%6 = load i8, ptr %arrayidx49, align 1, !tbaa !5
%cmp51 = icmp eq i8 %6, 73
br i1 %cmp51, label %cleanup, label %for.inc
for.inc: ; preds = %for.cond, %if.end.thread, %land.lhs.true24, %land.lhs.true46
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !8
for.cond57: ; preds = %for.cond, %for.cond57.backedge
%indvars.iv149 = phi i64 [ %indvars.iv149.be, %for.cond57.backedge ], [ 0, %for.cond ]
%arrayidx59 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv149
%7 = load i8, ptr %arrayidx59, align 1, !tbaa !5
switch i8 %7, label %for.inc73 [
i8 0, label %for.end96
i8 65, label %for.end75
]
for.inc73: ; preds = %for.cond57
%indvars.iv.next150 = add nuw i64 %indvars.iv149, 1
br label %for.cond57.backedge
for.cond57.backedge: ; preds = %for.cond80, %for.inc73
%indvars.iv149.be = phi i64 [ %indvars.iv.next150, %for.inc73 ], [ 0, %for.cond80 ]
br label %for.cond57, !llvm.loop !10
for.end75: ; preds = %for.cond57
%arrayidx59.le = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv149
store i8 48, ptr %arrayidx59.le, align 1, !tbaa !5
br label %for.cond80
for.cond80: ; preds = %for.end75, %for.cond80
%indvars.iv153 = phi i64 [ %indvars.iv149, %for.end75 ], [ %indvars.iv.next154, %for.cond80 ]
%indvars.iv.next154 = add nuw i64 %indvars.iv153, 1
%arrayidx83 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next154
%8 = load i8, ptr %arrayidx83, align 1, !tbaa !5
%arrayidx85 = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv153
store i8 %8, ptr %arrayidx85, align 1, !tbaa !5
%cmp89 = icmp eq i8 %8, 0
br i1 %cmp89, label %for.cond57.backedge, label %for.cond80
for.end96: ; preds = %for.cond57
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %s, ptr noundef nonnull dereferenceable(6) @__const.main.ans, i64 6)
%cmp100 = icmp eq i32 %bcmp, 0
%.str.2..str.1 = select i1 %cmp100, ptr @.str.2, ptr @.str.1
br label %cleanup
cleanup: ; preds = %land.lhs.true46, %land.lhs.true24, %land.lhs.true, %for.end96
%.str.2.sink = phi ptr [ %.str.2..str.1, %for.end96 ], [ @.str.1, %land.lhs.true ], [ @.str.1, %land.lhs.true24 ], [ @.str.1, %land.lhs.true46 ]
%call103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include <stdio.h>
#include <math.h>
double area(double a,double b, double c);
int main(){
int i,n = 0;
double x[20];
double y[20];
double a,b,c,s = 0;
while(scanf("%lf,%lf",&x[n],&y[n])!=EOF){
n++;
}
for(i=1;i<n-1;i++){
a = sqrt( (x[0]-x[i])*(x[0]-x[i]) + (y[0]-y[i])*(y[0]-y[i]) );
b = sqrt( (x[0]-x[i+1])*(x[0]-x[i+1]) + (y[0]-y[i+1])*(y[0]-y[i+1]) );
c = sqrt( (x[i+1]-x[i])*(x[i+1]-x[i]) + (y[i+1]-y[i])*(y[i+1]-y[i]) );
s += area(a,b,c);
}
printf("%f\n",s);
return 0;
}
double area(double a,double b, double c){
double z = (a+b+c)/2;
return sqrt(z*(z-a)*(z-b)*(z-c));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239151/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239151/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [20 x double], align 16
%y = alloca [20 x double], align 16
call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %y) #7
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv103 = phi i32 [ %indvars.iv.next104, %while.cond ], [ -1, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x double], ptr %x, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [20 x double], ptr %y, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%cmp.not = icmp eq i32 %call, -1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next104 = add nsw i32 %indvars.iv103, 1
br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !5
for.cond.preheader: ; preds = %while.cond
%0 = trunc i64 %indvars.iv to i32
%cmp396 = icmp ugt i32 %0, 2
br i1 %cmp396, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = zext i32 %indvars.iv103 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv100 = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next101, %for.body ]
%s.098 = phi double [ 0.000000e+00, %for.body.preheader ], [ %add70, %for.body ]
%1 = load double, ptr %x, align 16, !tbaa !7
%arrayidx6 = getelementptr inbounds [20 x double], ptr %x, i64 0, i64 %indvars.iv100
%2 = load double, ptr %y, align 16, !tbaa !7
%arrayidx14 = getelementptr inbounds [20 x double], ptr %y, i64 0, i64 %indvars.iv100
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%3 = load <2 x double>, ptr %arrayidx6, align 8, !tbaa !7
%4 = extractelement <2 x double> %3, i64 0
%sub7 = fsub double %1, %4
%5 = load <2 x double>, ptr %arrayidx14, align 8, !tbaa !7
%6 = extractelement <2 x double> %5, i64 0
%sub15 = fsub double %2, %6
%mul20 = fmul double %sub15, %sub15
%7 = call double @llvm.fmuladd.f64(double %sub7, double %sub7, double %mul20)
%sqrt95 = call double @llvm.sqrt.f64(double %7)
%8 = shufflevector <2 x double> %3, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%9 = insertelement <2 x double> %8, double %1, i64 1
%10 = fsub <2 x double> %9, %3
%11 = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%12 = insertelement <2 x double> %11, double %2, i64 1
%13 = fsub <2 x double> %12, %5
%14 = fmul <2 x double> %13, %13
%15 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %10, <2 x double> %10, <2 x double> %14)
%16 = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %15)
%17 = extractelement <2 x double> %16, i64 1
%add.i = fadd double %sqrt95, %17
%18 = extractelement <2 x double> %16, i64 0
%add1.i = fadd double %add.i, %18
%div.i = fmul double %add1.i, 5.000000e-01
%sub.i = fsub double %div.i, %sqrt95
%mul.i = fmul double %div.i, %sub.i
%19 = insertelement <2 x double> poison, double %div.i, i64 0
%20 = shufflevector <2 x double> %19, <2 x double> poison, <2 x i32> zeroinitializer
%21 = fsub <2 x double> %20, %16
%22 = extractelement <2 x double> %21, i64 1
%mul3.i = fmul double %22, %mul.i
%23 = extractelement <2 x double> %21, i64 0
%mul5.i = fmul double %23, %mul3.i
%call.i = call double @sqrt(double noundef %mul5.i) #7
%add70 = fadd double %s.098, %call.i
%exitcond.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %for.cond.preheader
%s.0.lcssa = phi double [ 0.000000e+00, %for.cond.preheader ], [ %add70, %for.body ]
%call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %s.0.lcssa)
call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %y) #7
call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %x) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local double @area(double noundef %a, double noundef %b, double noundef %c) local_unnamed_addr #5 {
entry:
%add = fadd double %a, %b
%add1 = fadd double %add, %c
%div = fmul double %add1, 5.000000e-01
%sub = fsub double %div, %a
%mul = fmul double %div, %sub
%sub2 = fsub double %div, %b
%mul3 = fmul double %sub2, %mul
%sub4 = fsub double %div, %c
%mul5 = fmul double %sub4, %mul3
%call = tail call double @sqrt(double noundef %mul5) #7
ret double %call
}
; 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 double @llvm.sqrt.f64(double) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
int main(){
int i,n;
double dx[21],dy[21];
double x,y,sum=0;
for(n=0;~scanf("%lf,%lf",&dx[n],&dy[n]);n++);
dx[n]=dx[0];
dy[n]=dy[0];
for (i=0;i<n;i++)
sum+=(dx[i]-dx[i+1])*(dy[i]+dy[i+1]);
printf("%f\n",sum/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239209/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239209/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dx = alloca [21 x double], align 16
%dy = alloca [21 x double], align 16
call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %dx) #4
call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %dy) #4
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv43 = phi i32 [ %indvars.iv.next44, %for.cond ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [21 x double], ptr %dx, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [21 x double], ptr %dy, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%tobool.not = icmp eq i32 %call, -1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next44 = add nuw i32 %indvars.iv43, 1
br i1 %tobool.not, label %for.end, label %for.cond, !llvm.loop !5
for.end: ; preds = %for.cond
%0 = load double, ptr %dx, align 16, !tbaa !7
store double %0, ptr %arrayidx, align 8, !tbaa !7
%1 = load double, ptr %dy, align 16, !tbaa !7
store double %1, ptr %arrayidx2, align 8, !tbaa !7
%2 = and i64 %indvars.iv, 4294967295
%cmp36.not = icmp eq i64 %2, 0
br i1 %cmp36.not, label %for.end23, label %for.body10.preheader
for.body10.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %indvars.iv43 to i64
%.pre = load double, ptr %dx, align 16, !tbaa !7
%.pre45 = load double, ptr %dy, align 16, !tbaa !7
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i32 %indvars.iv43, 1
br i1 %3, label %for.end23.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body10
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%4 = phi double [ %.pre45, %for.body10.preheader.new ], [ %10, %for.body10 ]
%5 = phi double [ %.pre, %for.body10.preheader.new ], [ %9, %for.body10 ]
%indvars.iv40 = phi i64 [ 0, %for.body10.preheader.new ], [ %indvars.iv.next41.1, %for.body10 ]
%sum.038 = phi double [ 0.000000e+00, %for.body10.preheader.new ], [ %11, %for.body10 ]
%niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.1, %for.body10 ]
%indvars.iv.next41 = or i64 %indvars.iv40, 1
%arrayidx14 = getelementptr inbounds [21 x double], ptr %dx, i64 0, i64 %indvars.iv.next41
%6 = load double, ptr %arrayidx14, align 8, !tbaa !7
%sub = fsub double %5, %6
%arrayidx19 = getelementptr inbounds [21 x double], ptr %dy, i64 0, i64 %indvars.iv.next41
%7 = load double, ptr %arrayidx19, align 8, !tbaa !7
%add20 = fadd double %4, %7
%8 = call double @llvm.fmuladd.f64(double %sub, double %add20, double %sum.038)
%indvars.iv.next41.1 = add nuw nsw i64 %indvars.iv40, 2
%arrayidx14.1 = getelementptr inbounds [21 x double], ptr %dx, i64 0, i64 %indvars.iv.next41.1
%9 = load double, ptr %arrayidx14.1, align 16, !tbaa !7
%sub.1 = fsub double %6, %9
%arrayidx19.1 = getelementptr inbounds [21 x double], ptr %dy, i64 0, i64 %indvars.iv.next41.1
%10 = load double, ptr %arrayidx19.1, align 16, !tbaa !7
%add20.1 = fadd double %7, %10
%11 = call double @llvm.fmuladd.f64(double %sub.1, double %add20.1, double %8)
%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.end23.loopexit.unr-lcssa.loopexit, label %for.body10, !llvm.loop !11
for.end23.loopexit.unr-lcssa.loopexit: ; preds = %for.body10
%12 = add nuw nsw i64 %indvars.iv40, 3
br label %for.end23.loopexit.unr-lcssa
for.end23.loopexit.unr-lcssa: ; preds = %for.end23.loopexit.unr-lcssa.loopexit, %for.body10.preheader
%.lcssa.ph = phi double [ undef, %for.body10.preheader ], [ %11, %for.end23.loopexit.unr-lcssa.loopexit ]
%.unr = phi double [ %.pre45, %for.body10.preheader ], [ %10, %for.end23.loopexit.unr-lcssa.loopexit ]
%.unr46 = phi double [ %.pre, %for.body10.preheader ], [ %9, %for.end23.loopexit.unr-lcssa.loopexit ]
%indvars.iv40.unr = phi i64 [ 1, %for.body10.preheader ], [ %12, %for.end23.loopexit.unr-lcssa.loopexit ]
%sum.038.unr = phi double [ 0.000000e+00, %for.body10.preheader ], [ %11, %for.end23.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end23.loopexit, label %for.body10.epil
for.body10.epil: ; preds = %for.end23.loopexit.unr-lcssa
%arrayidx14.epil = getelementptr inbounds [21 x double], ptr %dx, i64 0, i64 %indvars.iv40.unr
%13 = load double, ptr %arrayidx14.epil, align 8, !tbaa !7
%sub.epil = fsub double %.unr46, %13
%arrayidx19.epil = getelementptr inbounds [21 x double], ptr %dy, i64 0, i64 %indvars.iv40.unr
%14 = load double, ptr %arrayidx19.epil, align 8, !tbaa !7
%add20.epil = fadd double %.unr, %14
%15 = call double @llvm.fmuladd.f64(double %sub.epil, double %add20.epil, double %sum.038.unr)
br label %for.end23.loopexit
for.end23.loopexit: ; preds = %for.end23.loopexit.unr-lcssa, %for.body10.epil
%.lcssa = phi double [ %.lcssa.ph, %for.end23.loopexit.unr-lcssa ], [ %15, %for.body10.epil ]
%16 = fmul double %.lcssa, 5.000000e-01
br label %for.end23
for.end23: ; preds = %for.end23.loopexit, %for.end
%sum.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ %16, %for.end23.loopexit ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %sum.0.lcssa)
call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %dy) #4
call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %dx) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
int main(){
int n,x;
scanf("%d%d",&n,&x);
int sum=0,num,i;
for(i=0;i<n;i++){
scanf("%d",&num);
sum=sum+num;
}
if((sum+n-1)!=x){
printf("NO\n");
}
else
{
printf("YES\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.4 = 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
%num = 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 %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.011 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%sum.010 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %num)
%1 = load i32, ptr %num, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.010
%inc = add nuw nsw i32 %i.011, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%3 = add i32 %add, -1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sum.0.lcssa = phi i32 [ -1, %entry ], [ %3, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %2, %for.end.loopexit ]
%sub = add i32 %sum.0.lcssa, %.lcssa
%4 = load i32, ptr %x, align 4, !tbaa !5
%cmp3.not = icmp eq i32 %sub, %4
%str.str.4 = select i1 %cmp3.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.end.p0(i64 4, 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int n,t,i;
scanf("%d %d",&n,&t);
int a[n];
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
int count=0;
for(i=1;i<=n;i++){
count+=86400-a[i-1];
if(count>=t){
printf("%d\n",i);
return 0;
}
}
printf("%d\n",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_23931/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_23931/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = 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 %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t)
%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
%cmp26 = icmp sgt i32 %3, 0
br i1 %cmp26, label %for.body, label %cleanup
for.cond2.preheader: ; preds = %for.body
%cmp3.not28 = icmp slt i32 %6, 1
br i1 %cmp3.not28, label %cleanup, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%4 = load i32, ptr %t, align 4, !tbaa !5
%5 = add nuw i32 %6, 1
%wide.trip.count = zext i32 %5 to i64
%invariant.gep = getelementptr i32, ptr %vla, i64 -1
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.lr.ph, %for.inc10
%indvars.iv34 = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next35, %for.inc10 ]
%count.030 = phi i32 [ 0, %for.body4.lr.ph ], [ %add, %for.inc10 ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv34
%8 = load i32, ptr %gep, align 4, !tbaa !5
%reass.sub = sub i32 %count.030, %8
%add = add i32 %reass.sub, 86400
%cmp8.not = icmp slt i32 %add, %4
br i1 %cmp8.not, label %for.inc10, label %if.then
if.then: ; preds = %for.body4
%9 = trunc i64 %indvars.iv34 to i32
br label %cleanup
for.inc10: ; preds = %for.body4
%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 %cleanup, label %for.body4, !llvm.loop !11
cleanup: ; preds = %for.inc10, %for.cond2.preheader, %entry, %if.then
%.lcssa40.sink = phi i32 [ %9, %if.then ], [ %6, %for.cond2.preheader ], [ %3, %entry ], [ %6, %for.inc10 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.lcssa40.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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}
|
#include<stdio.h>
#define M 100000000
int main(){
int n,m,i,j,k,l;
int d[21][21];
scanf("%d %d",&n,&m);
for(i=0;i<21*21;i++)d[i/21][i%21]=M;
while(m--){
scanf("%d,%d,%d,%d",&i,&j,&k,&l);
d[i][j]=k;
d[j][i]=l;
d[i][i]=d[j][j]=0;
}
for(k=1;k<=n;k++){
for(j=1;j<=n;j++){
for(i=1;i<=n;i++){
if(d[i][j]>d[i][k]+d[k][j])d[i][j]=d[i][k]+d[k][j];
}
}
}
scanf("%d,%d,%d,%d",&i,&j,&k,&l);
printf("%d\n",k-d[i][j]-d[j][i]-l);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239353/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239353/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
; 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
%i = alloca i32, align 4
%j = alloca i32, align 4
%k = alloca i32, align 4
%l = alloca i32, align 4
%d = alloca [21 x [21 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 1764, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
br label %vector.body
vector.body: ; preds = %vector.body.1, %entry
%index = phi i32 [ 0, %entry ], [ %index.next.1, %vector.body.1 ]
%0 = udiv i32 %index, 21
%1 = zext i32 %0 to i64
%2 = urem i32 %index, 21
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %1, i64 %3
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %4, align 4, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %5, align 4, !tbaa !5
%index.next = or i32 %index, 8
%6 = icmp eq i32 %index.next, 440
br i1 %6, label %for.body, label %vector.body.1, !llvm.loop !9
vector.body.1: ; preds = %vector.body
%7 = udiv i32 %index.next, 21
%8 = zext i32 %7 to i64
%9 = urem i32 %index.next, 21
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %8, i64 %10
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %11, align 4, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
store <4 x i32> <i32 100000000, i32 100000000, i32 100000000, i32 100000000>, ptr %12, align 4, !tbaa !5
%index.next.1 = add nuw nsw i32 %index, 16
br label %vector.body
for.body: ; preds = %vector.body
%arrayidx2 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 20, i64 20
store i32 100000000, ptr %arrayidx2, align 16, !tbaa !5
store i32 441, ptr %i, align 4, !tbaa !5
%13 = load i32, ptr %m, align 4, !tbaa !5
%dec85 = add nsw i32 %13, -1
store i32 %dec85, ptr %m, align 4, !tbaa !5
%tobool.not86 = icmp eq i32 %13, 0
br i1 %tobool.not86, label %for.cond20.preheader, label %while.body
for.cond20.preheader: ; preds = %while.body, %for.body
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp21.not93 = icmp slt i32 %14, 1
br i1 %cmp21.not93, label %for.end63, label %for.cond23.preheader.preheader
for.cond23.preheader.preheader: ; preds = %for.cond20.preheader
%15 = add nuw i32 %14, 1
%wide.trip.count107 = zext i32 %15 to i64
%16 = add nsw i64 %wide.trip.count107, -1
%xtraiter = and i64 %16, 1
%17 = icmp eq i32 %15, 2
%unroll_iter = and i64 %16, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond23.preheader
while.body: ; preds = %for.body, %while.body
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i, ptr noundef nonnull %j, ptr noundef nonnull %k, ptr noundef nonnull %l)
%18 = load i32, ptr %k, align 4, !tbaa !5
%19 = load i32, ptr %i, align 4, !tbaa !5
%idxprom4 = sext i32 %19 to i64
%20 = load i32, ptr %j, align 4, !tbaa !5
%idxprom6 = sext i32 %20 to i64
%arrayidx7 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %idxprom4, i64 %idxprom6
store i32 %18, ptr %arrayidx7, align 4, !tbaa !5
%21 = load i32, ptr %l, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %idxprom6, i64 %idxprom4
store i32 %21, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx15 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %idxprom6, i64 %idxprom6
store i32 0, ptr %arrayidx15, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %idxprom4, i64 %idxprom4
store i32 0, ptr %arrayidx19, align 4, !tbaa !5
%22 = load i32, ptr %m, align 4, !tbaa !5
%dec = add nsw i32 %22, -1
store i32 %dec, ptr %m, align 4, !tbaa !5
%tobool.not = icmp eq i32 %22, 0
br i1 %tobool.not, label %for.cond20.preheader, label %while.body, !llvm.loop !13
for.cond23.preheader: ; preds = %for.cond23.preheader.preheader, %for.cond23.for.inc61_crit_edge.split
%indvars.iv104 = phi i64 [ 1, %for.cond23.preheader.preheader ], [ %indvars.iv.next105, %for.cond23.for.inc61_crit_edge.split ]
br label %for.cond26.preheader
for.cond26.preheader: ; preds = %for.cond23.preheader, %for.cond26.for.inc58_crit_edge
%indvars.iv99 = phi i64 [ 1, %for.cond23.preheader ], [ %indvars.iv.next100, %for.cond26.for.inc58_crit_edge ]
%arrayidx40 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv104, i64 %indvars.iv99
br i1 %17, label %for.cond26.for.inc58_crit_edge.unr-lcssa, label %for.body28
for.body28: ; preds = %for.cond26.preheader, %for.body28
%indvars.iv = phi i64 [ %indvars.iv.next.1, %for.body28 ], [ 1, %for.cond26.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body28 ], [ 0, %for.cond26.preheader ]
%arrayidx32 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv, i64 %indvars.iv99
%23 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%arrayidx36 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv, i64 %indvars.iv104
%24 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%add = add nsw i32 %25, %24
%spec.store.select = call i32 @llvm.smin.i32(i32 %23, i32 %add)
store i32 %spec.store.select, ptr %arrayidx32, align 4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx32.1 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv.next, i64 %indvars.iv99
%26 = load i32, ptr %arrayidx32.1, align 4, !tbaa !5
%arrayidx36.1 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv.next, i64 %indvars.iv104
%27 = load i32, ptr %arrayidx36.1, align 4, !tbaa !5
%28 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%add.1 = add nsw i32 %28, %27
%spec.store.select.1 = call i32 @llvm.smin.i32(i32 %26, i32 %add.1)
store i32 %spec.store.select.1, ptr %arrayidx32.1, align 4
%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.cond26.for.inc58_crit_edge.unr-lcssa, label %for.body28, !llvm.loop !14
for.cond26.for.inc58_crit_edge.unr-lcssa: ; preds = %for.body28, %for.cond26.preheader
%indvars.iv.unr = phi i64 [ 1, %for.cond26.preheader ], [ %indvars.iv.next.1, %for.body28 ]
br i1 %lcmp.mod.not, label %for.cond26.for.inc58_crit_edge, label %for.body28.epil
for.body28.epil: ; preds = %for.cond26.for.inc58_crit_edge.unr-lcssa
%arrayidx32.epil = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv.unr, i64 %indvars.iv99
%29 = load i32, ptr %arrayidx32.epil, align 4, !tbaa !5
%arrayidx36.epil = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %indvars.iv.unr, i64 %indvars.iv104
%30 = load i32, ptr %arrayidx36.epil, align 4, !tbaa !5
%31 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%add.epil = add nsw i32 %31, %30
%spec.store.select.epil = call i32 @llvm.smin.i32(i32 %29, i32 %add.epil)
store i32 %spec.store.select.epil, ptr %arrayidx32.epil, align 4
br label %for.cond26.for.inc58_crit_edge
for.cond26.for.inc58_crit_edge: ; preds = %for.cond26.for.inc58_crit_edge.unr-lcssa, %for.body28.epil
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count107
br i1 %exitcond103.not, label %for.cond23.for.inc61_crit_edge.split, label %for.cond26.preheader, !llvm.loop !15
for.cond23.for.inc61_crit_edge.split: ; preds = %for.cond26.for.inc58_crit_edge
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%exitcond108.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count107
br i1 %exitcond108.not, label %for.cond20.for.end63_crit_edge.split, label %for.cond23.preheader, !llvm.loop !16
for.cond20.for.end63_crit_edge.split: ; preds = %for.cond23.for.inc61_crit_edge.split
store i32 %15, ptr %i, align 4, !tbaa !5
store i32 %15, ptr %j, align 4, !tbaa !5
br label %for.end63
for.end63: ; preds = %for.cond20.for.end63_crit_edge.split, %for.cond20.preheader
%storemerge77.lcssa = phi i32 [ %15, %for.cond20.for.end63_crit_edge.split ], [ 1, %for.cond20.preheader ]
store i32 %storemerge77.lcssa, ptr %k, align 4, !tbaa !5
%call64 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i, ptr noundef nonnull %j, ptr noundef nonnull %k, ptr noundef nonnull %l)
%32 = load i32, ptr %k, align 4, !tbaa !5
%33 = load i32, ptr %i, align 4, !tbaa !5
%idxprom65 = sext i32 %33 to i64
%34 = load i32, ptr %j, align 4, !tbaa !5
%idxprom67 = sext i32 %34 to i64
%arrayidx68 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %idxprom65, i64 %idxprom67
%35 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%arrayidx72 = getelementptr inbounds [21 x [21 x i32]], ptr %d, i64 0, i64 %idxprom67, i64 %idxprom65
%36 = load i32, ptr %arrayidx72, align 4, !tbaa !5
%37 = load i32, ptr %l, align 4, !tbaa !5
%38 = add i32 %35, %36
%39 = add i32 %38, %37
%sub74 = sub i32 %32, %39
%call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub74)
call void @llvm.lifetime.end.p0(i64 1764, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
int max(int a, int b){
return a >= b ? a : b;
}
int next(int R, int *es, int *emaxs){
int i;
for(i = 0; i < R; i++){
if(es[i] < emaxs[i]){
es[i]++;
return 1;
}
else{
es[i] = 0;
}
}
return 0;
}
int is_covered(int R, int *m_facts, int *es){
int i;
for(i = 0; i < R; i++){
if(m_facts[i] > es[i]){
return 0;
}
}
return 1;
}
int main(){
int N, K, R, Q, i, j, now, ans = 0;
scanf("%d", &Q);
int *m = (int *)malloc(sizeof(int) * Q);
int *x = (int *)malloc(sizeof(int) * Q);
for(i = 0, N = 0; i < Q; i++){
scanf("%d%d", &m[i], &x[i]);
N = max(N, m[i]);
}
int *prime_num = (int *)malloc(sizeof(int) * (N + 1));
for(i = 0; i <= N; i++){
prime_num[i] = 0;
}
prime_num[0] = -1;
prime_num[1] = -1;
for(i = 2, K = 0; i <= N; i++){
if(prime_num[i] == 0){
prime_num[i] = K;
K++;
for(j = 2; i * j <= N; j++){
prime_num[i * j] = -1;
}
}
}
// printf("N = %d\n", N);
/* for(i = 0; i <= N; i++){
printf("prime_num[%d] = %d\n", i, prime_num[i]);
}
printf("\n");
*/ int *primes = (int *)malloc(sizeof(int) * K);
int *emaxs = (int *)malloc(sizeof(int) * K);
for(i = 0; i <= N; i++){
if(prime_num[i] >= 0){
primes[prime_num[i]] = i;
}
}
for(i = 0; i < K; i++){
for(emaxs[i] = -1, now = 1; now <= N; emaxs[i]++, now *= primes[i]){}
}
// printf("K = %d\n", K);
/* for(i = 0; i < K; i++){
printf("primes[%d] = %d\n", i, primes[i]);
}
printf("\n");
for(i = 0; i < K; i++){
printf("emaxs[%d] = %d\n", i, emaxs[i]);
}
printf("\n");
*/ for(R = 0; emaxs[R] > 1; R++){}
// printf("R = %d\n", R);
int **m_facts = (int **)malloc(sizeof(int *) * Q);
int *max_fact = (int *)malloc(sizeof(int) * Q);
for(i = 0; i < Q; i++){
m_facts[i] = (int *)malloc(sizeof(int) * K);
for(j = 0; j < K; j++){
m_facts[i][j] = 0;
}
for(j = 0; m[i] > 1; j++){
if(m[i] % primes[j] == 0){
m_facts[i][j]++;
m[i] /= primes[j];
max_fact[i] = j;
j--;
}
}
// printf("i = %d\n", i);
/* for(j = 0; j < K; j++){
printf("%d ", m_facts[i][j]);
}
printf("\n");
printf("max_fact[%d] = %d\n\n", i, max_fact[i]);
*/ }
int *es = (int *)malloc(sizeof(int) * R);
for(i = 0; i < R; i++){
es[i] = 0;
}
int *A = (int *)malloc(sizeof(int) * K);
do{
/* printf("es:");
for(i = 0; i < R; i++){
printf("%d ", es[i]);
}
printf("\n");
*/ now = 0;
for(i = R; i < K; i++){
A[i] = 0;
}
for(i = 0; i < Q; i++){
if(is_covered(R, m_facts[i], es) == 1){
if(max_fact[i] < R){
now += x[i];
}
else{
A[max_fact[i]] += x[i];
}
}
}
for(i = R; i < K; i++){
now += max(0, A[i]);
}
ans = max(ans, now);
}while(next(R, es, emaxs) == 1);
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239410/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239410/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @next(i32 noundef %R, ptr nocapture noundef %es, ptr nocapture noundef readonly %emaxs) local_unnamed_addr #1 {
entry:
%cmp16 = icmp sgt i32 %R, 0
br i1 %cmp16, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %R to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %if.else
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %if.else ]
%arrayidx = getelementptr inbounds i32, ptr %es, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds i32, ptr %emaxs, i64 %indvars.iv
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3 = icmp slt i32 %0, %1
br i1 %cmp3, label %if.then, label %if.else
if.then: ; preds = %for.body
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
br label %cleanup
if.else: ; preds = %for.body
store i32 0, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9
cleanup: ; preds = %if.else, %entry, %if.then
%retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ], [ 0, %if.else ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @is_covered(i32 noundef %R, ptr nocapture noundef readonly %m_facts, ptr nocapture noundef readonly %es) local_unnamed_addr #3 {
entry:
%cmp7 = icmp sgt i32 %R, 0
br i1 %cmp7, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %R to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i32, ptr %m_facts, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds i32, ptr %es, i64 %indvars.iv
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %0, %1
br i1 %cmp3, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%Q = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Q) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Q)
%0 = load i32, ptr %Q, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #10
%call4 = call noalias ptr @malloc(i64 noundef %mul) #10
%cmp371 = icmp sgt i32 %0, 0
br i1 %cmp371, label %for.body, label %for.end23
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%N.0373 = phi i32 [ %cond.i, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%arrayidx7 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx, ptr noundef %arrayidx7)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cond.i = call i32 @llvm.smax.i32(i32 %N.0373, i32 %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %Q, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end23, !llvm.loop !12
for.end23: ; preds = %for.body, %entry
%N.0.lcssa = phi i32 [ 0, %entry ], [ %cond.i, %for.body ]
%4 = phi i32 [ %0, %entry ], [ %2, %for.body ]
%add = add nuw i32 %N.0.lcssa, 1
%conv12 = sext i32 %add to i64
%mul13 = shl nsw i64 %conv12, 2
%call14 = call noalias ptr @malloc(i64 noundef %mul13) #10
%5 = zext i32 %add to i64
%6 = shl nuw nsw i64 %5, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %call14, i8 0, i64 %6, i1 false), !tbaa !5
store i32 -1, ptr %call14, align 4, !tbaa !5
%arrayidx25 = getelementptr inbounds i32, ptr %call14, i64 1
store i32 -1, ptr %arrayidx25, align 4, !tbaa !5
%cmp27.not381 = icmp slt i32 %N.0.lcssa, 2
br i1 %cmp27.not381, label %for.body60.preheader, label %for.body29.preheader
for.body29.preheader: ; preds = %for.end23
%wide.trip.count = zext i32 %add to i64
br label %for.body29
for.body29: ; preds = %for.body29.preheader, %for.inc48
%indvars.iv428 = phi i64 [ 2, %for.body29.preheader ], [ %indvars.iv.next429, %for.inc48 ]
%K.0384 = phi i32 [ 0, %for.body29.preheader ], [ %K.1, %for.inc48 ]
%arrayidx31 = getelementptr inbounds i32, ptr %call14, i64 %indvars.iv428
%7 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp32 = icmp eq i32 %7, 0
br i1 %cmp32, label %if.then, label %for.inc48
if.then: ; preds = %for.body29
store i32 %K.0384, ptr %arrayidx31, align 4, !tbaa !5
%inc36 = add nsw i32 %K.0384, 1
%indvars.iv428.tr = trunc i64 %indvars.iv428 to i32
%8 = shl i32 %indvars.iv428.tr, 1
%cmp39.not378 = icmp sgt i32 %8, %N.0.lcssa
br i1 %cmp39.not378, label %for.inc48, label %for.body41.preheader
for.body41.preheader: ; preds = %if.then
%9 = trunc i64 %indvars.iv428 to i32
br label %for.body41
for.body41: ; preds = %for.body41.preheader, %for.body41
%indvars.iv425 = phi i64 [ 2, %for.body41.preheader ], [ %indvars.iv.next426, %for.body41 ]
%mul38380 = phi i32 [ %8, %for.body41.preheader ], [ %mul38, %for.body41 ]
%idxprom43 = zext i32 %mul38380 to i64
%arrayidx44 = getelementptr inbounds i32, ptr %call14, i64 %idxprom43
store i32 -1, ptr %arrayidx44, align 4, !tbaa !5
%indvars.iv.next426 = add nuw nsw i64 %indvars.iv425, 1
%indvars = trunc i64 %indvars.iv.next426 to i32
%mul38 = mul nsw i32 %indvars, %9
%cmp39.not = icmp sgt i32 %mul38, %N.0.lcssa
br i1 %cmp39.not, label %for.inc48, label %for.body41, !llvm.loop !13
for.inc48: ; preds = %for.body41, %if.then, %for.body29
%K.1 = phi i32 [ %K.0384, %for.body29 ], [ %inc36, %if.then ], [ %inc36, %for.body41 ]
%indvars.iv.next429 = add nuw nsw i64 %indvars.iv428, 1
%exitcond.not = icmp eq i64 %indvars.iv.next429, %wide.trip.count
br i1 %exitcond.not, label %for.body60.preheader, label %for.body29, !llvm.loop !14
for.body60.preheader: ; preds = %for.inc48, %for.end23
%K.0.lcssa = phi i32 [ 0, %for.end23 ], [ %K.1, %for.inc48 ]
%conv51 = sext i32 %K.0.lcssa to i64
%mul52 = shl nsw i64 %conv51, 2
%call53 = call noalias ptr @malloc(i64 noundef %mul52) #10
%call56 = call noalias ptr @malloc(i64 noundef %mul52) #10
%wide.trip.count437 = zext i32 %add to i64
%min.iters.check = icmp ult i32 %N.0.lcssa, 7
br i1 %min.iters.check, label %for.body60.preheader536, label %vector.ph
vector.ph: ; preds = %for.body60.preheader
%n.vec = and i64 %wide.trip.count437, 4294967288
br label %vector.body
vector.body: ; preds = %pred.store.continue512, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %pred.store.continue512 ]
%10 = trunc i64 %offset.idx to i32
%11 = getelementptr inbounds i32, ptr %call14, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %11, align 4, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
%wide.load498 = load <4 x i32>, ptr %12, align 4, !tbaa !5
%13 = icmp sgt <4 x i32> %wide.load, <i32 -1, i32 -1, i32 -1, i32 -1>
%14 = icmp sgt <4 x i32> %wide.load498, <i32 -1, i32 -1, i32 -1, i32 -1>
%15 = extractelement <4 x i1> %13, i64 0
br i1 %15, label %pred.store.if, label %pred.store.continue
pred.store.if: ; preds = %vector.body
%16 = extractelement <4 x i32> %wide.load, i64 0
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i32, ptr %call53, i64 %17
store i32 %10, ptr %18, align 4, !tbaa !5
br label %pred.store.continue
pred.store.continue: ; preds = %pred.store.if, %vector.body
%19 = extractelement <4 x i1> %13, i64 1
br i1 %19, label %pred.store.if499, label %pred.store.continue500
pred.store.if499: ; preds = %pred.store.continue
%20 = extractelement <4 x i32> %wide.load, i64 1
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, ptr %call53, i64 %21
%23 = or i32 %10, 1
store i32 %23, ptr %22, align 4, !tbaa !5
br label %pred.store.continue500
pred.store.continue500: ; preds = %pred.store.if499, %pred.store.continue
%24 = extractelement <4 x i1> %13, i64 2
br i1 %24, label %pred.store.if501, label %pred.store.continue502
pred.store.if501: ; preds = %pred.store.continue500
%25 = extractelement <4 x i32> %wide.load, i64 2
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds i32, ptr %call53, i64 %26
%28 = or i32 %10, 2
store i32 %28, ptr %27, align 4, !tbaa !5
br label %pred.store.continue502
pred.store.continue502: ; preds = %pred.store.if501, %pred.store.continue500
%29 = extractelement <4 x i1> %13, i64 3
br i1 %29, label %pred.store.if503, label %pred.store.continue504
pred.store.if503: ; preds = %pred.store.continue502
%30 = extractelement <4 x i32> %wide.load, i64 3
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds i32, ptr %call53, i64 %31
%33 = or i32 %10, 3
store i32 %33, ptr %32, align 4, !tbaa !5
br label %pred.store.continue504
pred.store.continue504: ; preds = %pred.store.if503, %pred.store.continue502
%34 = extractelement <4 x i1> %14, i64 0
br i1 %34, label %pred.store.if505, label %pred.store.continue506
pred.store.if505: ; preds = %pred.store.continue504
%35 = extractelement <4 x i32> %wide.load498, i64 0
%36 = zext i32 %35 to i64
%37 = getelementptr inbounds i32, ptr %call53, i64 %36
%38 = or i32 %10, 4
store i32 %38, ptr %37, align 4, !tbaa !5
br label %pred.store.continue506
pred.store.continue506: ; preds = %pred.store.if505, %pred.store.continue504
%39 = extractelement <4 x i1> %14, i64 1
br i1 %39, label %pred.store.if507, label %pred.store.continue508
pred.store.if507: ; preds = %pred.store.continue506
%40 = extractelement <4 x i32> %wide.load498, i64 1
%41 = zext i32 %40 to i64
%42 = getelementptr inbounds i32, ptr %call53, i64 %41
%43 = or i32 %10, 5
store i32 %43, ptr %42, align 4, !tbaa !5
br label %pred.store.continue508
pred.store.continue508: ; preds = %pred.store.if507, %pred.store.continue506
%44 = extractelement <4 x i1> %14, i64 2
br i1 %44, label %pred.store.if509, label %pred.store.continue510
pred.store.if509: ; preds = %pred.store.continue508
%45 = extractelement <4 x i32> %wide.load498, i64 2
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds i32, ptr %call53, i64 %46
%48 = or i32 %10, 6
store i32 %48, ptr %47, align 4, !tbaa !5
br label %pred.store.continue510
pred.store.continue510: ; preds = %pred.store.if509, %pred.store.continue508
%49 = extractelement <4 x i1> %14, i64 3
br i1 %49, label %pred.store.if511, label %pred.store.continue512
pred.store.if511: ; preds = %pred.store.continue510
%50 = extractelement <4 x i32> %wide.load498, i64 3
%51 = zext i32 %50 to i64
%52 = getelementptr inbounds i32, ptr %call53, i64 %51
%53 = or i32 %10, 7
store i32 %53, ptr %52, align 4, !tbaa !5
br label %pred.store.continue512
pred.store.continue512: ; preds = %pred.store.if511, %pred.store.continue510
%index.next = add nuw i64 %offset.idx, 8
%54 = icmp eq i64 %index.next, %n.vec
br i1 %54, label %middle.block, label %vector.body, !llvm.loop !15
middle.block: ; preds = %pred.store.continue512
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count437
br i1 %cmp.n, label %for.cond74.preheader, label %for.body60.preheader536
for.body60.preheader536: ; preds = %for.body60.preheader, %middle.block
%indvars.iv433.ph = phi i64 [ 0, %for.body60.preheader ], [ %n.vec, %middle.block ]
br label %for.body60
for.cond74.preheader: ; preds = %for.inc71, %middle.block
%cmp75390 = icmp sgt i32 %K.0.lcssa, 0
br i1 %cmp75390, label %for.body77.lr.ph, label %for.cond95.preheader
for.body77.lr.ph: ; preds = %for.cond74.preheader
%cmp81.not388 = icmp slt i32 %N.0.lcssa, 1
%55 = zext i32 %K.0.lcssa to i64
br i1 %cmp81.not388, label %for.body77.us.preheader, label %for.body77.preheader
for.body77.preheader: ; preds = %for.body77.lr.ph
%xtraiter = and i64 %55, 1
%56 = icmp eq i32 %K.0.lcssa, 1
br i1 %56, label %for.cond95.preheader.loopexit.unr-lcssa, label %for.body77.preheader.new
for.body77.preheader.new: ; preds = %for.body77.preheader
%unroll_iter = and i64 %55, 4294967294
br label %for.body77
for.body77.us.preheader: ; preds = %for.body77.lr.ph
%57 = shl nuw nsw i64 %55, 2
call void @llvm.memset.p0.i64(ptr align 4 %call56, i8 -1, i64 %57, i1 false), !tbaa !5
br label %for.cond95.preheader
for.body60: ; preds = %for.body60.preheader536, %for.inc71
%indvars.iv433 = phi i64 [ %indvars.iv.next434, %for.inc71 ], [ %indvars.iv433.ph, %for.body60.preheader536 ]
%arrayidx62 = getelementptr inbounds i32, ptr %call14, i64 %indvars.iv433
%58 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%cmp63 = icmp sgt i32 %58, -1
br i1 %cmp63, label %if.then65, label %for.inc71
if.then65: ; preds = %for.body60
%idxprom68 = zext i32 %58 to i64
%arrayidx69 = getelementptr inbounds i32, ptr %call53, i64 %idxprom68
%59 = trunc i64 %indvars.iv433 to i32
store i32 %59, ptr %arrayidx69, align 4, !tbaa !5
br label %for.inc71
for.inc71: ; preds = %for.body60, %if.then65
%indvars.iv.next434 = add nuw nsw i64 %indvars.iv433, 1
%exitcond438.not = icmp eq i64 %indvars.iv.next434, %wide.trip.count437
br i1 %exitcond438.not, label %for.cond74.preheader, label %for.body60, !llvm.loop !18
for.body77: ; preds = %for.cond80.for.inc92_crit_edge.1, %for.body77.preheader.new
%indvars.iv439 = phi i64 [ 0, %for.body77.preheader.new ], [ %indvars.iv.next440.1, %for.cond80.for.inc92_crit_edge.1 ]
%niter = phi i64 [ 0, %for.body77.preheader.new ], [ %niter.next.1, %for.cond80.for.inc92_crit_edge.1 ]
%arrayidx79 = getelementptr inbounds i32, ptr %call56, i64 %indvars.iv439
%arrayidx89 = getelementptr inbounds i32, ptr %call53, i64 %indvars.iv439
%60 = load i32, ptr %arrayidx89, align 4, !tbaa !5
br label %for.inc84
for.inc84: ; preds = %for.body77, %for.inc84
%61 = phi i32 [ -1, %for.body77 ], [ %inc87, %for.inc84 ]
%now.0389 = phi i32 [ 1, %for.body77 ], [ %mul90, %for.inc84 ]
%inc87 = add nsw i32 %61, 1
%mul90 = mul nsw i32 %60, %now.0389
%cmp81.not = icmp sgt i32 %mul90, %N.0.lcssa
br i1 %cmp81.not, label %for.cond80.for.inc92_crit_edge, label %for.inc84, !llvm.loop !19
for.cond80.for.inc92_crit_edge: ; preds = %for.inc84
store i32 %inc87, ptr %arrayidx79, align 4, !tbaa !5
%indvars.iv.next440 = or i64 %indvars.iv439, 1
%arrayidx79.1 = getelementptr inbounds i32, ptr %call56, i64 %indvars.iv.next440
%arrayidx89.1 = getelementptr inbounds i32, ptr %call53, i64 %indvars.iv.next440
%62 = load i32, ptr %arrayidx89.1, align 4, !tbaa !5
br label %for.inc84.1
for.inc84.1: ; preds = %for.inc84.1, %for.cond80.for.inc92_crit_edge
%63 = phi i32 [ -1, %for.cond80.for.inc92_crit_edge ], [ %inc87.1, %for.inc84.1 ]
%now.0389.1 = phi i32 [ 1, %for.cond80.for.inc92_crit_edge ], [ %mul90.1, %for.inc84.1 ]
%inc87.1 = add nsw i32 %63, 1
%mul90.1 = mul nsw i32 %62, %now.0389.1
%cmp81.not.1 = icmp sgt i32 %mul90.1, %N.0.lcssa
br i1 %cmp81.not.1, label %for.cond80.for.inc92_crit_edge.1, label %for.inc84.1, !llvm.loop !19
for.cond80.for.inc92_crit_edge.1: ; preds = %for.inc84.1
store i32 %inc87.1, ptr %arrayidx79.1, align 4, !tbaa !5
%indvars.iv.next440.1 = add nuw nsw i64 %indvars.iv439, 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.cond95.preheader.loopexit.unr-lcssa, label %for.body77, !llvm.loop !20
for.cond95.preheader.loopexit.unr-lcssa: ; preds = %for.cond80.for.inc92_crit_edge.1, %for.body77.preheader
%indvars.iv439.unr = phi i64 [ 0, %for.body77.preheader ], [ %indvars.iv.next440.1, %for.cond80.for.inc92_crit_edge.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond95.preheader, label %for.body77.epil
for.body77.epil: ; preds = %for.cond95.preheader.loopexit.unr-lcssa
%arrayidx79.epil = getelementptr inbounds i32, ptr %call56, i64 %indvars.iv439.unr
%arrayidx89.epil = getelementptr inbounds i32, ptr %call53, i64 %indvars.iv439.unr
%64 = load i32, ptr %arrayidx89.epil, align 4, !tbaa !5
br label %for.inc84.epil
for.inc84.epil: ; preds = %for.inc84.epil, %for.body77.epil
%65 = phi i32 [ -1, %for.body77.epil ], [ %inc87.epil, %for.inc84.epil ]
%now.0389.epil = phi i32 [ 1, %for.body77.epil ], [ %mul90.epil, %for.inc84.epil ]
%inc87.epil = add nsw i32 %65, 1
%mul90.epil = mul nsw i32 %64, %now.0389.epil
%cmp81.not.epil = icmp sgt i32 %mul90.epil, %N.0.lcssa
br i1 %cmp81.not.epil, label %for.cond80.for.inc92_crit_edge.epil, label %for.inc84.epil, !llvm.loop !19
for.cond80.for.inc92_crit_edge.epil: ; preds = %for.inc84.epil
store i32 %inc87.epil, ptr %arrayidx79.epil, align 4, !tbaa !5
br label %for.cond95.preheader
for.cond95.preheader: ; preds = %for.cond80.for.inc92_crit_edge.epil, %for.cond95.preheader.loopexit.unr-lcssa, %for.body77.us.preheader, %for.cond74.preheader
br label %for.cond95
for.cond95: ; preds = %for.cond95.preheader, %for.cond95
%indvars.iv449 = phi i64 [ %indvars.iv.next450, %for.cond95 ], [ 0, %for.cond95.preheader ]
%arrayidx97 = getelementptr inbounds i32, ptr %call56, i64 %indvars.iv449
%66 = load i32, ptr %arrayidx97, align 4, !tbaa !5
%cmp98 = icmp sgt i32 %66, 1
%indvars.iv.next450 = add nuw i64 %indvars.iv449, 1
br i1 %cmp98, label %for.cond95, label %for.end103, !llvm.loop !21
for.end103: ; preds = %for.cond95
%67 = trunc i64 %indvars.iv449 to i32
%conv104 = sext i32 %4 to i64
%mul105 = shl nsw i64 %conv104, 3
%call106 = call noalias ptr @malloc(i64 noundef %mul105) #10
%mul108 = shl nsw i64 %conv104, 2
%call109 = call noalias ptr @malloc(i64 noundef %mul108) #10
%cmp111399 = icmp sgt i32 %4, 0
br i1 %cmp111399, label %for.body113.lr.ph, label %for.end160
for.body113.lr.ph: ; preds = %for.end103
%68 = zext i32 %K.0.lcssa to i64
%69 = shl nuw nsw i64 %68, 2
%wide.trip.count461 = zext i32 %4 to i64
br label %for.body113
for.body113: ; preds = %for.body113.lr.ph, %for.inc158
%indvars.iv457 = phi i64 [ 0, %for.body113.lr.ph ], [ %indvars.iv.next458, %for.inc158 ]
%call116 = call noalias ptr @malloc(i64 noundef %mul52) #10
%arrayidx118 = getelementptr inbounds ptr, ptr %call106, i64 %indvars.iv457
store ptr %call116, ptr %arrayidx118, align 8, !tbaa !22
br i1 %cmp75390, label %for.body122.preheader, label %for.cond130.preheader
for.body122.preheader: ; preds = %for.body113
call void @llvm.memset.p0.i64(ptr align 4 %call116, i8 0, i64 %69, i1 false), !tbaa !5
br label %for.cond130.preheader
for.cond130.preheader: ; preds = %for.body122.preheader, %for.body113
%arrayidx132 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv457
%arrayidx132.promoted = load i32, ptr %arrayidx132, align 4, !tbaa !5
%cmp133396 = icmp sgt i32 %arrayidx132.promoted, 1
br i1 %cmp133396, label %for.body135.lr.ph, label %for.inc158
for.body135.lr.ph: ; preds = %for.cond130.preheader
%arrayidx153 = getelementptr inbounds i32, ptr %call109, i64 %indvars.iv457
br label %for.body135
for.body135: ; preds = %for.body135.lr.ph, %for.inc155
%j.2398 = phi i32 [ 0, %for.body135.lr.ph ], [ %inc156, %for.inc155 ]
%div395397 = phi i32 [ %arrayidx132.promoted, %for.body135.lr.ph ], [ %div394, %for.inc155 ]
%idxprom138 = sext i32 %j.2398 to i64
%arrayidx139 = getelementptr inbounds i32, ptr %call53, i64 %idxprom138
%70 = load i32, ptr %arrayidx139, align 4, !tbaa !5
%rem = srem i32 %div395397, %70
%div = sdiv i32 %div395397, %70
%cmp140 = icmp eq i32 %rem, 0
br i1 %cmp140, label %if.then142, label %for.inc155
if.then142: ; preds = %for.body135
%arrayidx146 = getelementptr inbounds i32, ptr %call116, i64 %idxprom138
%71 = load i32, ptr %arrayidx146, align 4, !tbaa !5
%inc147 = add nsw i32 %71, 1
store i32 %inc147, ptr %arrayidx146, align 4, !tbaa !5
store i32 %div, ptr %arrayidx132, align 4, !tbaa !5
store i32 %j.2398, ptr %arrayidx153, align 4, !tbaa !5
%dec = add nsw i32 %j.2398, -1
br label %for.inc155
for.inc155: ; preds = %for.body135, %if.then142
%div394 = phi i32 [ %div, %if.then142 ], [ %div395397, %for.body135 ]
%j.3 = phi i32 [ %dec, %if.then142 ], [ %j.2398, %for.body135 ]
%inc156 = add nsw i32 %j.3, 1
%cmp133 = icmp sgt i32 %div394, 1
br i1 %cmp133, label %for.body135, label %for.inc158, !llvm.loop !24
for.inc158: ; preds = %for.inc155, %for.cond130.preheader
%indvars.iv.next458 = add nuw nsw i64 %indvars.iv457, 1
%exitcond462.not = icmp eq i64 %indvars.iv.next458, %wide.trip.count461
br i1 %exitcond462.not, label %for.end160, label %for.body113, !llvm.loop !25
for.end160: ; preds = %for.inc158, %for.end103
%mul162 = shl i64 %indvars.iv449, 2
%call163 = call noalias ptr @malloc(i64 noundef %mul162) #10
%cmp165402.not = icmp eq i32 %67, 0
br i1 %cmp165402.not, label %for.end172, label %for.body167.preheader
for.body167.preheader: ; preds = %for.end160
call void @llvm.memset.p0.i64(ptr align 4 %call163, i8 0, i64 %mul162, i1 false), !tbaa !5
br label %for.end172
for.end172: ; preds = %for.body167.preheader, %for.end160
%call175 = call noalias ptr @malloc(i64 noundef %mul52) #10
%cmp177404 = icmp sgt i32 %K.0.lcssa, %67
%scevgep = getelementptr i8, ptr %call175, i64 %mul162
%72 = trunc i64 %indvars.iv449 to i32
%73 = xor i32 %72, -1
%74 = add i32 %K.0.lcssa, %73
%75 = zext i32 %74 to i64
%76 = shl nuw nsw i64 %75, 2
%77 = add nuw nsw i64 %76, 4
%wide.trip.count477 = zext i32 %4 to i64
%wide.trip.count484 = zext i32 %K.0.lcssa to i64
%78 = sub i64 %wide.trip.count484, %indvars.iv449
%min.iters.check516 = icmp ult i64 %78, 8
%n.vec519 = and i64 %78, -8
%ind.end = add i64 %indvars.iv449, %n.vec519
%79 = getelementptr i32, ptr %call175, i64 %indvars.iv449
%cmp.n521 = icmp eq i64 %78, %n.vec519
br label %do.body
do.body: ; preds = %next.exit, %for.end172
%ans.0 = phi i32 [ 0, %for.end172 ], [ %cond.i349, %next.exit ]
br i1 %cmp177404, label %for.body179.preheader, label %for.cond185.preheader
for.body179.preheader: ; preds = %do.body
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, i8 0, i64 %77, i1 false), !tbaa !5
br label %for.cond185.preheader
for.cond185.preheader: ; preds = %for.body179.preheader, %do.body
br i1 %cmp111399, label %for.body188, label %for.cond215.preheader
for.cond215.preheader: ; preds = %for.inc212, %for.cond185.preheader
%now.1.lcssa = phi i32 [ 0, %for.cond185.preheader ], [ %now.2, %for.inc212 ]
br i1 %cmp177404, label %for.body218.preheader, label %for.end225
for.body218.preheader: ; preds = %for.cond215.preheader
br i1 %min.iters.check516, label %for.body218.preheader528, label %vector.ph517
vector.ph517: ; preds = %for.body218.preheader
%80 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %now.1.lcssa, i64 0
br label %vector.body522
vector.body522: ; preds = %vector.body522, %vector.ph517
%index = phi i64 [ 0, %vector.ph517 ], [ %index.next527, %vector.body522 ]
%vec.phi = phi <4 x i32> [ %80, %vector.ph517 ], [ %85, %vector.body522 ]
%vec.phi523 = phi <4 x i32> [ zeroinitializer, %vector.ph517 ], [ %86, %vector.body522 ]
%81 = getelementptr i32, ptr %79, i64 %index
%wide.load525 = load <4 x i32>, ptr %81, align 4, !tbaa !5
%82 = getelementptr inbounds i32, ptr %81, i64 4
%wide.load526 = load <4 x i32>, ptr %82, align 4, !tbaa !5
%83 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load525, <4 x i32> zeroinitializer)
%84 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load526, <4 x i32> zeroinitializer)
%85 = add <4 x i32> %83, %vec.phi
%86 = add <4 x i32> %84, %vec.phi523
%index.next527 = add nuw i64 %index, 8
%87 = icmp eq i64 %index.next527, %n.vec519
br i1 %87, label %middle.block514, label %vector.body522, !llvm.loop !26
middle.block514: ; preds = %vector.body522
%bin.rdx = add <4 x i32> %86, %85
%88 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n521, label %for.end225, label %for.body218.preheader528
for.body218.preheader528: ; preds = %for.body218.preheader, %middle.block514
%indvars.iv480.ph = phi i64 [ %indvars.iv449, %for.body218.preheader ], [ %ind.end, %middle.block514 ]
%now.3411.ph = phi i32 [ %now.1.lcssa, %for.body218.preheader ], [ %88, %middle.block514 ]
br label %for.body218
for.body188: ; preds = %for.cond185.preheader, %for.inc212
%indvars.iv473 = phi i64 [ %indvars.iv.next474, %for.inc212 ], [ 0, %for.cond185.preheader ]
%now.1407 = phi i32 [ %now.2, %for.inc212 ], [ 0, %for.cond185.preheader ]
%arrayidx190 = getelementptr inbounds ptr, ptr %call106, i64 %indvars.iv473
%89 = load ptr, ptr %arrayidx190, align 8, !tbaa !22
br i1 %cmp165402.not, label %if.then194, label %for.body.i
for.cond.i: ; preds = %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, %indvars.iv449
br i1 %exitcond.not.i, label %if.then194, label %for.body.i, !llvm.loop !11
for.body.i: ; preds = %for.body188, %for.cond.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.cond.i ], [ 0, %for.body188 ]
%arrayidx.i = getelementptr inbounds i32, ptr %89, i64 %indvars.iv.i
%90 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%arrayidx2.i = getelementptr inbounds i32, ptr %call163, i64 %indvars.iv.i
%91 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.i = icmp sgt i32 %90, %91
br i1 %cmp3.i, label %for.inc212, label %for.cond.i
if.then194: ; preds = %for.cond.i, %for.body188
%arrayidx196 = getelementptr inbounds i32, ptr %call109, i64 %indvars.iv473
%92 = load i32, ptr %arrayidx196, align 4, !tbaa !5
%cmp197 = icmp slt i32 %92, %67
%arrayidx201 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv473
%93 = load i32, ptr %arrayidx201, align 4, !tbaa !5
br i1 %cmp197, label %if.then199, label %if.else
if.then199: ; preds = %if.then194
%add202 = add nsw i32 %93, %now.1407
br label %for.inc212
if.else: ; preds = %if.then194
%idxprom207 = sext i32 %92 to i64
%arrayidx208 = getelementptr inbounds i32, ptr %call175, i64 %idxprom207
%94 = load i32, ptr %arrayidx208, align 4, !tbaa !5
%add209 = add nsw i32 %94, %93
store i32 %add209, ptr %arrayidx208, align 4, !tbaa !5
br label %for.inc212
for.inc212: ; preds = %for.body.i, %if.else, %if.then199
%now.2 = phi i32 [ %add202, %if.then199 ], [ %now.1407, %if.else ], [ %now.1407, %for.body.i ]
%indvars.iv.next474 = add nuw nsw i64 %indvars.iv473, 1
%exitcond478.not = icmp eq i64 %indvars.iv.next474, %wide.trip.count477
br i1 %exitcond478.not, label %for.cond215.preheader, label %for.body188, !llvm.loop !27
for.body218: ; preds = %for.body218.preheader528, %for.body218
%indvars.iv480 = phi i64 [ %indvars.iv.next481, %for.body218 ], [ %indvars.iv480.ph, %for.body218.preheader528 ]
%now.3411 = phi i32 [ %add222, %for.body218 ], [ %now.3411.ph, %for.body218.preheader528 ]
%arrayidx220 = getelementptr inbounds i32, ptr %call175, i64 %indvars.iv480
%95 = load i32, ptr %arrayidx220, align 4, !tbaa !5
%cond.i348 = call i32 @llvm.smax.i32(i32 %95, i32 0)
%add222 = add nsw i32 %cond.i348, %now.3411
%indvars.iv.next481 = add nuw i64 %indvars.iv480, 1
%exitcond485.not = icmp eq i64 %indvars.iv.next481, %wide.trip.count484
br i1 %exitcond485.not, label %for.end225, label %for.body218, !llvm.loop !28
for.end225: ; preds = %for.body218, %middle.block514, %for.cond215.preheader
%now.3.lcssa = phi i32 [ %now.1.lcssa, %for.cond215.preheader ], [ %88, %middle.block514 ], [ %add222, %for.body218 ]
%cond.i349 = call i32 @llvm.smax.i32(i32 %ans.0, i32 %now.3.lcssa)
br i1 %cmp165402.not, label %do.end, label %for.body.i353
for.body.i353: ; preds = %for.end225, %if.else.i
%indvars.iv.i354 = phi i64 [ %indvars.iv.next.i358, %if.else.i ], [ 0, %for.end225 ]
%arrayidx.i355 = getelementptr inbounds i32, ptr %call163, i64 %indvars.iv.i354
%96 = load i32, ptr %arrayidx.i355, align 4, !tbaa !5
%arrayidx2.i356 = getelementptr inbounds i32, ptr %call56, i64 %indvars.iv.i354
%97 = load i32, ptr %arrayidx2.i356, align 4, !tbaa !5
%cmp3.i357 = icmp slt i32 %96, %97
br i1 %cmp3.i357, label %next.exit, label %if.else.i
if.else.i: ; preds = %for.body.i353
store i32 0, ptr %arrayidx.i355, align 4, !tbaa !5
%indvars.iv.next.i358 = add nuw nsw i64 %indvars.iv.i354, 1
%exitcond.not.i359 = icmp eq i64 %indvars.iv.next.i358, %indvars.iv449
br i1 %exitcond.not.i359, label %do.end, label %for.body.i353, !llvm.loop !9
next.exit: ; preds = %for.body.i353
%inc.i = add nsw i32 %96, 1
store i32 %inc.i, ptr %arrayidx.i355, align 4, !tbaa !5
br label %do.body, !llvm.loop !29
do.end: ; preds = %for.end225, %if.else.i
%call230 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cond.i349)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Q) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #7
; 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 nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { 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}
!15 = distinct !{!15, !10, !16, !17}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !10, !17, !16}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = !{!23, !23, i64 0}
!23 = !{!"any pointer", !7, i64 0}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10, !16, !17}
!27 = distinct !{!27, !10}
!28 = distinct !{!28, !10, !17, !16}
!29 = distinct !{!29, !10}
|
#include <stdio.h>
int main(void)
{
int s,m = 0,h = 0;
scanf("%d",&s);
while(s>=3600) {
s -= 3600;
h++;
}
while(s>=60) {
s -= 60;
m++;
}
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239454/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239454/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%.pr = load i32, ptr %s, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %.pr, 3599
br i1 %cmp12, label %while.body.preheader, label %while.cond1thread-pre-split
while.body.preheader: ; preds = %entry
%0 = add nsw i32 %.pr, -3600
%1 = add nuw i32 %.pr, 3599
%smin = call i32 @llvm.smin.i32(i32 %.pr, i32 7199)
%2 = sub nuw i32 %1, %smin
%3 = udiv i32 %2, 3600
%.neg = mul nsw i32 %3, -3600
%4 = add nsw i32 %.neg, %0
%5 = add nuw nsw i32 %3, 1
store i32 %4, ptr %s, align 4, !tbaa !5
br label %while.cond1thread-pre-split
while.cond1thread-pre-split: ; preds = %while.body.preheader, %entry
%.pr11 = phi i32 [ %4, %while.body.preheader ], [ %.pr, %entry ]
%h.0.lcssa = phi i32 [ %5, %while.body.preheader ], [ 0, %entry ]
%cmp214 = icmp sgt i32 %.pr11, 59
br i1 %cmp214, label %while.body3.preheader, label %while.end6
while.body3.preheader: ; preds = %while.cond1thread-pre-split
%6 = add nsw i32 %.pr11, -60
%7 = add nuw nsw i32 %.pr11, 59
%smin18 = call i32 @llvm.smin.i32(i32 %.pr11, i32 119)
%8 = sub nuw nsw i32 %7, %smin18
%9 = udiv i32 %8, 60
%.neg20 = mul nsw i32 %9, -60
%10 = add nsw i32 %.neg20, %6
%11 = add nuw nsw i32 %9, 1
store i32 %10, ptr %s, align 4, !tbaa !5
br label %while.end6
while.end6: ; preds = %while.body3.preheader, %while.cond1thread-pre-split
%.lcssa = phi i32 [ %10, %while.body3.preheader ], [ %.pr11, %while.cond1thread-pre-split ]
%m.0.lcssa = phi i32 [ %11, %while.body3.preheader ], [ 0, %while.cond1thread-pre-split ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.0.lcssa, i32 noundef %m.0.lcssa, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int S;
int h,m,s;
scanf("%d",&S);
s=S%60;
S/=60;
m=S%60;
h=S/60;
printf("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239498/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239498/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%rem = srem i32 %0, 60
%div = sdiv i32 %0, 60
store i32 %div, ptr %S, align 4, !tbaa !5
%rem1 = srem i32 %div, 60
%div2 = sdiv i32 %0, 3600
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2, i32 noundef %rem1, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int S,h,m,s;
scanf("%d",&S);
h = S/3600;
m = S%3600/60;
s = S%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239548/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239548/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int S;
scanf("%d",&S);
printf("%d:%d:%d\n",S/3600,S%3600/60,S%60);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239591/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239591/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int S;
int h, m, s;
scanf("%d", &S);
h = S / 3600;
m = (S - 3600 * h) / 60;
s = S - (3600 * h) - (60 * m);
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239634/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239634/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int allSec;
int hour , min , sec;
scanf("%d" , &allSec);
hour = allSec / 3600;
allSec = allSec % 3600;
min = allSec / 60;
sec = allSec % 60;
printf("%d:%d:%d\n" , hour , min , sec);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239678/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239678/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%allSec = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %allSec) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %allSec)
%0 = load i32, ptr %allSec, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %allSec, align 4, !tbaa !5
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem25 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem25 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %allSec) #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;
int h=0,m=0,s=0;
scanf("%d",&a);
while(a>=3600) a-=3600,h++;
while(a>=60) a-=60,m++;
s=a;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239720/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239720/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%.pr = load i32, ptr %a, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %.pr, 3599
br i1 %cmp12, label %while.body.preheader, label %while.cond1thread-pre-split
while.body.preheader: ; preds = %entry
%0 = add nsw i32 %.pr, -3600
%1 = add nuw i32 %.pr, 3599
%smin = call i32 @llvm.smin.i32(i32 %.pr, i32 7199)
%2 = sub nuw i32 %1, %smin
%3 = udiv i32 %2, 3600
%.neg = mul nsw i32 %3, -3600
%4 = add nsw i32 %.neg, %0
%5 = add nuw nsw i32 %3, 1
store i32 %4, ptr %a, align 4, !tbaa !5
br label %while.cond1thread-pre-split
while.cond1thread-pre-split: ; preds = %while.body.preheader, %entry
%.pr11 = phi i32 [ %4, %while.body.preheader ], [ %.pr, %entry ]
%h.0.lcssa = phi i32 [ %5, %while.body.preheader ], [ 0, %entry ]
%cmp214 = icmp sgt i32 %.pr11, 59
br i1 %cmp214, label %while.body3.preheader, label %while.end6
while.body3.preheader: ; preds = %while.cond1thread-pre-split
%6 = add nsw i32 %.pr11, -60
%7 = add nuw nsw i32 %.pr11, 59
%smin18 = call i32 @llvm.smin.i32(i32 %.pr11, i32 119)
%8 = sub nuw nsw i32 %7, %smin18
%9 = udiv i32 %8, 60
%.neg20 = mul nsw i32 %9, -60
%10 = add nsw i32 %.neg20, %6
%11 = add nuw nsw i32 %9, 1
store i32 %10, ptr %a, align 4, !tbaa !5
br label %while.end6
while.end6: ; preds = %while.body3.preheader, %while.cond1thread-pre-split
%.lcssa = phi i32 [ %10, %while.body3.preheader ], [ %.pr11, %while.cond1thread-pre-split ]
%m.0.lcssa = phi i32 [ %11, %while.body3.preheader ], [ 0, %while.cond1thread-pre-split ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.0.lcssa, i32 noundef %m.0.lcssa, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int S;
scanf("%d", &S);
printf("%d:%d:%d\n", S/3600, S/60%60, S%60);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239764/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239764/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%div1 = sdiv i32 %0, 60
%rem = srem i32 %div1, 60
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int h, m, s;
scanf("%d", &s);
h = s / (60 * 60);
m = s / 60 - h * 60;
s -= ((m * 60) + (h * 60 * 60));
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239807/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239807/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%div1 = sdiv i32 %0, 60
%mul.neg = mul nsw i32 %div, -60
%sub = add nsw i32 %mul.neg, %div1
%mul2.neg = mul i32 %sub, -60
%mul4.neg = mul nsw i32 %div, -3600
%add.neg = add i32 %mul4.neg, %0
%sub5 = add i32 %add.neg, %mul2.neg
store i32 %sub5, ptr %s, align 4, !tbaa !5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %sub, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
S=S%3600;
m=S/60;
s=S%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239850/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239850/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %S, align 4, !tbaa !5
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem25 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem25 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int S;
int h, m, s;
scanf("%d", &S);
h = S / 3600;
m = S % 3600 / 60;
s = S % 3600 % 60;
printf("%d:%d:%d\n", h, m, s);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239894/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239894/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int t, h, m ;
int a;
scanf("%d", &t);
h = t / 3600;
t = t-h*3600;
m = t / 60;
t = t - m * 60;
printf("%d:%d:%d\n", h,m,t);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239937/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239937/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul2.neg = mul nsw i32 %div1, -60
%sub3 = add i32 %mul2.neg, %sub
store i32 %sub3, ptr %t, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int s;
int h;
int m;
scanf("%d", &s);
h = s / 3600;
m = (s / 60) % 60;
s = s % 60;
printf("%d:%d:%d\n", h, m, s);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_239980/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_239980/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%div1 = sdiv i32 %0, 60
%rem = srem i32 %div1, 60
%rem2 = srem i32 %0, 60
store i32 %rem2, ptr %s, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int s1,h,m,s2;
scanf("%d",&s1);
h = (int)(s1/3600);
m = (int)((s1%3600)/60);
s2 = s1-3600*h-m*60;
printf("%d:%d:%d\n",h,m,s2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240021/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240021/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s1) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1)
%0 = load i32, ptr %s1, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div17 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div17 to i32
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%mul2.neg = mul nsw i32 %div1.sext, -60
%sub3 = add i32 %sub, %mul2.neg
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %sub3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s1) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int S,resH,resM,resS=0;
scanf("%d",&S);
resH=S/3600;
resM=(S%3600)/60;
resS=(S%3600)%60;
printf("%d:%d:%d\n",resH,resM,resS);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240065/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240065/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int h, m, s, S;
scanf("%d", &S);
h = S / 3600;
m = S % 3600 / 60;
s = S %60;
printf("%d:%d:%d\n",h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240108/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240108/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main();
int main(){
int S, h, m, s;
scanf("%d", &S);
h=S/3600; /*????????????*/
m=(S-h*3600)/60; /*(S??????h????????£????????????????§???°????????????)/???????????????\
?±????????????????60??§?????£??????*/
s=S-h*3600-m*60; /*?????£????§?*/
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240151/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240151/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int hour,minute,second,input;
scanf("%d",&input);
hour = input/3600;
minute = (input - hour*3600) / 60;
second = input - hour*3600 - minute*60;
printf("%d:%d:%d\n",hour,minute,second);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240195/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240195/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%0 = load i32, ptr %input, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
m=S/60-h*60;
s=S-h*3600-m*60;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240245/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240245/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%div1 = sdiv i32 %0, 60
%mul.neg = mul nsw i32 %div, -60
%sub = add nsw i32 %mul.neg, %div1
%mul2.neg = mul nsw i32 %div, -3600
%sub3 = add i32 %mul2.neg, %0
%mul4.neg = mul i32 %sub, -60
%sub5 = add i32 %sub3, %mul4.neg
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %sub, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int S, Oo, h, m, s;
int main(){
scanf("%d", &S);
h = S / 3600;
m = S / 60 - h * 60;
s = S - h * 3600 - m * 60;
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240289/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240289/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@S = dso_local global i32 0, align 4
@h = dso_local local_unnamed_addr global i32 0, align 4
@m = dso_local local_unnamed_addr global i32 0, align 4
@s = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [10 x i8] c"%d:%d:%d\0A\00", align 1
@Oo = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @S)
%0 = load i32, ptr @S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
store i32 %div, ptr @h, align 4, !tbaa !5
%div1 = sdiv i32 %0, 60
%mul.neg = mul nsw i32 %div, -60
%sub = add nsw i32 %mul.neg, %div1
store i32 %sub, ptr @m, align 4, !tbaa !5
%mul2.neg = mul nsw i32 %div, -3600
%sub3 = add i32 %mul2.neg, %0
%mul4.neg = mul i32 %sub, -60
%sub5 = add i32 %sub3, %mul4.neg
store i32 %sub5, ptr @s, align 4, !tbaa !5
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %sub, i32 noundef %sub5)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int S, h, m, s;
scanf("%d", &S);
h = S / 3600;
m = (S % 3600) / 60;
s = (S % 3600) % 60;
printf("%d:%d:%d\n", h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240339/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240339/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int S, h, m, s;
scanf("%d", &S);
h = S / 3600;
m = (S % 3600) / 60;
s = (S % 3600) % 60;
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240382/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240382/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int S,h,m,s;
scanf("%d",&S);
h = S/3600;
S -= 3600*h;
m = S/60;
S -= 60*m;
s = S;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240425/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240425/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul2.neg = mul nsw i32 %div1, -60
%sub3 = add i32 %mul2.neg, %sub
store i32 %sub3, ptr %S, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int s, m, h, S;
scanf("%d\n",&S);
h = S / 3600;
m = (S - h * 3600) / 60;
s = S - (m * 60 + h * 3600);
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240469/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240469/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul2.neg = mul nsw i32 %div1, -60
%sub4 = add i32 %sub, %mul2.neg
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int Seconds,hour,minute,second;
scanf("%d",&Seconds);
second = (Seconds%3600) %60;
Seconds = Seconds - second;
minute = (Seconds%3600) / 60;
Seconds = Seconds - 60*minute;
hour = Seconds / 3600;
printf("%d:%d:%d\n",hour,minute,second);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240519/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240519/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Seconds = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Seconds) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Seconds)
%0 = load i32, ptr %Seconds, align 4, !tbaa !5
%rem = srem i32 %0, 3600
%rem1.lhs.trunc = trunc i32 %rem to i16
%rem18 = srem i16 %rem1.lhs.trunc, 60
%rem1.sext = sext i16 %rem18 to i32
%sub = sub nsw i32 %0, %rem1.sext
%rem2 = srem i32 %sub, 3600
%div.lhs.trunc = trunc i32 %rem2 to i16
%div9 = sdiv i16 %div.lhs.trunc, 60
%div.sext = sext i16 %div9 to i32
%mul.neg = mul nsw i32 %div.sext, -60
%sub3 = add i32 %mul.neg, %sub
store i32 %sub3, ptr %Seconds, align 4, !tbaa !5
%div4 = sdiv i32 %sub3, 3600
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div4, i32 noundef %div.sext, i32 noundef %rem1.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Seconds) #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 S,h,m,s;
scanf("%d", &S);
h = S / 3600;
m = (S - h*3600)/60;
s = S - h*3600 - m*60;
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240562/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240562/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int h,s;
scanf("%d",&s);
h=s/3600;
s%=3600;
printf("%d:%d:%d\n",h,s/60,s%60);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240605/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240605/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %s, align 4, !tbaa !5
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem25 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem25 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
m=S%3600/60;
s=S%3600%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240649/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240649/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int S, h, m, s;
scanf("%d", &S);
h = S / 3600;
m = S % 3600 / 60;
s = S % 3600 % 60;
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240692/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240692/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
m=(S-(h*3600))/60;
s=S-((h*3600)+(m*60));
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240735/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240735/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul3.neg = mul nsw i32 %div1, -60
%sub4 = add i32 %sub, %mul3.neg
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int s,m,h,a;
scanf("%d",&s);
h=s/3600;
a=s%3600;
m=a/60;
s=a%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240793/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240793/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem26 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem26 to i32
store i32 %rem2.sext, ptr %s, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a, h, m, s;
scanf("%d", &a);
h = a / 3600;
m = a % 3600 / 60;
s = a % 60;
printf("%d:%d:%d\n", h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240836/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240836/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
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>
void main(){
int t;
scanf("%d",&t);
while(t--){
unsigned long long int x;
scanf("%llu",&x);
if(x&1==0){
x = x/2;
printf("%llu %llu\n",x,x);
}
else{
x = x-1;
printf("%d %llu\n",1,x);
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24088/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24088/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu\00", align 1
@.str.3 = private unnamed_addr constant [9 x i8] c"%d %llu\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec5 = add nsw i32 %0, -1
store i32 %dec5, ptr %t, align 4, !tbaa !5
%tobool.not6 = icmp eq i32 %0, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i64, ptr %x, align 8, !tbaa !9
%sub = add i64 %1, -1
store i64 %sub, ptr %x, align 8, !tbaa !9
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 1, i64 noundef %sub)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
//#include<math.h>
//#include<string.h>
//#include <stdlib.h>
//int cmp(const void *a,const void *b)
//{
// return *(int *)a-*(int *)b;
//���Ǵ�С�����������ǴӴ�С�ijɣ� return *(int *)b-*(int *)a;
//}
//qsort(op,a,sizeof(op[0]),cmp);
//(���飬��Ҫ��������ָ���������������ռ�ڴ��С���ȽϺ�����
int main()
{
int a,b,c,d,e,e1,f,f1,g,h;
scanf("%d",&a);
while(a--)
{
g=0;
scanf("%d",&b);
for(c=1;c*c<=b;c++)
{
if((b-c)%c!=0) continue;
d=(b-c)/c;
for(e=1;e*e<=d;e++)
{
if(d%e!=0) continue;
f=d/e;
e1=e; f1=f;
while(f1%e1)
{
h=f1%e1;
f1=e1;
e1=h;
}
if(e1==1)
{
printf("%d %d\n",e*c,f*c);
g=1;
break;
}
}
if(g==1) break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24093/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24093/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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)
%0 = load i32, ptr %a, align 4, !tbaa !5
%dec55 = add nsw i32 %0, -1
store i32 %dec55, ptr %a, align 4, !tbaa !5
%tobool.not56 = icmp eq i32 %0, 0
br i1 %tobool.not56, label %while.end30, label %while.body
while.body: ; preds = %entry, %for.end29
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not53 = icmp slt i32 %1, 1
br i1 %cmp.not53, label %for.end29, label %for.body
for.body: ; preds = %while.body, %for.inc27
%c.054 = phi i32 [ %inc28, %for.inc27 ], [ 1, %while.body ]
%sub = sub nsw i32 %1, %c.054
%rem = srem i32 %sub, %c.054
%div = sdiv i32 %sub, %c.054
%cmp2.not = icmp eq i32 %rem, 0
%cmp6 = icmp sgt i32 %div, 0
%or.cond = and i1 %cmp2.not, %cmp6
br i1 %or.cond, label %if.then19, label %for.inc27
if.then19: ; preds = %for.body
%mul21 = mul nsw i32 %div, %c.054
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.054, i32 noundef %mul21)
br label %for.end29
for.inc27: ; preds = %for.body
%inc28 = add nuw nsw i32 %c.054, 1
%mul = mul nsw i32 %inc28, %inc28
%cmp.not = icmp sgt i32 %mul, %1
br i1 %cmp.not, label %for.end29, label %for.body, !llvm.loop !9
for.end29: ; preds = %for.inc27, %while.body, %if.then19
%2 = load i32, ptr %a, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %a, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end30, label %while.body, !llvm.loop !11
while.end30: ; preds = %for.end29, %entry
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>
#include <stdlib.h>
int main(void) {
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
m=(S-h*3600)/60;
s=S-(h*3600)-m*60;
printf("%d:%d:%d\n",h,m,s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_240973/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_240973/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define BUFMAX 10
#define DAYSEC 86400
#define HOURSEC 3600
#define MINSEC 60
int main(){
char buf[BUFMAX];
int t,h,m,s;
fgets(buf,BUFMAX,stdin);
buf[BUFMAX-1] = '\0';
sscanf(buf,"%d", &t);
h = t / HOURSEC;
m = (t % HOURSEC) / MINSEC;
s = t % MINSEC;
printf("%d:%d:%d\n",h, m, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241022/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%buf = alloca [10 x i8], align 1
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %buf) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 10, ptr noundef %0)
%arrayidx = getelementptr inbounds [10 x i8], ptr %buf, i64 0, i64 9
store i8 0, ptr %arrayidx, align 1, !tbaa !9
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %buf, ptr noundef nonnull @.str, ptr noundef nonnull %t) #3
%1 = load i32, ptr %t, align 4, !tbaa !10
%div = sdiv i32 %1, 3600
%rem = srem i32 %1, 3600
%div3.lhs.trunc = trunc i32 %rem to i16
%div36 = sdiv i16 %div3.lhs.trunc, 60
%div3.sext = sext i16 %div36 to i32
%rem4 = srem i32 %1, 60
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div3.sext, i32 noundef %rem4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %buf) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
|
#include<stdio.h>
int main(){
int second;
scanf("%d",&second);
printf("%d:%d:%d\n",second/60/60,(second%3600)/60,(second%3600)%60);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241073/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241073/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%second = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %second) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %second)
%0 = load i32, ptr %second, align 4, !tbaa !5
%div1 = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div2.lhs.trunc = trunc i32 %rem to i16
%div26 = sdiv i16 %div2.lhs.trunc, 60
%div2.sext = sext i16 %div26 to i32
%rem47 = srem i16 %div2.lhs.trunc, 60
%rem4.sext = sext i16 %rem47 to i32
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div1, i32 noundef %div2.sext, i32 noundef %rem4.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %second) #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 S,h,m,s;
scanf("%d",&S);
if(S>=0 && S<=86400){
h=S/3600;
m=(S-h*3600)/60;
s=S-(h*3600+m*60);
printf("%d:%d:%d\n",h,m,s);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241116/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241116/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4
%or.cond = icmp ult i32 %0, 86401
br i1 %or.cond, label %if.then, label %if.end
if.then: ; preds = %entry
%div = udiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add nsw i32 %mul.neg, %0
%div2 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div2, -60
%sub5 = add nsw i32 %sub, %mul4.neg
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div2, i32 noundef %sub5)
br label %if.end
if.end: ; preds = %if.then, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#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 a[100005]={0};
int i,n,cnt;
scanf("%d",&n);
cnt=n;
for(i=0;i<n;i++){
scanf("%d",a+i);
}
qsort(a,n,sizeof(int),cmp);
for(i=0;i<n-1;i++)
if(a[i]==a[i+1])
cnt--;
printf("%d\n",cnt);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24116/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24116/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @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:
%t = alloca i32, align 4
%a = alloca [100005 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec30 = add nsw i32 %0, -1
store i32 %dec30, ptr %t, align 4, !tbaa !5
%tobool.not31 = icmp eq i32 %0, 0
br i1 %tobool.not31, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end15
call void @llvm.lifetime.start.p0(i64 400020, ptr nonnull %a) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400020) %a, i8 0, i64 400020, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %1, 0
br i1 %cmp24, label %for.body, label %while.body.for.end_crit_edge
while.body.for.end_crit_edge: ; preds = %while.body
%.pre37 = sext i32 %1 to i64
br label %for.end
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %while.body.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre37, %while.body.for.end_crit_edge ], [ %3, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #7
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp526 = icmp sgt i32 %4, 1
br i1 %cmp526, label %for.body7.preheader, label %for.end15
for.body7.preheader: ; preds = %for.end
%sub = add nsw i32 %4, -1
%wide.trip.count = zext i32 %sub to i64
%.pre = load i32, ptr %a, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body7.preheader40, 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
%5 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %1, i64 0
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.load39, %vector.body ]
%vec.phi = phi <4 x i32> [ %5, %vector.ph ], [ %15, %vector.body ]
%vec.phi38 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%6 = or i64 %index, 1
%7 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %6
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load39 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%10 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load39, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = icmp eq <4 x i32> %9, %wide.load
%12 = icmp eq <4 x i32> %10, %wide.load39
%13 = sext <4 x i1> %11 to <4 x i32>
%14 = sext <4 x i1> %12 to <4 x i32>
%15 = add <4 x i32> %vec.phi, %13
%16 = add <4 x i32> %vec.phi38, %14
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %16, %15
%18 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load39, i64 3
br i1 %cmp.n, label %for.end15, label %for.body7.preheader40
for.body7.preheader40: ; preds = %for.body7.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body7.preheader ]
%indvars.iv34.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body7.preheader ]
%cnt.028.ph = phi i32 [ %18, %middle.block ], [ %1, %for.body7.preheader ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader40, %for.body7
%scalar.recur = phi i32 [ %19, %for.body7 ], [ %scalar.recur.ph, %for.body7.preheader40 ]
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %for.body7 ], [ %indvars.iv34.ph, %for.body7.preheader40 ]
%cnt.028 = phi i32 [ %spec.select, %for.body7 ], [ %cnt.028.ph, %for.body7.preheader40 ]
%indvars.iv.next35 = add nuw nsw i64 %indvars.iv34, 1
%arrayidx9 = getelementptr inbounds [100005 x i32], ptr %a, i64 0, i64 %indvars.iv.next35
%19 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %scalar.recur, %19
%dec12 = sext i1 %cmp10 to i32
%spec.select = add nsw i32 %cnt.028, %dec12
%exitcond.not = icmp eq i64 %indvars.iv.next35, %wide.trip.count
br i1 %exitcond.not, label %for.end15, label %for.body7, !llvm.loop !14
for.end15: ; preds = %for.body7, %middle.block, %for.end
%cnt.0.lcssa = phi i32 [ %1, %for.end ], [ %18, %middle.block ], [ %spec.select, %for.body7 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.end.p0(i64 400020, ptr nonnull %a) #7
%20 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %20, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %20, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %for.end15, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree
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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !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}
|
#include <stdio.h>
int main(void) {
int S, h, m, s;
scanf("%d", &S);
h = S / 3600;
m = (S % 3600) / 60;
s = (S % 3600) % 60;
printf("%d:%d:%d\n", h, m, s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241202/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241202/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int S;
int h,m,s;
scanf("%d",&S);
h=S/3600;
S=S-(h*3600);
m=S/60;
s=S%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241246/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241246/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
store i32 %sub, ptr %S, align 4, !tbaa !5
%div1 = sdiv i32 %sub, 60
%rem = srem i32 %sub, 60
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t,n;
scanf("%d",&t);
for(int i=0;i<t;i++){
scanf("%d",&n);
int h=n-1;
printf("%d %d\n",1,h); }
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24129/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24129/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
for.body: ; preds = %entry, %for.body
%i.05 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %1, -1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1, i32 noundef %sub)
%inc = add nuw nsw i32 %i.05, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
m=(S-(h*3600))/60;
s=S-(h*3600)-(m*60);
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241332/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241332/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int S,h,m,s;
scanf("%d",&S);
h=S/3600;
m=(S-h*3600)/60;
s=S-h*3600-m*60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241376/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241376/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
// Your code here!
int S;
int h,m,s;
scanf("%d",&S);
h=S/3600;
m=(S%3600)/60;
s=(S%3600)%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241419/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241419/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int S, s, h, m;
int main(){
scanf("%d", &s);
h =s/3600;
m = (s%3600)/60;
S = s%60;
printf("%d:%d:%d\n", h, m, S);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241462/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241462/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@s = dso_local global i32 0, align 4
@h = dso_local local_unnamed_addr global i32 0, align 4
@m = dso_local local_unnamed_addr global i32 0, align 4
@S = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s)
%0 = load i32, ptr @s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
store i32 %div, ptr @h, align 4, !tbaa !5
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
store i32 %div1.sext, ptr @m, align 4, !tbaa !5
%rem2 = srem i32 %0, 60
store i32 %rem2, ptr @S, align 4, !tbaa !5
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a;
int h;
int m;
int mm;
int s;
scanf("%d",&a);
h = a / 3600;
mm = a - 3600 * h;
m = mm / 60;
s = a - 3600 * h - 60 * m;
printf("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241505/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241505/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
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>
#ifdef DEBUG
#include<conio.h>
#endif // DEBUG
int main () {
#ifdef DEBUG
freopen("input.txt", "r", stdin);
#endif // DEBUG
int a;
scanf("%d", &a);
int sec, minu, hour;
sec = a % 60;
a = a / 60;
minu = a % 60;
hour = a / 60;
printf("%d:%d:%d\n", hour, minu, sec);
#ifdef DEBUG
getch();
#endif // DEBUG
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241556/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241556/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%rem = srem i32 %0, 60
%div = sdiv i32 %0, 60
store i32 %div, ptr %a, align 4, !tbaa !5
%rem1 = srem i32 %div, 60
%div2 = sdiv i32 %0, 3600
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2, i32 noundef %rem1, i32 noundef %rem)
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 min(int a,int b)
{
if(a<=b)
return a;
else
return b;
}
int main()
{
int n,m;
scanf("%d %d",&n,&m);
int x=2*n+1;
int a[4*n+2];
int cu=0,i;
for(i=0;i<=4*n+1;i++)
a[i]=0;
for(i=x;i<=min(4*n,m);i++)
{
a[cu]=i;
cu+=2;
}
int y=cu-2;
a[cu]=0;
cu=1;
for(i=1;i<=min(2*n,m);i++)
{
a[cu]=i;
cu+=2;
}
cu-=2;
int final;
if(cu>=y)
final=cu;
else
final=y;
for(i=0;i<=final;i++)
{ if(a[i]!=0)
printf("%d ",a[i]);
}
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2416/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2416/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl i32 %0, 1
%add = or i32 %mul, 1
%mul1 = shl nsw i32 %0, 2
%add2 = or i32 %mul1, 2
%1 = zext i32 %add2 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%mul3 = shl i32 %3, 2
%cmp.not69 = icmp slt i32 %3, 0
br i1 %cmp.not69, label %for.cond5.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%add4 = or i32 %mul3, 1
%smax = call i32 @llvm.smax.i32(i32 %add4, i32 0)
%4 = zext i32 %smax to i64
%5 = shl nuw nsw i64 %4, 2
%6 = add nuw nsw i64 %5, 4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %vla, i8 0, i64 %6, i1 false), !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body.preheader, %entry
%7 = load i32, ptr %m, align 4, !tbaa !5
%b.a.i = call i32 @llvm.smin.i32(i32 %mul3, i32 %7)
%cmp8.not72 = icmp sgt i32 %add, %b.a.i
br i1 %cmp8.not72, label %for.end15, label %for.body9.preheader
for.body9.preheader: ; preds = %for.cond5.preheader
%8 = sub i32 %b.a.i, %mul
%9 = xor i32 %mul, -1
%10 = add i32 %b.a.i, %9
%xtraiter = and i32 %8, 3
%11 = icmp ult i32 %10, 3
br i1 %11, label %for.end15.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i32 %8, -4
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next.3, %for.body9 ]
%i.173 = phi i32 [ %add, %for.body9.preheader.new ], [ %inc14.3, %for.body9 ]
%niter = phi i32 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %i.173, ptr %arrayidx11, align 16, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 2
%inc14 = add nsw i32 %i.173, 1
%arrayidx11.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next
store i32 %inc14, ptr %arrayidx11.1, align 8, !tbaa !5
%indvars.iv.next.1 = or i64 %indvars.iv, 4
%inc14.1 = add nsw i32 %i.173, 2
%arrayidx11.2 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.1
store i32 %inc14.1, ptr %arrayidx11.2, align 16, !tbaa !5
%indvars.iv.next.2 = or i64 %indvars.iv, 6
%inc14.2 = add nsw i32 %i.173, 3
%arrayidx11.3 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next.2
store i32 %inc14.2, ptr %arrayidx11.3, align 8, !tbaa !5
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 8
%inc14.3 = add nsw i32 %i.173, 4
%niter.next.3 = add i32 %niter, 4
%niter.ncmp.3.not = icmp eq i32 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3.not, label %for.end15.loopexit.unr-lcssa, label %for.body9, !llvm.loop !9
for.end15.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%indvars.iv.next.lcssa.ph = phi i64 [ undef, %for.body9.preheader ], [ %indvars.iv.next.3, %for.body9 ]
%indvars.iv.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next.3, %for.body9 ]
%i.173.unr = phi i32 [ %add, %for.body9.preheader ], [ %inc14.3, %for.body9 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end15.loopexit, label %for.body9.epil
for.body9.epil: ; preds = %for.end15.loopexit.unr-lcssa, %for.body9.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body9.epil ], [ %indvars.iv.unr, %for.end15.loopexit.unr-lcssa ]
%i.173.epil = phi i32 [ %inc14.epil, %for.body9.epil ], [ %i.173.unr, %for.end15.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end15.loopexit.unr-lcssa ]
%arrayidx11.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.epil
store i32 %i.173.epil, ptr %arrayidx11.epil, align 8, !tbaa !5
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 2
%inc14.epil = add nsw i32 %i.173.epil, 1
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end15.loopexit, label %for.body9.epil, !llvm.loop !11
for.end15.loopexit: ; preds = %for.body9.epil, %for.end15.loopexit.unr-lcssa
%indvars.iv.next.lcssa = phi i64 [ %indvars.iv.next.lcssa.ph, %for.end15.loopexit.unr-lcssa ], [ %indvars.iv.next.epil, %for.body9.epil ]
%12 = trunc i64 %indvars.iv.next.lcssa to i32
br label %for.end15
for.end15: ; preds = %for.end15.loopexit, %for.cond5.preheader
%cu.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ %12, %for.end15.loopexit ]
%idxprom16 = zext i32 %cu.0.lcssa to i64
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %idxprom16
store i32 0, ptr %arrayidx17, align 4, !tbaa !5
%mul19 = shl nsw i32 %3, 1
%b.a.i67 = call i32 @llvm.smin.i32(i32 %mul19, i32 %7)
%cmp21.not77 = icmp slt i32 %b.a.i67, 1
br i1 %cmp21.not77, label %for.end28, label %for.body22.preheader
for.body22.preheader: ; preds = %for.end15
%xtraiter94 = and i32 %b.a.i67, 3
%13 = icmp ult i32 %b.a.i67, 4
br i1 %13, label %for.end28.loopexit.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter98 = and i32 %b.a.i67, -4
%invariant.gep = getelementptr i32, ptr %vla, i64 2
%invariant.gep100 = getelementptr i32, ptr %vla, i64 4
%invariant.gep102 = getelementptr i32, ptr %vla, i64 6
br label %for.body22
for.body22: ; preds = %for.body22, %for.body22.preheader.new
%indvars.iv85 = phi i64 [ 1, %for.body22.preheader.new ], [ %indvars.iv.next86.3, %for.body22 ]
%i.278 = phi i32 [ 1, %for.body22.preheader.new ], [ %inc27.3, %for.body22 ]
%niter99 = phi i32 [ 0, %for.body22.preheader.new ], [ %niter99.next.3, %for.body22 ]
%arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv85
store i32 %i.278, ptr %arrayidx24, align 4, !tbaa !5
%inc27 = add nuw nsw i32 %i.278, 1
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv85
store i32 %inc27, ptr %gep, align 4, !tbaa !5
%inc27.1 = add nuw nsw i32 %i.278, 2
%gep101 = getelementptr i32, ptr %invariant.gep100, i64 %indvars.iv85
store i32 %inc27.1, ptr %gep101, align 4, !tbaa !5
%inc27.2 = add nuw nsw i32 %i.278, 3
%gep103 = getelementptr i32, ptr %invariant.gep102, i64 %indvars.iv85
store i32 %inc27.2, ptr %gep103, align 4, !tbaa !5
%indvars.iv.next86.3 = add nuw nsw i64 %indvars.iv85, 8
%inc27.3 = add nuw nsw i32 %i.278, 4
%niter99.next.3 = add i32 %niter99, 4
%niter99.ncmp.3 = icmp eq i32 %niter99.next.3, %unroll_iter98
br i1 %niter99.ncmp.3, label %for.end28.loopexit.unr-lcssa, label %for.body22, !llvm.loop !13
for.end28.loopexit.unr-lcssa: ; preds = %for.body22, %for.body22.preheader
%indvars.iv.next86.lcssa.ph = phi i64 [ undef, %for.body22.preheader ], [ %indvars.iv.next86.3, %for.body22 ]
%indvars.iv85.unr = phi i64 [ 1, %for.body22.preheader ], [ %indvars.iv.next86.3, %for.body22 ]
%i.278.unr = phi i32 [ 1, %for.body22.preheader ], [ %inc27.3, %for.body22 ]
%lcmp.mod96.not = icmp eq i32 %xtraiter94, 0
br i1 %lcmp.mod96.not, label %for.end28.loopexit, label %for.body22.epil
for.body22.epil: ; preds = %for.end28.loopexit.unr-lcssa, %for.body22.epil
%indvars.iv85.epil = phi i64 [ %indvars.iv.next86.epil, %for.body22.epil ], [ %indvars.iv85.unr, %for.end28.loopexit.unr-lcssa ]
%i.278.epil = phi i32 [ %inc27.epil, %for.body22.epil ], [ %i.278.unr, %for.end28.loopexit.unr-lcssa ]
%epil.iter95 = phi i32 [ %epil.iter95.next, %for.body22.epil ], [ 0, %for.end28.loopexit.unr-lcssa ]
%arrayidx24.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv85.epil
store i32 %i.278.epil, ptr %arrayidx24.epil, align 4, !tbaa !5
%indvars.iv.next86.epil = add nuw nsw i64 %indvars.iv85.epil, 2
%inc27.epil = add nuw nsw i32 %i.278.epil, 1
%epil.iter95.next = add i32 %epil.iter95, 1
%epil.iter95.cmp.not = icmp eq i32 %epil.iter95.next, %xtraiter94
br i1 %epil.iter95.cmp.not, label %for.end28.loopexit, label %for.body22.epil, !llvm.loop !14
for.end28.loopexit: ; preds = %for.body22.epil, %for.end28.loopexit.unr-lcssa
%indvars.iv.next86.lcssa = phi i64 [ %indvars.iv.next86.lcssa.ph, %for.end28.loopexit.unr-lcssa ], [ %indvars.iv.next86.epil, %for.body22.epil ]
%14 = trunc i64 %indvars.iv.next86.lcssa to i32
br label %for.end28
for.end28: ; preds = %for.end28.loopexit, %for.end15
%cu.1.lcssa = phi i32 [ 1, %for.end15 ], [ %14, %for.end28.loopexit ]
%cu.0.cu.1 = call i32 @llvm.umax.i32(i32 %cu.1.lcssa, i32 %cu.0.lcssa)
%cmp32.not81 = icmp slt i32 %cu.0.cu.1, 2
br i1 %cmp32.not81, label %for.end44, label %for.body33.preheader
for.body33.preheader: ; preds = %for.end28
%15 = add nsw i32 %cu.0.cu.1, -1
%wide.trip.count = zext i32 %15 to i64
br label %for.body33
for.body33: ; preds = %for.body33.preheader, %for.inc42
%indvars.iv88 = phi i64 [ 0, %for.body33.preheader ], [ %indvars.iv.next89, %for.inc42 ]
%arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88
%16 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%cmp36.not = icmp eq i32 %16, 0
br i1 %cmp36.not, label %for.inc42, label %if.then37
if.then37: ; preds = %for.body33
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16)
br label %for.inc42
for.inc42: ; preds = %for.body33, %if.then37
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond91.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count
br i1 %exitcond91.not, label %for.end44, label %for.body33, !llvm.loop !15
for.end44: ; preds = %for.inc42, %for.end28
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: 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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
#define charsize 100005 //10^5+5
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a= c;}
void cin(ll *n){ scanf("%lld",&(*n)); }
void cin2(ll *a, ll *b){ scanf("%lld%lld",&(*a),&(*b)); }
void cin3(ll *a, ll *b, ll *c){ scanf("%lld%lld%lld",&(*a),&(*b),&(*c)); }
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod_MOD1(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
ll mod_p(ll n ,ll p){n+= n<0?((-n)/p+1)*p:0; return n%=p;}
ll change_into_num(char s[] , ll len, ll p){ return !p ? 0 : POW(10,p-1)*(s[len-p]-'0') + change_into_num(s,len,p-1); }
void lr_lower( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); }
void lr_upper( int *l, int *r, ll am, ll val , int type ){ (type<3) ? ( am <= val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ) : ( am < val ? ( *l = (*l+*r)/2 ) : ( *r= (*l+*r)/2 ) ); }
int cmp_lower( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a>=b ? 1 : 0 ) : ( a>b ? 1 : 0 ) ; }
int cmp_upper( ll a, ll b, int type ){ return (type==1) ? ( a==b ? 1 : 0 ) : (type==2) ? ( a<=b ? 1 : 0 ) : ( a<b ? 1 : 0 ) ; }
// return smallest p which meets a[p]==val :1 >=:2 >:3
ll lower_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_lower(&l,&r,a[ (l+r)/2 ],val,type); return cmp_lower(a[l],val,type) ? l : cmp_lower(a[r],val,type) ? r : -1; }
// return biggest p which meets a[p]==val :1 <=:2 <:3
ll upper_bound( ll a[], int l, int r, ll val , int type ){ while(r-l>1) lr_upper(&l,&r,a[ (l+r)/2 ],val,type); return cmp_upper(a[r],val,type) ? r : cmp_upper(a[l],val,type) ? l : -1; }
// count i which meets ai==x
ll count(ll a[], int l, int r, ll x){ int p = lower_bound(a,l,r,x,1); return p==-1 ? 0 : upper_bound(a,p,r,x,1)-p+1; }
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
int cmp_string( const void * a , const void * b ) { return strcmp( (char *)a , (char *)b ); } // qsort((void*)s,n,sizeof(s[0]),int_sort );
int cmp_char(const void * a, const void * b) { return *(char *)a - *(char *)b;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
void sort_string(int n,int size,char s[][size]){ qsort( (void*)s , n , sizeof(s[0]) , cmp_string ); }
void sort_char(char *s){ qsort( (void *)s , strlen(s) , sizeof(char) , cmp_char ); }
ll unique_string(ll n ,ll size, char s[][size]){ ll ans=1; rep(i,1,n) if( strcmp(s[i],s[i-1]) ) ans++; return ans; }
ll unique_num(ll n , ll a[]){ ll ans=1; rep(i,1,n) if( a[i]!=a[i-1] ) ans++; return ans; }
typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}
int main(void){
// char ;
ll n,h,m,s;
// ll ans=0;
cin(&n);
// cin(&);
// cin(&);
// cin2(&,&);
// cin3(&,&,&);
// scanf("%s",);
// ll [n];
// rep(i,0,n){
// cin(&[i]);
// }
h = n/3600;
m = (n%3600)/60;
s = n%60;
printf("%lld:%lld:%lld\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241642/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241642/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.3 = private unnamed_addr constant [16 x i8] c"%lld:%lld:%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @cin(ptr noundef %n) local_unnamed_addr #2 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %n)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @cin2(ptr noundef %a, ptr noundef %b) local_unnamed_addr #2 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %a, ptr noundef %b)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @cin3(ptr noundef %a, ptr noundef %b, ptr noundef %c) local_unnamed_addr #2 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %a, ptr noundef %b, ptr noundef %c)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 {
entry:
%cmp.not = icmp sgt i64 %a, %b
%cmp1.not = icmp sgt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #4 {
entry:
%cmp.not = icmp slt i64 %a, %b
%cmp1.not = icmp slt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #5 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #4 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %c.04.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %c.04, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #6 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod_MOD1(i64 noundef %n) local_unnamed_addr #7 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%n.nonneg = sub i64 0, %n
%0 = urem i64 %n.nonneg, 1000000007
%1 = add nsw i64 %0, %n
%mul = sub i64 1000000007, %1
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, 1000000007
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod_p(i64 noundef %n, i64 noundef %p) local_unnamed_addr #7 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%div7 = sdiv i64 %n, %p
%add = sub i64 1, %div7
%mul = mul nsw i64 %add, %p
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, %p
ret i64 %rem
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @change_into_num(ptr nocapture noundef readonly %s, i64 noundef %len, i64 noundef %p) local_unnamed_addr #8 {
entry:
%tobool.not11 = icmp eq i64 %p, 0
br i1 %tobool.not11, label %cond.end, label %cond.false.preheader
cond.false.preheader: ; preds = %entry
%0 = add i64 %p, -2
br label %cond.false
cond.false: ; preds = %cond.false.preheader, %POW.exit
%indvar = phi i64 [ 0, %cond.false.preheader ], [ %indvar.next, %POW.exit ]
%p.tr13 = phi i64 [ %p, %cond.false.preheader ], [ %sub, %POW.exit ]
%accumulator.tr12 = phi i64 [ 0, %cond.false.preheader ], [ %add, %POW.exit ]
%1 = xor i64 %indvar, -1
%2 = add i64 %1, %p
%sub = add nsw i64 %p.tr13, -1
%cmp3.i = icmp sgt i64 %p.tr13, 1
br i1 %cmp3.i, label %for.body.i.preheader, label %POW.exit
for.body.i.preheader: ; preds = %cond.false
%3 = sub i64 %0, %indvar
%xtraiter = and i64 %2, 7
%4 = icmp ult i64 %3, 7
br i1 %4, label %POW.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %2, -8
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%c.04.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul.i.7, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ]
%mul.i.7 = mul i64 %c.04.i, 100000000
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %POW.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !18
POW.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%mul.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ]
%c.04.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul.i.7, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %POW.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil
%c.04.i.epil = phi i64 [ %mul.i.epil, %for.body.i.epil ], [ %c.04.i.unr, %POW.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %POW.exit.loopexit.unr-lcssa ]
%mul.i.epil = mul nsw i64 %c.04.i.epil, 10
%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 %POW.exit, label %for.body.i.epil, !llvm.loop !19
POW.exit: ; preds = %POW.exit.loopexit.unr-lcssa, %for.body.i.epil, %cond.false
%c.0.lcssa.i = phi i64 [ 1, %cond.false ], [ %mul.i.lcssa.ph, %POW.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ]
%sub1 = sub nsw i64 %len, %p.tr13
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %sub1
%5 = load i8, ptr %arrayidx, align 1, !tbaa !20
%conv = sext i8 %5 to i64
%sub2 = add nsw i64 %conv, -48
%mul = mul nsw i64 %sub2, %c.0.lcssa.i
%add = add nsw i64 %mul, %accumulator.tr12
%tobool.not = icmp eq i64 %sub, 0
%indvar.next = add i64 %indvar, 1
br i1 %tobool.not, label %cond.end, label %cond.false
cond.end: ; preds = %POW.exit, %entry
%accumulator.tr.lcssa = phi i64 [ 0, %entry ], [ %add, %POW.exit ]
ret i64 %accumulator.tr.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @lr_lower(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 {
entry:
%cmp = icmp slt i32 %type, 3
%0 = load i32, ptr %l, align 4, !tbaa !21
%1 = load i32, ptr %r, align 4, !tbaa !21
%add = add nsw i32 %1, %0
%div = sdiv i32 %add, 2
%cmp1 = icmp slt i64 %am, %val
%l.r = select i1 %cmp1, ptr %l, ptr %r
%cmp6.not = icmp sgt i64 %am, %val
%r.l = select i1 %cmp6.not, ptr %r, ptr %l
%l.sink = select i1 %cmp, ptr %l.r, ptr %r.l
store i32 %div, ptr %l.sink, align 4, !tbaa !21
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @lr_upper(ptr nocapture noundef %l, ptr nocapture noundef %r, i64 noundef %am, i64 noundef %val, i32 noundef %type) local_unnamed_addr #9 {
entry:
%cmp = icmp slt i32 %type, 3
%0 = load i32, ptr %l, align 4, !tbaa !21
%1 = load i32, ptr %r, align 4, !tbaa !21
%add3 = add nsw i32 %1, %0
%div4 = sdiv i32 %add3, 2
%cmp1.not = icmp sgt i64 %am, %val
%r.l = select i1 %cmp1.not, ptr %r, ptr %l
%cmp6 = icmp slt i64 %am, %val
%l.r = select i1 %cmp6, ptr %l, ptr %r
%l.sink = select i1 %cmp, ptr %r.l, ptr %l.r
store i32 %div4, ptr %l.sink, align 4, !tbaa !21
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @cmp_lower(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 {
entry:
switch i32 %type, label %cond.false6 [
i32 1, label %cond.true
i32 2, label %cond.true3
]
cond.true: ; preds = %entry
%cmp1 = icmp eq i64 %a, %b
br label %cond.end10
cond.true3: ; preds = %entry
%cmp4.not = icmp sge i64 %a, %b
br label %cond.end10
cond.false6: ; preds = %entry
%cmp7 = icmp sgt i64 %a, %b
br label %cond.end10
cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true
%cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ]
%cond11 = zext i1 %cond11.in to i32
ret i32 %cond11
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @cmp_upper(i64 noundef %a, i64 noundef %b, i32 noundef %type) local_unnamed_addr #7 {
entry:
switch i32 %type, label %cond.false6 [
i32 1, label %cond.true
i32 2, label %cond.true3
]
cond.true: ; preds = %entry
%cmp1 = icmp eq i64 %a, %b
br label %cond.end10
cond.true3: ; preds = %entry
%cmp4.not = icmp sle i64 %a, %b
br label %cond.end10
cond.false6: ; preds = %entry
%cmp7 = icmp slt i64 %a, %b
br label %cond.end10
cond.end10: ; preds = %cond.true3, %cond.false6, %cond.true
%cond11.in = phi i1 [ %cmp1, %cond.true ], [ %cmp4.not, %cond.true3 ], [ %cmp7, %cond.false6 ]
%cond11 = zext i1 %cond11.in to i32
ret i32 %cond11
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 {
entry:
%sub34 = sub nsw i32 %r, %l
%cmp35 = icmp sgt i32 %sub34, 1
br i1 %cmp35, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%cmp.i = icmp slt i32 %type, 3
br i1 %cmp.i, label %while.body.us, label %while.body
while.body.us: ; preds = %while.body.lr.ph, %while.body.us
%l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ]
%r.addr.0 = phi i32 [ %spec.select51, %while.body.us ], [ %r, %while.body.lr.ph ]
%add.us = add nsw i32 %l.addr.0, %r.addr.0
%div.us = sdiv i32 %add.us, 2
%idxprom.us = sext i32 %div.us to i64
%arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us
%0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
%cmp1.i.us = icmp slt i64 %0, %val
%spec.select = select i1 %cmp1.i.us, i32 %div.us, i32 %l.addr.0
%spec.select51 = select i1 %cmp1.i.us, i32 %r.addr.0, i32 %div.us
%sub.us = sub nsw i32 %spec.select51, %spec.select
%cmp.us = icmp sgt i32 %sub.us, 1
br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !23
while.body: ; preds = %while.body.lr.ph, %while.body
%l.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %l, %while.body.lr.ph ]
%r.addr.2 = phi i32 [ %spec.select53, %while.body ], [ %r, %while.body.lr.ph ]
%add = add nsw i32 %l.addr.2, %r.addr.2
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp6.not.i = icmp sgt i64 %1, %val
%spec.select52 = select i1 %cmp6.not.i, i32 %l.addr.2, i32 %div
%spec.select53 = select i1 %cmp6.not.i, i32 %div, i32 %r.addr.2
%sub = sub nsw i32 %spec.select53, %spec.select52
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !23
while.end: ; preds = %while.body, %while.body.us, %entry
%r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select51, %while.body.us ], [ %spec.select53, %while.body ]
%l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select52, %while.body ]
%idxprom1 = sext i32 %l.addr.0..lcssa to i64
%arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !5
switch i32 %type, label %cmp_lower.exit [
i32 1, label %cond.true.i
i32 2, label %cond.true3.i
]
cond.true.i: ; preds = %while.end
%cmp1.i17 = icmp eq i64 %2, %val
br i1 %cmp1.i17, label %cond.end9, label %cond.false.thread
cond.false.thread: ; preds = %cond.true.i
%idxprom345 = sext i32 %r.addr.0..lcssa to i64
%arrayidx446 = getelementptr inbounds i64, ptr %a, i64 %idxprom345
%3 = load i64, ptr %arrayidx446, align 8, !tbaa !5
%cmp1.i23 = icmp eq i64 %3, %val
br label %cmp_lower.exit26
cond.true3.i: ; preds = %while.end
%cmp4.not.i.not = icmp slt i64 %2, %val
br i1 %cmp4.not.i.not, label %cond.false.thread47, label %cond.end9
cond.false.thread47: ; preds = %cond.true3.i
%idxprom348 = sext i32 %r.addr.0..lcssa to i64
%arrayidx449 = getelementptr inbounds i64, ptr %a, i64 %idxprom348
%4 = load i64, ptr %arrayidx449, align 8, !tbaa !5
%cmp4.not.i19 = icmp sge i64 %4, %val
br label %cmp_lower.exit26
cmp_lower.exit: ; preds = %while.end
%cmp7.i = icmp sgt i64 %2, %val
br i1 %cmp7.i, label %cond.end9, label %cond.false
cond.false: ; preds = %cmp_lower.exit
%idxprom3 = sext i32 %r.addr.0..lcssa to i64
%arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3
%5 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%cmp7.i25 = icmp sgt i64 %5, %val
br label %cmp_lower.exit26
cmp_lower.exit26: ; preds = %cond.false.thread, %cond.false.thread47, %cond.false
%cond11.in.i20 = phi i1 [ %cmp1.i23, %cond.false.thread ], [ %cmp4.not.i19, %cond.false.thread47 ], [ %cmp7.i25, %cond.false ]
%6 = sext i32 %r.addr.0..lcssa to i64
%.pre = select i1 %cond11.in.i20, i64 %6, i64 -1
br label %cond.end9
cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_lower.exit, %cmp_lower.exit26
%conv.pre-phi = phi i64 [ %idxprom1, %cmp_lower.exit ], [ %.pre, %cmp_lower.exit26 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ]
ret i64 %conv.pre-phi
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @upper_bound(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %val, i32 noundef %type) local_unnamed_addr #8 {
entry:
%sub33 = sub nsw i32 %r, %l
%cmp34 = icmp sgt i32 %sub33, 1
br i1 %cmp34, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %entry
%cmp.i = icmp slt i32 %type, 3
br i1 %cmp.i, label %while.body.us, label %while.body
while.body.us: ; preds = %while.body.lr.ph, %while.body.us
%l.addr.0 = phi i32 [ %spec.select, %while.body.us ], [ %l, %while.body.lr.ph ]
%r.addr.0 = phi i32 [ %spec.select50, %while.body.us ], [ %r, %while.body.lr.ph ]
%add.us = add nsw i32 %l.addr.0, %r.addr.0
%div.us = sdiv i32 %add.us, 2
%idxprom.us = sext i32 %div.us to i64
%arrayidx.us = getelementptr inbounds i64, ptr %a, i64 %idxprom.us
%0 = load i64, ptr %arrayidx.us, align 8, !tbaa !5
%cmp1.not.i.us = icmp sgt i64 %0, %val
%spec.select = select i1 %cmp1.not.i.us, i32 %l.addr.0, i32 %div.us
%spec.select50 = select i1 %cmp1.not.i.us, i32 %div.us, i32 %r.addr.0
%sub.us = sub nsw i32 %spec.select50, %spec.select
%cmp.us = icmp sgt i32 %sub.us, 1
br i1 %cmp.us, label %while.body.us, label %while.end, !llvm.loop !24
while.body: ; preds = %while.body.lr.ph, %while.body
%l.addr.2 = phi i32 [ %spec.select51, %while.body ], [ %l, %while.body.lr.ph ]
%r.addr.2 = phi i32 [ %spec.select52, %while.body ], [ %r, %while.body.lr.ph ]
%add = add nsw i32 %l.addr.2, %r.addr.2
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cmp6.i = icmp slt i64 %1, %val
%spec.select51 = select i1 %cmp6.i, i32 %div, i32 %l.addr.2
%spec.select52 = select i1 %cmp6.i, i32 %r.addr.2, i32 %div
%sub = sub nsw i32 %spec.select52, %spec.select51
%cmp = icmp sgt i32 %sub, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !24
while.end: ; preds = %while.body, %while.body.us, %entry
%r.addr.0..lcssa = phi i32 [ %r, %entry ], [ %spec.select50, %while.body.us ], [ %spec.select52, %while.body ]
%l.addr.0..lcssa = phi i32 [ %l, %entry ], [ %spec.select, %while.body.us ], [ %spec.select51, %while.body ]
%idxprom1 = sext i32 %r.addr.0..lcssa to i64
%arrayidx2 = getelementptr inbounds i64, ptr %a, i64 %idxprom1
%2 = load i64, ptr %arrayidx2, align 8, !tbaa !5
switch i32 %type, label %cmp_upper.exit [
i32 1, label %cond.true.i
i32 2, label %cond.true3.i
]
cond.true.i: ; preds = %while.end
%cmp1.i = icmp eq i64 %2, %val
br i1 %cmp1.i, label %cond.end9, label %cond.false.thread
cond.false.thread: ; preds = %cond.true.i
%idxprom344 = sext i32 %l.addr.0..lcssa to i64
%arrayidx445 = getelementptr inbounds i64, ptr %a, i64 %idxprom344
%3 = load i64, ptr %arrayidx445, align 8, !tbaa !5
%cmp1.i22 = icmp eq i64 %3, %val
br label %cmp_upper.exit25
cond.true3.i: ; preds = %while.end
%cmp4.not.i.not = icmp sgt i64 %2, %val
br i1 %cmp4.not.i.not, label %cond.false.thread46, label %cond.end9
cond.false.thread46: ; preds = %cond.true3.i
%idxprom347 = sext i32 %l.addr.0..lcssa to i64
%arrayidx448 = getelementptr inbounds i64, ptr %a, i64 %idxprom347
%4 = load i64, ptr %arrayidx448, align 8, !tbaa !5
%cmp4.not.i18 = icmp sle i64 %4, %val
br label %cmp_upper.exit25
cmp_upper.exit: ; preds = %while.end
%cmp7.i = icmp slt i64 %2, %val
br i1 %cmp7.i, label %cond.end9, label %cond.false
cond.false: ; preds = %cmp_upper.exit
%idxprom3 = sext i32 %l.addr.0..lcssa to i64
%arrayidx4 = getelementptr inbounds i64, ptr %a, i64 %idxprom3
%5 = load i64, ptr %arrayidx4, align 8, !tbaa !5
%cmp7.i24 = icmp slt i64 %5, %val
br label %cmp_upper.exit25
cmp_upper.exit25: ; preds = %cond.false.thread, %cond.false.thread46, %cond.false
%cond11.in.i19 = phi i1 [ %cmp1.i22, %cond.false.thread ], [ %cmp4.not.i18, %cond.false.thread46 ], [ %cmp7.i24, %cond.false ]
%6 = sext i32 %l.addr.0..lcssa to i64
%.pre = select i1 %cond11.in.i19, i64 %6, i64 -1
br label %cond.end9
cond.end9: ; preds = %cond.true3.i, %cond.true.i, %cmp_upper.exit, %cmp_upper.exit25
%conv.pre-phi = phi i64 [ %idxprom1, %cmp_upper.exit ], [ %.pre, %cmp_upper.exit25 ], [ %idxprom1, %cond.true.i ], [ %idxprom1, %cond.true3.i ]
ret i64 %conv.pre-phi
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @count(ptr nocapture noundef readonly %a, i32 noundef %l, i32 noundef %r, i64 noundef %x) local_unnamed_addr #8 {
entry:
%sub34.i = sub nsw i32 %r, %l
%cmp35.i = icmp sgt i32 %sub34.i, 1
br i1 %cmp35.i, label %while.body.us.i, label %while.end.i
while.body.us.i: ; preds = %entry, %while.body.us.i
%l.addr.0.i = phi i32 [ %spec.select.i, %while.body.us.i ], [ %l, %entry ]
%r.addr.0.i = phi i32 [ %spec.select51.i, %while.body.us.i ], [ %r, %entry ]
%add.us.i = add nsw i32 %r.addr.0.i, %l.addr.0.i
%div.us.i = sdiv i32 %add.us.i, 2
%idxprom.us.i = sext i32 %div.us.i to i64
%arrayidx.us.i = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i
%0 = load i64, ptr %arrayidx.us.i, align 8, !tbaa !5
%cmp1.i.us.i = icmp slt i64 %0, %x
%spec.select.i = select i1 %cmp1.i.us.i, i32 %div.us.i, i32 %l.addr.0.i
%spec.select51.i = select i1 %cmp1.i.us.i, i32 %r.addr.0.i, i32 %div.us.i
%sub.us.i = sub nsw i32 %spec.select51.i, %spec.select.i
%cmp.us.i = icmp sgt i32 %sub.us.i, 1
br i1 %cmp.us.i, label %while.body.us.i, label %while.end.i, !llvm.loop !23
while.end.i: ; preds = %while.body.us.i, %entry
%r.addr.0..lcssa.i = phi i32 [ %r, %entry ], [ %spec.select51.i, %while.body.us.i ]
%l.addr.0..lcssa.i = phi i32 [ %l, %entry ], [ %spec.select.i, %while.body.us.i ]
%idxprom1.i = sext i32 %l.addr.0..lcssa.i to i64
%arrayidx2.i = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i
%1 = load i64, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp1.i17.i = icmp eq i64 %1, %x
br i1 %cmp1.i17.i, label %lower_bound.exit, label %cond.false.thread.i
cond.false.thread.i: ; preds = %while.end.i
%idxprom345.i = sext i32 %r.addr.0..lcssa.i to i64
%arrayidx446.i = getelementptr inbounds i64, ptr %a, i64 %idxprom345.i
%2 = load i64, ptr %arrayidx446.i, align 8, !tbaa !5
%cmp1.i23.i = icmp eq i64 %2, %x
%.pre.i = select i1 %cmp1.i23.i, i64 %idxprom345.i, i64 -1
br label %lower_bound.exit
lower_bound.exit: ; preds = %while.end.i, %cond.false.thread.i
%conv.pre-phi.i = phi i64 [ %.pre.i, %cond.false.thread.i ], [ %idxprom1.i, %while.end.i ]
%conv = trunc i64 %conv.pre-phi.i to i32
%cmp = icmp eq i32 %conv, -1
br i1 %cmp, label %cond.end, label %cond.false
cond.false: ; preds = %lower_bound.exit
%sub33.i = sub nsw i32 %r, %conv
%cmp34.i = icmp sgt i32 %sub33.i, 1
br i1 %cmp34.i, label %while.body.us.i18, label %while.end.i9
while.body.us.i18: ; preds = %cond.false, %while.body.us.i18
%l.addr.0.i19 = phi i32 [ %spec.select.i25, %while.body.us.i18 ], [ %conv, %cond.false ]
%r.addr.0.i20 = phi i32 [ %spec.select50.i, %while.body.us.i18 ], [ %r, %cond.false ]
%add.us.i21 = add nsw i32 %r.addr.0.i20, %l.addr.0.i19
%div.us.i22 = sdiv i32 %add.us.i21, 2
%idxprom.us.i23 = sext i32 %div.us.i22 to i64
%arrayidx.us.i24 = getelementptr inbounds i64, ptr %a, i64 %idxprom.us.i23
%3 = load i64, ptr %arrayidx.us.i24, align 8, !tbaa !5
%cmp1.not.i.us.i = icmp sgt i64 %3, %x
%spec.select.i25 = select i1 %cmp1.not.i.us.i, i32 %l.addr.0.i19, i32 %div.us.i22
%spec.select50.i = select i1 %cmp1.not.i.us.i, i32 %div.us.i22, i32 %r.addr.0.i20
%sub.us.i26 = sub nsw i32 %spec.select50.i, %spec.select.i25
%cmp.us.i27 = icmp sgt i32 %sub.us.i26, 1
br i1 %cmp.us.i27, label %while.body.us.i18, label %while.end.i9, !llvm.loop !24
while.end.i9: ; preds = %while.body.us.i18, %cond.false
%r.addr.0..lcssa.i10 = phi i32 [ %r, %cond.false ], [ %spec.select50.i, %while.body.us.i18 ]
%l.addr.0..lcssa.i11 = phi i32 [ %conv, %cond.false ], [ %spec.select.i25, %while.body.us.i18 ]
%idxprom1.i12 = sext i32 %r.addr.0..lcssa.i10 to i64
%arrayidx2.i13 = getelementptr inbounds i64, ptr %a, i64 %idxprom1.i12
%4 = load i64, ptr %arrayidx2.i13, align 8, !tbaa !5
%cmp1.i.i = icmp eq i64 %4, %x
br i1 %cmp1.i.i, label %upper_bound.exit, label %cond.false.thread.i14
cond.false.thread.i14: ; preds = %while.end.i9
%idxprom344.i = sext i32 %l.addr.0..lcssa.i11 to i64
%arrayidx445.i = getelementptr inbounds i64, ptr %a, i64 %idxprom344.i
%5 = load i64, ptr %arrayidx445.i, align 8, !tbaa !5
%cmp1.i22.i = icmp eq i64 %5, %x
%.pre.i15 = select i1 %cmp1.i22.i, i64 %idxprom344.i, i64 -1
br label %upper_bound.exit
upper_bound.exit: ; preds = %while.end.i9, %cond.false.thread.i14
%conv.pre-phi.i16 = phi i64 [ %.pre.i15, %cond.false.thread.i14 ], [ %idxprom1.i12, %while.end.i9 ]
%reass.sub = sub nsw i64 %conv.pre-phi.i16, %conv.pre-phi.i
%add = add nsw i64 %reass.sub, 1
br label %cond.end
cond.end: ; preds = %lower_bound.exit, %upper_bound.exit
%cond = phi i64 [ %add, %upper_bound.exit ], [ 0, %lower_bound.exit ]
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #10 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #10 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_string(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #11 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #10 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !20
%conv = sext i8 %0 to i32
%1 = load i8, ptr %b, align 1, !tbaa !20
%conv1 = sext i8 %1 to i32
%sub = sub nsw i32 %conv, %conv1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #17
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #17
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort_string(i32 noundef %n, i32 noundef %size, ptr noundef %s) local_unnamed_addr #2 {
entry:
%0 = zext i32 %size to i64
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %s, i64 noundef %conv, i64 noundef %0, ptr noundef nonnull @cmp_string) #17
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort_char(ptr noundef %s) local_unnamed_addr #2 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #16
tail call void @qsort(ptr noundef %s, i64 noundef %call, i64 noundef 1, ptr noundef nonnull @cmp_char) #17
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #12
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i64 @unique_string(i64 noundef %n, i64 noundef %size, ptr nocapture noundef readonly %s) local_unnamed_addr #14 {
entry:
%cmp8 = icmp sgt i64 %n, 1
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %for.body ]
ret i64 %ans.0.lcssa
for.body: ; preds = %entry, %for.body
%i.010 = phi i64 [ %inc2, %for.body ], [ 1, %entry ]
%ans.09 = phi i64 [ %spec.select, %for.body ], [ 1, %entry ]
%0 = mul nsw i64 %i.010, %size
%arrayidx = getelementptr inbounds i8, ptr %s, i64 %0
%sub = add nsw i64 %i.010, -1
%1 = mul nsw i64 %sub, %size
%arrayidx1 = getelementptr inbounds i8, ptr %s, i64 %1
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx, ptr noundef nonnull dereferenceable(1) %arrayidx1) #16
%tobool.not = icmp ne i32 %call, 0
%inc = zext i1 %tobool.not to i64
%spec.select = add nuw nsw i64 %ans.09, %inc
%inc2 = add nuw nsw i64 %i.010, 1
%exitcond.not = icmp eq i64 %inc2, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !25
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @unique_num(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #8 {
entry:
%cmp9 = icmp sgt i64 %n, 1
br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = add i64 %n, -1
%min.iters.check = icmp ult i64 %n, 5
br i1 %min.iters.check, label %for.body.preheader16, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %0, -4
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1, i64 0>, %vector.ph ], [ %9, %vector.body ]
%vec.phi12 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%offset.idx = or i64 %index, 1
%1 = getelementptr inbounds i64, ptr %a, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = getelementptr inbounds i64, ptr %1, i64 2
%wide.load13 = load <2 x i64>, ptr %2, align 8, !tbaa !5
%3 = getelementptr i64, ptr %1, i64 -1
%wide.load14 = load <2 x i64>, ptr %3, align 8, !tbaa !5
%4 = getelementptr i64, ptr %1, i64 1
%wide.load15 = load <2 x i64>, ptr %4, align 8, !tbaa !5
%5 = icmp ne <2 x i64> %wide.load, %wide.load14
%6 = icmp ne <2 x i64> %wide.load13, %wide.load15
%7 = zext <2 x i1> %5 to <2 x i64>
%8 = zext <2 x i1> %6 to <2 x i64>
%9 = add <2 x i64> %vec.phi, %7
%10 = add <2 x i64> %vec.phi12, %8
%index.next = add nuw i64 %index, 4
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !26
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %10, %9
%12 = tail call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %0, %n.vec
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader16
for.body.preheader16: ; preds = %for.body.preheader, %middle.block
%i.011.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
%ans.010.ph = phi i64 [ 1, %for.body.preheader ], [ %12, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%ans.0.lcssa = phi i64 [ 1, %entry ], [ %12, %middle.block ], [ %spec.select, %for.body ]
ret i64 %ans.0.lcssa
for.body: ; preds = %for.body.preheader16, %for.body
%i.011 = phi i64 [ %inc3, %for.body ], [ %i.011.ph, %for.body.preheader16 ]
%ans.010 = phi i64 [ %spec.select, %for.body ], [ %ans.010.ph, %for.body.preheader16 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.011
%13 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx1 = getelementptr i64, ptr %arrayidx, i64 -1
%14 = load i64, ptr %arrayidx1, align 8, !tbaa !5
%cmp2.not = icmp ne i64 %13, %14
%inc = zext i1 %cmp2.not to i64
%spec.select = add nuw nsw i64 %ans.010, %inc
%inc3 = add nuw nsw i64 %i.011, 1
%exitcond.not = icmp eq i64 %inc3, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !27
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #10 {
entry:
%0 = load i64, ptr %p, align 8, !tbaa !28
%1 = load i64, ptr %q, align 8, !tbaa !28
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #10 {
entry:
%0 = load i64, ptr %q, align 8, !tbaa !28
%1 = load i64, ptr %p, align 8, !tbaa !28
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #17
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #2 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #17
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #17
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%div = sdiv i64 %0, 3600
%rem = srem i64 %0, 3600
%div1.lhs.trunc = trunc i64 %rem to i16
%div13 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div13 to i64
%rem2 = srem i64 %0, 60
%call = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %div, i64 noundef %div1.sext, i64 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #17
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #15
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 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, 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 #10 = { 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 #11 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { 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 #13 = { 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 #14 = { nofree 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 #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !17}
!20 = !{!7, !7, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !7, i64 0}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10, !11, !12}
!27 = distinct !{!27, !10, !12, !11}
!28 = !{!29, !6, i64 0}
!29 = !{!"", !6, i64 0, !6, i64 8}
|
#include <stdio.h>
#include <stdlib.h>
int compare(const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}
int main()
{
long n,k,dif,i;
scanf("%ld %ld",&n,&k);
long a[n],b[n-1];
for (i=0;i<n;i++){
scanf("%ld",&a[i]);
if (i>0){
b[i-1]=a[i]-a[i-1];
}
}
qsort(b,n-1,sizeof(long),compare);
dif = a[n-1]-a[0];
for (i=0;i<k-1;i++){
dif-=b[n-2-i];
}
printf("%ld",dif);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24170/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24170/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !9
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !9
%sub = add nsw i64 %2, -1
%vla1 = alloca i64, i64 %sub, align 16
%cmp37 = icmp sgt i64 %2, 0
br i1 %cmp37, label %for.inc.peel, label %for.end
for.inc.peel: ; preds = %entry
%call2.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i64, ptr %n, align 8, !tbaa !9
%cmp.peel = icmp sgt i64 %3, 1
br i1 %cmp.peel, label %for.inc, label %for.end.loopexit
for.inc: ; preds = %for.inc.peel, %for.inc
%i.038 = phi i64 [ %inc, %for.inc ], [ 1, %for.inc.peel ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %i.038
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%4 = load i64, ptr %arrayidx, align 8, !tbaa !9
%sub5 = add nsw i64 %i.038, -1
%arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %sub5
%5 = load i64, ptr %arrayidx6, align 8, !tbaa !9
%sub7 = sub nsw i64 %4, %5
%arrayidx9 = getelementptr inbounds i64, ptr %vla1, i64 %sub5
store i64 %sub7, ptr %arrayidx9, align 8, !tbaa !9
%inc = add nuw nsw i64 %i.038, 1
%6 = load i64, ptr %n, align 8, !tbaa !9
%cmp = icmp slt i64 %inc, %6
br i1 %cmp, label %for.inc, label %for.end.loopexit, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc, %for.inc.peel
%.lcssa43 = phi i64 [ %3, %for.inc.peel ], [ %6, %for.inc ]
%.pre = add nsw i64 %.lcssa43, -1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%sub10.pre-phi = phi i64 [ %.pre, %for.end.loopexit ], [ %sub, %entry ]
call void @qsort(ptr noundef nonnull %vla1, i64 noundef %sub10.pre-phi, i64 noundef 8, ptr noundef nonnull @compare) #7
%7 = load i64, ptr %n, align 8, !tbaa !9
%8 = getelementptr i64, ptr %vla, i64 %7
%arrayidx12 = getelementptr i64, ptr %8, i64 -1
%9 = load i64, ptr %arrayidx12, align 8, !tbaa !9
%10 = load i64, ptr %vla, align 16, !tbaa !9
%sub14 = sub nsw i64 %9, %10
%11 = load i64, ptr %k, align 8, !tbaa !9
%cmp1739 = icmp sgt i64 %11, 1
br i1 %cmp1739, label %for.body18.lr.ph, label %for.end25
for.body18.lr.ph: ; preds = %for.end
%sub19 = add nsw i64 %7, -2
%12 = add i64 %11, -2
%13 = add i64 %11, -1
%min.iters.check = icmp ult i64 %11, 5
br i1 %min.iters.check, label %for.body18.preheader, label %vector.ph
vector.ph: ; preds = %for.body18.lr.ph
%n.vec = and i64 %13, -4
%14 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %sub14, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %14, %vector.ph ], [ %19, %vector.body ]
%vec.phi45 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%15 = sub i64 %sub19, %index
%16 = getelementptr inbounds i64, ptr %vla1, i64 %15
%17 = getelementptr inbounds i64, ptr %16, i64 -1
%wide.load = load <2 x i64>, ptr %17, align 8, !tbaa !9
%reverse = shufflevector <2 x i64> %wide.load, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
%18 = getelementptr inbounds i64, ptr %16, i64 -3
%wide.load46 = load <2 x i64>, ptr %18, align 8, !tbaa !9
%reverse47 = shufflevector <2 x i64> %wide.load46, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
%19 = sub <2 x i64> %vec.phi, %reverse
%20 = sub <2 x i64> %vec.phi45, %reverse47
%index.next = add nuw i64 %index, 4
%21 = icmp eq i64 %index.next, %n.vec
br i1 %21, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %20, %19
%22 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %13, %n.vec
br i1 %cmp.n, label %for.end25, label %for.body18.preheader
for.body18.preheader: ; preds = %for.body18.lr.ph, %middle.block
%dif.041.ph = phi i64 [ %sub14, %for.body18.lr.ph ], [ %22, %middle.block ]
%i.140.ph = phi i64 [ 0, %for.body18.lr.ph ], [ %n.vec, %middle.block ]
br label %for.body18
for.body18: ; preds = %for.body18.preheader, %for.body18
%dif.041 = phi i64 [ %sub22, %for.body18 ], [ %dif.041.ph, %for.body18.preheader ]
%i.140 = phi i64 [ %inc24, %for.body18 ], [ %i.140.ph, %for.body18.preheader ]
%sub20 = sub i64 %sub19, %i.140
%arrayidx21 = getelementptr inbounds i64, ptr %vla1, i64 %sub20
%23 = load i64, ptr %arrayidx21, align 8, !tbaa !9
%sub22 = sub nsw i64 %dif.041, %23
%inc24 = add nuw nsw i64 %i.140, 1
%exitcond.not = icmp eq i64 %i.140, %12
br i1 %exitcond.not, label %for.end25, label %for.body18, !llvm.loop !17
for.end25: ; preds = %for.body18, %middle.block, %for.end
%dif.0.lcssa = phi i64 [ %sub14, %for.end ], [ %22, %middle.block ], [ %sub22, %for.body18 ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %dif.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #7
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: 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 i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
|
#include<stdio.h>
int main(){
int h, m, s;
scanf("%d",&s);
h=s/3600;
m=s%3600/60;
s=s%3600%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241743/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241743/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
store i32 %rem3.sext, ptr %s, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int h, m, s;
scanf("%d", &s);
h = s / 3600;
m = s % 3600 / 60;
s = s % 60;
printf("%d:%d:%d\n", h, m, s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241794/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241794/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i32, ptr %s, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
store i32 %rem2, ptr %s, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int S, h, m, s;
scanf("%d", &S);
h = (S/3600);
m = (S -(3600*h))/60;
s = (S -(3600*h)-(m*60));
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241837/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241837/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
%div1 = sdiv i32 %sub, 60
%mul4.neg = mul nsw i32 %div1, -60
%sub5 = add i32 %mul4.neg, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a;
scanf("%d", &a);
printf("%d:%d:%d\n", a/3600, (a%3600)/60, (a%3600)%60);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241880/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241880/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem36 = srem i16 %div1.lhs.trunc, 60
%rem3.sext = sext i16 %rem36 to i32
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem3.sext)
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(void)
{
int n, h, m, s;
scanf("%d",&n);
h = n/3600;
m = n%3600/60;
s = n%60;
printf("%d:%d:%d\n", h, m, s );
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241923/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241923/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
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 S;
int h, m, s;
scanf("%d",&S);
h=S/3600;
S%=3600;
m=S/60;
s=S%60;
printf("%d:%d:%d\n", h, m, s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241967/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241967/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %S, align 4, !tbaa !5
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem25 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem25 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int N,h,m,s;
scanf ("%d",&N);
h=(N/3600);
m=(N%3600/60);
s=(N%60);
printf ("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242016/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242016/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2)
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 S,h,m,s,x;
scanf("%d",&S);
h=S/3600;
x=S%3600;
m=x/60;
s=x%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242067/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242067/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
%div1.lhs.trunc = trunc i32 %rem to i16
%div15 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div15 to i32
%rem26 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem26 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int second, hour, minute;
scanf("%d", &second);
minute = second / 60;
second %= 60;
hour = minute / 60;
minute %= 60;
printf("%d:%d:%d\n", hour, minute, second);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242153/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242153/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%second = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %second) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %second)
%0 = load i32, ptr %second, align 4, !tbaa !5
%div = sdiv i32 %0, 60
%rem = srem i32 %0, 60
store i32 %rem, ptr %second, align 4, !tbaa !5
%div1 = sdiv i32 %0, 3600
%rem2 = srem i32 %div, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div1, i32 noundef %rem2, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %second) #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 S,h,m,s;
scanf("%d",&S);
s=S%60;
S/=60;
m=S%60;
S/=60;
h=S;
printf("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242197/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242197/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%rem = srem i32 %0, 60
%div = sdiv i32 %0, 60
%rem1 = srem i32 %div, 60
%div2 = sdiv i32 %0, 3600
store i32 %div2, ptr %S, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div2, i32 noundef %rem1, i32 noundef %rem)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,i,j;
scanf("%d",&n);
char a[500][500];
for(i=0;i<n;++i)
scanf("%s",&a[i]);
int ch=0;
char x=a[0][0];
for(i=0;i<n;++i)
{
if(a[i][i]!=x)
{
ch=1;
}
}
for(i=0;i<n;++i)
{
for(j=0;j<n;++j)
{
if((i+j)==(n-1) && a[i][j]!=x)
{
ch=1;
}
}
}
x=a[0][1];
if(x==a[0][0])
ch=1;
for(i=0;i<n;++i)
{
for(j=0;j<n;++j)
{
if(i==j || (i+j)==(n-1))
;
else if(a[i][j]!=x)
{
ch=1;
}
}
}
if(ch==1)
printf("NO");
else
printf("YES");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24224/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24224/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [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
%a = alloca [500 x [500 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 250000, ptr nonnull %a) #3
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp122 = icmp sgt i32 %0, 0
br i1 %cmp122, label %for.body, label %if.end91
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !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
%.pre = load i8, ptr %a, align 16, !tbaa !11
%cmp5124 = icmp sgt i32 %1, 0
br i1 %cmp5124, label %for.body6.preheader, label %for.end42.thread
for.body6.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body6.preheader199, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i8> poison, i8 %.pre, i64 0
%broadcast.splat = shufflevector <4 x i8> %broadcast.splatinsert, <4 x i8> 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 ], [ %36, %vector.body ]
%vec.phi195 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %37, %vector.body ]
%3 = or i64 %index, 1
%4 = or i64 %index, 2
%5 = or i64 %index, 3
%6 = or i64 %index, 4
%7 = or i64 %index, 5
%8 = or i64 %index, 6
%9 = or i64 %index, 7
%10 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %index, i64 %index
%11 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %3, i64 %3
%12 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %4, i64 %4
%13 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %5, i64 %5
%14 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %6, i64 %6
%15 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %7, i64 %7
%16 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %8, i64 %8
%17 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %9, i64 %9
%18 = load i8, ptr %10, align 8, !tbaa !11
%19 = load i8, ptr %11, align 1, !tbaa !11
%20 = load i8, ptr %12, align 2, !tbaa !11
%21 = load i8, ptr %13, align 1, !tbaa !11
%22 = insertelement <4 x i8> poison, i8 %18, i64 0
%23 = insertelement <4 x i8> %22, i8 %19, i64 1
%24 = insertelement <4 x i8> %23, i8 %20, i64 2
%25 = insertelement <4 x i8> %24, i8 %21, i64 3
%26 = load i8, ptr %14, align 4, !tbaa !11
%27 = load i8, ptr %15, align 1, !tbaa !11
%28 = load i8, ptr %16, align 2, !tbaa !11
%29 = load i8, ptr %17, align 1, !tbaa !11
%30 = insertelement <4 x i8> poison, i8 %26, i64 0
%31 = insertelement <4 x i8> %30, i8 %27, i64 1
%32 = insertelement <4 x i8> %31, i8 %28, i64 2
%33 = insertelement <4 x i8> %32, i8 %29, i64 3
%34 = icmp eq <4 x i8> %25, %broadcast.splat
%35 = icmp eq <4 x i8> %33, %broadcast.splat
%36 = select <4 x i1> %34, <4 x i32> %vec.phi, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%37 = select <4 x i1> %35, <4 x i32> %vec.phi195, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%index.next = add nuw i64 %index, 8
%38 = icmp eq i64 %index.next, %n.vec
br i1 %38, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%rdx.select.cmp.not = icmp ne <4 x i32> %36, zeroinitializer
%rdx.select.cmp196198 = icmp ne <4 x i32> %37, zeroinitializer
%rdx.select.cmp196 = select <4 x i1> %rdx.select.cmp.not, <4 x i1> <i1 true, i1 true, i1 true, i1 true>, <4 x i1> %rdx.select.cmp196198
%39 = bitcast <4 x i1> %rdx.select.cmp196 to i4
%.not = icmp ne i4 %39, 0
%rdx.select197 = zext i1 %.not to i32
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond17.preheader, label %for.body6.preheader199
for.body6.preheader199: ; preds = %for.body6.preheader, %middle.block
%indvars.iv147.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
%ch.0126.ph = phi i32 [ 0, %for.body6.preheader ], [ %rdx.select197, %middle.block ]
br label %for.body6
for.cond17.preheader: ; preds = %for.body6, %middle.block
%spec.select.lcssa = phi i32 [ %rdx.select197, %middle.block ], [ %spec.select, %for.body6 ]
br i1 %cmp5124, label %for.cond21.preheader.lr.ph, label %for.end42.thread
for.cond21.preheader.lr.ph: ; preds = %for.cond17.preheader
%sub = add nsw i32 %1, -1
%40 = zext i32 %sub to i64
%wide.trip.count159 = zext i32 %1 to i64
%41 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%42 = icmp eq i64 %41, 0
%unroll_iter = and i64 %wide.trip.count, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond21.preheader.us
for.cond21.preheader.us: ; preds = %for.cond21.for.inc40_crit_edge.us, %for.cond21.preheader.lr.ph
%indvars.iv156 = phi i64 [ %indvars.iv.next157, %for.cond21.for.inc40_crit_edge.us ], [ 0, %for.cond21.preheader.lr.ph ]
%ch.2134.us = phi i32 [ %ch.4.us.lcssa, %for.cond21.for.inc40_crit_edge.us ], [ %spec.select.lcssa, %for.cond21.preheader.lr.ph ]
br i1 %42, label %for.cond21.for.inc40_crit_edge.us.unr-lcssa, label %for.body24.us
for.body24.us: ; preds = %for.cond21.preheader.us, %for.inc37.us.1
%indvars.iv150 = phi i64 [ %indvars.iv.next151.1, %for.inc37.us.1 ], [ 0, %for.cond21.preheader.us ]
%ch.3130.us = phi i32 [ %ch.4.us.1, %for.inc37.us.1 ], [ %ch.2134.us, %for.cond21.preheader.us ]
%niter = phi i64 [ %niter.next.1, %for.inc37.us.1 ], [ 0, %for.cond21.preheader.us ]
%43 = add nuw nsw i64 %indvars.iv150, %indvars.iv156
%cmp25.us = icmp eq i64 %43, %40
br i1 %cmp25.us, label %land.lhs.true.us, label %for.inc37.us
land.lhs.true.us: ; preds = %for.body24.us
%arrayidx30.us = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv150
%44 = load i8, ptr %arrayidx30.us, align 2, !tbaa !11
%cmp33.not.us = icmp eq i8 %44, %.pre
%spec.select119.us = select i1 %cmp33.not.us, i32 %ch.3130.us, i32 1
br label %for.inc37.us
for.inc37.us: ; preds = %land.lhs.true.us, %for.body24.us
%ch.4.us = phi i32 [ %ch.3130.us, %for.body24.us ], [ %spec.select119.us, %land.lhs.true.us ]
%indvars.iv.next151 = or i64 %indvars.iv150, 1
%45 = add nuw nsw i64 %indvars.iv.next151, %indvars.iv156
%cmp25.us.1 = icmp eq i64 %45, %40
br i1 %cmp25.us.1, label %land.lhs.true.us.1, label %for.inc37.us.1
land.lhs.true.us.1: ; preds = %for.inc37.us
%arrayidx30.us.1 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv.next151
%46 = load i8, ptr %arrayidx30.us.1, align 1, !tbaa !11
%cmp33.not.us.1 = icmp eq i8 %46, %.pre
%spec.select119.us.1 = select i1 %cmp33.not.us.1, i32 %ch.4.us, i32 1
br label %for.inc37.us.1
for.inc37.us.1: ; preds = %land.lhs.true.us.1, %for.inc37.us
%ch.4.us.1 = phi i32 [ %ch.4.us, %for.inc37.us ], [ %spec.select119.us.1, %land.lhs.true.us.1 ]
%indvars.iv.next151.1 = add nuw nsw i64 %indvars.iv150, 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.cond21.for.inc40_crit_edge.us.unr-lcssa, label %for.body24.us, !llvm.loop !15
for.cond21.for.inc40_crit_edge.us.unr-lcssa: ; preds = %for.inc37.us.1, %for.cond21.preheader.us
%ch.4.us.lcssa.ph = phi i32 [ undef, %for.cond21.preheader.us ], [ %ch.4.us.1, %for.inc37.us.1 ]
%indvars.iv150.unr = phi i64 [ 0, %for.cond21.preheader.us ], [ %indvars.iv.next151.1, %for.inc37.us.1 ]
%ch.3130.us.unr = phi i32 [ %ch.2134.us, %for.cond21.preheader.us ], [ %ch.4.us.1, %for.inc37.us.1 ]
br i1 %lcmp.mod.not, label %for.cond21.for.inc40_crit_edge.us, label %for.body24.us.epil
for.body24.us.epil: ; preds = %for.cond21.for.inc40_crit_edge.us.unr-lcssa
%47 = add nuw nsw i64 %indvars.iv150.unr, %indvars.iv156
%cmp25.us.epil = icmp eq i64 %47, %40
br i1 %cmp25.us.epil, label %land.lhs.true.us.epil, label %for.cond21.for.inc40_crit_edge.us
land.lhs.true.us.epil: ; preds = %for.body24.us.epil
%arrayidx30.us.epil = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv156, i64 %indvars.iv150.unr
%48 = load i8, ptr %arrayidx30.us.epil, align 1, !tbaa !11
%cmp33.not.us.epil = icmp eq i8 %48, %.pre
%spec.select119.us.epil = select i1 %cmp33.not.us.epil, i32 %ch.3130.us.unr, i32 1
br label %for.cond21.for.inc40_crit_edge.us
for.cond21.for.inc40_crit_edge.us: ; preds = %for.body24.us.epil, %land.lhs.true.us.epil, %for.cond21.for.inc40_crit_edge.us.unr-lcssa
%ch.4.us.lcssa = phi i32 [ %ch.4.us.lcssa.ph, %for.cond21.for.inc40_crit_edge.us.unr-lcssa ], [ %ch.3130.us.unr, %for.body24.us.epil ], [ %spec.select119.us.epil, %land.lhs.true.us.epil ]
%indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
%exitcond160.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count159
br i1 %exitcond160.not, label %for.end42, label %for.cond21.preheader.us, !llvm.loop !16
for.body6: ; preds = %for.body6.preheader199, %for.body6
%indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.body6 ], [ %indvars.iv147.ph, %for.body6.preheader199 ]
%ch.0126 = phi i32 [ %spec.select, %for.body6 ], [ %ch.0126.ph, %for.body6.preheader199 ]
%arrayidx10 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv147, i64 %indvars.iv147
%49 = load i8, ptr %arrayidx10, align 1, !tbaa !11
%cmp12.not = icmp eq i8 %49, %.pre
%spec.select = select i1 %cmp12.not, i32 %ch.0126, i32 1
%indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
%exitcond.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count
br i1 %exitcond.not, label %for.cond17.preheader, label %for.body6, !llvm.loop !17
for.end42.thread: ; preds = %for.cond17.preheader, %for.end
%ch.2.lcssa.ph = phi i32 [ %spec.select.lcssa, %for.cond17.preheader ], [ 0, %for.end ]
%arrayidx44185 = getelementptr inbounds [500 x i8], ptr %a, i64 0, i64 1
%50 = load i8, ptr %arrayidx44185, align 1, !tbaa !11
%cmp49186 = icmp eq i8 %50, %.pre
br i1 %cmp49186, label %if.end91, label %for.end84
for.end42: ; preds = %for.cond21.for.inc40_crit_edge.us
%arrayidx44 = getelementptr inbounds [500 x i8], ptr %a, i64 0, i64 1
%51 = load i8, ptr %arrayidx44, align 1, !tbaa !11
%cmp49 = icmp eq i8 %51, %.pre
%spec.select120 = select i1 %cmp49, i32 1, i32 %ch.4.us.lcssa
br i1 %cmp5124, label %for.cond57.preheader.lr.ph, label %for.end84
for.cond57.preheader.lr.ph: ; preds = %for.end42
%sub64 = add nsw i32 %1, -1
%52 = zext i32 %sub64 to i64
%wide.trip.count170 = zext i32 %1 to i64
%xtraiter204 = and i64 %wide.trip.count, 1
%53 = icmp eq i64 %41, 0
%unroll_iter207 = and i64 %wide.trip.count, 4294967294
%lcmp.mod205.not = icmp eq i64 %xtraiter204, 0
br label %for.cond57.preheader.us
for.cond57.preheader.us: ; preds = %for.cond57.for.inc82_crit_edge.us, %for.cond57.preheader.lr.ph
%indvars.iv167 = phi i64 [ %indvars.iv.next168, %for.cond57.for.inc82_crit_edge.us ], [ 0, %for.cond57.preheader.lr.ph ]
%ch.6142.us = phi i32 [ %ch.8.us.lcssa, %for.cond57.for.inc82_crit_edge.us ], [ %spec.select120, %for.cond57.preheader.lr.ph ]
br i1 %53, label %for.cond57.for.inc82_crit_edge.us.unr-lcssa, label %for.body60.us
for.body60.us: ; preds = %for.cond57.preheader.us, %for.inc79.us.1
%indvars.iv161 = phi i64 [ %indvars.iv.next162.1, %for.inc79.us.1 ], [ 0, %for.cond57.preheader.us ]
%ch.7138.us = phi i32 [ %ch.8.us.1, %for.inc79.us.1 ], [ %ch.6142.us, %for.cond57.preheader.us ]
%niter208 = phi i64 [ %niter208.next.1, %for.inc79.us.1 ], [ 0, %for.cond57.preheader.us ]
%cmp61.us = icmp eq i64 %indvars.iv167, %indvars.iv161
%54 = add nuw nsw i64 %indvars.iv161, %indvars.iv167
%cmp65.us = icmp eq i64 %54, %52
%or.cond = select i1 %cmp61.us, i1 true, i1 %cmp65.us
br i1 %or.cond, label %for.inc79.us, label %if.else.us
if.else.us: ; preds = %for.body60.us
%arrayidx71.us = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv167, i64 %indvars.iv161
%55 = load i8, ptr %arrayidx71.us, align 2, !tbaa !11
%cmp74.not.us = icmp eq i8 %55, %51
%spec.select121.us = select i1 %cmp74.not.us, i32 %ch.7138.us, i32 1
br label %for.inc79.us
for.inc79.us: ; preds = %if.else.us, %for.body60.us
%ch.8.us = phi i32 [ %ch.7138.us, %for.body60.us ], [ %spec.select121.us, %if.else.us ]
%indvars.iv.next162 = or i64 %indvars.iv161, 1
%cmp61.us.1 = icmp eq i64 %indvars.iv167, %indvars.iv.next162
%56 = add nuw nsw i64 %indvars.iv.next162, %indvars.iv167
%cmp65.us.1 = icmp eq i64 %56, %52
%or.cond.1 = select i1 %cmp61.us.1, i1 true, i1 %cmp65.us.1
br i1 %or.cond.1, label %for.inc79.us.1, label %if.else.us.1
if.else.us.1: ; preds = %for.inc79.us
%arrayidx71.us.1 = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv167, i64 %indvars.iv.next162
%57 = load i8, ptr %arrayidx71.us.1, align 1, !tbaa !11
%cmp74.not.us.1 = icmp eq i8 %57, %51
%spec.select121.us.1 = select i1 %cmp74.not.us.1, i32 %ch.8.us, i32 1
br label %for.inc79.us.1
for.inc79.us.1: ; preds = %if.else.us.1, %for.inc79.us
%ch.8.us.1 = phi i32 [ %ch.8.us, %for.inc79.us ], [ %spec.select121.us.1, %if.else.us.1 ]
%indvars.iv.next162.1 = add nuw nsw i64 %indvars.iv161, 2
%niter208.next.1 = add i64 %niter208, 2
%niter208.ncmp.1 = icmp eq i64 %niter208.next.1, %unroll_iter207
br i1 %niter208.ncmp.1, label %for.cond57.for.inc82_crit_edge.us.unr-lcssa, label %for.body60.us, !llvm.loop !18
for.cond57.for.inc82_crit_edge.us.unr-lcssa: ; preds = %for.inc79.us.1, %for.cond57.preheader.us
%ch.8.us.lcssa.ph = phi i32 [ undef, %for.cond57.preheader.us ], [ %ch.8.us.1, %for.inc79.us.1 ]
%indvars.iv161.unr = phi i64 [ 0, %for.cond57.preheader.us ], [ %indvars.iv.next162.1, %for.inc79.us.1 ]
%ch.7138.us.unr = phi i32 [ %ch.6142.us, %for.cond57.preheader.us ], [ %ch.8.us.1, %for.inc79.us.1 ]
br i1 %lcmp.mod205.not, label %for.cond57.for.inc82_crit_edge.us, label %for.body60.us.epil
for.body60.us.epil: ; preds = %for.cond57.for.inc82_crit_edge.us.unr-lcssa
%cmp61.us.epil = icmp eq i64 %indvars.iv167, %indvars.iv161.unr
%58 = add nuw nsw i64 %indvars.iv161.unr, %indvars.iv167
%cmp65.us.epil = icmp eq i64 %58, %52
%or.cond.epil = select i1 %cmp61.us.epil, i1 true, i1 %cmp65.us.epil
br i1 %or.cond.epil, label %for.cond57.for.inc82_crit_edge.us, label %if.else.us.epil
if.else.us.epil: ; preds = %for.body60.us.epil
%arrayidx71.us.epil = getelementptr inbounds [500 x [500 x i8]], ptr %a, i64 0, i64 %indvars.iv167, i64 %indvars.iv161.unr
%59 = load i8, ptr %arrayidx71.us.epil, align 1, !tbaa !11
%cmp74.not.us.epil = icmp eq i8 %59, %51
%spec.select121.us.epil = select i1 %cmp74.not.us.epil, i32 %ch.7138.us.unr, i32 1
br label %for.cond57.for.inc82_crit_edge.us
for.cond57.for.inc82_crit_edge.us: ; preds = %for.body60.us.epil, %if.else.us.epil, %for.cond57.for.inc82_crit_edge.us.unr-lcssa
%ch.8.us.lcssa = phi i32 [ %ch.8.us.lcssa.ph, %for.cond57.for.inc82_crit_edge.us.unr-lcssa ], [ %ch.7138.us.unr, %for.body60.us.epil ], [ %spec.select121.us.epil, %if.else.us.epil ]
%indvars.iv.next168 = add nuw nsw i64 %indvars.iv167, 1
%exitcond171.not = icmp eq i64 %indvars.iv.next168, %wide.trip.count170
br i1 %exitcond171.not, label %for.end84, label %for.cond57.preheader.us, !llvm.loop !19
for.end84: ; preds = %for.cond57.for.inc82_crit_edge.us, %for.end42.thread, %for.end42
%ch.6.lcssa = phi i32 [ %spec.select120, %for.end42 ], [ %ch.2.lcssa.ph, %for.end42.thread ], [ %ch.8.us.lcssa, %for.cond57.for.inc82_crit_edge.us ]
%cmp85 = icmp eq i32 %ch.6.lcssa, 1
%spec.select194 = select i1 %cmp85, ptr @.str.2, ptr @.str.3
br label %if.end91
if.end91: ; preds = %for.end84, %for.end42.thread, %entry
%.str.3.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %for.end42.thread ], [ %spec.select194, %for.end84 ]
%call90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 250000, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !14, !13}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
int main(void)
{
int h,m,s,S;
scanf("%d",&S);
h=S/3600;
S=S%3600;
m=S/60;
s=S%60;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i32, ptr %S, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %S, align 4, !tbaa !5
%div1.lhs.trunc = trunc i32 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i32
%rem25 = srem i16 %div1.lhs.trunc, 60
%rem2.sext = sext i16 %rem25 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div1.sext, i32 noundef %rem2.sext)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int no = 0;
scanf("%d", &no);
printf("%d:%d:%d\n", no/3600, no/60%60, no%60);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242326/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242326/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d:%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%no = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no) #3
store i32 0, ptr %no, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %no)
%0 = load i32, ptr %no, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%div1 = sdiv i32 %0, 60
%rem = srem i32 %div1, 60
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, i32 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no) #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,flag1,flag2;
scanf("%d",&n);
getchar();
char str[n+1][n+1],chd,cho;
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
scanf("%c",&str[i][j]);
}
getchar();
}
chd=str[1][1];
cho=str[1][2];
//printf("%c %c\n",chd,cho);
flag1=1;
flag2=1;
if(chd==cho)
{
flag1=0;
flag2=0;
}
else
{
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
if((i==j)||((i+j)==(n+1)))
{
if(str[i][j]!=chd)
flag1=0;
//break;
//printf("%d %d\n",i,j);
}
else
{
if(str[i][j]!=cho)
flag2=0;
//break;
}
}
if(flag1==0||flag2==0)
break;
}
}
if(flag1&&flag2)
printf("YES");
else
printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24237/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24237/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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 ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%1 = load i32, ptr %n, align 4, !tbaa !9
%add = add nsw i32 %1, 1
%2 = zext i32 %add to i64
%3 = call ptr @llvm.stacksave.p0()
%4 = mul nuw i64 %2, %2
%vla = alloca i8, i64 %4, align 16
%5 = load i32, ptr %n, align 4, !tbaa !9
%cmp.not106 = icmp slt i32 %5, 1
br i1 %cmp.not106, label %if.end75, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry, %for.end
%6 = phi i32 [ %11, %for.end ], [ %5, %entry ]
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.end ], [ 1, %entry ]
%cmp4.not104 = icmp slt i32 %6, 1
br i1 %cmp4.not104, label %for.end, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%7 = mul nuw nsw i64 %indvars.iv126, %2
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %7
br label %for.body5
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%indvars.iv = phi i64 [ 1, %for.body5.lr.ph ], [ %indvars.iv.next, %for.body5 ]
%arrayidx7 = getelementptr inbounds i8, ptr %arrayidx, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !9
%9 = sext i32 %8 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv, %9
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body5, %for.cond3.preheader
%10 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i98 = call i32 @getc(ptr noundef %10)
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%11 = load i32, ptr %n, align 4, !tbaa !9
%12 = sext i32 %11 to i64
%cmp.not.not = icmp slt i64 %indvars.iv126, %12
br i1 %cmp.not.not, label %for.cond3.preheader, label %for.end12, !llvm.loop !13
for.end12: ; preds = %for.end
%arrayidx13.phi.trans.insert = getelementptr inbounds i8, ptr %vla, i64 %2
%arrayidx14.phi.trans.insert = getelementptr inbounds i8, ptr %arrayidx13.phi.trans.insert, i64 1
%.pre = load i8, ptr %arrayidx14.phi.trans.insert, align 1, !tbaa !14
%arrayidx16.phi.trans.insert = getelementptr inbounds i8, ptr %arrayidx13.phi.trans.insert, i64 2
%.pre139 = load i8, ptr %arrayidx16.phi.trans.insert, align 1, !tbaa !14
%cmp18 = icmp eq i8 %.pre, %.pre139
br i1 %cmp18, label %if.else73, label %for.cond20.preheader
for.cond20.preheader: ; preds = %for.end12
%cmp21.not114 = icmp slt i32 %11, 1
br i1 %cmp21.not114, label %if.end75, label %for.cond24.preheader.lr.ph
for.cond24.preheader.lr.ph: ; preds = %for.cond20.preheader
%add31 = add nuw i32 %11, 1
%13 = zext i32 %add31 to i64
%14 = add nsw i64 %13, -1
%xtraiter = and i64 %14, 1
%15 = icmp eq i32 %add31, 2
%unroll_iter = and i64 %14, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond24.preheader
for.cond20: ; preds = %for.cond24.for.end58_crit_edge
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%exitcond137.not = icmp eq i64 %indvars.iv.next134, %13
br i1 %exitcond137.not, label %if.end69, label %for.cond24.preheader, !llvm.loop !15
for.cond24.preheader: ; preds = %for.cond24.preheader.lr.ph, %for.cond20
%indvars.iv133 = phi i64 [ 1, %for.cond24.preheader.lr.ph ], [ %indvars.iv.next134, %for.cond20 ]
%16 = mul nuw nsw i64 %indvars.iv133, %2
%arrayidx46 = getelementptr inbounds i8, ptr %vla, i64 %16
br i1 %15, label %for.cond24.for.end58_crit_edge.unr-lcssa, label %for.body27
for.body27: ; preds = %for.cond24.preheader, %for.body27
%indvars.iv129 = phi i64 [ %indvars.iv.next130.1, %for.body27 ], [ 1, %for.cond24.preheader ]
%flag1.1110 = phi i32 [ %flag1.2.1, %for.body27 ], [ 1, %for.cond24.preheader ]
%flag2.1109 = phi i32 [ %flag2.2.1, %for.body27 ], [ 1, %for.cond24.preheader ]
%niter = phi i64 [ %niter.next.1, %for.body27 ], [ 0, %for.cond24.preheader ]
%cmp28 = icmp eq i64 %indvars.iv133, %indvars.iv129
%17 = add nuw nsw i64 %indvars.iv129, %indvars.iv133
%cmp32 = icmp eq i64 %17, %13
%or.cond123 = select i1 %cmp28, i1 true, i1 %cmp32
%arrayidx38 = getelementptr inbounds i8, ptr %arrayidx46, i64 %indvars.iv129
%18 = load i8, ptr %arrayidx38, align 1, !tbaa !14
%cmp41.not = icmp eq i8 %18, %.pre
%spec.select = select i1 %cmp41.not, i32 %flag1.1110, i32 0
%cmp51.not = icmp eq i8 %18, %.pre139
%19 = select i1 %or.cond123, i1 true, i1 %cmp51.not
%flag1.2 = select i1 %or.cond123, i32 %spec.select, i32 %flag1.1110
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%cmp28.1 = icmp eq i64 %indvars.iv133, %indvars.iv.next130
%20 = add nuw nsw i64 %indvars.iv.next130, %indvars.iv133
%cmp32.1 = icmp eq i64 %20, %13
%or.cond123.1 = select i1 %cmp28.1, i1 true, i1 %cmp32.1
%arrayidx38.1 = getelementptr inbounds i8, ptr %arrayidx46, i64 %indvars.iv.next130
%21 = load i8, ptr %arrayidx38.1, align 1, !tbaa !14
%cmp41.not.1 = icmp eq i8 %21, %.pre
%spec.select.1 = select i1 %cmp41.not.1, i32 %flag1.2, i32 0
%cmp51.not.1 = icmp eq i8 %21, %.pre139
%22 = select i1 %or.cond123.1, i1 true, i1 %cmp51.not.1
%23 = select i1 %22, i1 %19, i1 false
%flag2.2.1 = select i1 %23, i32 %flag2.1109, i32 0
%flag1.2.1 = select i1 %or.cond123.1, i32 %spec.select.1, i32 %flag1.2
%indvars.iv.next130.1 = add nuw nsw i64 %indvars.iv129, 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.cond24.for.end58_crit_edge.unr-lcssa, label %for.body27, !llvm.loop !16
for.cond24.for.end58_crit_edge.unr-lcssa: ; preds = %for.body27, %for.cond24.preheader
%flag2.2.lcssa.ph = phi i32 [ undef, %for.cond24.preheader ], [ %flag2.2.1, %for.body27 ]
%flag1.2.lcssa.ph = phi i32 [ undef, %for.cond24.preheader ], [ %flag1.2.1, %for.body27 ]
%indvars.iv129.unr = phi i64 [ 1, %for.cond24.preheader ], [ %indvars.iv.next130.1, %for.body27 ]
%flag1.1110.unr = phi i32 [ 1, %for.cond24.preheader ], [ %flag1.2.1, %for.body27 ]
%flag2.1109.unr = phi i32 [ 1, %for.cond24.preheader ], [ %flag2.2.1, %for.body27 ]
br i1 %lcmp.mod.not, label %for.cond24.for.end58_crit_edge, label %for.body27.epil
for.body27.epil: ; preds = %for.cond24.for.end58_crit_edge.unr-lcssa
%cmp28.epil = icmp eq i64 %indvars.iv133, %indvars.iv129.unr
%24 = add nuw nsw i64 %indvars.iv129.unr, %indvars.iv133
%cmp32.epil = icmp eq i64 %24, %13
%or.cond123.epil = select i1 %cmp28.epil, i1 true, i1 %cmp32.epil
%arrayidx38.epil = getelementptr inbounds i8, ptr %arrayidx46, i64 %indvars.iv129.unr
%25 = load i8, ptr %arrayidx38.epil, align 1, !tbaa !14
%cmp41.not.epil = icmp eq i8 %25, %.pre
%spec.select.epil = select i1 %cmp41.not.epil, i32 %flag1.1110.unr, i32 0
%cmp51.not.epil = icmp eq i8 %25, %.pre139
%26 = select i1 %or.cond123.epil, i1 true, i1 %cmp51.not.epil
%flag2.2.epil = select i1 %26, i32 %flag2.1109.unr, i32 0
%flag1.2.epil = select i1 %or.cond123.epil, i32 %spec.select.epil, i32 %flag1.1110.unr
br label %for.cond24.for.end58_crit_edge
for.cond24.for.end58_crit_edge: ; preds = %for.cond24.for.end58_crit_edge.unr-lcssa, %for.body27.epil
%flag2.2.lcssa = phi i32 [ %flag2.2.lcssa.ph, %for.cond24.for.end58_crit_edge.unr-lcssa ], [ %flag2.2.epil, %for.body27.epil ]
%flag1.2.lcssa = phi i32 [ %flag1.2.lcssa.ph, %for.cond24.for.end58_crit_edge.unr-lcssa ], [ %flag1.2.epil, %for.body27.epil ]
%cmp59 = icmp eq i32 %flag1.2.lcssa, 0
%cmp62 = icmp eq i32 %flag2.2.lcssa, 0
%or.cond = select i1 %cmp59, i1 true, i1 %cmp62
br i1 %or.cond, label %if.end69, label %for.cond20
if.end69: ; preds = %for.cond24.for.end58_crit_edge, %for.cond20
%flag2.3.ph = phi i32 [ %flag2.2.lcssa, %for.cond24.for.end58_crit_edge ], [ 1, %for.cond20 ]
%flag1.3.ph = phi i32 [ %flag1.2.lcssa, %for.cond24.for.end58_crit_edge ], [ 1, %for.cond20 ]
%27 = icmp ne i32 %flag1.3.ph, 0
%28 = icmp ne i32 %flag2.3.ph, 0
%29 = select i1 %27, i1 %28, i1 false
br i1 %29, label %if.end75, label %if.else73
if.else73: ; preds = %for.end12, %if.end69
br label %if.end75
if.end75: ; preds = %if.end69, %for.cond20.preheader, %entry, %if.else73
%.str.3.sink = phi ptr [ @.str.3, %if.else73 ], [ @.str.2, %entry ], [ @.str.2, %for.cond20.preheader ], [ @.str.2, %if.end69 ]
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.stackrestore.p0(ptr %3)
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
; Function Attrs: nofree nounwind
declare noundef i32 @getc(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 = { 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 = !{!"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 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
|
#include<stdio.h>
int main(){
char x[350][350];
char t,d,nd;
int i,j,n,check=0;
scanf("%d",&n);
getchar();
for (i=0;i<n;i++){
for (j=0;j<n;j++){
t=getchar();
x[i][j]=t;
}
getchar();
}
d=x[0][0];
nd=x[0][1];
if (d==nd) check=1;
for (i=0;i<n;i++){
for (j=0;j<n;j++){
if ((i==j)||(i+j==n-1)){
if (x[i][j]!=d){
check=1;
break;
}
}
else {
if (x[i][j]!=nd) {
check=1;
break;
}
}
}
if (check) break;
}
if (check) printf("NO\n");
else printf("YES\n");
//printf("\n");
//for (i=0;i<n;i++) {for (j=0;j<n;j++) printf("%c",x[i][j]); printf("\n");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24242/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24242/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@str = 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:
%x = alloca [350 x [350 x i8]], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 122500, ptr nonnull %x) #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 ptr, ptr @stdin, align 8, !tbaa !5
%call.i = call i32 @getc(ptr noundef %0)
%1 = load i32, ptr %n, align 4, !tbaa !9
%cmp99 = icmp sgt i32 %1, 0
br i1 %cmp99, label %for.cond2.preheader, label %if.else65
for.cond2.preheader: ; preds = %entry, %for.end
%2 = phi i32 [ %7, %for.end ], [ %1, %entry ]
%indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.end ], [ 0, %entry ]
%cmp397 = icmp sgt i32 %2, 0
br i1 %cmp397, label %for.body4, label %for.end
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond2.preheader ]
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i88 = call i32 @getc(ptr noundef %3)
%conv = trunc i32 %call.i88 to i8
%arrayidx7 = getelementptr inbounds [350 x [350 x i8]], ptr %x, i64 0, i64 %indvars.iv110, i64 %indvars.iv
store i8 %conv, ptr %arrayidx7, align 1, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !9
%5 = sext i32 %4 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp3, label %for.body4, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body4, %for.cond2.preheader
%6 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i89 = call i32 @getc(ptr noundef %6)
%indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1
%7 = load i32, ptr %n, align 4, !tbaa !9
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next111, %8
br i1 %cmp, label %for.cond2.preheader, label %for.end11, !llvm.loop !14
for.end11: ; preds = %for.end
%.pre = load i8, ptr %x, align 16, !tbaa !11
%arrayidx15.phi.trans.insert = getelementptr inbounds [350 x i8], ptr %x, i64 0, i64 1
%.pre121 = load i8, ptr %arrayidx15.phi.trans.insert, align 1, !tbaa !11
%cmp18 = icmp ne i8 %.pre, %.pre121
%cmp21103 = icmp sgt i32 %7, 0
br i1 %cmp21103, label %for.cond24.preheader.lr.ph, label %for.end61
for.cond24.preheader.lr.ph: ; preds = %for.end11
%sub = add nsw i32 %7, -1
%9 = zext i32 %sub to i64
%wide.trip.count119 = zext i32 %7 to i64
br label %for.cond24.preheader.us
for.cond24.preheader.us: ; preds = %for.cond20.us, %for.cond24.preheader.lr.ph
%indvars.iv117 = phi i64 [ %indvars.iv.next118, %for.cond20.us ], [ 0, %for.cond24.preheader.lr.ph ]
%check.1105.us = phi i1 [ true, %for.cond20.us ], [ %cmp18, %for.cond24.preheader.lr.ph ]
br label %for.body27.us
for.body27.us: ; preds = %for.cond24.preheader.us, %for.inc54.us
%indvars.iv113 = phi i64 [ 0, %for.cond24.preheader.us ], [ %indvars.iv.next114, %for.inc54.us ]
%cmp28.us = icmp eq i64 %indvars.iv117, %indvars.iv113
%10 = add nuw nsw i64 %indvars.iv113, %indvars.iv117
%cmp30.us = icmp eq i64 %10, %9
%or.cond = select i1 %cmp28.us, i1 true, i1 %cmp30.us
%arrayidx36.us = getelementptr inbounds [350 x [350 x i8]], ptr %x, i64 0, i64 %indvars.iv117, i64 %indvars.iv113
%11 = load i8, ptr %arrayidx36.us, align 1, !tbaa !11
br i1 %or.cond, label %if.then32.us, label %if.else.us
if.else.us: ; preds = %for.body27.us
%cmp49.not.us = icmp eq i8 %11, %.pre121
br i1 %cmp49.not.us, label %for.inc54.us, label %if.end67
if.then32.us: ; preds = %for.body27.us
%cmp39.not.us = icmp eq i8 %11, %.pre
br i1 %cmp39.not.us, label %for.inc54.us, label %if.end67
for.inc54.us: ; preds = %if.then32.us, %if.else.us
%indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1
%exitcond.not = icmp eq i64 %indvars.iv.next114, %wide.trip.count119
br i1 %exitcond.not, label %for.cond24.for.end56_crit_edge.us, label %for.body27.us, !llvm.loop !15
for.cond20.us: ; preds = %for.cond24.for.end56_crit_edge.us
%indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
%exitcond120.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count119
br i1 %exitcond120.not, label %if.else65, label %for.cond24.preheader.us, !llvm.loop !16
for.cond24.for.end56_crit_edge.us: ; preds = %for.inc54.us
br i1 %check.1105.us, label %for.cond20.us, label %if.end67
for.end61: ; preds = %for.end11
br i1 %cmp18, label %if.else65, label %if.end67
if.else65: ; preds = %for.cond20.us, %entry, %for.end61
br label %if.end67
if.end67: ; preds = %for.cond24.for.end56_crit_edge.us, %if.else.us, %if.then32.us, %for.end61, %if.else65
%str.sink = phi ptr [ @str, %if.else65 ], [ @str.3, %for.end61 ], [ @str.3, %if.then32.us ], [ @str.3, %if.else.us ], [ @str.3, %for.cond24.for.end56_crit_edge.us ]
%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 122500, 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 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!"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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
|
#include <stdio.h>
int main(void){
int i,j,k,n,a,b,dice[7],
side[5] = {2,3,5,4,2};
char order[7][3] = {"","","N","W","E","S","NN"};
for(i=1;i<7;i++)
scanf("%d", &dice[i]);
scanf("%d", &n);
//上面を合わせる
for(i=0;i<n;i++){
scanf("%d%d",&a,&b);
for(j=1;dice[j]!=a;j++);
//回転
for(k=0;order[j][k]!='\0';k++){
dice[0] = dice[1];
switch(order[j][k]){
case 'E':
dice[1] = dice[4];
dice[4] = dice[6];
dice[6] = dice[3];
dice[3] = dice[0];
break;
case 'N':
dice[1] = dice[2];
dice[2] = dice[6];
dice[6] = dice[5];
dice[5] = dice[0];
break;
case 'S':
dice[1] = dice[5];
dice[5] = dice[6];
dice[6] = dice[2];
dice[2] = dice[0];
break;
case 'W':
dice[1] = dice[3];
dice[3] = dice[6];
dice[6] = dice[4];
dice[4] = dice[0];
break;
}
}
for(j=0;b!=dice[side[j]];j++);
printf("%d\n",dice[side[j+1]]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242478/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242478/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.side = private unnamed_addr constant [5 x i32] [i32 2, i32 3, i32 5, i32 4, i32 2], align 16
@__const.main.order = private unnamed_addr constant [7 x [3 x i8]] [[3 x i8] zeroinitializer, [3 x i8] zeroinitializer, [3 x i8] c"N\00\00", [3 x i8] c"W\00\00", [3 x i8] c"E\00\00", [3 x i8] c"S\00\00", [3 x i8] c"NN\00"], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree 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
%dice = alloca [7 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice) #3
%arrayidx = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx.1 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 4
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp3102 = icmp sgt i32 %0, 0
br i1 %cmp3102, label %for.body4, label %for.end85
for.body4: ; preds = %entry, %for.end77
%i.1103 = phi i32 [ %inc84, %for.end77 ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
br label %for.cond6
for.cond6: ; preds = %for.cond6, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond6 ], [ 1, %for.body4 ]
%arrayidx8 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not = icmp eq i32 %2, %1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp9.not, label %for.cond14.preheader, label %for.cond6, !llvm.loop !9
for.cond14.preheader: ; preds = %for.cond6
%3 = and i64 %indvars.iv, 4294967295
%4 = icmp eq i64 %3, 1
br i1 %4, label %for.cond67.preheader, label %for.body21.lr.ph
for.body21.lr.ph: ; preds = %for.cond14.preheader
%arrayidx1899 = getelementptr inbounds [7 x [3 x i8]], ptr @__const.main.order, i64 0, i64 %indvars.iv, i64 0
%5 = load i8, ptr %arrayidx1899, align 1, !tbaa !11
%arrayidx22.promoted = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx56.promoted = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%arrayidx58.promoted = load i32, ptr %arrayidx.5, align 8, !tbaa !5
%arrayidx60.promoted = load i32, ptr %arrayidx.3, align 16, !tbaa !5
%arrayidx47.promoted = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%arrayidx51.promoted = load i32, ptr %arrayidx.1, align 8, !tbaa !5
br label %for.body21
for.cond14.for.cond67.preheader_crit_edge: ; preds = %for.inc64
store i32 %12, ptr %dice, align 16, !tbaa !5
br label %for.cond67.preheader
for.cond67.preheader: ; preds = %for.cond14.for.cond67.preheader_crit_edge, %for.cond14.preheader
%6 = load i32, ptr %b, align 4, !tbaa !5
br label %for.cond67
for.body21: ; preds = %for.body21.lr.ph, %for.inc64
%indvars.iv106 = phi i64 [ 0, %for.body21.lr.ph ], [ %indvars.iv.next107, %for.inc64 ]
%7 = phi i32 [ %arrayidx51.promoted, %for.body21.lr.ph ], [ %14, %for.inc64 ]
%8 = phi i32 [ %arrayidx47.promoted, %for.body21.lr.ph ], [ %15, %for.inc64 ]
%9 = phi i32 [ %arrayidx60.promoted, %for.body21.lr.ph ], [ %16, %for.inc64 ]
%10 = phi i32 [ %arrayidx58.promoted, %for.body21.lr.ph ], [ %17, %for.inc64 ]
%11 = phi i32 [ %arrayidx56.promoted, %for.body21.lr.ph ], [ %18, %for.inc64 ]
%12 = phi i32 [ %arrayidx22.promoted, %for.body21.lr.ph ], [ %19, %for.inc64 ]
%13 = phi i8 [ %5, %for.body21.lr.ph ], [ %20, %for.inc64 ]
%conv28 = sext i8 %13 to i32
switch i32 %conv28, label %for.inc64 [
i32 69, label %sw.bb
i32 78, label %sw.bb37
i32 83, label %sw.bb46
i32 87, label %sw.bb55
]
sw.bb: ; preds = %for.body21
store i32 %9, ptr %arrayidx, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.3, align 16, !tbaa !5
store i32 %11, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %12, ptr %arrayidx.2, align 4, !tbaa !5
br label %for.inc64
sw.bb37: ; preds = %for.body21
store i32 %7, ptr %arrayidx, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.1, align 8, !tbaa !5
store i32 %8, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %12, ptr %arrayidx.4, align 4, !tbaa !5
br label %for.inc64
sw.bb46: ; preds = %for.body21
store i32 %8, ptr %arrayidx, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.4, align 4, !tbaa !5
store i32 %7, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %12, ptr %arrayidx.1, align 8, !tbaa !5
br label %for.inc64
sw.bb55: ; preds = %for.body21
store i32 %11, ptr %arrayidx, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %12, ptr %arrayidx.3, align 16, !tbaa !5
br label %for.inc64
for.inc64: ; preds = %sw.bb, %sw.bb37, %sw.bb46, %sw.bb55, %for.body21
%14 = phi i32 [ %7, %sw.bb ], [ %10, %sw.bb37 ], [ %12, %sw.bb46 ], [ %7, %sw.bb55 ], [ %7, %for.body21 ]
%15 = phi i32 [ %8, %sw.bb ], [ %12, %sw.bb37 ], [ %10, %sw.bb46 ], [ %8, %sw.bb55 ], [ %8, %for.body21 ]
%16 = phi i32 [ %10, %sw.bb ], [ %9, %sw.bb37 ], [ %9, %sw.bb46 ], [ %12, %sw.bb55 ], [ %9, %for.body21 ]
%17 = phi i32 [ %11, %sw.bb ], [ %8, %sw.bb37 ], [ %7, %sw.bb46 ], [ %9, %sw.bb55 ], [ %10, %for.body21 ]
%18 = phi i32 [ %12, %sw.bb ], [ %11, %sw.bb37 ], [ %11, %sw.bb46 ], [ %10, %sw.bb55 ], [ %11, %for.body21 ]
%19 = phi i32 [ %9, %sw.bb ], [ %7, %sw.bb37 ], [ %8, %sw.bb46 ], [ %11, %sw.bb55 ], [ %12, %for.body21 ]
%indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
%arrayidx18 = getelementptr inbounds [7 x [3 x i8]], ptr @__const.main.order, i64 0, i64 %indvars.iv, i64 %indvars.iv.next107
%20 = load i8, ptr %arrayidx18, align 1, !tbaa !11
%cmp19.not = icmp eq i8 %20, 0
br i1 %cmp19.not, label %for.cond14.for.cond67.preheader_crit_edge, label %for.body21, !llvm.loop !12
for.cond67: ; preds = %for.cond67, %for.cond67.preheader
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.cond67 ], [ 0, %for.cond67.preheader ]
%arrayidx69 = getelementptr inbounds [5 x i32], ptr @__const.main.side, i64 0, i64 %indvars.iv108
%21 = load i32, ptr %arrayidx69, align 4, !tbaa !5
%idxprom70 = sext i32 %21 to i64
%arrayidx71 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom70
%22 = load i32, ptr %arrayidx71, align 4, !tbaa !5
%cmp72.not = icmp eq i32 %6, %22
%indvars.iv.next109 = add nuw i64 %indvars.iv108, 1
br i1 %cmp72.not, label %for.end77, label %for.cond67, !llvm.loop !13
for.end77: ; preds = %for.cond67
%add = add i64 %indvars.iv108, 1
%idxprom78 = and i64 %add, 4294967295
%arrayidx79 = getelementptr inbounds [5 x i32], ptr @__const.main.side, i64 0, i64 %idxprom78
%23 = load i32, ptr %arrayidx79, align 4, !tbaa !5
%idxprom80 = sext i32 %23 to i64
%arrayidx81 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 %idxprom80
%24 = load i32, ptr %arrayidx81, align 4, !tbaa !5
%call82 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %24)
%inc84 = add nuw nsw i32 %i.1103, 1
%25 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc84, %25
br i1 %cmp3, label %for.body4, label %for.end85, !llvm.loop !14
for.end85: ; preds = %for.end77, %entry
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main(){
int dice[6],q,i;
char c;
for(i=0;i<6;i++){
scanf("%d",&dice[i]);
}
scanf("%d",&q);
for(i=0;i<q;i++){
int x,y;
scanf("%d %d",&x,&y);
if((x==dice[5] && y==dice[4])||(x==dice[4] && y==dice[0])||(x==dice[0] && y==dice[1])||(x==dice[1] && y==dice[5])){
printf("%d\n",dice[2]);
}else if((x==dice[0] && y==dice[2])||(x==dice[2] && y==dice[5])||(x==dice[5] && y==dice[3])||(x==dice[3] && y==dice[0])){
printf("%d\n",dice[4]);
}else if((x==dice[5] && y==dice[1])||(x==dice[1] && y==dice[0])||(x==dice[0] && y==dice[4])||(x==dice[4] && y==dice[5])){
printf("%d\n",dice[3]);
}else if((x==dice[0] && y==dice[3])||(x==dice[3] && y==dice[5])||(x==dice[5] && y==dice[2])||(x==dice[2] && y==dice[0])){
printf("%d\n",dice[1]);
}else if((x==dice[2] && y==dice[1])||(x==dice[1] && y==dice[3])||(x==dice[3] && y==dice[4])||(x==dice[4] && y==dice[2])){
printf("%d\n",dice[5]);
}else{
printf("%d\n",dice[0]);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242528/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242528/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dice = alloca [6 x i32], align 16
%q = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dice) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dice)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp3163 = icmp sgt i32 %0, 0
br i1 %cmp3163, label %for.body4, label %for.end145
for.body4: ; preds = %entry, %if.end142
%i.1164 = phi i32 [ %inc144, %if.end142 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp7 = icmp eq i32 %1, %2
%.pre = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%.pre168.pre.pre = load i32, ptr %y, align 4
%cmp9 = icmp eq i32 %.pre168.pre.pre, %.pre
%or.cond182 = select i1 %cmp7, i1 %cmp9, i1 false
br i1 %or.cond182, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body4
%cmp11 = icmp eq i32 %1, %.pre
%.pre166 = load i32, ptr %dice, align 16, !tbaa !5
%cmp14 = icmp eq i32 %.pre168.pre.pre, %.pre166
%or.cond183 = select i1 %cmp11, i1 %cmp14, i1 false
br i1 %or.cond183, label %if.then, label %lor.lhs.false15
lor.lhs.false15: ; preds = %lor.lhs.false
%cmp17 = icmp eq i32 %1, %.pre166
%.pre167 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
br i1 %cmp17, label %land.lhs.true18, label %lor.lhs.false21.thread
land.lhs.true18: ; preds = %lor.lhs.false15
%cmp20 = icmp eq i32 %.pre168.pre.pre, %.pre167
br i1 %cmp20, label %if.then, label %lor.lhs.false21
lor.lhs.false21: ; preds = %land.lhs.true18
%cmp23 = icmp eq i32 %1, %.pre167
%cmp26 = icmp eq i32 %.pre168.pre.pre, %2
%or.cond = select i1 %cmp23, i1 %cmp26, i1 false
br i1 %or.cond, label %if.then, label %land.lhs.true31
lor.lhs.false21.thread: ; preds = %lor.lhs.false15
%cmp23171 = icmp eq i32 %1, %.pre167
%cmp26172 = icmp eq i32 %.pre168.pre.pre, %2
%or.cond173 = select i1 %cmp23171, i1 %cmp26172, i1 false
br i1 %or.cond173, label %if.then, label %if.else.thread
if.else.thread: ; preds = %lor.lhs.false21.thread
%.pre169178 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
br label %lor.lhs.false34
if.then: ; preds = %lor.lhs.false, %for.body4, %lor.lhs.false21.thread, %lor.lhs.false21, %land.lhs.true18
%3 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
br label %if.end142
land.lhs.true31: ; preds = %lor.lhs.false21
%.pre169 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp33 = icmp eq i32 %.pre168.pre.pre, %.pre169
br i1 %cmp33, label %if.end142, label %lor.lhs.false34
lor.lhs.false34: ; preds = %if.else.thread, %land.lhs.true31
%.pre169181 = phi i32 [ %.pre169178, %if.else.thread ], [ %.pre169, %land.lhs.true31 ]
%cmp23174180 = phi i1 [ %cmp23171, %if.else.thread ], [ %cmp23, %land.lhs.true31 ]
%cmp26175179 = phi i1 [ %cmp26172, %if.else.thread ], [ %cmp26, %land.lhs.true31 ]
%cmp36 = icmp eq i32 %1, %.pre169181
%or.cond150 = select i1 %cmp36, i1 %cmp26175179, i1 false
br i1 %or.cond150, label %if.end142, label %lor.lhs.false40
lor.lhs.false40: ; preds = %lor.lhs.false34
%.pre170 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp45 = icmp eq i32 %.pre168.pre.pre, %.pre170
%or.cond184 = select i1 %cmp7, i1 %cmp45, i1 false
br i1 %or.cond184, label %if.end142, label %lor.lhs.false46
lor.lhs.false46: ; preds = %lor.lhs.false40
%cmp48 = icmp eq i32 %1, %.pre170
%cmp51 = icmp eq i32 %.pre168.pre.pre, %.pre166
%or.cond151 = select i1 %cmp48, i1 %cmp51, i1 false
br i1 %or.cond151, label %if.end142, label %if.else55
if.else55: ; preds = %lor.lhs.false46
%cmp60 = icmp eq i32 %.pre168.pre.pre, %.pre167
%or.cond152 = select i1 %cmp7, i1 %cmp60, i1 false
%or.cond153 = select i1 %cmp23174180, i1 %cmp51, i1 false
%or.cond185 = select i1 %or.cond152, i1 true, i1 %or.cond153
br i1 %or.cond185, label %if.end142, label %lor.lhs.false67
lor.lhs.false67: ; preds = %if.else55
%cmp72 = icmp eq i32 %.pre168.pre.pre, %.pre
%or.cond154 = select i1 %cmp17, i1 %cmp72, i1 false
%or.cond155 = select i1 %cmp11, i1 %cmp26175179, i1 false
%or.cond186 = select i1 %or.cond154, i1 true, i1 %or.cond155
br i1 %or.cond186, label %if.end142, label %if.else82
if.else82: ; preds = %lor.lhs.false67
%cmp87 = icmp eq i32 %.pre168.pre.pre, %.pre170
%or.cond156 = select i1 %cmp17, i1 %cmp87, i1 false
%or.cond157 = select i1 %cmp48, i1 %cmp26175179, i1 false
%or.cond187 = select i1 %or.cond156, i1 true, i1 %or.cond157
br i1 %or.cond187, label %if.end142, label %lor.lhs.false94
lor.lhs.false94: ; preds = %if.else82
%cmp99 = icmp eq i32 %.pre168.pre.pre, %.pre169181
%or.cond158 = select i1 %cmp7, i1 %cmp99, i1 false
br i1 %or.cond158, label %if.end142, label %lor.lhs.false100
lor.lhs.false100: ; preds = %lor.lhs.false94
br i1 %cmp36, label %land.lhs.true103, label %lor.lhs.false115
land.lhs.true103: ; preds = %lor.lhs.false100
br i1 %cmp51, label %if.end142, label %land.lhs.true112
land.lhs.true112: ; preds = %land.lhs.true103
%or.cond159 = select i1 %cmp23174180, i1 %cmp87, i1 false
%or.cond188 = select i1 %cmp60, i1 true, i1 %or.cond159
%or.cond160 = select i1 %cmp48, i1 %cmp72, i1 false
%or.cond189 = select i1 %or.cond188, i1 true, i1 %or.cond160
%or.cond161.old = select i1 %cmp11, i1 %cmp99, i1 false
%or.cond192 = select i1 %or.cond189, i1 true, i1 %or.cond161.old
br i1 %or.cond192, label %if.end142, label %if.else136
lor.lhs.false115: ; preds = %lor.lhs.false100
%or.cond159.old = select i1 %cmp23174180, i1 %cmp87, i1 false
%or.cond160.old = select i1 %cmp48, i1 %cmp72, i1 false
%or.cond190 = select i1 %or.cond159.old, i1 true, i1 %or.cond160.old
%or.cond161 = select i1 %cmp11, i1 %cmp99, i1 false
%or.cond191 = select i1 %or.cond190, i1 true, i1 %or.cond161
br i1 %or.cond191, label %if.end142, label %if.else136
if.else136: ; preds = %land.lhs.true112, %lor.lhs.false115
br label %if.end142
if.end142: ; preds = %land.lhs.true112, %lor.lhs.false115, %land.lhs.true103, %if.else82, %lor.lhs.false94, %if.else55, %lor.lhs.false67, %land.lhs.true31, %lor.lhs.false34, %lor.lhs.false46, %lor.lhs.false40, %if.else136, %if.then
%.pre.sink = phi i32 [ %.pre166, %if.else136 ], [ %3, %if.then ], [ %.pre, %lor.lhs.false40 ], [ %.pre, %lor.lhs.false46 ], [ %.pre, %lor.lhs.false34 ], [ %.pre, %land.lhs.true31 ], [ %.pre170, %lor.lhs.false67 ], [ %.pre170, %if.else55 ], [ %.pre167, %lor.lhs.false94 ], [ %.pre167, %if.else82 ], [ %.pre167, %land.lhs.true103 ], [ %2, %lor.lhs.false115 ], [ %2, %land.lhs.true112 ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
%inc144 = add nuw nsw i32 %i.1164, 1
%4 = load i32, ptr %q, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc144, %4
br i1 %cmp3, label %for.body4, label %for.end145, !llvm.loop !9
for.end145: ; preds = %if.end142, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dice) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
int main(void){
int i,ex1,ex2,ex3,ex4,a,b,q;
int dice[7];
int command;
for(i = 1;i <= 6;i++){
scanf("%d",&dice[i]);
}
scanf("%d",&q);
for(i = 0;i < q;i++){
scanf("%d%d",&a,&b);
while(1){
command = rand() % 4;
if(command == 0){
ex1 = dice[1];
ex2 = dice[2];
ex3 = dice[5];
ex4 = dice[6];
dice[1] = ex3;
dice[2] = ex1;
dice[5] = ex4;
dice[6] = ex2;
}else if(command == 1){
ex1 = dice[1];
ex2 = dice[2];
ex3 = dice[5];
ex4 = dice[6];
dice[1] = ex2;
dice[2] = ex4;
dice[5] = ex1;
dice[6] = ex3;
}else if(command == 2){
ex1 = dice[1];
ex2 = dice[3];
ex3 = dice[4];
ex4 = dice[6];
dice[1] = ex3;
dice[3] = ex1;
dice[4] = ex4;
dice[6] = ex2;
}else if(command == 3){
ex1 = dice[1];
ex2 = dice[3];
ex3 = dice[4];
ex4 = dice[6];
dice[1] = ex2;
dice[3] = ex4;
dice[4] = ex1;
dice[6] = ex3;
}
if(dice[1] == a && dice[2] == b)
break;
}
printf("%d\n",dice[3]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242571/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242571/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%q = alloca i32, align 4
%dice = alloca [7 x i32], align 16
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 %q) #4
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice) #4
%arrayidx = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx.1 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 4
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp382 = icmp sgt i32 %0, 0
br i1 %cmp382, label %for.body4, label %for.end61
for.body4: ; preds = %entry, %while.end
%i.183 = phi i32 [ %inc60, %while.end ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %for.body4
%call6 = call i32 @rand() #4
%rem = srem i32 %call6, 4
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
switch i32 %rem, label %if.end50 [
i32 0, label %if.then
i32 1, label %if.then17
i32 2, label %if.then28
i32 3, label %if.then39
]
if.then: ; preds = %while.cond
%1 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%2 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %2, ptr %arrayidx, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx.1, align 8, !tbaa !5
store i32 %3, ptr %arrayidx.4, align 4, !tbaa !5
br label %if.end50.sink.split
if.then17: ; preds = %while.cond
%4 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%5 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%6 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
store i32 %6, ptr %arrayidx.1, align 8, !tbaa !5
store i32 %.pre, ptr %arrayidx.4, align 4, !tbaa !5
br label %if.end50.sink.split
if.then28: ; preds = %while.cond
%7 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx.3, align 16, !tbaa !5
%9 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %8, ptr %arrayidx, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.3, align 16, !tbaa !5
br label %if.end50.sink.split
if.then39: ; preds = %while.cond
%10 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%11 = load i32, ptr %arrayidx.3, align 16, !tbaa !5
%12 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %10, ptr %arrayidx, align 4, !tbaa !5
store i32 %12, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx.3, align 16, !tbaa !5
br label %if.end50.sink.split
if.end50.sink.split: ; preds = %if.then, %if.then28, %if.then39, %if.then17
%.sink = phi i32 [ %5, %if.then17 ], [ %11, %if.then39 ], [ %7, %if.then28 ], [ %1, %if.then ]
%.ph = phi i32 [ %4, %if.then17 ], [ %10, %if.then39 ], [ %8, %if.then28 ], [ %2, %if.then ]
store i32 %.sink, ptr %arrayidx.5, align 8, !tbaa !5
br label %if.end50
if.end50: ; preds = %if.end50.sink.split, %while.cond
%13 = phi i32 [ %.pre, %while.cond ], [ %.ph, %if.end50.sink.split ]
%14 = load i32, ptr %a, align 4, !tbaa !5
%cmp52 = icmp eq i32 %13, %14
br i1 %cmp52, label %land.lhs.true, label %while.cond.backedge
land.lhs.true: ; preds = %if.end50
%15 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%16 = load i32, ptr %b, align 4, !tbaa !5
%cmp54 = icmp eq i32 %15, %16
br i1 %cmp54, label %while.end, label %while.cond.backedge
while.cond.backedge: ; preds = %land.lhs.true, %if.end50
br label %while.cond
while.end: ; preds = %land.lhs.true
%17 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%inc60 = add nuw nsw i32 %i.183, 1
%18 = load i32, ptr %q, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc60, %18
br i1 %cmp3, label %for.body4, label %for.end61, !llvm.loop !9
for.end61: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #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: nounwind
declare i32 @rand() local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int E[6] = {3,0,-2,2,0,-3};
int N[6] = {1,4,0,0,-4,-1};
int lsp[6] = {0,1,2,-2,-1,0};
void DICE(int a,int d[]){
int d2[6];
int i;
if(a == 0){
for(i = 0;i < 6; i++){
d2[i] = d[i + E[i]];
}
}
if(a == 1){
for(i = 0;i < 6; i++){
d2[i] = d[i + N[i]];
}
}
memcpy(d,d2,6 * sizeof(int));
}
void l_spin(int d[]){
int d2[6];
int i;
for(i = 0; i < 6; i++){
d2[i] = d[i + lsp[i]];
}
memcpy(d,d2,6 * sizeof(int));
}
int main(void){
int d[6];
int n, i, a, b;
for(i = 0; i < 6; i++){
scanf("%d",&d[i]);
}
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%d",&a);
scanf("%d",&b);
while(1){
DICE(0,d);
if(d[0] == a) break;
DICE(1,d);
if(d[0] == a) break;
}
while(1){
l_spin(d);
if(d[1] == b) break;
}
printf("%d\n",d[2]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242614/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242614/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@E = dso_local local_unnamed_addr global [6 x i32] [i32 3, i32 0, i32 -2, i32 2, i32 0, i32 -3], align 16
@N = dso_local local_unnamed_addr global [6 x i32] [i32 1, i32 4, i32 0, i32 0, i32 -4, i32 -1], align 16
@lsp = dso_local local_unnamed_addr global [6 x i32] [i32 0, i32 1, i32 2, i32 -2, i32 -1, i32 0], align 16
@.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(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @DICE(i32 noundef %a, ptr nocapture noundef %d) local_unnamed_addr #0 {
entry:
switch i32 %a, label %if.end21 [
i32 0, label %for.body.preheader
i32 1, label %if.end21.sink.split
]
for.body.preheader: ; preds = %entry
br label %if.end21.sink.split
if.end21.sink.split: ; preds = %entry, %for.body.preheader
%N.sink = phi ptr [ @E, %for.body.preheader ], [ @N, %entry ]
%.sink43 = phi ptr [ getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 1), %for.body.preheader ], [ getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 1), %entry ]
%.sink42 = phi ptr [ getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 2), %for.body.preheader ], [ getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 2), %entry ]
%.sink41 = phi ptr [ getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 3), %for.body.preheader ], [ getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 3), %entry ]
%.sink40 = phi ptr [ getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 4), %for.body.preheader ], [ getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 4), %entry ]
%.sink39 = phi ptr [ getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 5), %for.body.preheader ], [ getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 5), %entry ]
%0 = load i32, ptr %N.sink, align 16, !tbaa !5
%idxprom14 = sext i32 %0 to i64
%arrayidx15 = getelementptr inbounds i32, ptr %d, i64 %idxprom14
%1 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%2 = load i32, ptr %.sink43, align 4, !tbaa !5
%add13.1 = add nsw i32 %2, 1
%idxprom14.1 = sext i32 %add13.1 to i64
%arrayidx15.1 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.1
%3 = load i32, ptr %arrayidx15.1, align 4, !tbaa !5
%4 = load i32, ptr %.sink42, align 4, !tbaa !5
%add13.2 = add nsw i32 %4, 2
%idxprom14.2 = sext i32 %add13.2 to i64
%arrayidx15.2 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.2
%5 = load i32, ptr %arrayidx15.2, align 4, !tbaa !5
%6 = load i32, ptr %.sink41, align 4, !tbaa !5
%add13.3 = add nsw i32 %6, 3
%idxprom14.3 = sext i32 %add13.3 to i64
%arrayidx15.3 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.3
%7 = load i32, ptr %arrayidx15.3, align 4, !tbaa !5
%8 = load i32, ptr %.sink40, align 4, !tbaa !5
%add13.4 = add nsw i32 %8, 4
%idxprom14.4 = sext i32 %add13.4 to i64
%arrayidx15.4 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.4
%9 = load i32, ptr %arrayidx15.4, align 4, !tbaa !5
%10 = load i32, ptr %.sink39, align 4, !tbaa !5
%add13.5 = add nsw i32 %10, 5
%idxprom14.5 = sext i32 %add13.5 to i64
%arrayidx15.5 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.5
%11 = load i32, ptr %arrayidx15.5, align 4, !tbaa !5
br label %if.end21
if.end21: ; preds = %if.end21.sink.split, %entry
%d2.sroa.13.0 = phi i32 [ undef, %entry ], [ %11, %if.end21.sink.split ]
%d2.sroa.11.0 = phi i32 [ undef, %entry ], [ %9, %if.end21.sink.split ]
%d2.sroa.9.0 = phi i32 [ undef, %entry ], [ %7, %if.end21.sink.split ]
%d2.sroa.7.0 = phi i32 [ undef, %entry ], [ %5, %if.end21.sink.split ]
%d2.sroa.5.0 = phi i32 [ undef, %entry ], [ %3, %if.end21.sink.split ]
%d2.sroa.0.0 = phi i32 [ undef, %entry ], [ %1, %if.end21.sink.split ]
store i32 %d2.sroa.0.0, ptr %d, align 4
%d2.sroa.5.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 4
store i32 %d2.sroa.5.0, ptr %d2.sroa.5.0.d.sroa_idx, align 4
%d2.sroa.7.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 8
store i32 %d2.sroa.7.0, ptr %d2.sroa.7.0.d.sroa_idx, align 4
%d2.sroa.9.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 12
store i32 %d2.sroa.9.0, ptr %d2.sroa.9.0.d.sroa_idx, align 4
%d2.sroa.11.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 16
store i32 %d2.sroa.11.0, ptr %d2.sroa.11.0.d.sroa_idx, align 4
%d2.sroa.13.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 20
store i32 %d2.sroa.13.0, ptr %d2.sroa.13.0.d.sroa_idx, align 4
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @l_spin(ptr nocapture noundef %d) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @lsp, align 16, !tbaa !5
%idxprom1 = sext i32 %0 to i64
%arrayidx2 = getelementptr inbounds i32, ptr %d, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 1), align 4, !tbaa !5
%add.1 = add nsw i32 %2, 1
%idxprom1.1 = sext i32 %add.1 to i64
%arrayidx2.1 = getelementptr inbounds i32, ptr %d, i64 %idxprom1.1
%3 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 2), align 8, !tbaa !5
%add.2 = add nsw i32 %4, 2
%idxprom1.2 = sext i32 %add.2 to i64
%arrayidx2.2 = getelementptr inbounds i32, ptr %d, i64 %idxprom1.2
%5 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%6 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 3), align 4, !tbaa !5
%add.3 = add nsw i32 %6, 3
%idxprom1.3 = sext i32 %add.3 to i64
%arrayidx2.3 = getelementptr inbounds i32, ptr %d, i64 %idxprom1.3
%7 = load i32, ptr %arrayidx2.3, align 4, !tbaa !5
%8 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 4), align 16, !tbaa !5
%add.4 = add nsw i32 %8, 4
%idxprom1.4 = sext i32 %add.4 to i64
%arrayidx2.4 = getelementptr inbounds i32, ptr %d, i64 %idxprom1.4
%9 = load i32, ptr %arrayidx2.4, align 4, !tbaa !5
%10 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 5), align 4, !tbaa !5
%add.5 = add nsw i32 %10, 5
%idxprom1.5 = sext i32 %add.5 to i64
%arrayidx2.5 = getelementptr inbounds i32, ptr %d, i64 %idxprom1.5
%11 = load i32, ptr %arrayidx2.5, align 4, !tbaa !5
store i32 %1, ptr %d, align 4
%d2.sroa.4.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 4
store i32 %3, ptr %d2.sroa.4.0.d.sroa_idx, align 4
%d2.sroa.5.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 8
store i32 %5, ptr %d2.sroa.5.0.d.sroa_idx, align 4
%d2.sroa.6.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 12
store i32 %7, ptr %d2.sroa.6.0.d.sroa_idx, align 4
%d2.sroa.7.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 16
store i32 %9, ptr %d2.sroa.7.0.d.sroa_idx, align 4
%d2.sroa.8.0.d.sroa_idx = getelementptr inbounds i8, ptr %d, i64 20
store i32 %11, ptr %d2.sroa.8.0.d.sroa_idx, align 4
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%d = alloca [6 x i32], align 16
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp356 = icmp sgt i32 %0, 0
br i1 %cmp356, label %for.body4, label %for.end26
for.body4: ; preds = %entry, %while.end21
%i.157 = phi i32 [ %inc25, %while.end21 ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr @E, align 16, !tbaa !5
%idxprom14.i = sext i32 %1 to i64
%arrayidx15.i = getelementptr inbounds i32, ptr %d, i64 %idxprom14.i
%2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 1), align 4, !tbaa !5
%add13.1.i = add nsw i32 %2, 1
%idxprom14.1.i = sext i32 %add13.1.i to i64
%arrayidx15.1.i = getelementptr inbounds i32, ptr %d, i64 %idxprom14.1.i
%3 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 2), align 8, !tbaa !5
%add13.2.i = add nsw i32 %3, 2
%idxprom14.2.i = sext i32 %add13.2.i to i64
%arrayidx15.2.i = getelementptr inbounds i32, ptr %d, i64 %idxprom14.2.i
%4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 3), align 4, !tbaa !5
%add13.3.i = add nsw i32 %4, 3
%idxprom14.3.i = sext i32 %add13.3.i to i64
%arrayidx15.3.i = getelementptr inbounds i32, ptr %d, i64 %idxprom14.3.i
%5 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 4), align 16, !tbaa !5
%add13.4.i = add nsw i32 %5, 4
%idxprom14.4.i = sext i32 %add13.4.i to i64
%arrayidx15.4.i = getelementptr inbounds i32, ptr %d, i64 %idxprom14.4.i
%6 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @E, i64 0, i64 5), align 4, !tbaa !5
%add13.5.i = add nsw i32 %6, 5
%idxprom14.5.i = sext i32 %add13.5.i to i64
%arrayidx15.5.i = getelementptr inbounds i32, ptr %d, i64 %idxprom14.5.i
%7 = load i32, ptr %a, align 4, !tbaa !5
%8 = load i32, ptr @N, align 16
%idxprom14.i31 = sext i32 %8 to i64
%arrayidx15.i32 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.i31
%9 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 1), align 4
%add13.1.i33 = add nsw i32 %9, 1
%idxprom14.1.i34 = sext i32 %add13.1.i33 to i64
%arrayidx15.1.i35 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.1.i34
%10 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 2), align 8
%add13.2.i36 = add nsw i32 %10, 2
%idxprom14.2.i37 = sext i32 %add13.2.i36 to i64
%arrayidx15.2.i38 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.2.i37
%11 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 3), align 4
%add13.3.i39 = add nsw i32 %11, 3
%idxprom14.3.i40 = sext i32 %add13.3.i39 to i64
%arrayidx15.3.i41 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.3.i40
%12 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 4), align 16
%add13.4.i42 = add nsw i32 %12, 4
%idxprom14.4.i43 = sext i32 %add13.4.i42 to i64
%arrayidx15.4.i44 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.4.i43
%13 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @N, i64 0, i64 5), align 4
%add13.5.i45 = add nsw i32 %13, 5
%idxprom14.5.i46 = sext i32 %add13.5.i45 to i64
%arrayidx15.5.i47 = getelementptr inbounds i32, ptr %d, i64 %idxprom14.5.i46
br label %while.cond
while.cond: ; preds = %if.end, %for.body4
%14 = load i32, ptr %arrayidx15.i, align 4, !tbaa !5
%15 = load i32, ptr %arrayidx15.1.i, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx15.2.i, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx15.3.i, align 4, !tbaa !5
%18 = load i32, ptr %arrayidx15.4.i, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx15.5.i, align 4, !tbaa !5
store i32 %14, ptr %d, align 16
store i32 %15, ptr %arrayidx.1, align 4
store i32 %16, ptr %arrayidx.2, align 8
store i32 %17, ptr %arrayidx.3, align 4
store i32 %18, ptr %arrayidx.4, align 16
store i32 %19, ptr %arrayidx.5, align 4
%cmp8 = icmp eq i32 %14, %7
br i1 %cmp8, label %while.end, label %if.end
if.end: ; preds = %while.cond
%20 = load i32, ptr %arrayidx15.i32, align 4, !tbaa !5
%21 = load i32, ptr %arrayidx15.1.i35, align 4, !tbaa !5
%22 = load i32, ptr %arrayidx15.2.i38, align 4, !tbaa !5
%23 = load i32, ptr %arrayidx15.3.i41, align 4, !tbaa !5
%24 = load i32, ptr %arrayidx15.4.i44, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx15.5.i47, align 4, !tbaa !5
store i32 %20, ptr %d, align 16
store i32 %21, ptr %arrayidx.1, align 4
store i32 %22, ptr %arrayidx.2, align 8
store i32 %23, ptr %arrayidx.3, align 4
store i32 %24, ptr %arrayidx.4, align 16
store i32 %25, ptr %arrayidx.5, align 4
%cmp11 = icmp eq i32 %20, %7
br i1 %cmp11, label %while.end, label %while.cond
while.end: ; preds = %if.end, %while.cond
%26 = load i32, ptr @lsp, align 16, !tbaa !5
%idxprom1.i = sext i32 %26 to i64
%arrayidx2.i = getelementptr inbounds i32, ptr %d, i64 %idxprom1.i
%27 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 1), align 4, !tbaa !5
%add.1.i = add nsw i32 %27, 1
%idxprom1.1.i = sext i32 %add.1.i to i64
%arrayidx2.1.i = getelementptr inbounds i32, ptr %d, i64 %idxprom1.1.i
%28 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 2), align 8, !tbaa !5
%add.2.i = add nsw i32 %28, 2
%idxprom1.2.i = sext i32 %add.2.i to i64
%arrayidx2.2.i = getelementptr inbounds i32, ptr %d, i64 %idxprom1.2.i
%29 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 3), align 4, !tbaa !5
%add.3.i = add nsw i32 %29, 3
%idxprom1.3.i = sext i32 %add.3.i to i64
%arrayidx2.3.i = getelementptr inbounds i32, ptr %d, i64 %idxprom1.3.i
%30 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 4), align 16, !tbaa !5
%add.4.i = add nsw i32 %30, 4
%idxprom1.4.i = sext i32 %add.4.i to i64
%arrayidx2.4.i = getelementptr inbounds i32, ptr %d, i64 %idxprom1.4.i
%31 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @lsp, i64 0, i64 5), align 4, !tbaa !5
%add.5.i = add nsw i32 %31, 5
%idxprom1.5.i = sext i32 %add.5.i to i64
%arrayidx2.5.i = getelementptr inbounds i32, ptr %d, i64 %idxprom1.5.i
%32 = load i32, ptr %b, align 4, !tbaa !5
br label %while.cond14
while.cond14: ; preds = %while.cond14, %while.end
%33 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%34 = load i32, ptr %arrayidx2.1.i, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx2.2.i, align 4, !tbaa !5
%36 = load i32, ptr %arrayidx2.3.i, align 4, !tbaa !5
%37 = load i32, ptr %arrayidx2.4.i, align 4, !tbaa !5
%38 = load i32, ptr %arrayidx2.5.i, align 4, !tbaa !5
store i32 %33, ptr %d, align 16
store i32 %34, ptr %arrayidx.1, align 4
store i32 %35, ptr %arrayidx.2, align 8
store i32 %36, ptr %arrayidx.3, align 4
store i32 %37, ptr %arrayidx.4, align 16
store i32 %38, ptr %arrayidx.5, align 4
%cmp18 = icmp eq i32 %34, %32
br i1 %cmp18, label %while.end21, label %while.cond14
while.end21: ; preds = %while.cond14
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %35)
%inc25 = add nuw nsw i32 %i.157, 1
%39 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc25, %39
br i1 %cmp3, label %for.body4, label %for.end26, !llvm.loop !9
for.end26: ; preds = %while.end21, %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
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int dice(int *me,int ue,int mae){
int migi,i=0;
if(ue==me[0]){
if(mae==me[1])migi=me[2];
if(mae==me[2])migi=me[4];
if(mae==me[4])migi=me[3];
if(mae==me[3])migi=me[1];
}else if(ue==me[1]){
if(mae==me[0])migi=me[3];
if(mae==me[3])migi=me[5];
if(mae==me[5])migi=me[2];
if(mae==me[2])migi=me[0];
}else if(ue==me[2]){
if(mae==me[0])migi=me[1];
if(mae==me[1])migi=me[5];
if(mae==me[5])migi=me[4];
if(mae==me[4])migi=me[0];
}else if(ue==me[3]){
if(mae==me[0])migi=me[4];
if(mae==me[4])migi=me[5];
if(mae==me[5])migi=me[1];
if(mae==me[1])migi=me[0];
}else if(ue==me[4]){
if(mae==me[0])migi=me[2];
if(mae==me[2])migi=me[5];
if(mae==me[5])migi=me[3];
if(mae==me[3])migi=me[0];
}else if(ue==me[5]){
if(mae==me[1])migi=me[3];
if(mae==me[3])migi=me[4];
if(mae==me[4])migi=me[2];
if(mae==me[2])migi=me[1];
}
return migi;
}
int main(){
int me[5]; //サイコロの目
int q; //命令の数
int ue,mae; //面
int j;
for(j=0;j<6;j++){
scanf("%d",&me[j]);
}
scanf("%d",&q);
for(j=0;j<q;j++){
scanf("%d %d",&ue,&mae);
int migi=dice(me,ue,mae);
printf("%d\n",migi);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242658/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242658/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dice(ptr nocapture noundef readonly %me, i32 noundef %ue, i32 noundef %mae) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %me, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %ue
%arrayidx1 = getelementptr inbounds i32, ptr %me, i64 1
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%cmp2 = icmp eq i32 %1, %mae
%arrayidx4 = getelementptr inbounds i32, ptr %me, i64 2
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%. = select i1 %cmp2, i32 %2, i32 undef
%cmp6 = icmp eq i32 %2, %mae
%arrayidx8 = getelementptr inbounds i32, ptr %me, i64 4
%3 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%.. = select i1 %cmp6, i32 %3, i32 %.
%cmp11 = icmp eq i32 %3, %mae
%arrayidx13 = getelementptr inbounds i32, ptr %me, i64 3
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%.migi.1 = select i1 %cmp11, i32 %4, i32 %..
%cmp16 = icmp eq i32 %4, %mae
%spec.select = select i1 %cmp16, i32 %1, i32 %.migi.1
br label %if.end144
if.else: ; preds = %entry
%cmp21 = icmp eq i32 %1, %ue
br i1 %cmp21, label %if.then22, label %if.else43
if.then22: ; preds = %if.else
%cmp24 = icmp eq i32 %0, %mae
%arrayidx26 = getelementptr inbounds i32, ptr %me, i64 3
%5 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%.247 = select i1 %cmp24, i32 %5, i32 undef
%cmp29 = icmp eq i32 %5, %mae
%arrayidx31 = getelementptr inbounds i32, ptr %me, i64 5
%6 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%..247 = select i1 %cmp29, i32 %6, i32 %.247
%cmp34 = icmp eq i32 %6, %mae
%arrayidx36 = getelementptr inbounds i32, ptr %me, i64 2
%7 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%.migi.4 = select i1 %cmp34, i32 %7, i32 %..247
%cmp39 = icmp eq i32 %7, %mae
%spec.select229 = select i1 %cmp39, i32 %0, i32 %.migi.4
br label %if.end144
if.else43: ; preds = %if.else
%arrayidx44 = getelementptr inbounds i32, ptr %me, i64 2
%8 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%cmp45 = icmp eq i32 %8, %ue
br i1 %cmp45, label %if.then46, label %if.else67
if.then46: ; preds = %if.else43
%cmp53 = icmp eq i32 %1, %mae
%arrayidx55 = getelementptr inbounds i32, ptr %me, i64 5
%9 = load i32, ptr %arrayidx55, align 4, !tbaa !5
%.248 = select i1 %cmp53, i32 %9, i32 %1
%cmp58 = icmp eq i32 %9, %mae
%arrayidx60 = getelementptr inbounds i32, ptr %me, i64 4
%10 = load i32, ptr %arrayidx60, align 4, !tbaa !5
%..248 = select i1 %cmp58, i32 %10, i32 %.248
%cmp63 = icmp eq i32 %10, %mae
%spec.select230 = select i1 %cmp63, i32 %0, i32 %..248
br label %if.end144
if.else67: ; preds = %if.else43
%arrayidx68 = getelementptr inbounds i32, ptr %me, i64 3
%11 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%cmp69 = icmp eq i32 %11, %ue
br i1 %cmp69, label %if.then70, label %if.else91
if.then70: ; preds = %if.else67
%cmp72 = icmp eq i32 %0, %mae
%arrayidx74 = getelementptr inbounds i32, ptr %me, i64 4
%12 = load i32, ptr %arrayidx74, align 4, !tbaa !5
%.249 = select i1 %cmp72, i32 %12, i32 undef
%cmp77 = icmp eq i32 %12, %mae
%arrayidx79 = getelementptr inbounds i32, ptr %me, i64 5
%13 = load i32, ptr %arrayidx79, align 4, !tbaa !5
%..249 = select i1 %cmp77, i32 %13, i32 %.249
%cmp82 = icmp eq i32 %13, %mae
%spec.select231 = select i1 %cmp82, i32 %1, i32 %..249
%cmp87 = icmp eq i32 %1, %mae
%spec.select234 = select i1 %cmp87, i32 %0, i32 %spec.select231
br label %if.end144
if.else91: ; preds = %if.else67
%arrayidx92 = getelementptr inbounds i32, ptr %me, i64 4
%14 = load i32, ptr %arrayidx92, align 4, !tbaa !5
%cmp93 = icmp eq i32 %14, %ue
br i1 %cmp93, label %if.then94, label %if.else115
if.then94: ; preds = %if.else91
%cmp101 = icmp eq i32 %8, %mae
%arrayidx103 = getelementptr inbounds i32, ptr %me, i64 5
%15 = load i32, ptr %arrayidx103, align 4, !tbaa !5
%.250 = select i1 %cmp101, i32 %15, i32 %8
%cmp106 = icmp eq i32 %15, %mae
%spec.select232 = select i1 %cmp106, i32 %11, i32 %.250
%cmp111 = icmp eq i32 %11, %mae
%spec.select235 = select i1 %cmp111, i32 %0, i32 %spec.select232
br label %if.end144
if.else115: ; preds = %if.else91
%arrayidx116 = getelementptr inbounds i32, ptr %me, i64 5
%16 = load i32, ptr %arrayidx116, align 4, !tbaa !5
%cmp117 = icmp eq i32 %16, %ue
br i1 %cmp117, label %if.then118, label %if.end144
if.then118: ; preds = %if.else115
%cmp125 = icmp eq i32 %11, %mae
%spec.select233 = select i1 %cmp125, i32 %14, i32 %11
%cmp130 = icmp eq i32 %14, %mae
%migi.17 = select i1 %cmp130, i32 %8, i32 %spec.select233
%cmp135 = icmp eq i32 %8, %mae
%spec.select236 = select i1 %cmp135, i32 %1, i32 %migi.17
br label %if.end144
if.end144: ; preds = %if.then118, %if.then94, %if.then70, %if.then46, %if.then22, %if.then, %if.else115
%migi.18 = phi i32 [ undef, %if.else115 ], [ %spec.select, %if.then ], [ %spec.select229, %if.then22 ], [ %spec.select230, %if.then46 ], [ %spec.select234, %if.then70 ], [ %spec.select235, %if.then94 ], [ %spec.select236, %if.then118 ]
ret i32 %migi.18
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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:
%me = alloca [5 x i32], align 16
%q = alloca i32, align 4
%ue = alloca i32, align 4
%mae = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %me) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ue) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %mae) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %me)
%arrayidx.1 = getelementptr inbounds [5 x i32], ptr %me, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [5 x i32], ptr %me, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [5 x i32], ptr %me, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [5 x i32], ptr %me, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [5 x i32], ptr %me, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp316 = icmp sgt i32 %0, 0
br i1 %cmp316, label %for.body4, label %for.end10
for.body4: ; preds = %entry, %dice.exit
%j.117 = phi i32 [ %inc9, %dice.exit ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ue, ptr noundef nonnull %mae)
%1 = load i32, ptr %ue, align 4, !tbaa !5
%2 = load i32, ptr %mae, align 4, !tbaa !5
%3 = load i32, ptr %me, align 16, !tbaa !5
%cmp.i = icmp eq i32 %3, %1
%4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %for.body4
%cmp2.i = icmp eq i32 %4, %2
%5 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%..i = select i1 %cmp2.i, i32 %5, i32 undef
%cmp6.i = icmp eq i32 %5, %2
%6 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%...i = select i1 %cmp6.i, i32 %6, i32 %..i
%cmp11.i = icmp eq i32 %6, %2
%7 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%.migi.1.i = select i1 %cmp11.i, i32 %7, i32 %...i
%cmp16.i = icmp eq i32 %7, %2
%spec.select.i = select i1 %cmp16.i, i32 %4, i32 %.migi.1.i
br label %dice.exit
if.else.i: ; preds = %for.body4
%cmp21.i = icmp eq i32 %4, %1
br i1 %cmp21.i, label %if.then22.i, label %if.else43.i
if.then22.i: ; preds = %if.else.i
%cmp24.i = icmp eq i32 %3, %2
%8 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%.247.i = select i1 %cmp24.i, i32 %8, i32 undef
%cmp29.i = icmp eq i32 %8, %2
%9 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%..247.i = select i1 %cmp29.i, i32 %9, i32 %.247.i
%cmp34.i = icmp eq i32 %9, %2
%10 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%.migi.4.i = select i1 %cmp34.i, i32 %10, i32 %..247.i
%cmp39.i = icmp eq i32 %10, %2
%spec.select229.i = select i1 %cmp39.i, i32 %3, i32 %.migi.4.i
br label %dice.exit
if.else43.i: ; preds = %if.else.i
%11 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp45.i = icmp eq i32 %11, %1
br i1 %cmp45.i, label %if.then46.i, label %if.else67.i
if.then46.i: ; preds = %if.else43.i
%cmp53.i = icmp eq i32 %4, %2
%12 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%.248.i = select i1 %cmp53.i, i32 %12, i32 %4
%cmp58.i = icmp eq i32 %12, %2
%13 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%..248.i = select i1 %cmp58.i, i32 %13, i32 %.248.i
%cmp63.i = icmp eq i32 %13, %2
%spec.select230.i = select i1 %cmp63.i, i32 %3, i32 %..248.i
br label %dice.exit
if.else67.i: ; preds = %if.else43.i
%14 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp69.i = icmp eq i32 %14, %1
br i1 %cmp69.i, label %if.then70.i, label %if.else91.i
if.then70.i: ; preds = %if.else67.i
%cmp72.i = icmp eq i32 %3, %2
%15 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%.249.i = select i1 %cmp72.i, i32 %15, i32 undef
%cmp77.i = icmp eq i32 %15, %2
%16 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%..249.i = select i1 %cmp77.i, i32 %16, i32 %.249.i
%cmp82.i = icmp eq i32 %16, %2
%spec.select231.i = select i1 %cmp82.i, i32 %4, i32 %..249.i
%cmp87.i = icmp eq i32 %4, %2
%spec.select234.i = select i1 %cmp87.i, i32 %3, i32 %spec.select231.i
br label %dice.exit
if.else91.i: ; preds = %if.else67.i
%17 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp93.i = icmp eq i32 %17, %1
br i1 %cmp93.i, label %if.then94.i, label %if.else115.i
if.then94.i: ; preds = %if.else91.i
%cmp101.i = icmp eq i32 %11, %2
%18 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%.250.i = select i1 %cmp101.i, i32 %18, i32 %11
%cmp106.i = icmp eq i32 %18, %2
%spec.select232.i = select i1 %cmp106.i, i32 %14, i32 %.250.i
%cmp111.i = icmp eq i32 %14, %2
%spec.select235.i = select i1 %cmp111.i, i32 %3, i32 %spec.select232.i
br label %dice.exit
if.else115.i: ; preds = %if.else91.i
%19 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp117.i = icmp eq i32 %19, %1
call void @llvm.assume(i1 %cmp117.i)
%cmp125.i = icmp eq i32 %14, %2
%spec.select233.i = select i1 %cmp125.i, i32 %17, i32 %14
%cmp130.i = icmp eq i32 %17, %2
%migi.17.i = select i1 %cmp130.i, i32 %11, i32 %spec.select233.i
%cmp135.i = icmp eq i32 %11, %2
%spec.select236.i = select i1 %cmp135.i, i32 %4, i32 %migi.17.i
br label %dice.exit
dice.exit: ; preds = %if.then.i, %if.then22.i, %if.then46.i, %if.then70.i, %if.then94.i, %if.else115.i
%migi.18.i = phi i32 [ %spec.select.i, %if.then.i ], [ %spec.select229.i, %if.then22.i ], [ %spec.select230.i, %if.then46.i ], [ %spec.select234.i, %if.then70.i ], [ %spec.select235.i, %if.then94.i ], [ %spec.select236.i, %if.else115.i ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %migi.18.i)
%inc9 = add nuw nsw i32 %j.117, 1
%20 = load i32, ptr %q, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc9, %20
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !9
for.end10: ; preds = %dice.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %mae) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ue) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %me) #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 willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int face[7][7][4] = {
{{0},{0},{0},{0},{0},{0},{0}},
{{0},{0},{0,1,2,3},{0,1,3,5},{0,1,4,2},{0,1,5,4},{0}},
{{0},{0,2,1,4},{0},{0,2,3,1},{0,2,4,6},{0},{0,2,6,3}},
{{0},{0,3,1,2},{0,3,2,6},{0},{0},{0,3,5,1},{0,3,6,5}},
{{0},{0,4,1,5},{0,4,2,1},{0},{0},{0,4,5,6},{0,4,6,2}},
{{0},{0,5,1,3},{0},{0,5,3,6},{0,5,4,1},{0},{0,5,6,4}},
{{0},{0},{0,6,2,4},{0,6,3,2},{0,6,4,5},{0,6,5,3},{0}}};
int assign[7];
int main()
{
int q, i, t, f;
for (i = 1; i <= 6; i++) scanf("%d", assign+i);
scanf("%d", &q);
while (q--) {
scanf("%d%d", &t, &f);
for (i = 1; i <= 6; i++) {
if (assign[i] == t) t = i;
if (assign[i] == f) f = i;
}
printf("%d\n", assign[face[t][f][3]]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242700/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242700/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@face = dso_local local_unnamed_addr global [7 x [7 x [4 x i32]]] [[7 x [4 x i32]] zeroinitializer, [7 x [4 x i32]] [[4 x i32] zeroinitializer, [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 1, i32 2, i32 3], [4 x i32] [i32 0, i32 1, i32 3, i32 5], [4 x i32] [i32 0, i32 1, i32 4, i32 2], [4 x i32] [i32 0, i32 1, i32 5, i32 4], [4 x i32] zeroinitializer], [7 x [4 x i32]] [[4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 2, i32 1, i32 4], [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 2, i32 3, i32 1], [4 x i32] [i32 0, i32 2, i32 4, i32 6], [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 2, i32 6, i32 3]], [7 x [4 x i32]] [[4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 3, i32 1, i32 2], [4 x i32] [i32 0, i32 3, i32 2, i32 6], [4 x i32] zeroinitializer, [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 3, i32 5, i32 1], [4 x i32] [i32 0, i32 3, i32 6, i32 5]], [7 x [4 x i32]] [[4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 4, i32 1, i32 5], [4 x i32] [i32 0, i32 4, i32 2, i32 1], [4 x i32] zeroinitializer, [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 4, i32 5, i32 6], [4 x i32] [i32 0, i32 4, i32 6, i32 2]], [7 x [4 x i32]] [[4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 5, i32 1, i32 3], [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 5, i32 3, i32 6], [4 x i32] [i32 0, i32 5, i32 4, i32 1], [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 5, i32 6, i32 4]], [7 x [4 x i32]] [[4 x i32] zeroinitializer, [4 x i32] zeroinitializer, [4 x i32] [i32 0, i32 6, i32 2, i32 4], [4 x i32] [i32 0, i32 6, i32 3, i32 2], [4 x i32] [i32 0, i32 6, i32 4, i32 5], [4 x i32] [i32 0, i32 6, i32 5, i32 3], [4 x i32] zeroinitializer]], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@assign = dso_local global [7 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i32, align 4
%t = alloca i32, align 4
%f = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 1))
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 2))
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 3))
%call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 4))
%call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 5))
%call.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 6))
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%dec39 = add nsw i32 %0, -1
store i32 %dec39, ptr %q, align 4, !tbaa !5
%tobool.not40 = icmp eq i32 %0, 0
br i1 %tobool.not40, label %while.end, label %while.body
while.body: ; preds = %entry, %for.inc12.5
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %f)
%t.promoted = load i32, ptr %t, align 4, !tbaa !5
%f.promoted = load i32, ptr %f, align 4, !tbaa !5
%1 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 1), align 4, !tbaa !5
%cmp6 = icmp eq i32 %1, %t.promoted
br i1 %cmp6, label %if.then, label %if.end
if.then: ; preds = %while.body
store i32 1, ptr %t, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %while.body
%i.132 = phi i32 [ 1, %if.then ], [ %t.promoted, %while.body ]
%cmp9 = icmp eq i32 %1, %f.promoted
br i1 %cmp9, label %if.then10, label %for.inc12
if.then10: ; preds = %if.end
store i32 1, ptr %f, align 4, !tbaa !5
br label %for.inc12
for.inc12: ; preds = %if.end, %if.then10
%i.134 = phi i32 [ %f.promoted, %if.end ], [ 1, %if.then10 ]
%2 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 2), align 8, !tbaa !5
%cmp6.1 = icmp eq i32 %2, %i.132
br i1 %cmp6.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %for.inc12
store i32 2, ptr %t, align 4, !tbaa !5
br label %if.end.1
if.end.1: ; preds = %if.then.1, %for.inc12
%i.132.1 = phi i32 [ 2, %if.then.1 ], [ %i.132, %for.inc12 ]
%cmp9.1 = icmp eq i32 %2, %i.134
br i1 %cmp9.1, label %if.then10.1, label %for.inc12.1
if.then10.1: ; preds = %if.end.1
store i32 2, ptr %f, align 4, !tbaa !5
br label %for.inc12.1
for.inc12.1: ; preds = %if.then10.1, %if.end.1
%i.134.1 = phi i32 [ %i.134, %if.end.1 ], [ 2, %if.then10.1 ]
%3 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 3), align 4, !tbaa !5
%cmp6.2 = icmp eq i32 %3, %i.132.1
br i1 %cmp6.2, label %if.then.2, label %if.end.2
if.then.2: ; preds = %for.inc12.1
store i32 3, ptr %t, align 4, !tbaa !5
br label %if.end.2
if.end.2: ; preds = %if.then.2, %for.inc12.1
%i.132.2 = phi i32 [ 3, %if.then.2 ], [ %i.132.1, %for.inc12.1 ]
%cmp9.2 = icmp eq i32 %3, %i.134.1
br i1 %cmp9.2, label %if.then10.2, label %for.inc12.2
if.then10.2: ; preds = %if.end.2
store i32 3, ptr %f, align 4, !tbaa !5
br label %for.inc12.2
for.inc12.2: ; preds = %if.then10.2, %if.end.2
%i.134.2 = phi i32 [ %i.134.1, %if.end.2 ], [ 3, %if.then10.2 ]
%4 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 4), align 16, !tbaa !5
%cmp6.3 = icmp eq i32 %4, %i.132.2
br i1 %cmp6.3, label %if.then.3, label %if.end.3
if.then.3: ; preds = %for.inc12.2
store i32 4, ptr %t, align 4, !tbaa !5
br label %if.end.3
if.end.3: ; preds = %if.then.3, %for.inc12.2
%i.132.3 = phi i32 [ 4, %if.then.3 ], [ %i.132.2, %for.inc12.2 ]
%cmp9.3 = icmp eq i32 %4, %i.134.2
br i1 %cmp9.3, label %if.then10.3, label %for.inc12.3
if.then10.3: ; preds = %if.end.3
store i32 4, ptr %f, align 4, !tbaa !5
br label %for.inc12.3
for.inc12.3: ; preds = %if.then10.3, %if.end.3
%i.134.3 = phi i32 [ %i.134.2, %if.end.3 ], [ 4, %if.then10.3 ]
%5 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 5), align 4, !tbaa !5
%cmp6.4 = icmp eq i32 %5, %i.132.3
br i1 %cmp6.4, label %if.then.4, label %if.end.4
if.then.4: ; preds = %for.inc12.3
store i32 5, ptr %t, align 4, !tbaa !5
br label %if.end.4
if.end.4: ; preds = %if.then.4, %for.inc12.3
%i.132.4 = phi i32 [ 5, %if.then.4 ], [ %i.132.3, %for.inc12.3 ]
%cmp9.4 = icmp eq i32 %5, %i.134.3
br i1 %cmp9.4, label %if.then10.4, label %for.inc12.4
if.then10.4: ; preds = %if.end.4
store i32 5, ptr %f, align 4, !tbaa !5
br label %for.inc12.4
for.inc12.4: ; preds = %if.then10.4, %if.end.4
%i.134.4 = phi i32 [ %i.134.3, %if.end.4 ], [ 5, %if.then10.4 ]
%6 = load i32, ptr getelementptr inbounds ([7 x i32], ptr @assign, i64 0, i64 6), align 8, !tbaa !5
%cmp6.5 = icmp eq i32 %6, %i.132.4
br i1 %cmp6.5, label %if.then.5, label %if.end.5
if.then.5: ; preds = %for.inc12.4
store i32 6, ptr %t, align 4, !tbaa !5
br label %if.end.5
if.end.5: ; preds = %if.then.5, %for.inc12.4
%7 = phi i32 [ 6, %if.then.5 ], [ %i.132.4, %for.inc12.4 ]
%cmp9.5 = icmp eq i32 %6, %i.134.4
br i1 %cmp9.5, label %if.then10.5, label %for.inc12.5
if.then10.5: ; preds = %if.end.5
store i32 6, ptr %f, align 4, !tbaa !5
br label %for.inc12.5
for.inc12.5: ; preds = %if.then10.5, %if.end.5
%8 = phi i32 [ 6, %if.then10.5 ], [ %i.134.4, %if.end.5 ]
%idxprom15 = sext i32 %7 to i64
%idxprom17 = sext i32 %8 to i64
%arrayidx19 = getelementptr inbounds [7 x [7 x [4 x i32]]], ptr @face, i64 0, i64 %idxprom15, i64 %idxprom17, i64 3
%9 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%idxprom20 = sext i32 %9 to i64
%arrayidx21 = getelementptr inbounds [7 x i32], ptr @assign, i64 0, i64 %idxprom20
%10 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%11 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %11, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%tobool.not = icmp eq i32 %11, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %for.inc12.5, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int num[6];
int top=0,front=1,right=2,left=3,back=4,bottom=5;
int i,j,n;
int x,y;
int rep;
int aftertop,afterfront;
for(i=0;i<6;i++) scanf("%d",&num[i]);
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&x,&y);
for(j=0;j<6;j++)
{
if(x==num[j])
{
aftertop=j;
break;
}
}
for(j=0;j<6;j++)
{
if(y==num[j])
{
afterfront=j;
break;
}
}
top=0;
front=1;
right=2;
left=3;
back=4;
bottom=5;
while((top!=aftertop)&&(front!=afterfront))
{
rep=top;
top=front;
front=bottom;
bottom=back;
back=rep;
}
while(top!=aftertop)
{
rep=top;
top=right;
right=bottom;
bottom=left;
left=rep;
}
while(front!=afterfront)
{
rep=front;
front=right;
right=back;
back=left;
left=rep;
}
printf("%d\n",num[right]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242744/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242744/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca [6 x i32], align 16
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %num) #3
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 %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp371 = icmp sgt i32 %0, 0
br i1 %cmp371, label %for.body4, label %for.end41
for.body4: ; preds = %entry, %while.end35
%afterfront.074 = phi i32 [ %afterfront.1, %while.end35 ], [ undef, %entry ]
%aftertop.073 = phi i32 [ %aftertop.1, %while.end35 ], [ undef, %entry ]
%i.172 = phi i32 [ %inc40, %while.end35 ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y)
%1 = load i32, ptr %x, align 4, !tbaa !5
%2 = load i32, ptr %num, align 16, !tbaa !5
%cmp11 = icmp eq i32 %1, %2
br i1 %cmp11, label %for.end14, label %for.inc12
for.inc12: ; preds = %for.body4
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %1, %3
br i1 %cmp11.1, label %for.end14, label %for.inc12.1
for.inc12.1: ; preds = %for.inc12
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp11.2 = icmp eq i32 %1, %4
br i1 %cmp11.2, label %for.end14, label %for.inc12.2
for.inc12.2: ; preds = %for.inc12.1
%5 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %1, %5
br i1 %cmp11.3, label %for.end14, label %for.inc12.3
for.inc12.3: ; preds = %for.inc12.2
%6 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp11.4 = icmp eq i32 %1, %6
br i1 %cmp11.4, label %for.end14, label %for.inc12.4
for.inc12.4: ; preds = %for.inc12.3
%7 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %1, %7
%spec.select = select i1 %cmp11.5, i32 5, i32 %aftertop.073
br label %for.end14
for.end14: ; preds = %for.inc12.4, %for.inc12.3, %for.inc12.2, %for.inc12.1, %for.inc12, %for.body4
%aftertop.1 = phi i32 [ 0, %for.body4 ], [ 1, %for.inc12 ], [ 2, %for.inc12.1 ], [ 3, %for.inc12.2 ], [ 4, %for.inc12.3 ], [ %spec.select, %for.inc12.4 ]
%8 = load i32, ptr %y, align 4, !tbaa !5
%cmp20 = icmp eq i32 %8, %2
br i1 %cmp20, label %for.end25, label %for.inc23
for.inc23: ; preds = %for.end14
%9 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp20.1 = icmp eq i32 %8, %9
br i1 %cmp20.1, label %for.end25, label %for.inc23.1
for.inc23.1: ; preds = %for.inc23
%10 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp20.2 = icmp eq i32 %8, %10
br i1 %cmp20.2, label %for.end25, label %for.inc23.2
for.inc23.2: ; preds = %for.inc23.1
%11 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp20.3 = icmp eq i32 %8, %11
br i1 %cmp20.3, label %for.end25, label %for.inc23.3
for.inc23.3: ; preds = %for.inc23.2
%12 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp20.4 = icmp eq i32 %8, %12
br i1 %cmp20.4, label %for.end25, label %for.inc23.4
for.inc23.4: ; preds = %for.inc23.3
%13 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp20.5 = icmp eq i32 %8, %13
%spec.select78 = select i1 %cmp20.5, i32 5, i32 %afterfront.074
br label %for.end25
for.end25: ; preds = %for.inc23.4, %for.inc23.3, %for.inc23.2, %for.inc23.1, %for.inc23, %for.end14
%afterfront.1 = phi i32 [ 0, %for.end14 ], [ 1, %for.inc23 ], [ 2, %for.inc23.1 ], [ 3, %for.inc23.2 ], [ 4, %for.inc23.3 ], [ %spec.select78, %for.inc23.4 ]
br label %while.cond
while.cond: ; preds = %while.cond, %for.end25
%top.0 = phi i32 [ 0, %for.end25 ], [ %front.0, %while.cond ]
%front.0 = phi i32 [ 1, %for.end25 ], [ %bottom.0, %while.cond ]
%back.0 = phi i32 [ 4, %for.end25 ], [ %top.0, %while.cond ]
%bottom.0 = phi i32 [ 5, %for.end25 ], [ %back.0, %while.cond ]
%cmp26 = icmp ne i32 %top.0, %aftertop.1
%cmp27 = icmp ne i32 %front.0, %afterfront.1
%14 = select i1 %cmp26, i1 %cmp27, i1 false
br i1 %14, label %while.cond, label %while.cond28, !llvm.loop !9
while.cond28: ; preds = %while.cond, %while.cond28
%top.1 = phi i32 [ %right.0, %while.cond28 ], [ %top.0, %while.cond ]
%right.0 = phi i32 [ %bottom.1, %while.cond28 ], [ 2, %while.cond ]
%left.0 = phi i32 [ %top.1, %while.cond28 ], [ 3, %while.cond ]
%bottom.1 = phi i32 [ %left.0, %while.cond28 ], [ %bottom.0, %while.cond ]
%cmp29.not = icmp eq i32 %top.1, %aftertop.1
br i1 %cmp29.not, label %while.cond32, label %while.cond28, !llvm.loop !11
while.cond32: ; preds = %while.cond28, %while.cond32
%front.1 = phi i32 [ %right.1, %while.cond32 ], [ %front.0, %while.cond28 ]
%right.1 = phi i32 [ %back.1, %while.cond32 ], [ %right.0, %while.cond28 ]
%left.1 = phi i32 [ %front.1, %while.cond32 ], [ %left.0, %while.cond28 ]
%back.1 = phi i32 [ %left.1, %while.cond32 ], [ %back.0, %while.cond28 ]
%cmp33.not = icmp eq i32 %front.1, %afterfront.1
br i1 %cmp33.not, label %while.end35, label %while.cond32, !llvm.loop !12
while.end35: ; preds = %while.cond32
%idxprom36 = sext i32 %right.1 to i64
%arrayidx37 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 %idxprom36
%15 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%inc40 = add nuw nsw i32 %i.172, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc40, %16
br i1 %cmp3, label %for.body4, label %for.end41, !llvm.loop !13
for.end41: ; preds = %while.end35, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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
call void @llvm.lifetime.end.p0(i64 24, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
// AOJ 0120: Patisserie
// 2017.9.28 bal4u@uu
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#define EQ(a,b) (fabs(a-b)<= 1e-7)
int r[13];
char buf[202], *p;
double d[13][13]; // ???????????±???????????????????°´????????¢
double dp[13][4100]; // ?°´????????¢, ??´?????????????????±??????????±\??´?????????
int main()
{
int w, n, i, j, k, t, s;
int lim;
double x;
for (i = 3; i <= 10; i++) for (j = i; j <= 10; j++)
d[i][j] = d[j][i] = 2.0 * sqrt(i * j);
while (fgets(p = buf, 200, stdin) != NULL) {
s = 0, n = -1;
while (*p) {
while (isspace(*p)) p++;
if (isdigit(*p)) {
if (n < 0) w = atoi(p);
else t = atoi(p), r[n] = t, s += t;
n++;
while (isdigit(*p)) p++;
}
}
if (2 * s <= w) { puts("OK"); continue; }
memset(dp, 0, sizeof(dp));
for (i = 0; i < n; i++) dp[i][1<<i] = r[i];
lim = 1 << n;
for (k = 0; k < lim; k++) {
for (i = 0; i < n; i++) { // ??????????????±??????
for (j = 0; j < n; j++) { // ??´????????±??????
if (dp[j][k] == 0) continue;
else {
int ii;
x = dp[j][k] + d[r[i]][r[j]];
ii = k | (1 << i);
if (dp[i][ii] == 0 || x < dp[i][ii]) dp[i][ii] = x;
}
}
}
}
for (x = 10000, i = 0; i < n; i++) {
if (dp[i][lim-1] == 0) continue;
dp[i][lim-1] += r[i];
if (dp[i][lim-1] < x) x = dp[i][lim-1];
}
puts(EQ(x, w) || x <= w ? "OK" : "NA");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242788/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242788/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@d = dso_local local_unnamed_addr global [13 x [13 x double]] zeroinitializer, align 16
@buf = dso_local global [202 x i8] zeroinitializer, align 16
@p = dso_local local_unnamed_addr global ptr null, align 8
@stdin = external local_unnamed_addr global ptr, align 8
@r = dso_local local_unnamed_addr global [13 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"OK\00", align 1
@dp = dso_local local_unnamed_addr global [13 x [4100 x double]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
store <2 x double> <double 6.000000e+00, double 0x401BB67AE8584CAA>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 3, i64 3), align 16, !tbaa !5
store <2 x double> <double 0x401EFBDEB14F4EDA, double 0x4020F876CCDF6CD9>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 3, i64 5), align 16, !tbaa !5
store <2 x double> <double 0x4022548EB9151E85, double 0x4023988E1409212E>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 3, i64 7), align 16, !tbaa !5
store <2 x double> <double 0x4024C8DC2E423980, double 0x4025E8ADD236A58F>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 3, i64 9), align 16, !tbaa !5
store <2 x double> <double 0x401BB67AE8584CAA, double 8.000000e+00>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 4, i64 3), align 8, !tbaa !5
store <2 x double> <double 0x401EFBDEB14F4EDA, double 0x4021E3779B97F4A8>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 5, i64 3), align 16, !tbaa !5
store <2 x double> <double 0x4020F876CCDF6CD9, double 0x4023988E1409212E>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 6, i64 3), align 8, !tbaa !5
store <2 x double> <double 0x4021E3779B97F4A8, double 0x4023988E1409212E>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 4, i64 5), align 8, !tbaa !5
store <2 x double> <double 0x4022548EB9151E85, double 0x40252A7FA9D2F8EA>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 7, i64 3), align 16, !tbaa !5
store <2 x double> <double 0x4023988E1409212E, double 0x4026A09E667F3BCD>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 8, i64 3), align 8, !tbaa !5
store <2 x double> <double 0x40252A7FA9D2F8EA, double 0x4026A09E667F3BCD>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 4, i64 7), align 8, !tbaa !5
store <2 x double> <double 0x4024C8DC2E423980, double 1.200000e+01>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 9, i64 3), align 16, !tbaa !5
store <2 x double> <double 0x4025E8ADD236A58F, double 0x40294C583ADA5B53>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 10, i64 3), align 8, !tbaa !5
store <2 x double> <double 1.200000e+01, double 0x40294C583ADA5B53>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 4, i64 9), align 8, !tbaa !5
store <2 x double> <double 1.000000e+01, double 0x4025E8ADD236A58F>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 5, i64 5), align 16, !tbaa !5
store <2 x double> <double 0x4027AA10D193C22D, double 0x40294C583ADA5B53>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 5, i64 7), align 16, !tbaa !5
store <2 x double> <double 0x402AD5336963EEFC, double 0x402C48C6001F0AC0>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 5, i64 9), align 16, !tbaa !5
store <2 x double> <double 0x4025E8ADD236A58F, double 1.200000e+01>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 6, i64 5), align 8, !tbaa !5
store <2 x double> <double 0x4027AA10D193C22D, double 0x4029EC474A261264>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 7, i64 5), align 16, !tbaa !5
store <2 x double> <double 0x40294C583ADA5B53, double 0x402BB67AE8584CAA>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 8, i64 5), align 8, !tbaa !5
store <2 x double> <double 0x4029EC474A261264, double 0x402BB67AE8584CAA>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 6, i64 7), align 8, !tbaa !5
store <2 x double> <double 0x402AD5336963EEFC, double 0x402D64D51E0DB1C6>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 9, i64 5), align 16, !tbaa !5
store <2 x double> <double 0x402C48C6001F0AC0, double 0x402EFBDEB14F4EDA>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 10, i64 5), align 8, !tbaa !5
store <2 x double> <double 0x402D64D51E0DB1C6, double 0x402EFBDEB14F4EDA>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 6, i64 9), align 8, !tbaa !5
store <2 x double> <double 1.400000e+01, double 0x402DEEEA11683F49>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 7, i64 7), align 16, !tbaa !5
store <2 x double> <double 0x402FBFBF7EBC755F, double 0x4030BBB307ACAFDB>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 7, i64 9), align 16, !tbaa !5
store <2 x double> <double 0x402DEEEA11683F49, double 1.600000e+01>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 8, i64 7), align 8, !tbaa !5
store <2 x double> <double 0x402FBFBF7EBC755F, double 0x4030F876CCDF6CD9>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 9, i64 7), align 16, !tbaa !5
store <2 x double> <double 0x4030BBB307ACAFDB, double 0x4031E3779B97F4A8>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 10, i64 7), align 8, !tbaa !5
store <2 x double> <double 0x4030F876CCDF6CD9, double 0x4031E3779B97F4A8>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 8, i64 9), align 8, !tbaa !5
store <2 x double> <double 1.800000e+01, double 0x4032F9422C23C47E>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 9, i64 9), align 16, !tbaa !5
store <2 x double> <double 0x4032F9422C23C47E, double 2.000000e+01>, ptr getelementptr inbounds ([13 x [13 x double]], ptr @d, i64 0, i64 10, i64 9), align 8, !tbaa !5
store ptr @buf, ptr @p, align 8, !tbaa !9
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call14277 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 200, ptr noundef %0)
%cmp15.not278 = icmp eq ptr %call14277, null
br i1 %cmp15.not278, label %while.end184, label %while.cond17.preheader
while.cond17.preheader: ; preds = %entry, %while.cond.backedge
%w.0279 = phi i32 [ %w.1.lcssa336, %while.cond.backedge ], [ undef, %entry ]
%1 = load ptr, ptr @p, align 8, !tbaa !9
%2 = load i8, ptr %1, align 1, !tbaa !11
%tobool.not259 = icmp eq i8 %2, 0
br i1 %tobool.not259, label %while.end54.thread, label %while.cond19.preheader.lr.ph
while.cond19.preheader.lr.ph: ; preds = %while.cond17.preheader
%call20 = tail call ptr @__ctype_b_loc() #7
%.pre = load ptr, ptr %call20, align 8, !tbaa !9
br label %while.cond19.preheader
while.cond19.preheader: ; preds = %while.cond19.preheader.lr.ph, %if.end53
%3 = phi i8 [ %2, %while.cond19.preheader.lr.ph ], [ %24, %if.end53 ]
%4 = phi ptr [ %1, %while.cond19.preheader.lr.ph ], [ %25, %if.end53 ]
%5 = phi ptr [ %.pre, %while.cond19.preheader.lr.ph ], [ %26, %if.end53 ]
%w.1262 = phi i32 [ %w.0279, %while.cond19.preheader.lr.ph ], [ %w.3, %if.end53 ]
%n.0261 = phi i32 [ -1, %while.cond19.preheader.lr.ph ], [ %n.1, %if.end53 ]
%s.0260 = phi i32 [ 0, %while.cond19.preheader.lr.ph ], [ %s.2, %if.end53 ]
%idxprom22249 = sext i8 %3 to i64
%arrayidx23250 = getelementptr inbounds i16, ptr %5, i64 %idxprom22249
%6 = load i16, ptr %arrayidx23250, align 2, !tbaa !12
%conv24251 = zext i16 %6 to i32
%and252 = and i32 %conv24251, 8192
%tobool25.not253 = icmp eq i32 %and252, 0
br i1 %tobool25.not253, label %while.end, label %while.body26
while.body26: ; preds = %while.cond19.preheader, %while.body26
%7 = phi ptr [ %incdec.ptr, %while.body26 ], [ %4, %while.cond19.preheader ]
%incdec.ptr = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr, ptr @p, align 8, !tbaa !9
%8 = load ptr, ptr %call20, align 8, !tbaa !9
%9 = load i8, ptr %incdec.ptr, align 1, !tbaa !11
%idxprom22 = sext i8 %9 to i64
%arrayidx23 = getelementptr inbounds i16, ptr %8, i64 %idxprom22
%10 = load i16, ptr %arrayidx23, align 2, !tbaa !12
%conv24 = zext i16 %10 to i32
%and = and i32 %conv24, 8192
%tobool25.not = icmp eq i32 %and, 0
br i1 %tobool25.not, label %while.end, label %while.body26, !llvm.loop !14
while.end: ; preds = %while.body26, %while.cond19.preheader
%11 = phi i8 [ %3, %while.cond19.preheader ], [ %9, %while.body26 ]
%12 = phi ptr [ %4, %while.cond19.preheader ], [ %incdec.ptr, %while.body26 ]
%13 = phi ptr [ %5, %while.cond19.preheader ], [ %8, %while.body26 ]
%conv24.lcssa = phi i32 [ %conv24251, %while.cond19.preheader ], [ %conv24, %while.body26 ]
%and32 = and i32 %conv24.lcssa, 2048
%tobool33.not = icmp eq i32 %and32, 0
br i1 %tobool33.not, label %if.end53, label %if.then
if.then: ; preds = %while.end
%cmp34 = icmp slt i32 %n.0261, 0
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull %12, ptr noundef null, i32 noundef 10) #8
%conv.i = trunc i64 %call.i to i32
br i1 %cmp34, label %if.end, label %if.else
if.else: ; preds = %if.then
%idxprom39 = zext i32 %n.0261 to i64
%arrayidx40 = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %idxprom39
store i32 %conv.i, ptr %arrayidx40, align 4, !tbaa !16
%add = add nsw i32 %s.0260, %conv.i
br label %if.end
if.end: ; preds = %if.then, %if.else
%s.1 = phi i32 [ %add, %if.else ], [ %s.0260, %if.then ]
%w.2 = phi i32 [ %w.1262, %if.else ], [ %conv.i, %if.then ]
%inc41 = add nsw i32 %n.0261, 1
%14 = load ptr, ptr %call20, align 8, !tbaa !9
%15 = load ptr, ptr @p, align 8, !tbaa !9
%16 = load i8, ptr %15, align 1, !tbaa !11
%idxprom45256 = sext i8 %16 to i64
%arrayidx46257 = getelementptr inbounds i16, ptr %14, i64 %idxprom45256
%17 = load i16, ptr %arrayidx46257, align 2, !tbaa !12
%18 = and i16 %17, 2048
%tobool49.not258 = icmp eq i16 %18, 0
br i1 %tobool49.not258, label %if.end53, label %while.body50
while.body50: ; preds = %if.end, %while.body50
%19 = phi ptr [ %incdec.ptr51, %while.body50 ], [ %15, %if.end ]
%incdec.ptr51 = getelementptr inbounds i8, ptr %19, i64 1
store ptr %incdec.ptr51, ptr @p, align 8, !tbaa !9
%20 = load ptr, ptr %call20, align 8, !tbaa !9
%21 = load i8, ptr %incdec.ptr51, align 1, !tbaa !11
%idxprom45 = sext i8 %21 to i64
%arrayidx46 = getelementptr inbounds i16, ptr %20, i64 %idxprom45
%22 = load i16, ptr %arrayidx46, align 2, !tbaa !12
%23 = and i16 %22, 2048
%tobool49.not = icmp eq i16 %23, 0
br i1 %tobool49.not, label %if.end53, label %while.body50, !llvm.loop !18
if.end53: ; preds = %while.body50, %if.end, %while.end
%24 = phi i8 [ %11, %while.end ], [ %16, %if.end ], [ %21, %while.body50 ]
%25 = phi ptr [ %12, %while.end ], [ %15, %if.end ], [ %incdec.ptr51, %while.body50 ]
%26 = phi ptr [ %13, %while.end ], [ %14, %if.end ], [ %20, %while.body50 ]
%s.2 = phi i32 [ %s.0260, %while.end ], [ %s.1, %if.end ], [ %s.1, %while.body50 ]
%n.1 = phi i32 [ %n.0261, %while.end ], [ %inc41, %if.end ], [ %inc41, %while.body50 ]
%w.3 = phi i32 [ %w.1262, %while.end ], [ %w.2, %if.end ], [ %w.2, %while.body50 ]
%tobool.not = icmp eq i8 %24, 0
br i1 %tobool.not, label %while.end54, label %while.cond19.preheader, !llvm.loop !19
while.end54: ; preds = %if.end53
%mul55 = shl nsw i32 %s.2, 1
%cmp56.not = icmp sgt i32 %mul55, %w.3
br i1 %cmp56.not, label %if.end60, label %while.cond.backedge
while.end54.thread: ; preds = %while.cond17.preheader
%cmp56.not333 = icmp slt i32 %w.0279, 0
br i1 %cmp56.not333, label %if.end60.thread, label %while.cond.backedge
if.end60.thread: ; preds = %while.end54.thread
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(426400) @dp, i8 0, i64 426400, i1 false)
br label %for.end175
while.cond.backedge: ; preds = %while.end54, %while.end54.thread, %for.end175
%.str.sink = phi ptr [ %cond, %for.end175 ], [ @.str, %while.end54.thread ], [ @.str, %while.end54 ]
%w.1.lcssa336 = phi i32 [ %w.1.lcssa335341354369, %for.end175 ], [ %w.0279, %while.end54.thread ], [ %w.3, %while.end54 ]
%call59 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.sink)
store ptr @buf, ptr @p, align 8, !tbaa !9
%27 = load ptr, ptr @stdin, align 8, !tbaa !9
%call14 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 200, ptr noundef %27)
%cmp15.not = icmp eq ptr %call14, null
br i1 %cmp15.not, label %while.end184, label %while.cond17.preheader, !llvm.loop !20
if.end60: ; preds = %while.end54
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(426400) @dp, i8 0, i64 426400, i1 false)
%cmp62265 = icmp sgt i32 %n.1, 0
br i1 %cmp62265, label %for.body64.preheader, label %for.end175
for.body64.preheader: ; preds = %if.end60
%wide.trip.count = zext i32 %n.1 to i64
%xtraiter = and i64 %wide.trip.count, 1
%28 = icmp eq i32 %n.1, 1
br i1 %28, label %for.end74.unr-lcssa, label %for.body64.preheader.new
for.body64.preheader.new: ; preds = %for.body64.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body64
for.body64: ; preds = %for.body64, %for.body64.preheader.new
%indvars.iv = phi i64 [ 0, %for.body64.preheader.new ], [ %indvars.iv.next.1, %for.body64 ]
%niter = phi i64 [ 0, %for.body64.preheader.new ], [ %niter.next.1, %for.body64 ]
%arrayidx66 = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %indvars.iv
%29 = load i32, ptr %arrayidx66, align 8, !tbaa !16
%conv67 = sitofp i32 %29 to double
%30 = trunc i64 %indvars.iv to i32
%shl = shl nuw i32 1, %30
%idxprom70 = zext i32 %shl to i64
%arrayidx71 = getelementptr inbounds [13 x [4100 x double]], ptr @dp, i64 0, i64 %indvars.iv, i64 %idxprom70
store double %conv67, ptr %arrayidx71, align 8, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx66.1 = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %indvars.iv.next
%31 = load i32, ptr %arrayidx66.1, align 4, !tbaa !16
%conv67.1 = sitofp i32 %31 to double
%32 = trunc i64 %indvars.iv.next to i32
%shl.1 = shl nuw i32 1, %32
%idxprom70.1 = sext i32 %shl.1 to i64
%arrayidx71.1 = getelementptr inbounds [13 x [4100 x double]], ptr @dp, i64 0, i64 %indvars.iv.next, i64 %idxprom70.1
store double %conv67.1, ptr %arrayidx71.1, align 16, !tbaa !5
%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.end74.unr-lcssa, label %for.body64, !llvm.loop !21
for.end74.unr-lcssa: ; preds = %for.body64, %for.body64.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body64.preheader ], [ %indvars.iv.next.1, %for.body64 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end74, label %for.body64.epil
for.body64.epil: ; preds = %for.end74.unr-lcssa
%arrayidx66.epil = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %indvars.iv.unr
%33 = load i32, ptr %arrayidx66.epil, align 4, !tbaa !16
%conv67.epil = sitofp i32 %33 to double
%34 = trunc i64 %indvars.iv.unr to i32
%shl.epil = shl nuw i32 1, %34
%idxprom70.epil = sext i32 %shl.epil to i64
%arrayidx71.epil = getelementptr inbounds [13 x [4100 x double]], ptr @dp, i64 0, i64 %indvars.iv.unr, i64 %idxprom70.epil
store double %conv67.epil, ptr %arrayidx71.epil, align 8, !tbaa !5
br label %for.end74
for.end74: ; preds = %for.end74.unr-lcssa, %for.body64.epil
%shl75 = shl nuw i32 1, %n.1
%cmp77271.not = icmp eq i32 %n.1, 31
br i1 %cmp77271.not, label %for.cond138.preheader, label %for.cond80.preheader.lr.ph
for.cond80.preheader.lr.ph: ; preds = %for.end74
br i1 %cmp62265, label %for.cond80.preheader.us.preheader, label %for.end175
for.cond80.preheader.us.preheader: ; preds = %for.cond80.preheader.lr.ph
%smax = tail call i32 @llvm.smax.i32(i32 %shl75, i32 1)
%wide.trip.count322 = zext i32 %smax to i64
%wide.trip.count317 = zext i32 %n.1 to i64
br label %for.cond80.preheader.us
for.cond80.preheader.us: ; preds = %for.cond80.preheader.us.preheader, %for.cond80.for.inc135_crit_edge.split.us.us
%indvars.iv319 = phi i64 [ 0, %for.cond80.preheader.us.preheader ], [ %indvars.iv.next320, %for.cond80.for.inc135_crit_edge.split.us.us ]
%35 = trunc i64 %indvars.iv319 to i32
br label %for.cond84.preheader.us.us
for.cond84.preheader.us.us: ; preds = %for.cond84.for.inc132_crit_edge.us.us, %for.cond80.preheader.us
%indvars.iv314 = phi i64 [ %indvars.iv.next315, %for.cond84.for.inc132_crit_edge.us.us ], [ 0, %for.cond80.preheader.us ]
%arrayidx101.us.us = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %indvars.iv314
%36 = trunc i64 %indvars.iv314 to i32
%shl109.us.us = shl nuw i32 1, %36
%or.us.us = or i32 %shl109.us.us, %35
%idxprom112.us.us = sext i32 %or.us.us to i64
%arrayidx113.us.us = getelementptr inbounds [13 x [4100 x double]], ptr @dp, i64 0, i64 %indvars.iv314, i64 %idxprom112.us.us
br label %for.body87.us.us
for.body87.us.us: ; preds = %for.inc129.us.us, %for.cond84.preheader.us.us
%indvars.iv309 = phi i64 [ %indvars.iv.next310, %for.inc129.us.us ], [ 0, %for.cond84.preheader.us.us ]
%arrayidx91.us.us = getelementptr inbounds [13 x [4100 x double]], ptr @dp, i64 0, i64 %indvars.iv309, i64 %indvars.iv319
%37 = load double, ptr %arrayidx91.us.us, align 8, !tbaa !5
%cmp92.us.us = fcmp oeq double %37, 0.000000e+00
br i1 %cmp92.us.us, label %for.inc129.us.us, label %if.else95.us.us
if.else95.us.us: ; preds = %for.body87.us.us
%38 = load i32, ptr %arrayidx101.us.us, align 4, !tbaa !16
%idxprom102.us.us = sext i32 %38 to i64
%arrayidx105.us.us = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %indvars.iv309
%39 = load i32, ptr %arrayidx105.us.us, align 4, !tbaa !16
%idxprom106.us.us = sext i32 %39 to i64
%arrayidx107.us.us = getelementptr inbounds [13 x [13 x double]], ptr @d, i64 0, i64 %idxprom102.us.us, i64 %idxprom106.us.us
%40 = load double, ptr %arrayidx107.us.us, align 8, !tbaa !5
%add108.us.us = fadd double %37, %40
%41 = load double, ptr %arrayidx113.us.us, align 8, !tbaa !5
%cmp114.us.us = fcmp oeq double %41, 0.000000e+00
%cmp120.us.us = fcmp olt double %add108.us.us, %41
%or.cond.us.us = select i1 %cmp114.us.us, i1 true, i1 %cmp120.us.us
br i1 %or.cond.us.us, label %if.then122.us.us, label %for.inc129.us.us
if.then122.us.us: ; preds = %if.else95.us.us
store double %add108.us.us, ptr %arrayidx113.us.us, align 8, !tbaa !5
br label %for.inc129.us.us
for.inc129.us.us: ; preds = %if.then122.us.us, %if.else95.us.us, %for.body87.us.us
%indvars.iv.next310 = add nuw nsw i64 %indvars.iv309, 1
%exitcond313.not = icmp eq i64 %indvars.iv.next310, %wide.trip.count317
br i1 %exitcond313.not, label %for.cond84.for.inc132_crit_edge.us.us, label %for.body87.us.us, !llvm.loop !22
for.cond84.for.inc132_crit_edge.us.us: ; preds = %for.inc129.us.us
%indvars.iv.next315 = add nuw nsw i64 %indvars.iv314, 1
%exitcond318.not = icmp eq i64 %indvars.iv.next315, %wide.trip.count317
br i1 %exitcond318.not, label %for.cond80.for.inc135_crit_edge.split.us.us, label %for.cond84.preheader.us.us, !llvm.loop !23
for.cond80.for.inc135_crit_edge.split.us.us: ; preds = %for.cond84.for.inc132_crit_edge.us.us
%indvars.iv.next320 = add nuw nsw i64 %indvars.iv319, 1
%exitcond323.not = icmp eq i64 %indvars.iv.next320, %wide.trip.count322
br i1 %exitcond323.not, label %for.cond138.preheader, label %for.cond80.preheader.us, !llvm.loop !24
for.cond138.preheader: ; preds = %for.cond80.for.inc135_crit_edge.split.us.us, %for.end74
%shl75356 = phi i32 [ -2147483648, %for.end74 ], [ %shl75, %for.cond80.for.inc135_crit_edge.split.us.us ]
%n.0.lcssa334342352 = phi i32 [ 31, %for.end74 ], [ %n.1, %for.cond80.for.inc135_crit_edge.split.us.us ]
br i1 %cmp62265, label %for.body141.lr.ph, label %for.end175
for.body141.lr.ph: ; preds = %for.cond138.preheader
%sub = add nsw i32 %shl75356, -1
%idxprom144 = sext i32 %sub to i64
%wide.trip.count327 = zext i32 %n.0.lcssa334342352 to i64
br label %for.body141
for.body141: ; preds = %for.body141.lr.ph, %for.inc173
%indvars.iv324 = phi i64 [ 0, %for.body141.lr.ph ], [ %indvars.iv.next325, %for.inc173 ]
%x.0275 = phi double [ 1.000000e+04, %for.body141.lr.ph ], [ %x.1, %for.inc173 ]
%arrayidx145 = getelementptr inbounds [13 x [4100 x double]], ptr @dp, i64 0, i64 %indvars.iv324, i64 %idxprom144
%42 = load double, ptr %arrayidx145, align 8, !tbaa !5
%cmp146 = fcmp oeq double %42, 0.000000e+00
br i1 %cmp146, label %for.inc173, label %if.end149
if.end149: ; preds = %for.body141
%arrayidx151 = getelementptr inbounds [13 x i32], ptr @r, i64 0, i64 %indvars.iv324
%43 = load i32, ptr %arrayidx151, align 4, !tbaa !16
%conv152 = sitofp i32 %43 to double
%add158 = fadd double %42, %conv152
store double %add158, ptr %arrayidx145, align 8, !tbaa !5
%cmp164 = fcmp olt double %add158, %x.0275
br i1 %cmp164, label %if.then166, label %for.inc173
if.then166: ; preds = %if.end149
br label %for.inc173
for.inc173: ; preds = %if.end149, %if.then166, %for.body141
%x.1 = phi double [ %x.0275, %for.body141 ], [ %add158, %if.then166 ], [ %x.0275, %if.end149 ]
%indvars.iv.next325 = add nuw nsw i64 %indvars.iv324, 1
%exitcond328.not = icmp eq i64 %indvars.iv.next325, %wide.trip.count327
br i1 %exitcond328.not, label %for.end175, label %for.body141, !llvm.loop !25
for.end175: ; preds = %for.inc173, %if.end60.thread, %if.end60, %for.cond80.preheader.lr.ph, %for.cond138.preheader
%w.1.lcssa335341354369 = phi i32 [ %w.3, %for.cond138.preheader ], [ %w.3, %for.cond80.preheader.lr.ph ], [ %w.3, %if.end60 ], [ %w.0279, %if.end60.thread ], [ %w.3, %for.inc173 ]
%x.0.lcssa = phi double [ 1.000000e+04, %for.cond138.preheader ], [ 1.000000e+04, %for.cond80.preheader.lr.ph ], [ 1.000000e+04, %if.end60 ], [ 1.000000e+04, %if.end60.thread ], [ %x.1, %for.inc173 ]
%conv176 = sitofp i32 %w.1.lcssa335341354369 to double
%sub177 = fsub double %x.0.lcssa, %conv176
%44 = tail call double @llvm.fabs.f64(double %sub177)
%cmp178 = fcmp ole double %44, 0x3E7AD7F29ABCAF48
%cmp181 = fcmp ole double %x.0.lcssa, %conv176
%45 = select i1 %cmp178, i1 true, i1 %cmp181
%cond = select i1 %45, ptr @.str, ptr @.str.1
br label %while.cond.backedge
while.end184: ; preds = %while.cond.backedge, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind 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 = !{!"double", !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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}
!25 = distinct !{!25, !15}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int a, b;
scanf("%d %d", &a, &b);
if(a < b){
printf("a < b\n");
}else if(a > b){
printf("a > b\n");
}else{
printf("a == b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242852/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242852/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a==b){
printf("a == b\n");
}else if(a>=b){
printf("a > b\n");
}else{
printf("a < b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242896/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242896/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%cmp2.not = icmp slt i32 %0, %1
%str.str.4 = select i1 %cmp2.not, ptr @str, ptr @str.4
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.str.4
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (){
int a,b;
scanf("%d%d",&a,&b);
if(a>b)
printf("a > b\n");
else if(a<b)
printf("a < b\n");
else
printf("a == b\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242939/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242939/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp2 = icmp slt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a;
int b;
scanf("%d %d", &a, &b);
if(a < b){
printf("a < b\n");
}
else if(a > b){
printf("a > b\n");
}
else {
printf("a == b\n");
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242982/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242982/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, char *argv[])
{
int a, b;
scanf("%d %d", &a, &b);
if (a < b) printf("a < b\n");
else if (a > b) printf("a > b\n");
else printf("a == b\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243031/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243031/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (){
int a,b;
scanf("%d %d",&a,&b);
if(a == b) printf("a == b\n");
else if(a < b) printf("a < b\n");
else printf("a > b\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243075/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243075/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%cmp2 = icmp slt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("a < b\n");
}
if(a>b){
printf("a > b\n");
}
if(a==b){
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243118/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243118/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre12 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp eq i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d%d",&a,&b);
if(a<b){printf("a < b");}
else{if(a==b){printf("a == b");}
else{printf("a > b");}
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243183/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243183/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp eq i32 %0, %1
%.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
%putchar = call i32 @putchar(i32 10)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, const char * argv[]) {
int a, b;
scanf("%d %d", &a, &b);
if (a<b) {
printf("a < b\n");
}
else if (a>b){
printf("a > b\n");
}
else if (a==b){
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243233/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243233/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end10.sink.split, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp sgt i32 %0, %1
br i1 %cmp2, label %if.end10.sink.split, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = icmp eq i32 %0, %1
br i1 %cmp6, label %if.end10.sink.split, label %if.end10
if.end10.sink.split: ; preds = %if.else5, %if.else, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ]
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
br label %if.end10
if.end10: ; preds = %if.end10.sink.split, %if.else5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a>b)
printf("a > b\n");
if(a<b)
printf("a < b\n");
if(a==b)
printf("a == b\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243277/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243277/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre12 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2 = icmp slt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp eq i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
long long int n,x,y;
scanf("%lld %lld %lld",&n,&x,&y);
long long int arr[n+1][3];
for(int i = 1; i <= n; i++)
{
arr[i][0] = 0;
arr[i][2] = 1;
arr[i][1] = 1;
}
for(int i = 1; i <= n; i++)
{
scanf("%lld",&arr[i][0]);
for(int j = 1; j <= x;j++)
{
if(i-j > 0 && arr[i][0] >= arr[i-j][0])
{
arr[i][1] = 0;
}
}
}
for(int i = 1; i <= n; i++)
for(int j = 1; j <= y;j++)
{
if(i+j <= n && arr[i][0] >= arr[i+j][0])
{
arr[i][2] = 0;
}
}
for(int i = 1; i <= n; i++)
{
if(arr[i][1] == 1 && arr[i][2] == 1)
{
printf("%d\n",i);
break;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24332/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24332/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
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 %n, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i64, ptr %n, align 8, !tbaa !5
%add = add nsw i64 %0, 1
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca [3 x i64], i64 %add, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not135 = icmp slt i64 %2, 1
br i1 %cmp.not135, label %cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %2, 1
%3 = icmp eq i64 %2, 1
br i1 %3, label %for.cond10.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %2, -2
br label %for.body
for.cond10.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader
%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.cond10.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond10.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv.unr
store i64 0, ptr %arrayidx.epil, align 8, !tbaa !5
%arrayidx5.epil = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv.unr, i64 2
store i64 1, ptr %arrayidx5.epil, align 8, !tbaa !5
%arrayidx8.epil = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv.unr, i64 1
store i64 1, ptr %arrayidx8.epil, align 8, !tbaa !5
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.cond10.preheader.unr-lcssa, %for.body.epil
br i1 %cmp.not135, label %cleanup, label %for.body15
for.body: ; preds = %for.body, %for.body.preheader.new
%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 ]
%arrayidx = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv
store i64 0, ptr %arrayidx, align 8, !tbaa !5
%arrayidx5 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv, i64 2
store i64 1, ptr %arrayidx5, align 8, !tbaa !5
%arrayidx8 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv, i64 1
store i64 1, ptr %arrayidx8, align 8, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv.next
store i64 0, ptr %arrayidx.1, align 8, !tbaa !5
%arrayidx5.1 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv.next, i64 2
store i64 1, ptr %arrayidx5.1, align 8, !tbaa !5
%arrayidx8.1 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv.next, i64 1
store i64 1, ptr %arrayidx8.1, align 8, !tbaa !5
%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.cond10.preheader.unr-lcssa, label %for.body, !llvm.loop !9
for.cond47.preheader: ; preds = %for.cond.cleanup24
%cmp49.not145 = icmp slt i64 %11, 1
br i1 %cmp49.not145, label %cleanup, label %for.cond54.preheader.lr.ph
for.cond54.preheader.lr.ph: ; preds = %for.cond47.preheader
%4 = load i64, ptr %y, align 8, !tbaa !5
%cmp56.not143 = icmp slt i64 %4, 1
br i1 %cmp56.not143, label %for.body91.preheader, label %for.cond54.preheader.preheader
for.cond54.preheader.preheader: ; preds = %for.cond54.preheader.lr.ph
%xtraiter195 = and i64 %4, 1
%5 = icmp eq i64 %4, 1
%unroll_iter197 = and i64 %4, -2
%lcmp.mod196.not = icmp eq i64 %xtraiter195, 0
br label %for.cond54.preheader
for.body15: ; preds = %for.cond10.preheader, %for.cond.cleanup24
%indvars.iv160 = phi i64 [ %indvars.iv.next161, %for.cond.cleanup24 ], [ 1, %for.cond10.preheader ]
%arrayidx17 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv160
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx17)
%6 = load i64, ptr %x, align 8, !tbaa !5
%cmp22.not138 = icmp slt i64 %6, 1
br i1 %cmp22.not138, label %for.cond.cleanup24, label %for.body25.lr.ph
for.body25.lr.ph: ; preds = %for.body15
%arrayidx39 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv160, i64 1
%xtraiter191 = and i64 %6, 1
%7 = icmp eq i64 %6, 1
br i1 %7, label %for.cond.cleanup24.loopexit.unr-lcssa, label %for.body25.lr.ph.new
for.body25.lr.ph.new: ; preds = %for.body25.lr.ph
%unroll_iter193 = and i64 %6, -2
br label %for.body25
for.cond.cleanup24.loopexit.unr-lcssa: ; preds = %for.inc40.1, %for.body25.lr.ph
%indvars.iv155.unr = phi i64 [ 1, %for.body25.lr.ph ], [ %indvars.iv.next156.1, %for.inc40.1 ]
%lcmp.mod192.not = icmp eq i64 %xtraiter191, 0
br i1 %lcmp.mod192.not, label %for.cond.cleanup24, label %for.body25.epil
for.body25.epil: ; preds = %for.cond.cleanup24.loopexit.unr-lcssa
%8 = sub nsw i64 %indvars.iv160, %indvars.iv155.unr
%cmp26.epil = icmp sgt i64 %8, 0
br i1 %cmp26.epil, label %land.lhs.true.epil, label %for.cond.cleanup24
land.lhs.true.epil: ; preds = %for.body25.epil
%9 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%idxprom32.epil = and i64 %8, 4294967295
%arrayidx33.epil = getelementptr inbounds [3 x i64], ptr %vla, i64 %idxprom32.epil
%10 = load i64, ptr %arrayidx33.epil, align 8, !tbaa !5
%cmp35.not.epil = icmp slt i64 %9, %10
br i1 %cmp35.not.epil, label %for.cond.cleanup24, label %if.then.epil
if.then.epil: ; preds = %land.lhs.true.epil
store i64 0, ptr %arrayidx39, align 8, !tbaa !5
br label %for.cond.cleanup24
for.cond.cleanup24: ; preds = %for.cond.cleanup24.loopexit.unr-lcssa, %if.then.epil, %land.lhs.true.epil, %for.body25.epil, %for.body15
%indvars.iv.next161 = add nuw i64 %indvars.iv160, 1
%11 = load i64, ptr %n, align 8, !tbaa !5
%cmp12.not = icmp slt i64 %11, %indvars.iv.next161
br i1 %cmp12.not, label %for.cond47.preheader, label %for.body15, !llvm.loop !11
for.body25: ; preds = %for.inc40.1, %for.body25.lr.ph.new
%indvars.iv155 = phi i64 [ 1, %for.body25.lr.ph.new ], [ %indvars.iv.next156.1, %for.inc40.1 ]
%niter194 = phi i64 [ 0, %for.body25.lr.ph.new ], [ %niter194.next.1, %for.inc40.1 ]
%12 = sub nsw i64 %indvars.iv160, %indvars.iv155
%cmp26 = icmp sgt i64 %12, 0
br i1 %cmp26, label %land.lhs.true, label %for.inc40
land.lhs.true: ; preds = %for.body25
%13 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%idxprom32 = and i64 %12, 4294967295
%arrayidx33 = getelementptr inbounds [3 x i64], ptr %vla, i64 %idxprom32
%14 = load i64, ptr %arrayidx33, align 8, !tbaa !5
%cmp35.not = icmp slt i64 %13, %14
br i1 %cmp35.not, label %for.inc40, label %if.then
if.then: ; preds = %land.lhs.true
store i64 0, ptr %arrayidx39, align 8, !tbaa !5
br label %for.inc40
for.inc40: ; preds = %for.body25, %land.lhs.true, %if.then
%indvars.iv.next156.neg = xor i64 %indvars.iv155, -1
%15 = add i64 %indvars.iv160, %indvars.iv.next156.neg
%cmp26.1 = icmp sgt i64 %15, 0
br i1 %cmp26.1, label %land.lhs.true.1, label %for.inc40.1
land.lhs.true.1: ; preds = %for.inc40
%16 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%idxprom32.1 = and i64 %15, 4294967295
%arrayidx33.1 = getelementptr inbounds [3 x i64], ptr %vla, i64 %idxprom32.1
%17 = load i64, ptr %arrayidx33.1, align 8, !tbaa !5
%cmp35.not.1 = icmp slt i64 %16, %17
br i1 %cmp35.not.1, label %for.inc40.1, label %if.then.1
if.then.1: ; preds = %land.lhs.true.1
store i64 0, ptr %arrayidx39, align 8, !tbaa !5
br label %for.inc40.1
for.inc40.1: ; preds = %if.then.1, %land.lhs.true.1, %for.inc40
%indvars.iv.next156.1 = add nuw nsw i64 %indvars.iv155, 2
%niter194.next.1 = add i64 %niter194, 2
%niter194.ncmp.1 = icmp eq i64 %niter194.next.1, %unroll_iter193
br i1 %niter194.ncmp.1, label %for.cond.cleanup24.loopexit.unr-lcssa, label %for.body25, !llvm.loop !12
for.cond54.preheader: ; preds = %for.cond54.preheader.preheader, %for.cond54.for.cond.cleanup58_crit_edge
%indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.cond54.for.cond.cleanup58_crit_edge ], [ 1, %for.cond54.preheader.preheader ]
%arrayidx66 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv168
%arrayidx77 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv168, i64 2
br i1 %5, label %for.cond54.for.cond.cleanup58_crit_edge.unr-lcssa, label %for.body59
for.cond86.preheader: ; preds = %for.cond54.for.cond.cleanup58_crit_edge
br i1 %cmp49.not145, label %cleanup, label %for.body91.preheader
for.body91.preheader: ; preds = %for.cond54.preheader.lr.ph, %for.cond86.preheader
br label %for.body91
for.cond54.for.cond.cleanup58_crit_edge.unr-lcssa: ; preds = %for.inc79.1, %for.cond54.preheader
%indvars.iv163.unr = phi i64 [ 1, %for.cond54.preheader ], [ %indvars.iv.next164.1, %for.inc79.1 ]
br i1 %lcmp.mod196.not, label %for.cond54.for.cond.cleanup58_crit_edge, label %for.body59.epil
for.body59.epil: ; preds = %for.cond54.for.cond.cleanup58_crit_edge.unr-lcssa
%18 = add nuw nsw i64 %indvars.iv163.unr, %indvars.iv168
%cmp62.not.epil = icmp slt i64 %11, %18
br i1 %cmp62.not.epil, label %for.cond54.for.cond.cleanup58_crit_edge, label %land.lhs.true64.epil
land.lhs.true64.epil: ; preds = %for.body59.epil
%19 = load i64, ptr %arrayidx66, align 8, !tbaa !5
%arrayidx70.epil = getelementptr inbounds [3 x i64], ptr %vla, i64 %18
%20 = load i64, ptr %arrayidx70.epil, align 8, !tbaa !5
%cmp72.not.epil = icmp slt i64 %19, %20
br i1 %cmp72.not.epil, label %for.cond54.for.cond.cleanup58_crit_edge, label %if.then74.epil
if.then74.epil: ; preds = %land.lhs.true64.epil
store i64 0, ptr %arrayidx77, align 8, !tbaa !5
br label %for.cond54.for.cond.cleanup58_crit_edge
for.cond54.for.cond.cleanup58_crit_edge: ; preds = %for.body59.epil, %land.lhs.true64.epil, %if.then74.epil, %for.cond54.for.cond.cleanup58_crit_edge.unr-lcssa
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%exitcond171 = icmp eq i64 %indvars.iv168, %11
br i1 %exitcond171, label %for.cond86.preheader, label %for.cond54.preheader, !llvm.loop !13
for.body59: ; preds = %for.cond54.preheader, %for.inc79.1
%indvars.iv163 = phi i64 [ %indvars.iv.next164.1, %for.inc79.1 ], [ 1, %for.cond54.preheader ]
%niter198 = phi i64 [ %niter198.next.1, %for.inc79.1 ], [ 0, %for.cond54.preheader ]
%21 = add nuw nsw i64 %indvars.iv163, %indvars.iv168
%cmp62.not = icmp slt i64 %11, %21
br i1 %cmp62.not, label %for.inc79, label %land.lhs.true64
land.lhs.true64: ; preds = %for.body59
%22 = load i64, ptr %arrayidx66, align 8, !tbaa !5
%arrayidx70 = getelementptr inbounds [3 x i64], ptr %vla, i64 %21
%23 = load i64, ptr %arrayidx70, align 8, !tbaa !5
%cmp72.not = icmp slt i64 %22, %23
br i1 %cmp72.not, label %for.inc79, label %if.then74
if.then74: ; preds = %land.lhs.true64
store i64 0, ptr %arrayidx77, align 8, !tbaa !5
br label %for.inc79
for.inc79: ; preds = %for.body59, %land.lhs.true64, %if.then74
%indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1
%24 = add nuw nsw i64 %indvars.iv.next164, %indvars.iv168
%cmp62.not.1 = icmp slt i64 %11, %24
br i1 %cmp62.not.1, label %for.inc79.1, label %land.lhs.true64.1
land.lhs.true64.1: ; preds = %for.inc79
%25 = load i64, ptr %arrayidx66, align 8, !tbaa !5
%arrayidx70.1 = getelementptr inbounds [3 x i64], ptr %vla, i64 %24
%26 = load i64, ptr %arrayidx70.1, align 8, !tbaa !5
%cmp72.not.1 = icmp slt i64 %25, %26
br i1 %cmp72.not.1, label %for.inc79.1, label %if.then74.1
if.then74.1: ; preds = %land.lhs.true64.1
store i64 0, ptr %arrayidx77, align 8, !tbaa !5
br label %for.inc79.1
for.inc79.1: ; preds = %if.then74.1, %land.lhs.true64.1, %for.inc79
%indvars.iv.next164.1 = add nuw nsw i64 %indvars.iv163, 2
%niter198.next.1 = add i64 %niter198, 2
%niter198.ncmp.1 = icmp eq i64 %niter198.next.1, %unroll_iter197
br i1 %niter198.ncmp.1, label %for.cond54.for.cond.cleanup58_crit_edge.unr-lcssa, label %for.body59, !llvm.loop !14
for.body91: ; preds = %for.body91.preheader, %for.inc106
%indvars.iv175 = phi i64 [ %indvars.iv.next176, %for.inc106 ], [ 1, %for.body91.preheader ]
%arrayidx94 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv175, i64 1
%27 = load i64, ptr %arrayidx94, align 8, !tbaa !5
%cmp95 = icmp eq i64 %27, 1
br i1 %cmp95, label %land.lhs.true97, label %for.inc106
land.lhs.true97: ; preds = %for.body91
%arrayidx100 = getelementptr inbounds [3 x i64], ptr %vla, i64 %indvars.iv175, i64 2
%28 = load i64, ptr %arrayidx100, align 8, !tbaa !5
%cmp101 = icmp eq i64 %28, 1
br i1 %cmp101, label %if.then103, label %for.inc106
if.then103: ; preds = %land.lhs.true97
%29 = trunc i64 %indvars.iv175 to i32
%call104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %29)
br label %cleanup
for.inc106: ; preds = %for.body91, %land.lhs.true97
%indvars.iv.next176 = add nuw i64 %indvars.iv175, 1
%cmp88.not = icmp slt i64 %11, %indvars.iv.next176
br i1 %cmp88.not, label %cleanup, label %for.body91, !llvm.loop !15
cleanup: ; preds = %for.inc106, %for.cond47.preheader, %entry, %for.cond10.preheader, %for.cond86.preheader, %if.then103
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(void) {
int a,b;
scanf("%d %d",&a,&b);
if (a < b) {
printf("a < b\n");
}
else if (a > b) {
printf("a > b\n");
}
else if (a == b) {
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243363/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243363/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end10.sink.split, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp sgt i32 %0, %1
br i1 %cmp2, label %if.end10.sink.split, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = icmp eq i32 %0, %1
br i1 %cmp6, label %if.end10.sink.split, label %if.end10
if.end10.sink.split: ; preds = %if.else5, %if.else, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ]
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
br label %if.end10
if.end10: ; preds = %if.end10.sink.split, %if.else5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d",&a);
scanf("%d",&b);
if(a < b){
printf("a < b\n");
}
if(a > b){
printf("a > b\n");
}
if(a == b){
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre13 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre13, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp3 = icmp sgt i32 %3, %2
br i1 %cmp3, label %if.then4, label %if.end6
if.then4: ; preds = %if.end
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre14 = load i32, ptr %a, align 4, !tbaa !5
%.pre15 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
%4 = phi i32 [ %.pre15, %if.then4 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre14, %if.then4 ], [ %3, %if.end ]
%cmp7 = icmp eq i32 %5, %4
br i1 %cmp7, label %if.then8, label %if.end10
if.then8: ; preds = %if.end6
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end10
if.end10: ; preds = %if.then8, %if.end6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a;
int b;
scanf("%d", &a);
scanf("%d", &b);
if (a < b)
{
printf("a < b\n");
}
if (a > b)
{
printf("a > b\n");
}
if (a == b)
{
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243457/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243457/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre13 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre13, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp3 = icmp sgt i32 %3, %2
br i1 %cmp3, label %if.then4, label %if.end6
if.then4: ; preds = %if.end
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre14 = load i32, ptr %a, align 4, !tbaa !5
%.pre15 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
%4 = phi i32 [ %.pre15, %if.then4 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre14, %if.then4 ], [ %3, %if.end ]
%cmp7 = icmp eq i32 %5, %4
br i1 %cmp7, label %if.then8, label %if.end10
if.then8: ; preds = %if.end6
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end10
if.end10: ; preds = %if.then8, %if.end6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,x,y,day=0,b,i;
scanf("%d%d%d",&n,&x,&y);
int a[n+5];
for (int i=1;i<=n;i++) scanf("%d",&a[i]);
for (int i=1;i<=n;i++){
int kt=0;
if ((i-x)<=0) b =1;
else b= i-x;
for (int j=i;j>=b;j--) if (a[i]<a[j]&&i!=j||i==j) kt=1;
else {kt=0; break;}
if (kt==1){
if (i+y>n) b=n;
else b = i+y;
for (int j=i;j<=b;j++) if (a[i]<a[j]&&i!=j||i==j) kt=1;
else {kt=0; break;}}
if (kt==1) {day=i;break;}
}
printf("%d",day);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24350/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 5
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not111 = icmp slt i32 %3, 1
br i1 %cmp.not111, label %cleanup62, label %for.body
for.cond4.preheader: ; preds = %for.body
%cmp5.not120 = icmp slt i32 %7, 1
br i1 %cmp5.not120, label %cleanup62, label %for.body7.lr.ph
for.body7.lr.ph: ; preds = %for.cond4.preheader
%4 = load i32, ptr %x, align 4, !tbaa !5
%5 = load i32, ptr %y, align 4
%6 = add nuw i32 %7, 1
%wide.trip.count = zext i32 %6 to i64
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %8
br i1 %cmp.not.not, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body7: ; preds = %for.body7.lr.ph, %for.inc60
%indvars.iv127 = phi i64 [ 1, %for.body7.lr.ph ], [ %indvars.iv.next128, %for.inc60 ]
%9 = trunc i64 %indvars.iv127 to i32
%sub = sub nsw i32 %9, %4
%.sub = call i32 @llvm.smax.i32(i32 %sub, i32 1)
%10 = zext i32 %.sub to i64
%cmp11.not113 = icmp ult i64 %indvars.iv127, %10
br i1 %cmp11.not113, label %for.inc60, label %for.body13.lr.ph
for.body13.lr.ph: ; preds = %for.body7
%arrayidx15 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv127
%11 = load i32, ptr %arrayidx15, align 4, !tbaa !5
br label %for.body13
for.cond10: ; preds = %for.body13
%dec = add nsw i32 %j.0114, -1
%cmp11.not.not = icmp sgt i32 %j.0114, %.sub
br i1 %cmp11.not.not, label %for.body13, label %if.then27, !llvm.loop !11
for.body13: ; preds = %for.body13.lr.ph, %for.cond10
%j.0114 = phi i32 [ %9, %for.body13.lr.ph ], [ %dec, %for.cond10 ]
%idxprom16 = zext i32 %j.0114 to i64
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %idxprom16
%12 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp slt i32 %11, %12
%cmp19.not = icmp eq i64 %indvars.iv127, %idxprom16
%or.cond98 = or i1 %cmp19.not, %cmp18
br i1 %or.cond98, label %for.cond10, label %for.inc60
if.then27: ; preds = %for.cond10
%add28 = add nsw i32 %5, %9
%.add28 = call i32 @llvm.smin.i32(i32 %add28, i32 %7)
%13 = sext i32 %.add28 to i64
%cmp36.not116 = icmp sgt i64 %indvars.iv127, %13
br i1 %cmp36.not116, label %cleanup62, label %for.body38
for.cond35: ; preds = %for.body38
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%cmp36.not.not = icmp slt i64 %indvars.iv129, %13
br i1 %cmp36.not.not, label %for.body38, label %cleanup62, !llvm.loop !12
for.body38: ; preds = %if.then27, %for.cond35
%indvars.iv129 = phi i64 [ %indvars.iv.next130, %for.cond35 ], [ %indvars.iv127, %if.then27 ]
%arrayidx42 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv129
%14 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%cmp43 = icmp slt i32 %11, %14
%cmp45.not = icmp eq i64 %indvars.iv127, %indvars.iv129
%or.cond100 = or i1 %cmp45.not, %cmp43
br i1 %or.cond100, label %for.cond35, label %for.inc60
for.inc60: ; preds = %for.body13, %for.body38, %for.body7
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%exitcond.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count
br i1 %exitcond.not, label %cleanup62, label %for.body7, !llvm.loop !13
cleanup62: ; preds = %for.inc60, %if.then27, %for.cond35, %entry, %for.cond4.preheader
%day.2 = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %9, %for.cond35 ], [ %9, %if.then27 ], [ 0, %for.inc60 ]
%call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %day.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("a < b\n");
}
else if(a>b){
printf("a > b\n");
}
else{
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243543/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243543/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("a < b\n");
}
else if(a>b){
printf("a > b\n");
}
else if(a==b){
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243600/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243600/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.end10.sink.split, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp sgt i32 %0, %1
br i1 %cmp2, label %if.end10.sink.split, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = icmp eq i32 %0, %1
br i1 %cmp6, label %if.end10.sink.split, label %if.end10
if.end10.sink.split: ; preds = %if.else5, %if.else, %entry
%str.4.sink = phi ptr [ @str.5, %entry ], [ @str.4, %if.else ], [ @str, %if.else5 ]
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
br label %if.end10
if.end10: ; preds = %if.end10.sink.split, %if.else5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d %d",&a, &b);
if(a < b)
{
printf("a < b\n");
}
if(a > b)
{
printf("a > b\n");
}
if(a == b)
{
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243644/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243644/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre12 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre12, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp2 = icmp sgt i32 %3, %2
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre14, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %if.then3 ], [ %3, %if.end ]
%cmp6 = icmp eq i32 %5, %4
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%puts11 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d %d",&a,&b);
if(a<b){
printf("a < b\n");
}
else if(a>b){
printf("a > b\n");
}
else
{
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243688/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243688/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"a == b\00", align 1
@str.4 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.