Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(void){
int S,s,h,m;
scanf("%d",&S);
h=S/3600;
m=S%3600;
s=m%60;
m=m/60;
printf("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%rem1.lhs.trunc = trunc i32 %rem to i16
%rem16 = srem i16 %rem1.lhs.trunc, 60
%rem1.sext = sext i16 %rem16 to i32
%div27 = sdiv i16 %rem1.lhs.trunc, 60
%div2.sext = sext i16 %div27 to i32
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div2.sext, i32 noundef %rem1.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;
int h = 0;
int m = 0;
scanf("%d",&a);
if(a/3600!=0){
h = a / 3600;
a -= 3600 * h;
}
if(a/60!=0){
m = a / 60;
a -= 60 * m;
}
printf("%d:%d:%d\n",h,m,a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241239/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%.off = add i32 %0, 3599
%cmp.not = icmp ult i32 %.off, 7199
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub = add i32 %mul.neg, %0
store i32 %sub, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i32 [ %sub, %if.then ], [ %0, %entry ]
%h.0 = phi i32 [ %div, %if.then ], [ 0, %entry ]
%.off12 = add i32 %1, 59
%cmp3.not = icmp ult i32 %.off12, 119
br i1 %cmp3.not, label %if.end8, label %if.then4
if.then4: ; preds = %if.end
%div2 = sdiv i32 %1, 60
%mul6.neg = mul nsw i32 %div2, -60
%sub7 = add i32 %mul6.neg, %1
store i32 %sub7, ptr %a, align 4, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then4, %if.end
%2 = phi i32 [ %sub7, %if.then4 ], [ %1, %if.end ]
%m.0 = phi i32 [ %div2, %if.then4 ], [ 0, %if.end ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.0, i32 noundef %m.0, i32 noundef %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, char const *argv[]) {
int s,m,h;
scanf("%d", &s);
m = 0;
h = 0;
if(s >59){
m = s / 60;
s = s % 60;
if(m > 59){
h = m / 60;
m = m % 60;
}
}
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241282/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241282/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) 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
%cmp = icmp sgt i32 %0, 59
br i1 %cmp, label %if.then, label %if.end5
if.then: ; preds = %entry
%div = udiv i32 %0, 60
%rem = urem i32 %0, 60
store i32 %rem, ptr %s, align 4, !tbaa !5
%cmp1 = icmp ugt i32 %0, 3599
br i1 %cmp1, label %if.then2, label %if.end5
if.then2: ; preds = %if.then
%div3 = udiv i32 %0, 3600
%rem4 = urem i32 %div, 60
br label %if.end5
if.end5: ; preds = %if.then, %if.then2, %entry
%1 = phi i32 [ %rem, %if.then2 ], [ %rem, %if.then ], [ %0, %entry ]
%m.0 = phi i32 [ %rem4, %if.then2 ], [ %div, %if.then ], [ 0, %entry ]
%h.0 = phi i32 [ %div3, %if.then2 ], [ 0, %if.then ], [ 0, %entry ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %h.0, i32 noundef %m.0, i32 noundef %1)
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;
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_241325/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241325/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
int main() {
int i,j1,j2,k1,k2,s,m,h;
scanf("%d\n",&i);
j1=i%3600;
j2=i-j1;
h=j2/3600;
k1=(i-h*3600)%60;
k2=(i-h*3600)-k1;
m=k2/60;
s=i-m*60-h*3600;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241369/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241369/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%mul.neg = mul nsw i32 %div, -3600
%sub1 = add i32 %mul.neg, %0
%div6 = sdiv i32 %sub1, 60
%mul7.neg = mul nsw i32 %div6, -60
%sub10 = add i32 %sub1, %mul7.neg
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div6, i32 noundef %sub10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #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;
int rS;
int sh = 60 * 60;
int sm = 60;
scanf("%d",&S);
h = (S/sh);
rS = S - (h * sh);
m = rS/sm;
rS = rS - (m*sm);
s = rS;
printf("%d:%d:%d\n",h,m,s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241411/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241411/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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(void)
{
int s;
scanf("%d", &s);
printf("%d:%d:%d\n", s/3600, (s%3600)/60, (s%3600)%60);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241455/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241455/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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,s,m,h;
scanf("%d",&S);
s = S%60;
m = S/60;
h = m/60;
m = m%60;
printf("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241499/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241499/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 %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/60)%60,s%60);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241549/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241549/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(){
int a, t;
while(scanf("%d", &a) == 1){
t = a / 3600;
a = a % 3600;
printf("%d:", t);
t = a / 60;
a = a % 60;
printf("%d:%d\n", t, a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241592/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241592/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d:%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp7 = icmp eq i32 %call6, 1
br i1 %cmp7, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %a, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%1 = load i32, ptr %a, align 4, !tbaa !5
%div2 = sdiv i32 %1, 60
%rem3 = srem i32 %1, 60
store i32 %rem3, ptr %a, align 4, !tbaa !5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %div2, i32 noundef %rem3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%cmp = icmp eq i32 %call, 1
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int para,time;
int i;
int div = 3600;
scanf("%d",¶);
for (i = 1; i <= 3; i++)
{
time = para / div;
para %= div;
div /= 60;
printf("%d",time);
if (i != 3)
putchar(':');
else
putchar('\n');
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241635/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241635/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.inc.2:
%para = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %para) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %para)
%0 = load i32, ptr %para, align 4, !tbaa !5
%div1 = sdiv i32 %0, 3600
%rem = srem i32 %0, 3600
store i32 %rem, ptr %para, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div1)
%1 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call i32 @putc(i32 noundef 58, ptr noundef %1)
%.pre = load i32, ptr %para, align 4, !tbaa !5
%div1.1 = sdiv i32 %.pre, 60
%rem.1 = srem i32 %.pre, 60
store i32 %rem.1, ptr %para, align 4, !tbaa !5
%call3.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div1.1)
%2 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i.1 = call i32 @putc(i32 noundef 58, ptr noundef %2)
%.pre14 = load i32, ptr %para, align 4, !tbaa !5
store i32 0, ptr %para, align 4, !tbaa !5
%call3.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre14)
%3 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i11.2 = call i32 @putc(i32 noundef 10, ptr noundef %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %para) #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
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
int main(void)
{
int S,h,m,s;
scanf("%d\n",&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_241693/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241693/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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()
{
long int s;
scanf("%i", &s);
printf("%i:%i:%i\n", s / 3600, s % 3600 / 60, s % 60);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241736/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241736/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%i\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%i:%i:%i\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i64, ptr %s, align 8, !tbaa !5
%div = sdiv i64 %0, 3600
%rem = srem i64 %0, 3600
%div1.lhs.trunc = trunc i64 %rem to i16
%div14 = sdiv i16 %div1.lhs.trunc, 60
%div1.sext = sext i16 %div14 to i64
%rem2 = srem i64 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div, i64 noundef %div1.sext, i64 noundef %rem2)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b)
{
return (*(int*)b-*(int*)a);
}
int main()
{
int t,k,n,i,a[300000],c;
long long s=0;
scanf("%d%d",&t,&k);
t--;
scanf("%d",&n);
for(i=0;i<t;i++)
{
scanf("%d",&c);
a[i]=(c-n);
s+=a[i];
n=c;
}
qsort(a,t,sizeof(int),cmp);
for(i=0;i<k-1;i++)
s-=a[i];
printf("%lld\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24178/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24178/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%t = alloca i32, align 4
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [300000 x i32], align 16
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %k)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %t, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %1 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%s.029 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub = sub nsw i32 %2, %3
%arrayidx = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 %sub, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i32 %sub to i64
%add = add nsw i64 %s.029, %conv
store i32 %2, ptr %n, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %t, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv5.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ]
%s.0.lcssa = phi i64 [ 0, %entry.for.end_crit_edge ], [ %add, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv5.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #6
%6 = load i32, ptr %k, align 4, !tbaa !5
%cmp831 = icmp sgt i32 %6, 1
br i1 %cmp831, label %for.body10.preheader, label %for.end17
for.body10.preheader: ; preds = %for.end
%sub7 = add nsw i32 %6, -1
%wide.trip.count = zext i32 %sub7 to i64
%min.iters.check = icmp ult i32 %6, 5
br i1 %min.iters.check, label %for.body10.preheader42, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
%7 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %s.0.lcssa, 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> [ %7, %vector.ph ], [ %12, %vector.body ]
%vec.phi40 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%8 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 2
%wide.load41 = load <2 x i32>, ptr %9, align 8, !tbaa !5
%10 = sext <2 x i32> %wide.load to <2 x i64>
%11 = sext <2 x i32> %wide.load41 to <2 x i64>
%12 = sub <2 x i64> %vec.phi, %10
%13 = sub <2 x i64> %vec.phi40, %11
%index.next = add nuw i64 %index, 4
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %13, %12
%15 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end17, label %for.body10.preheader42
for.body10.preheader42: ; preds = %for.body10.preheader, %middle.block
%indvars.iv37.ph = phi i64 [ 0, %for.body10.preheader ], [ %n.vec, %middle.block ]
%s.133.ph = phi i64 [ %s.0.lcssa, %for.body10.preheader ], [ %15, %middle.block ]
br label %for.body10
for.body10: ; preds = %for.body10.preheader42, %for.body10
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body10 ], [ %indvars.iv37.ph, %for.body10.preheader42 ]
%s.133 = phi i64 [ %sub14, %for.body10 ], [ %s.133.ph, %for.body10.preheader42 ]
%arrayidx12 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv37
%16 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%conv13 = sext i32 %16 to i64
%sub14 = sub nsw i64 %s.133, %conv13
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end17, label %for.body10, !llvm.loop !14
for.end17: ; preds = %for.body10, %middle.block, %for.end
%s.1.lcssa = phi i64 [ %s.0.lcssa, %for.end ], [ %15, %middle.block ], [ %sub14, %for.body10 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %s.1.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: 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>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!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}
|
#include<stdio.h>
#include<stdlib.h>
int cmp(const void *a,const void *b)
{
return (*(int*)b-*(int*)a);
}
int main()
{
int t,k,n,i,a[300000],c;
long long s=0;
scanf("%d%d",&t,&k);
t=t-1;
scanf("%d",&n);
for(i=0;i<t;i++)
{
scanf("%d",&c);
a[i]=(c-n);
s+=a[i];
n=c;
}
qsort(a,t,sizeof(int),cmp);
k--;
for(i=0;i<k;i++)
s-=a[i];
printf("%lld\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24183/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24183/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%t = alloca i32, align 4
%k = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [300000 x i32], align 16
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 1200000, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %k)
%0 = load i32, ptr %t, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
store i32 %sub, ptr %t, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %t, align 4, !tbaa !5
%cmp27 = icmp sgt i32 %1, 0
br i1 %cmp27, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %1 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%s.029 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%sub3 = sub nsw i32 %2, %3
%arrayidx = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 %sub3, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i32 %sub3 to i64
%add = add nsw i64 %s.029, %conv
store i32 %2, ptr %n, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %t, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv6.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ]
%s.0.lcssa = phi i64 [ 0, %entry.for.end_crit_edge ], [ %add, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv6.pre-phi, i64 noundef 4, ptr noundef nonnull @cmp) #6
%6 = load i32, ptr %k, align 4, !tbaa !5
%dec = add i32 %6, -1
store i32 %dec, ptr %k, align 4, !tbaa !5
%cmp831 = icmp sgt i32 %6, 1
br i1 %cmp831, label %for.body10.preheader, label %for.end17
for.body10.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %dec to i64
%min.iters.check = icmp ult i32 %6, 5
br i1 %min.iters.check, label %for.body10.preheader42, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
%7 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %s.0.lcssa, 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> [ %7, %vector.ph ], [ %12, %vector.body ]
%vec.phi40 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%8 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <2 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 2
%wide.load41 = load <2 x i32>, ptr %9, align 8, !tbaa !5
%10 = sext <2 x i32> %wide.load to <2 x i64>
%11 = sext <2 x i32> %wide.load41 to <2 x i64>
%12 = sub <2 x i64> %vec.phi, %10
%13 = sub <2 x i64> %vec.phi40, %11
%index.next = add nuw i64 %index, 4
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %13, %12
%15 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end17, label %for.body10.preheader42
for.body10.preheader42: ; preds = %for.body10.preheader, %middle.block
%indvars.iv37.ph = phi i64 [ 0, %for.body10.preheader ], [ %n.vec, %middle.block ]
%s.133.ph = phi i64 [ %s.0.lcssa, %for.body10.preheader ], [ %15, %middle.block ]
br label %for.body10
for.body10: ; preds = %for.body10.preheader42, %for.body10
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body10 ], [ %indvars.iv37.ph, %for.body10.preheader42 ]
%s.133 = phi i64 [ %sub14, %for.body10 ], [ %s.133.ph, %for.body10.preheader42 ]
%arrayidx12 = getelementptr inbounds [300000 x i32], ptr %a, i64 0, i64 %indvars.iv37
%16 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%conv13 = sext i32 %16 to i64
%sub14 = sub nsw i64 %s.133, %conv13
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%exitcond.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count
br i1 %exitcond.not, label %for.end17, label %for.body10, !llvm.loop !14
for.end17: ; preds = %for.body10, %middle.block, %for.end
%s.1.lcssa = phi i64 [ %s.0.lcssa, %for.end ], [ %15, %middle.block ], [ %sub14, %for.body10 ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %s.1.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 1200000, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: 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>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!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}
|
#include <stdio.h>
int main ()
{
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_241873/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241873/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ss;
int h , m , s;
scanf( "%d" , &ss );
h = ss / 3600;
m = ( ss % 3600 ) / 60;
s = ( ss % 3600 ) % 60;
printf( "%d:%d:%d\n" , h , m , s );
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_241916/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_241916/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%ss = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ss) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ss)
%0 = load i32, ptr %ss, 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 %ss) #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>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <math.h>
int main(void)
{
int n;
double a, d, x, y, p, t;
while (scanf("%lf%lf",&a,&d) != EOF) {
scanf("%d", &n);
p = 0;
while (n--) {
p += d;
t = (int)(p/(4*a));
t = p - t*4*a;
p = t;
if (t < a) {
y = 0;
x = t;
}
else if (t < 2*a) {
x = a;
y = t - a;
}
else if (t < 3*a) {
y = a;
x = a-(t-2*a);
}
else {
x = 0;
y = a-(t-3*a);
}
printf("%.10f %.10f\n", x, y);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf%lf\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [13 x i8] c"%.10f %.10f\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 double, align 8
%d = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
%call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d)
%cmp.not42 = icmp eq i32 %call41, -1
br i1 %cmp.not42, label %while.end26, label %while.body
while.cond.loopexit: ; preds = %if.end24, %while.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end26, label %while.body, !llvm.loop !5
while.body: ; preds = %entry, %while.cond.loopexit
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !7
%dec38 = add nsw i32 %0, -1
store i32 %dec38, ptr %n, align 4, !tbaa !7
%tobool.not39 = icmp eq i32 %0, 0
br i1 %tobool.not39, label %while.cond.loopexit, label %while.body3
while.body3: ; preds = %while.body, %if.end24
%p.040 = phi double [ %3, %if.end24 ], [ 0.000000e+00, %while.body ]
%1 = load double, ptr %d, align 8, !tbaa !11
%add = fadd double %p.040, %1
%2 = load double, ptr %a, align 8, !tbaa !11
%mul = fmul double %2, 4.000000e+00
%div = fdiv double %add, %mul
%conv = fptosi double %div to i32
%conv4 = sitofp i32 %conv to double
%neg = fmul double %conv4, -4.000000e+00
%3 = call double @llvm.fmuladd.f64(double %neg, double %2, double %add)
%cmp7 = fcmp olt double %3, %2
br i1 %cmp7, label %if.end24, label %if.else
if.else: ; preds = %while.body3
%mul9 = fmul double %2, 2.000000e+00
%cmp10 = fcmp olt double %3, %mul9
br i1 %cmp10, label %if.then12, label %if.else13
if.then12: ; preds = %if.else
%sub = fsub double %3, %2
br label %if.end24
if.else13: ; preds = %if.else
%mul14 = fmul double %2, 3.000000e+00
%cmp15 = fcmp olt double %3, %mul14
br i1 %cmp15, label %if.then17, label %if.else20
if.then17: ; preds = %if.else13
%4 = call double @llvm.fmuladd.f64(double %2, double -2.000000e+00, double %3)
%sub19 = fsub double %2, %4
br label %if.end24
if.else20: ; preds = %if.else13
%5 = call double @llvm.fmuladd.f64(double %2, double -3.000000e+00, double %3)
%sub22 = fsub double %2, %5
br label %if.end24
if.end24: ; preds = %while.body3, %if.then12, %if.else20, %if.then17
%x.0 = phi double [ %2, %if.then12 ], [ %sub19, %if.then17 ], [ 0.000000e+00, %if.else20 ], [ %3, %while.body3 ]
%y.0 = phi double [ %sub, %if.then12 ], [ %2, %if.then17 ], [ %sub22, %if.else20 ], [ 0.000000e+00, %while.body3 ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %x.0, double noundef %y.0)
%6 = load i32, ptr %n, align 4, !tbaa !7
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %n, align 4, !tbaa !7
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.cond.loopexit, label %while.body3, !llvm.loop !13
while.end26: ; preds = %while.cond.loopexit, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind 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 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !9, i64 0}
!13 = distinct !{!13, !6}
|
#include<stdio.h>
int main(void)
{
int t,h,m,s;
scanf("%d",&t);
h=t/3600;
m=(t/60)%60;
s=t%60;
printf("%d:%d:%d\n",h,m,s);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242009/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242009/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 %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>
char a[304][304];
int main(void) {
// your code goes here
int n,i,j,f=0;
int x,y,z;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%s",a[i]);
for(i=0;i<n;i++){
if(a[i][i]!=a[0][0]) break;
}
if(i!=n){
printf("NO\n");
}
else{
for(i=0;i<n;i++){
if(a[i][n-i-1]!=a[0][0]) break;
}
if(i!=n){
printf("NO\n");
}
else{
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(i==j) continue;
if(i+j==n-1) continue;
if(a[i][j]==a[0][0]){
//printf("%d %d\n",i,j);
f=1;
break;
}
if(a[i][j]!=a[0][1]){
//printf("%d %d\n",i,j);
f=1;
break;
}
}
if(f==1) break;
}
if(f==1) printf("NO\n");
else printf("YES\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@a = dso_local global [304 x [304 x i8]] zeroinitializer, align 16
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp126 = icmp sgt i32 %0, 0
br i1 %cmp126, label %for.body, label %for.end14
for.cond2.preheader: ; preds = %for.body
%cmp3128 = icmp sgt i32 %2, 0
br i1 %cmp3128, label %for.body4.lr.ph, label %for.end14
for.body4.lr.ph: ; preds = %for.cond2.preheader
%1 = load i8, ptr @a, align 16, !tbaa !9
%wide.trip.count = zext i32 %2 to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [304 x [304 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !10
for.body4: ; preds = %for.body4.lr.ph, %for.inc12
%indvars.iv142 = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next143, %for.inc12 ]
%arrayidx8 = getelementptr inbounds [304 x [304 x i8]], ptr @a, i64 0, i64 %indvars.iv142, i64 %indvars.iv142
%4 = load i8, ptr %arrayidx8, align 1, !tbaa !9
%cmp10.not = icmp eq i8 %4, %1
br i1 %cmp10.not, label %for.inc12, label %for.end14.loopexit
for.inc12: ; preds = %for.body4
%indvars.iv.next143 = add nuw nsw i64 %indvars.iv142, 1
%exitcond.not = icmp eq i64 %indvars.iv.next143, %wide.trip.count
br i1 %exitcond.not, label %for.end14.thread, label %for.body4, !llvm.loop !12
for.end14.thread: ; preds = %for.inc12
br i1 %cmp3128, label %for.body22.lr.ph, label %for.end36
for.end14.loopexit: ; preds = %for.body4
%5 = trunc i64 %indvars.iv142 to i32
br label %for.end14
for.end14: ; preds = %for.end14.loopexit, %entry, %for.cond2.preheader
%cmp3128164 = phi i1 [ false, %for.cond2.preheader ], [ false, %entry ], [ %cmp3128, %for.end14.loopexit ]
%.lcssa163 = phi i32 [ %2, %for.cond2.preheader ], [ %0, %entry ], [ %2, %for.end14.loopexit ]
%i.1.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %5, %for.end14.loopexit ]
%cmp15.not = icmp eq i32 %i.1.lcssa, %.lcssa163
br i1 %cmp15.not, label %for.cond19.preheader, label %if.end97
for.cond19.preheader: ; preds = %for.end14
br i1 %cmp3128164, label %for.body22.lr.ph, label %for.end36
for.body22.lr.ph: ; preds = %for.end14.thread, %for.cond19.preheader
%.lcssa163170172 = phi i32 [ %2, %for.end14.thread ], [ %.lcssa163, %for.cond19.preheader ]
%6 = load i8, ptr @a, align 16, !tbaa !9
%wide.trip.count148 = zext i32 %.lcssa163170172 to i64
br label %for.body22
for.body22: ; preds = %for.body22.lr.ph, %for.inc34
%indvars.iv145 = phi i64 [ 0, %for.body22.lr.ph ], [ %indvars.iv.next146, %for.inc34 ]
%7 = trunc i64 %indvars.iv145 to i32
%8 = xor i32 %7, -1
%sub25 = add i32 %.lcssa163170172, %8
%idxprom26 = sext i32 %sub25 to i64
%arrayidx27 = getelementptr inbounds [304 x [304 x i8]], ptr @a, i64 0, i64 %indvars.iv145, i64 %idxprom26
%9 = load i8, ptr %arrayidx27, align 1, !tbaa !9
%cmp30.not = icmp eq i8 %9, %6
br i1 %cmp30.not, label %for.inc34, label %for.end36.loopexit
for.inc34: ; preds = %for.body22
%indvars.iv.next146 = add nuw nsw i64 %indvars.iv145, 1
%exitcond149.not = icmp eq i64 %indvars.iv.next146, %wide.trip.count148
br i1 %exitcond149.not, label %for.cond46.preheader.lr.ph, label %for.body22, !llvm.loop !13
for.end36.loopexit: ; preds = %for.body22
%10 = trunc i64 %indvars.iv145 to i32
br label %for.end36
for.end36: ; preds = %for.end36.loopexit, %for.end14.thread, %for.cond19.preheader
%cmp3128164169173 = phi i1 [ true, %for.cond19.preheader ], [ true, %for.end14.thread ], [ false, %for.end36.loopexit ]
%.lcssa163170171 = phi i32 [ %.lcssa163, %for.cond19.preheader ], [ %2, %for.end14.thread ], [ %.lcssa163170172, %for.end36.loopexit ]
%i.2.lcssa = phi i32 [ 0, %for.cond19.preheader ], [ 0, %for.end14.thread ], [ %10, %for.end36.loopexit ]
%cmp37.not = icmp ne i32 %i.2.lcssa, %.lcssa163170171
%brmerge = or i1 %cmp37.not, %cmp3128164169173
%str.5.mux = select i1 %cmp37.not, ptr @str.6, ptr @str
br i1 %brmerge, label %if.end97, label %for.cond46.preheader.lr.ph
for.cond46.preheader.lr.ph: ; preds = %for.inc34, %for.end36
%.lcssa163170171180181 = phi i32 [ %.lcssa163170171, %for.end36 ], [ %.lcssa163170172, %for.inc34 ]
%sub54 = add nsw i32 %.lcssa163170171180181, -1
%11 = load i8, ptr @a, align 16
%12 = load i8, ptr getelementptr inbounds ([304 x [304 x i8]], ptr @a, i64 0, i64 0, i64 1), align 1
%13 = zext i32 %sub54 to i64
%wide.trip.count159 = zext i32 %.lcssa163170171180181 to i64
br label %for.cond46.preheader.us
for.cond46.preheader.us: ; preds = %for.cond46.for.inc86_crit_edge.us, %for.cond46.preheader.lr.ph
%indvars.iv156 = phi i64 [ %indvars.iv.next157, %for.cond46.for.inc86_crit_edge.us ], [ 0, %for.cond46.preheader.lr.ph ]
br label %for.body49.us
for.body49.us: ; preds = %for.cond46.preheader.us, %for.inc79.us
%indvars.iv150 = phi i64 [ 0, %for.cond46.preheader.us ], [ %indvars.iv.next151, %for.inc79.us ]
%cmp50.us = icmp eq i64 %indvars.iv156, %indvars.iv150
%14 = add nuw nsw i64 %indvars.iv150, %indvars.iv156
%cmp55.us = icmp eq i64 %14, %13
%or.cond = select i1 %cmp50.us, i1 true, i1 %cmp55.us
br i1 %or.cond, label %for.inc79.us, label %if.end58.us
if.end58.us: ; preds = %for.body49.us
%arrayidx62.us = getelementptr inbounds [304 x [304 x i8]], ptr @a, i64 0, i64 %indvars.iv156, i64 %indvars.iv150
%15 = load i8, ptr %arrayidx62.us, align 1, !tbaa !9
%cmp65.us = icmp ne i8 %15, %11
%cmp75.not.us = icmp eq i8 %15, %12
%or.cond.us = select i1 %cmp65.us, i1 %cmp75.not.us, i1 false
br i1 %or.cond.us, label %for.inc79.us, label %if.end97
for.inc79.us: ; preds = %if.end58.us, %for.body49.us
%indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
%exitcond155.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count159
br i1 %exitcond155.not, label %for.cond46.for.inc86_crit_edge.us, label %for.body49.us, !llvm.loop !14
for.cond46.for.inc86_crit_edge.us: ; preds = %for.inc79.us
%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 %if.end97, label %for.cond46.preheader.us, !llvm.loop !15
if.end97: ; preds = %for.cond46.for.inc86_crit_edge.us, %if.end58.us, %for.end36, %for.end14
%str.5.sink = phi ptr [ @str.6, %for.end14 ], [ %str.5.mux, %for.end36 ], [ @str.6, %if.end58.us ], [ @str, %for.cond46.for.inc86_crit_edge.us ]
%puts124 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
|
#include<stdio.h>
int main(){
int i, x, y, z;
scanf("%d", &i);
x = i / 3600;
y = i % 3600 / 60;
z = i % 60;
printf("%d:%d:%d\n", x,y,z);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242102/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242102/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, 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 %i) #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,k;
scanf("%d",&n);
k=n/60;
printf("%d:%d:%d\n",k/60,k%60,n%60);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242146/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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, 60
%div1 = sdiv i32 %0, 3600
%rem = srem i32 %div, 60
%rem2 = srem i32 %0, 60
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div1, i32 noundef %rem, 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()
{
int S,h,m,s,a;
scanf("%d",&S);
h = S/60/60;
a = S%3600;
m = a/60;
s = a-m*60;
printf("%d:%d:%d\n",h,m,s);
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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
%mul.neg = mul nsw i32 %div2.sext, -60
%sub = add nsw i32 %mul.neg, %rem
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div1, i32 noundef %div2.sext, i32 noundef %sub)
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 hour, minute, second;
int input_sec, output_time[2];
int main() {
scanf("%d", &input_sec);
if (0 <= input_sec < 86400) {
int i = 0;
int temp = input_sec;
while (i <= 2) {
output_time[i] = temp % 60;
temp = (temp - output_time[i]) / 60;
i++;
}
second = output_time[0];
minute = output_time[1];
hour = output_time[2];
printf("%d:%d:%d\n", hour, minute, second);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242276/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242276/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@input_sec = dso_local global i32 0, align 4
@output_time = dso_local local_unnamed_addr global [2 x i32] zeroinitializer, align 4
@second = dso_local local_unnamed_addr global i32 0, align 4
@minute = dso_local local_unnamed_addr global i32 0, align 4
@hour = 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 @input_sec)
%0 = load i32, ptr @input_sec, align 4, !tbaa !5
%rem = srem i32 %0, 60
store i32 %rem, ptr @output_time, align 4, !tbaa !5
%div = sdiv i32 %0, 60
%rem.1 = srem i32 %div, 60
store i32 %rem.1, ptr getelementptr inbounds ([2 x i32], ptr @output_time, i64 0, i64 1), align 4, !tbaa !5
%div.1 = sdiv i32 %0, 3600
%rem.2 = srem i32 %div.1, 60
store i32 %rem.2, ptr getelementptr inbounds ([2 x i32], ptr @output_time, i64 1, i64 0), align 4, !tbaa !5
store i32 %rem, ptr @second, align 4, !tbaa !5
store i32 %rem.1, ptr @minute, align 4, !tbaa !5
store i32 %rem.2, ptr @hour, align 4, !tbaa !5
%call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.2, i32 noundef %rem.1, i32 noundef %rem)
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 n;
scanf("%d",&n);
printf("%d:%d:%d\n",n/3600,n%3600/60,n%3600%60);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 %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"}
|
// Aizu Vol-1 0144: Packet Transportation
// 2017.8.9
#include <stdio.h>
#define MAX 100
char visited[MAX + 2];
char cost[MAX + 2][MAX + 2], len[MAX + 2];
char Q[2][MAX + 2], end[2];
int n;
int search(int s, int g, int v);
int main(void)
{
int r, k, t;
int P, s, d, v;
int i, j;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d%d", &r, &k), len[r] = k;
for (j = 0; j < k; j++) scanf("%d", &t), cost[r][j] = t;
}
scanf("%d", &P);
for (i = 0; i < P; i++) {
scanf("%d%d%d", &s, &d, &v);
if (s == d) puts(v >= 1 ? "1" : "NA");
else if (v <= 1) puts("NA");
else {
if ((j = search(s, d, v)) >= 0) printf("%d\n", j);
else puts("NA");
}
}
return 0;
}
int search(int s, int g, int lim)
{
int i, k, k1, k2, step;
int e, a, b;
for (i = 1; i <= n; i++) visited[i] = 0;
Q[0][0] = s, end[0] = 1, visited[s] = 1, step = 2;
for (k1 = 0, k2 = 1; ; k2 = k1, k1 = !k2) {
for (e = 0, i = end[k1] - 1; i >= 0; i--) {
a = Q[k1][i], k = len[a];
while (k-- > 0) {
if ((b = cost[a][k]) == g) return step;
if (!visited[b]) Q[k2][e++] = b, visited[b] = 1;
}
}
if (e == 0) return -1;
end[k2] = e;
if (++step > lim) return -1;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@len = dso_local local_unnamed_addr global [102 x i8] zeroinitializer, align 16
@cost = dso_local local_unnamed_addr global [102 x [102 x i8]] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"1\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"NA\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@visited = dso_local local_unnamed_addr global [102 x i8] zeroinitializer, align 16
@Q = dso_local local_unnamed_addr global [2 x [102 x i8]] zeroinitializer, align 16
@end = dso_local local_unnamed_addr global [2 x i8] zeroinitializer, align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
%k = alloca i32, align 4
%t = alloca i32, align 4
%P = alloca i32, align 4
%s = alloca i32, align 4
%d = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %P) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #6
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp56 = icmp sgt i32 %0, 0
br i1 %cmp56, label %for.body, label %for.end14
for.body: ; preds = %entry, %for.inc12
%i.057 = phi i32 [ %inc13, %for.inc12 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %r, ptr noundef nonnull %k)
%1 = load i32, ptr %k, align 4, !tbaa !5
%conv = trunc i32 %1 to i8
%2 = load i32, ptr %r, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%arrayidx = getelementptr inbounds [102 x i8], ptr @len, i64 0, i64 %idxprom
store i8 %conv, ptr %arrayidx, align 1, !tbaa !9
%cmp354 = icmp sgt i32 %1, 0
br i1 %cmp354, label %for.body5, label %for.inc12
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%3 = load i32, ptr %t, align 4, !tbaa !5
%conv7 = trunc i32 %3 to i8
%4 = load i32, ptr %r, align 4, !tbaa !5
%idxprom8 = sext i32 %4 to i64
%arrayidx11 = getelementptr inbounds [102 x [102 x i8]], ptr @cost, i64 0, i64 %idxprom8, i64 %indvars.iv
store i8 %conv7, ptr %arrayidx11, align 1, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %k, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp3, label %for.body5, label %for.inc12, !llvm.loop !10
for.inc12: ; preds = %for.body5, %for.body
%inc13 = add nuw nsw i32 %i.057, 1
%7 = load i32, ptr @n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc13, %7
br i1 %cmp, label %for.body, label %for.end14, !llvm.loop !12
for.end14: ; preds = %for.inc12, %entry
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %P)
%8 = load i32, ptr %P, align 4, !tbaa !5
%cmp1762 = icmp sgt i32 %8, 0
br i1 %cmp1762, label %for.body19, label %for.end42
for.body19: ; preds = %for.end14, %for.inc40
%i.163 = phi i32 [ %inc41, %for.inc40 ], [ 0, %for.end14 ]
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s, ptr noundef nonnull %d, ptr noundef nonnull %v)
%9 = load i32, ptr %s, align 4, !tbaa !5
%10 = load i32, ptr %d, align 4, !tbaa !5
%cmp21 = icmp eq i32 %9, %10
%11 = load i32, ptr %v, align 4, !tbaa !5
br i1 %cmp21, label %if.then, label %if.else
if.then: ; preds = %for.body19
%cmp23 = icmp sgt i32 %11, 0
%cond = select i1 %cmp23, ptr @.str.3, ptr @.str.4
%call25 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
br label %for.inc40
if.else: ; preds = %for.body19
%cmp26 = icmp slt i32 %11, 2
br i1 %cmp26, label %if.then28, label %if.else30
if.then28: ; preds = %if.else
%call29 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %for.inc40
if.else30: ; preds = %if.else
%12 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not85.i = icmp slt i32 %12, 1
br i1 %cmp.not85.i, label %for.end.i, label %for.body.preheader.i
for.body.preheader.i: ; preds = %if.else30
%13 = zext i32 %12 to i64
call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds ([102 x i8], ptr @visited, i64 0, i64 1), i8 0, i64 %13, i1 false), !tbaa !9
br label %for.end.i
for.end.i: ; preds = %for.body.preheader.i, %if.else30
%conv.i = trunc i32 %9 to i8
store i8 %conv.i, ptr @Q, align 16, !tbaa !9
store i8 1, ptr @end, align 1, !tbaa !9
%idxprom1.i = sext i32 %9 to i64
%arrayidx2.i = getelementptr inbounds [102 x i8], ptr @visited, i64 0, i64 %idxprom1.i
store i8 1, ptr %arrayidx2.i, align 1, !tbaa !9
br label %for.body10.lr.ph.i
for.body10.lr.ph.i: ; preds = %for.end.i, %for.inc55.i
%idxprom4.i61 = phi i64 [ 0, %for.end.i ], [ %idxprom4.phi.trans.insert.i, %for.inc55.i ]
%step.0.i60 = phi i32 [ 2, %for.end.i ], [ %inc50.i, %for.inc55.i ]
%k2.0.i59 = phi i32 [ 1, %for.end.i ], [ %k1.0.i58, %for.inc55.i ]
%k1.0.i58 = phi i32 [ 0, %for.end.i ], [ %lnot.ext.i, %for.inc55.i ]
%14 = phi i8 [ 1, %for.end.i ], [ %.pre.i, %for.inc55.i ]
%conv6.i = zext i8 %14 to i64
%idxprom32.i = zext i32 %k2.0.i59 to i64
br label %for.body10.i
for.cond7.loopexit.i: ; preds = %if.end39.i, %for.body10.i
%e.1.lcssa.i = phi i32 [ %e.093.i, %for.body10.i ], [ %e.2.i, %if.end39.i ]
%cmp8.i = icmp sgt i64 %indvars.iv100.i, 1
br i1 %cmp8.i, label %for.body10.i, label %for.end42.i, !llvm.loop !13
for.body10.i: ; preds = %for.cond7.loopexit.i, %for.body10.lr.ph.i
%indvars.iv100.i = phi i64 [ %conv6.i, %for.body10.lr.ph.i ], [ %indvars.iv.next101.i, %for.cond7.loopexit.i ]
%e.093.i = phi i32 [ 0, %for.body10.lr.ph.i ], [ %e.1.lcssa.i, %for.cond7.loopexit.i ]
%indvars.iv.next101.i = add nsw i64 %indvars.iv100.i, -1
%idxprom13.i = and i64 %indvars.iv.next101.i, 4294967295
%arrayidx14.i = getelementptr inbounds [2 x [102 x i8]], ptr @Q, i64 0, i64 %idxprom4.i61, i64 %idxprom13.i
%15 = load i8, ptr %arrayidx14.i, align 1, !tbaa !9
%idxprom16.i = sext i8 %15 to i64
%arrayidx17.i = getelementptr inbounds [102 x i8], ptr @len, i64 0, i64 %idxprom16.i
%16 = load i8, ptr %arrayidx17.i, align 1, !tbaa !9
%cmp1988.i = icmp sgt i8 %16, 0
br i1 %cmp1988.i, label %while.body.preheader.i, label %for.cond7.loopexit.i
while.body.preheader.i: ; preds = %for.body10.i
%conv18.i = zext i8 %16 to i64
br label %while.body.i
while.body.i: ; preds = %if.end39.i, %while.body.preheader.i
%indvars.iv.i = phi i64 [ %conv18.i, %while.body.preheader.i ], [ %indvars.iv.next.i, %if.end39.i ]
%e.189.i = phi i32 [ %e.093.i, %while.body.preheader.i ], [ %e.2.i, %if.end39.i ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%idxprom23.i = and i64 %indvars.iv.next.i, 4294967295
%arrayidx24.i = getelementptr inbounds [102 x [102 x i8]], ptr @cost, i64 0, i64 %idxprom16.i, i64 %idxprom23.i
%17 = load i8, ptr %arrayidx24.i, align 1, !tbaa !9
%conv25.i = sext i8 %17 to i32
%cmp26.i = icmp eq i32 %10, %conv25.i
br i1 %cmp26.i, label %search.exit, label %if.end.i
if.end.i: ; preds = %while.body.i
%idxprom28.i = sext i8 %17 to i64
%arrayidx29.i = getelementptr inbounds [102 x i8], ptr @visited, i64 0, i64 %idxprom28.i
%18 = load i8, ptr %arrayidx29.i, align 1, !tbaa !9
%tobool.not.i = icmp eq i8 %18, 0
br i1 %tobool.not.i, label %if.then30.i, label %if.end39.i
if.then30.i: ; preds = %if.end.i
%inc34.i = add nsw i32 %e.189.i, 1
%idxprom35.i = sext i32 %e.189.i to i64
%arrayidx36.i = getelementptr inbounds [2 x [102 x i8]], ptr @Q, i64 0, i64 %idxprom32.i, i64 %idxprom35.i
store i8 %17, ptr %arrayidx36.i, align 1, !tbaa !9
store i8 1, ptr %arrayidx29.i, align 1, !tbaa !9
br label %if.end39.i
if.end39.i: ; preds = %if.then30.i, %if.end.i
%e.2.i = phi i32 [ %e.189.i, %if.end.i ], [ %inc34.i, %if.then30.i ]
%cmp19.i = icmp ugt i64 %indvars.iv.i, 1
br i1 %cmp19.i, label %while.body.i, label %for.cond7.loopexit.i, !llvm.loop !14
for.end42.i: ; preds = %for.cond7.loopexit.i
%cmp43.i = icmp eq i32 %e.1.lcssa.i, 0
br i1 %cmp43.i, label %if.else36, label %if.end46.i
if.end46.i: ; preds = %for.end42.i
%conv47.i = trunc i32 %e.1.lcssa.i to i8
%arrayidx49.i = getelementptr inbounds [2 x i8], ptr @end, i64 0, i64 %idxprom32.i
store i8 %conv47.i, ptr %arrayidx49.i, align 1, !tbaa !9
%exitcond.not.i = icmp eq i32 %step.0.i60, %11
br i1 %exitcond.not.i, label %if.else36, label %for.inc55.i
for.inc55.i: ; preds = %if.end46.i
%inc50.i = add nuw i32 %step.0.i60, 1
%lnot.ext.i = xor i32 %k1.0.i58, 1
%idxprom4.phi.trans.insert.i = zext i32 %lnot.ext.i to i64
%arrayidx5.phi.trans.insert.i = getelementptr inbounds [2 x i8], ptr @end, i64 0, i64 %idxprom4.phi.trans.insert.i
%.pre.i = load i8, ptr %arrayidx5.phi.trans.insert.i, align 1, !tbaa !9
%cmp892.i = icmp sgt i8 %.pre.i, 0
br i1 %cmp892.i, label %for.body10.lr.ph.i, label %if.else36
search.exit: ; preds = %while.body.i
%cmp32 = icmp sgt i32 %step.0.i60, -1
br i1 %cmp32, label %if.then34, label %if.else36
if.then34: ; preds = %search.exit
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %step.0.i60)
br label %for.inc40
if.else36: ; preds = %for.inc55.i, %if.end46.i, %for.end42.i, %search.exit
%call37 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %for.inc40
for.inc40: ; preds = %if.then, %if.then34, %if.else36, %if.then28
%inc41 = add nuw nsw i32 %i.163, 1
%19 = load i32, ptr %P, align 4, !tbaa !5
%cmp17 = icmp slt i32 %inc41, %19
br i1 %cmp17, label %for.body19, label %for.end42, !llvm.loop !15
for.end42: ; preds = %for.inc40, %for.end14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %P) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @search(i32 noundef %s, i32 noundef %g, i32 noundef %lim) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not85 = icmp slt i32 %0, 1
br i1 %cmp.not85, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
tail call void @llvm.memset.p0.i64(ptr nonnull align 1 getelementptr inbounds ([102 x i8], ptr @visited, i64 0, i64 1), i8 0, i64 %1, i1 false), !tbaa !9
br label %for.end
for.end: ; preds = %for.body.preheader, %entry
%conv = trunc i32 %s to i8
store i8 %conv, ptr @Q, align 16, !tbaa !9
store i8 1, ptr @end, align 1, !tbaa !9
%idxprom1 = sext i32 %s to i64
%arrayidx2 = getelementptr inbounds [102 x i8], ptr @visited, i64 0, i64 %idxprom1
store i8 1, ptr %arrayidx2, align 1, !tbaa !9
%smax = tail call i32 @llvm.smax.i32(i32 %lim, i32 2)
br label %for.body10.lr.ph
for.body10.lr.ph: ; preds = %for.end, %for.inc55
%idxprom4113 = phi i64 [ 0, %for.end ], [ %idxprom4, %for.inc55 ]
%step.0112 = phi i32 [ 2, %for.end ], [ %inc50, %for.inc55 ]
%k2.0111 = phi i32 [ 1, %for.end ], [ %k1.0110, %for.inc55 ]
%k1.0110 = phi i32 [ 0, %for.end ], [ %lnot.ext, %for.inc55 ]
%2 = phi i8 [ 1, %for.end ], [ %.pre, %for.inc55 ]
%conv6 = zext i8 %2 to i64
%idxprom32 = zext i32 %k2.0111 to i64
br label %for.body10
for.cond7.loopexit: ; preds = %if.end39, %for.body10
%e.1.lcssa = phi i32 [ %e.093, %for.body10 ], [ %e.2, %if.end39 ]
%cmp8 = icmp sgt i64 %indvars.iv100, 1
br i1 %cmp8, label %for.body10, label %for.end42, !llvm.loop !13
for.body10: ; preds = %for.body10.lr.ph, %for.cond7.loopexit
%indvars.iv100 = phi i64 [ %conv6, %for.body10.lr.ph ], [ %indvars.iv.next101, %for.cond7.loopexit ]
%e.093 = phi i32 [ 0, %for.body10.lr.ph ], [ %e.1.lcssa, %for.cond7.loopexit ]
%indvars.iv.next101 = add nsw i64 %indvars.iv100, -1
%idxprom13 = and i64 %indvars.iv.next101, 4294967295
%arrayidx14 = getelementptr inbounds [2 x [102 x i8]], ptr @Q, i64 0, i64 %idxprom4113, i64 %idxprom13
%3 = load i8, ptr %arrayidx14, align 1, !tbaa !9
%idxprom16 = sext i8 %3 to i64
%arrayidx17 = getelementptr inbounds [102 x i8], ptr @len, i64 0, i64 %idxprom16
%4 = load i8, ptr %arrayidx17, align 1, !tbaa !9
%cmp1988 = icmp sgt i8 %4, 0
br i1 %cmp1988, label %while.body.preheader, label %for.cond7.loopexit
while.body.preheader: ; preds = %for.body10
%conv18 = zext i8 %4 to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end39
%indvars.iv = phi i64 [ %conv18, %while.body.preheader ], [ %indvars.iv.next, %if.end39 ]
%e.189 = phi i32 [ %e.093, %while.body.preheader ], [ %e.2, %if.end39 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%idxprom23 = and i64 %indvars.iv.next, 4294967295
%arrayidx24 = getelementptr inbounds [102 x [102 x i8]], ptr @cost, i64 0, i64 %idxprom16, i64 %idxprom23
%5 = load i8, ptr %arrayidx24, align 1, !tbaa !9
%conv25 = sext i8 %5 to i32
%cmp26 = icmp eq i32 %conv25, %g
br i1 %cmp26, label %cleanup, label %if.end
if.end: ; preds = %while.body
%idxprom28 = sext i8 %5 to i64
%arrayidx29 = getelementptr inbounds [102 x i8], ptr @visited, i64 0, i64 %idxprom28
%6 = load i8, ptr %arrayidx29, align 1, !tbaa !9
%tobool.not = icmp eq i8 %6, 0
br i1 %tobool.not, label %if.then30, label %if.end39
if.then30: ; preds = %if.end
%inc34 = add nsw i32 %e.189, 1
%idxprom35 = sext i32 %e.189 to i64
%arrayidx36 = getelementptr inbounds [2 x [102 x i8]], ptr @Q, i64 0, i64 %idxprom32, i64 %idxprom35
store i8 %5, ptr %arrayidx36, align 1, !tbaa !9
store i8 1, ptr %arrayidx29, align 1, !tbaa !9
br label %if.end39
if.end39: ; preds = %if.then30, %if.end
%e.2 = phi i32 [ %e.189, %if.end ], [ %inc34, %if.then30 ]
%cmp19 = icmp ugt i64 %indvars.iv, 1
br i1 %cmp19, label %while.body, label %for.cond7.loopexit, !llvm.loop !14
for.end42: ; preds = %for.cond7.loopexit
%cmp43 = icmp eq i32 %e.1.lcssa, 0
br i1 %cmp43, label %cleanup, label %if.end46
if.end46: ; preds = %for.end42
%conv47 = trunc i32 %e.1.lcssa to i8
%idxprom48 = zext i32 %k2.0111 to i64
%arrayidx49 = getelementptr inbounds [2 x i8], ptr @end, i64 0, i64 %idxprom48
store i8 %conv47, ptr %arrayidx49, align 1, !tbaa !9
%exitcond.not = icmp eq i32 %step.0112, %smax
br i1 %exitcond.not, label %cleanup, label %for.inc55
for.inc55: ; preds = %if.end46
%inc50 = add nuw i32 %step.0112, 1
%lnot.ext = xor i32 %k1.0110, 1
%idxprom4.phi.trans.insert = zext i32 %lnot.ext to i64
%arrayidx5.phi.trans.insert = getelementptr inbounds [2 x i8], ptr @end, i64 0, i64 %idxprom4.phi.trans.insert
%.pre = load i8, ptr %arrayidx5.phi.trans.insert, align 1, !tbaa !9
%idxprom4 = zext i32 %lnot.ext to i64
%cmp892 = icmp sgt i8 %.pre, 0
br i1 %cmp892, label %for.body10.lr.ph, label %cleanup
cleanup: ; preds = %for.inc55, %if.end46, %for.end42, %while.body
%retval.0 = phi i32 [ %step.0112, %while.body ], [ -1, %for.end42 ], [ -1, %if.end46 ], [ -1, %for.inc55 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
|
#include <stdio.h>
#include <stdlib.h>
#define int long long
#define max_size (int)(2 * 1e5 + 1)
int main(){
int i, j, N, ans = 1;
char *A = (char *)malloc(sizeof(char) * max_size);
scanf("%s", A);
for(i = 0; A[i] != '\0'; i++){}
N = i;
int **sum = (int **)malloc(sizeof(int *) * N);
for(i = 0; i < N; i++){
sum[i] = (int *)malloc(sizeof(int) * 26);
for(j = 0; j < 26; j++){
sum[i][j] = 0;
}
}
for(i = 0; i < N; i++){
sum[i][(int)A[i] - (int)'a']++;
}
for(i = 1; i < N; i++){
for(j = 0; j < 26; j++){
sum[i][j] += sum[i - 1][j];
}
}
for(i = N - 1; i >= 0; i--){
ans += i - sum[i][(int)A[i] - (int)'a'] + 1;
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242412/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242412/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @main() local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(200001) ptr @malloc(i64 noundef 200001) #4
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %call)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%i.0 = phi i64 [ 0, %entry ], [ %inc, %for.cond ]
%arrayidx = getelementptr inbounds i8, ptr %call, i64 %i.0
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%inc = add nuw nsw i64 %i.0, 1
br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
%mul = shl i64 %i.0, 3
%call3 = tail call noalias ptr @malloc(i64 noundef %mul) #4
%cmp5108.not = icmp eq i64 %i.0, 0
br i1 %cmp5108.not, label %for.end67, label %for.body7
for.cond22.preheader: ; preds = %for.body7
br i1 %cmp5108.not, label %for.end67, label %for.body25.preheader
for.body25.preheader: ; preds = %for.cond22.preheader
%xtraiter = and i64 %i.0, 3
%1 = icmp ult i64 %i.0, 4
br i1 %1, label %for.cond34.preheader.unr-lcssa, label %for.body25.preheader.new
for.body25.preheader.new: ; preds = %for.body25.preheader
%unroll_iter = and i64 %i.0, 9223372036854775804
br label %for.body25
for.body7: ; preds = %for.end, %for.body7
%i.1109 = phi i64 [ %inc20, %for.body7 ], [ 0, %for.end ]
%calloc = tail call dereferenceable_or_null(208) ptr @calloc(i64 1, i64 208)
%arrayidx9 = getelementptr inbounds ptr, ptr %call3, i64 %i.1109
store ptr %calloc, ptr %arrayidx9, align 8, !tbaa !10
%inc20 = add nuw nsw i64 %i.1109, 1
%exitcond.not = icmp eq i64 %inc20, %i.0
br i1 %exitcond.not, label %for.cond22.preheader, label %for.body7, !llvm.loop !12
for.cond34.preheader.unr-lcssa: ; preds = %for.body25, %for.body25.preheader
%i.2111.unr = phi i64 [ 0, %for.body25.preheader ], [ %inc32.3, %for.body25 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond34.preheader, label %for.body25.epil
for.body25.epil: ; preds = %for.cond34.preheader.unr-lcssa, %for.body25.epil
%i.2111.epil = phi i64 [ %inc32.epil, %for.body25.epil ], [ %i.2111.unr, %for.cond34.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body25.epil ], [ 0, %for.cond34.preheader.unr-lcssa ]
%arrayidx26.epil = getelementptr inbounds ptr, ptr %call3, i64 %i.2111.epil
%2 = load ptr, ptr %arrayidx26.epil, align 8, !tbaa !10
%arrayidx27.epil = getelementptr inbounds i8, ptr %call, i64 %i.2111.epil
%3 = load i8, ptr %arrayidx27.epil, align 1, !tbaa !5
%conv28.epil = sext i8 %3 to i64
%4 = getelementptr i64, ptr %2, i64 %conv28.epil
%arrayidx29.epil = getelementptr i64, ptr %4, i64 -97
%5 = load i64, ptr %arrayidx29.epil, align 8, !tbaa !13
%inc30.epil = add nsw i64 %5, 1
store i64 %inc30.epil, ptr %arrayidx29.epil, align 8, !tbaa !13
%inc32.epil = add nuw nsw i64 %i.2111.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond34.preheader, label %for.body25.epil, !llvm.loop !15
for.cond34.preheader: ; preds = %for.body25.epil, %for.cond34.preheader.unr-lcssa
%cmp35113 = icmp ugt i64 %i.0, 1
br i1 %cmp35113, label %for.cond38.preheader, label %for.cond54.preheader
for.body25: ; preds = %for.body25, %for.body25.preheader.new
%i.2111 = phi i64 [ 0, %for.body25.preheader.new ], [ %inc32.3, %for.body25 ]
%niter = phi i64 [ 0, %for.body25.preheader.new ], [ %niter.next.3, %for.body25 ]
%arrayidx26 = getelementptr inbounds ptr, ptr %call3, i64 %i.2111
%6 = load ptr, ptr %arrayidx26, align 8, !tbaa !10
%arrayidx27 = getelementptr inbounds i8, ptr %call, i64 %i.2111
%7 = load i8, ptr %arrayidx27, align 1, !tbaa !5
%conv28 = sext i8 %7 to i64
%8 = getelementptr i64, ptr %6, i64 %conv28
%arrayidx29 = getelementptr i64, ptr %8, i64 -97
%9 = load i64, ptr %arrayidx29, align 8, !tbaa !13
%inc30 = add nsw i64 %9, 1
store i64 %inc30, ptr %arrayidx29, align 8, !tbaa !13
%inc32 = or i64 %i.2111, 1
%arrayidx26.1 = getelementptr inbounds ptr, ptr %call3, i64 %inc32
%10 = load ptr, ptr %arrayidx26.1, align 8, !tbaa !10
%arrayidx27.1 = getelementptr inbounds i8, ptr %call, i64 %inc32
%11 = load i8, ptr %arrayidx27.1, align 1, !tbaa !5
%conv28.1 = sext i8 %11 to i64
%12 = getelementptr i64, ptr %10, i64 %conv28.1
%arrayidx29.1 = getelementptr i64, ptr %12, i64 -97
%13 = load i64, ptr %arrayidx29.1, align 8, !tbaa !13
%inc30.1 = add nsw i64 %13, 1
store i64 %inc30.1, ptr %arrayidx29.1, align 8, !tbaa !13
%inc32.1 = or i64 %i.2111, 2
%arrayidx26.2 = getelementptr inbounds ptr, ptr %call3, i64 %inc32.1
%14 = load ptr, ptr %arrayidx26.2, align 8, !tbaa !10
%arrayidx27.2 = getelementptr inbounds i8, ptr %call, i64 %inc32.1
%15 = load i8, ptr %arrayidx27.2, align 1, !tbaa !5
%conv28.2 = sext i8 %15 to i64
%16 = getelementptr i64, ptr %14, i64 %conv28.2
%arrayidx29.2 = getelementptr i64, ptr %16, i64 -97
%17 = load i64, ptr %arrayidx29.2, align 8, !tbaa !13
%inc30.2 = add nsw i64 %17, 1
store i64 %inc30.2, ptr %arrayidx29.2, align 8, !tbaa !13
%inc32.2 = or i64 %i.2111, 3
%arrayidx26.3 = getelementptr inbounds ptr, ptr %call3, i64 %inc32.2
%18 = load ptr, ptr %arrayidx26.3, align 8, !tbaa !10
%arrayidx27.3 = getelementptr inbounds i8, ptr %call, i64 %inc32.2
%19 = load i8, ptr %arrayidx27.3, align 1, !tbaa !5
%conv28.3 = sext i8 %19 to i64
%20 = getelementptr i64, ptr %18, i64 %conv28.3
%arrayidx29.3 = getelementptr i64, ptr %20, i64 -97
%21 = load i64, ptr %arrayidx29.3, align 8, !tbaa !13
%inc30.3 = add nsw i64 %21, 1
store i64 %inc30.3, ptr %arrayidx29.3, align 8, !tbaa !13
%inc32.3 = add nuw nsw i64 %i.2111, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond34.preheader.unr-lcssa, label %for.body25, !llvm.loop !17
for.cond38.preheader: ; preds = %for.cond34.preheader, %for.cond38.preheader
%i.3114 = phi i64 [ %inc51, %for.cond38.preheader ], [ 1, %for.cond34.preheader ]
%22 = getelementptr ptr, ptr %call3, i64 %i.3114
%arrayidx43 = getelementptr ptr, ptr %22, i64 -1
%23 = load ptr, ptr %arrayidx43, align 8, !tbaa !10
%24 = load ptr, ptr %22, align 8, !tbaa !10
%25 = load i64, ptr %23, align 8, !tbaa !13
%26 = load i64, ptr %24, align 8, !tbaa !13
%add = add nsw i64 %26, %25
store i64 %add, ptr %24, align 8, !tbaa !13
%arrayidx44.1 = getelementptr inbounds i64, ptr %23, i64 1
%27 = load i64, ptr %arrayidx44.1, align 8, !tbaa !13
%arrayidx46.1 = getelementptr inbounds i64, ptr %24, i64 1
%28 = load i64, ptr %arrayidx46.1, align 8, !tbaa !13
%add.1 = add nsw i64 %28, %27
store i64 %add.1, ptr %arrayidx46.1, align 8, !tbaa !13
%arrayidx44.2 = getelementptr inbounds i64, ptr %23, i64 2
%29 = load i64, ptr %arrayidx44.2, align 8, !tbaa !13
%arrayidx46.2 = getelementptr inbounds i64, ptr %24, i64 2
%30 = load i64, ptr %arrayidx46.2, align 8, !tbaa !13
%add.2 = add nsw i64 %30, %29
store i64 %add.2, ptr %arrayidx46.2, align 8, !tbaa !13
%arrayidx44.3 = getelementptr inbounds i64, ptr %23, i64 3
%31 = load i64, ptr %arrayidx44.3, align 8, !tbaa !13
%arrayidx46.3 = getelementptr inbounds i64, ptr %24, i64 3
%32 = load i64, ptr %arrayidx46.3, align 8, !tbaa !13
%add.3 = add nsw i64 %32, %31
store i64 %add.3, ptr %arrayidx46.3, align 8, !tbaa !13
%arrayidx44.4 = getelementptr inbounds i64, ptr %23, i64 4
%33 = load i64, ptr %arrayidx44.4, align 8, !tbaa !13
%arrayidx46.4 = getelementptr inbounds i64, ptr %24, i64 4
%34 = load i64, ptr %arrayidx46.4, align 8, !tbaa !13
%add.4 = add nsw i64 %34, %33
store i64 %add.4, ptr %arrayidx46.4, align 8, !tbaa !13
%arrayidx44.5 = getelementptr inbounds i64, ptr %23, i64 5
%35 = load i64, ptr %arrayidx44.5, align 8, !tbaa !13
%arrayidx46.5 = getelementptr inbounds i64, ptr %24, i64 5
%36 = load i64, ptr %arrayidx46.5, align 8, !tbaa !13
%add.5 = add nsw i64 %36, %35
store i64 %add.5, ptr %arrayidx46.5, align 8, !tbaa !13
%arrayidx44.6 = getelementptr inbounds i64, ptr %23, i64 6
%37 = load i64, ptr %arrayidx44.6, align 8, !tbaa !13
%arrayidx46.6 = getelementptr inbounds i64, ptr %24, i64 6
%38 = load i64, ptr %arrayidx46.6, align 8, !tbaa !13
%add.6 = add nsw i64 %38, %37
store i64 %add.6, ptr %arrayidx46.6, align 8, !tbaa !13
%arrayidx44.7 = getelementptr inbounds i64, ptr %23, i64 7
%39 = load i64, ptr %arrayidx44.7, align 8, !tbaa !13
%arrayidx46.7 = getelementptr inbounds i64, ptr %24, i64 7
%40 = load i64, ptr %arrayidx46.7, align 8, !tbaa !13
%add.7 = add nsw i64 %40, %39
store i64 %add.7, ptr %arrayidx46.7, align 8, !tbaa !13
%arrayidx44.8 = getelementptr inbounds i64, ptr %23, i64 8
%41 = load i64, ptr %arrayidx44.8, align 8, !tbaa !13
%arrayidx46.8 = getelementptr inbounds i64, ptr %24, i64 8
%42 = load i64, ptr %arrayidx46.8, align 8, !tbaa !13
%add.8 = add nsw i64 %42, %41
store i64 %add.8, ptr %arrayidx46.8, align 8, !tbaa !13
%arrayidx44.9 = getelementptr inbounds i64, ptr %23, i64 9
%43 = load i64, ptr %arrayidx44.9, align 8, !tbaa !13
%arrayidx46.9 = getelementptr inbounds i64, ptr %24, i64 9
%44 = load i64, ptr %arrayidx46.9, align 8, !tbaa !13
%add.9 = add nsw i64 %44, %43
store i64 %add.9, ptr %arrayidx46.9, align 8, !tbaa !13
%arrayidx44.10 = getelementptr inbounds i64, ptr %23, i64 10
%45 = load i64, ptr %arrayidx44.10, align 8, !tbaa !13
%arrayidx46.10 = getelementptr inbounds i64, ptr %24, i64 10
%46 = load i64, ptr %arrayidx46.10, align 8, !tbaa !13
%add.10 = add nsw i64 %46, %45
store i64 %add.10, ptr %arrayidx46.10, align 8, !tbaa !13
%arrayidx44.11 = getelementptr inbounds i64, ptr %23, i64 11
%47 = load i64, ptr %arrayidx44.11, align 8, !tbaa !13
%arrayidx46.11 = getelementptr inbounds i64, ptr %24, i64 11
%48 = load i64, ptr %arrayidx46.11, align 8, !tbaa !13
%add.11 = add nsw i64 %48, %47
store i64 %add.11, ptr %arrayidx46.11, align 8, !tbaa !13
%arrayidx44.12 = getelementptr inbounds i64, ptr %23, i64 12
%49 = load i64, ptr %arrayidx44.12, align 8, !tbaa !13
%arrayidx46.12 = getelementptr inbounds i64, ptr %24, i64 12
%50 = load i64, ptr %arrayidx46.12, align 8, !tbaa !13
%add.12 = add nsw i64 %50, %49
store i64 %add.12, ptr %arrayidx46.12, align 8, !tbaa !13
%arrayidx44.13 = getelementptr inbounds i64, ptr %23, i64 13
%51 = load i64, ptr %arrayidx44.13, align 8, !tbaa !13
%arrayidx46.13 = getelementptr inbounds i64, ptr %24, i64 13
%52 = load i64, ptr %arrayidx46.13, align 8, !tbaa !13
%add.13 = add nsw i64 %52, %51
store i64 %add.13, ptr %arrayidx46.13, align 8, !tbaa !13
%arrayidx44.14 = getelementptr inbounds i64, ptr %23, i64 14
%53 = load i64, ptr %arrayidx44.14, align 8, !tbaa !13
%arrayidx46.14 = getelementptr inbounds i64, ptr %24, i64 14
%54 = load i64, ptr %arrayidx46.14, align 8, !tbaa !13
%add.14 = add nsw i64 %54, %53
store i64 %add.14, ptr %arrayidx46.14, align 8, !tbaa !13
%arrayidx44.15 = getelementptr inbounds i64, ptr %23, i64 15
%55 = load i64, ptr %arrayidx44.15, align 8, !tbaa !13
%arrayidx46.15 = getelementptr inbounds i64, ptr %24, i64 15
%56 = load i64, ptr %arrayidx46.15, align 8, !tbaa !13
%add.15 = add nsw i64 %56, %55
store i64 %add.15, ptr %arrayidx46.15, align 8, !tbaa !13
%arrayidx44.16 = getelementptr inbounds i64, ptr %23, i64 16
%57 = load i64, ptr %arrayidx44.16, align 8, !tbaa !13
%arrayidx46.16 = getelementptr inbounds i64, ptr %24, i64 16
%58 = load i64, ptr %arrayidx46.16, align 8, !tbaa !13
%add.16 = add nsw i64 %58, %57
store i64 %add.16, ptr %arrayidx46.16, align 8, !tbaa !13
%arrayidx44.17 = getelementptr inbounds i64, ptr %23, i64 17
%59 = load i64, ptr %arrayidx44.17, align 8, !tbaa !13
%arrayidx46.17 = getelementptr inbounds i64, ptr %24, i64 17
%60 = load i64, ptr %arrayidx46.17, align 8, !tbaa !13
%add.17 = add nsw i64 %60, %59
store i64 %add.17, ptr %arrayidx46.17, align 8, !tbaa !13
%arrayidx44.18 = getelementptr inbounds i64, ptr %23, i64 18
%61 = load i64, ptr %arrayidx44.18, align 8, !tbaa !13
%arrayidx46.18 = getelementptr inbounds i64, ptr %24, i64 18
%62 = load i64, ptr %arrayidx46.18, align 8, !tbaa !13
%add.18 = add nsw i64 %62, %61
store i64 %add.18, ptr %arrayidx46.18, align 8, !tbaa !13
%arrayidx44.19 = getelementptr inbounds i64, ptr %23, i64 19
%63 = load i64, ptr %arrayidx44.19, align 8, !tbaa !13
%arrayidx46.19 = getelementptr inbounds i64, ptr %24, i64 19
%64 = load i64, ptr %arrayidx46.19, align 8, !tbaa !13
%add.19 = add nsw i64 %64, %63
store i64 %add.19, ptr %arrayidx46.19, align 8, !tbaa !13
%arrayidx44.20 = getelementptr inbounds i64, ptr %23, i64 20
%65 = load i64, ptr %arrayidx44.20, align 8, !tbaa !13
%arrayidx46.20 = getelementptr inbounds i64, ptr %24, i64 20
%66 = load i64, ptr %arrayidx46.20, align 8, !tbaa !13
%add.20 = add nsw i64 %66, %65
store i64 %add.20, ptr %arrayidx46.20, align 8, !tbaa !13
%arrayidx44.21 = getelementptr inbounds i64, ptr %23, i64 21
%67 = load i64, ptr %arrayidx44.21, align 8, !tbaa !13
%arrayidx46.21 = getelementptr inbounds i64, ptr %24, i64 21
%68 = load i64, ptr %arrayidx46.21, align 8, !tbaa !13
%add.21 = add nsw i64 %68, %67
store i64 %add.21, ptr %arrayidx46.21, align 8, !tbaa !13
%arrayidx44.22 = getelementptr inbounds i64, ptr %23, i64 22
%69 = load i64, ptr %arrayidx44.22, align 8, !tbaa !13
%arrayidx46.22 = getelementptr inbounds i64, ptr %24, i64 22
%70 = load i64, ptr %arrayidx46.22, align 8, !tbaa !13
%add.22 = add nsw i64 %70, %69
store i64 %add.22, ptr %arrayidx46.22, align 8, !tbaa !13
%arrayidx44.23 = getelementptr inbounds i64, ptr %23, i64 23
%71 = load i64, ptr %arrayidx44.23, align 8, !tbaa !13
%arrayidx46.23 = getelementptr inbounds i64, ptr %24, i64 23
%72 = load i64, ptr %arrayidx46.23, align 8, !tbaa !13
%add.23 = add nsw i64 %72, %71
store i64 %add.23, ptr %arrayidx46.23, align 8, !tbaa !13
%arrayidx44.24 = getelementptr inbounds i64, ptr %23, i64 24
%73 = load i64, ptr %arrayidx44.24, align 8, !tbaa !13
%arrayidx46.24 = getelementptr inbounds i64, ptr %24, i64 24
%74 = load i64, ptr %arrayidx46.24, align 8, !tbaa !13
%add.24 = add nsw i64 %74, %73
store i64 %add.24, ptr %arrayidx46.24, align 8, !tbaa !13
%arrayidx44.25 = getelementptr inbounds i64, ptr %23, i64 25
%75 = load i64, ptr %arrayidx44.25, align 8, !tbaa !13
%arrayidx46.25 = getelementptr inbounds i64, ptr %24, i64 25
%76 = load i64, ptr %arrayidx46.25, align 8, !tbaa !13
%add.25 = add nsw i64 %76, %75
store i64 %add.25, ptr %arrayidx46.25, align 8, !tbaa !13
%inc51 = add nuw nsw i64 %i.3114, 1
%exitcond123.not = icmp eq i64 %inc51, %i.0
br i1 %exitcond123.not, label %for.cond54.preheader, label %for.cond38.preheader, !llvm.loop !18
for.cond54.preheader: ; preds = %for.cond38.preheader, %for.cond34.preheader
br i1 %cmp5108.not, label %for.end67, label %for.body57.preheader
for.body57.preheader: ; preds = %for.cond54.preheader
%xtraiter125 = and i64 %i.0, 3
%77 = icmp ult i64 %i.0, 4
br i1 %77, label %for.end67.loopexit.unr-lcssa, label %for.body57.preheader.new
for.body57.preheader.new: ; preds = %for.body57.preheader
%unroll_iter129 = and i64 %i.0, 9223372036854775804
br label %for.body57
for.body57: ; preds = %for.body57, %for.body57.preheader.new
%i.4.in117 = phi i64 [ %i.0, %for.body57.preheader.new ], [ %i.4.3, %for.body57 ]
%ans.0116 = phi i64 [ 1, %for.body57.preheader.new ], [ %add65.3, %for.body57 ]
%niter130 = phi i64 [ 0, %for.body57.preheader.new ], [ %niter130.next.3, %for.body57 ]
%i.4 = add nsw i64 %i.4.in117, -1
%arrayidx58 = getelementptr inbounds ptr, ptr %call3, i64 %i.4
%78 = load ptr, ptr %arrayidx58, align 8, !tbaa !10
%arrayidx59 = getelementptr inbounds i8, ptr %call, i64 %i.4
%79 = load i8, ptr %arrayidx59, align 1, !tbaa !5
%conv60 = sext i8 %79 to i64
%80 = getelementptr i64, ptr %78, i64 %conv60
%arrayidx62 = getelementptr i64, ptr %80, i64 -97
%81 = load i64, ptr %arrayidx62, align 8, !tbaa !13
%add64 = add i64 %ans.0116, %i.4.in117
%i.4.1 = add nsw i64 %i.4.in117, -2
%arrayidx58.1 = getelementptr inbounds ptr, ptr %call3, i64 %i.4.1
%82 = load ptr, ptr %arrayidx58.1, align 8, !tbaa !10
%arrayidx59.1 = getelementptr inbounds i8, ptr %call, i64 %i.4.1
%83 = load i8, ptr %arrayidx59.1, align 1, !tbaa !5
%conv60.1 = sext i8 %83 to i64
%84 = getelementptr i64, ptr %82, i64 %conv60.1
%arrayidx62.1 = getelementptr i64, ptr %84, i64 -97
%85 = load i64, ptr %arrayidx62.1, align 8, !tbaa !13
%86 = add i64 %add64, %i.4
%87 = add i64 %81, %85
%i.4.2 = add nsw i64 %i.4.in117, -3
%arrayidx58.2 = getelementptr inbounds ptr, ptr %call3, i64 %i.4.2
%88 = load ptr, ptr %arrayidx58.2, align 8, !tbaa !10
%arrayidx59.2 = getelementptr inbounds i8, ptr %call, i64 %i.4.2
%89 = load i8, ptr %arrayidx59.2, align 1, !tbaa !5
%conv60.2 = sext i8 %89 to i64
%90 = getelementptr i64, ptr %88, i64 %conv60.2
%arrayidx62.2 = getelementptr i64, ptr %90, i64 -97
%91 = load i64, ptr %arrayidx62.2, align 8, !tbaa !13
%92 = add i64 %86, %i.4.1
%93 = add i64 %87, %91
%i.4.3 = add nsw i64 %i.4.in117, -4
%arrayidx58.3 = getelementptr inbounds ptr, ptr %call3, i64 %i.4.3
%94 = load ptr, ptr %arrayidx58.3, align 8, !tbaa !10
%arrayidx59.3 = getelementptr inbounds i8, ptr %call, i64 %i.4.3
%95 = load i8, ptr %arrayidx59.3, align 1, !tbaa !5
%conv60.3 = sext i8 %95 to i64
%96 = getelementptr i64, ptr %94, i64 %conv60.3
%arrayidx62.3 = getelementptr i64, ptr %96, i64 -97
%97 = load i64, ptr %arrayidx62.3, align 8, !tbaa !13
%98 = add i64 %92, %i.4.2
%99 = add i64 %93, %97
%add65.3 = sub i64 %98, %99
%niter130.next.3 = add i64 %niter130, 4
%niter130.ncmp.3.not = icmp eq i64 %niter130.next.3, %unroll_iter129
br i1 %niter130.ncmp.3.not, label %for.end67.loopexit.unr-lcssa, label %for.body57, !llvm.loop !19
for.end67.loopexit.unr-lcssa: ; preds = %for.body57, %for.body57.preheader
%add65.lcssa.ph = phi i64 [ undef, %for.body57.preheader ], [ %add65.3, %for.body57 ]
%i.4.in117.unr = phi i64 [ %i.0, %for.body57.preheader ], [ %i.4.3, %for.body57 ]
%ans.0116.unr = phi i64 [ 1, %for.body57.preheader ], [ %add65.3, %for.body57 ]
%lcmp.mod127.not = icmp eq i64 %xtraiter125, 0
br i1 %lcmp.mod127.not, label %for.end67, label %for.body57.epil
for.body57.epil: ; preds = %for.end67.loopexit.unr-lcssa, %for.body57.epil
%i.4.in117.epil = phi i64 [ %i.4.epil, %for.body57.epil ], [ %i.4.in117.unr, %for.end67.loopexit.unr-lcssa ]
%ans.0116.epil = phi i64 [ %add65.epil, %for.body57.epil ], [ %ans.0116.unr, %for.end67.loopexit.unr-lcssa ]
%epil.iter126 = phi i64 [ %epil.iter126.next, %for.body57.epil ], [ 0, %for.end67.loopexit.unr-lcssa ]
%i.4.epil = add nsw i64 %i.4.in117.epil, -1
%arrayidx58.epil = getelementptr inbounds ptr, ptr %call3, i64 %i.4.epil
%100 = load ptr, ptr %arrayidx58.epil, align 8, !tbaa !10
%arrayidx59.epil = getelementptr inbounds i8, ptr %call, i64 %i.4.epil
%101 = load i8, ptr %arrayidx59.epil, align 1, !tbaa !5
%conv60.epil = sext i8 %101 to i64
%102 = getelementptr i64, ptr %100, i64 %conv60.epil
%arrayidx62.epil = getelementptr i64, ptr %102, i64 -97
%103 = load i64, ptr %arrayidx62.epil, align 8, !tbaa !13
%add64.epil = add i64 %ans.0116.epil, %i.4.in117.epil
%add65.epil = sub i64 %add64.epil, %103
%epil.iter126.next = add i64 %epil.iter126, 1
%epil.iter126.cmp.not = icmp eq i64 %epil.iter126.next, %xtraiter125
br i1 %epil.iter126.cmp.not, label %for.end67, label %for.body57.epil, !llvm.loop !20
for.end67: ; preds = %for.end67.loopexit.unr-lcssa, %for.body57.epil, %for.cond22.preheader, %for.end, %for.cond54.preheader
%ans.0.lcssa = phi i64 [ 1, %for.cond54.preheader ], [ 1, %for.end ], [ 1, %for.cond22.preheader ], [ %add65.lcssa.ph, %for.end67.loopexit.unr-lcssa ], [ %add65.epil, %for.body57.epil ]
%call68 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
ret i64 0
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 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 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 #2 = { nofree nounwind "no-trapping-math"="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 allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !9}
!18 = distinct !{!18, !9}
!19 = distinct !{!19, !9}
!20 = distinct !{!20, !16}
|
#include <stdio.h>
//関数プロトタイプ宣言
void moving_north(int *top, int *bottom, int *front, int *back);
void moving_south(int *top, int *bottom, int *front, int *back);
void moving_east(int *top, int *bottom, int *right_side, int *left_side);
void moving_west(int *top, int *bottom, int *right_side, int *left_side);
void rotate_right(int *front, int *back, int *right_side, int *left_side);
void rotate_left(int *front, int *back, int *right_side, int *left_side);
//ダイスの構造体
typedef struct{
int top;
int bottom;
int right_side;
int left_side;
int front;
int back;
}Dice;
int main(void)
{
Dice dice1;
//iはループ変数、input_countは問題の数、input_topとinput_frontは回転後の上面と前面の値
int i, input_count;
int input_top[100], input_front[100];
//ダイスの目と問題数を入力
scanf("%d %d %d %d %d %d",
&dice1.top, &dice1.front, &dice1.right_side, &dice1.left_side, &dice1.back, &dice1.bottom);
scanf("%d", &input_count);
//問題を入力
for(i = 0; i < input_count; i++){
scanf("%d %d", &input_top[i], &input_front[i]);
}
//実際に回転させ、右面を求める
for(i = 0; i < input_count; i++){
//上面を揃える(下面も確定する)
if((input_top[i] == dice1.right_side)){
moving_west(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
}
else if((input_top[i] == dice1.left_side)){
moving_east(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
}
else if(input_top[i] == dice1.front){
moving_north(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
}
else if(input_top[i] == dice1.back){
moving_south(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
}
else if(input_top[i] == dice1.bottom){
moving_north(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
moving_north(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
}
//上面と前面が揃った状態にする
if((input_front[i] == dice1.right_side)){
rotate_left(&dice1.front, &dice1.back, &dice1.right_side, &dice1.left_side);
/*
moving_west(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
moving_south(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
moving_east(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
*/
}
else if((input_front[i] == dice1.left_side)){
rotate_right(&dice1.front, &dice1.back, &dice1.right_side, &dice1.left_side);
/*
moving_east(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
moving_south(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
moving_west(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
*/
}
else if(input_front[i] == dice1.back){
rotate_left(&dice1.front, &dice1.back, &dice1.right_side, &dice1.left_side);
rotate_left(&dice1.front, &dice1.back, &dice1.right_side, &dice1.left_side);
/*
moving_west(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
moving_south(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
moving_south(&dice1.top, &dice1.bottom, &dice1.front, &dice1.back);
moving_east(&dice1.top, &dice1.bottom, &dice1.right_side, &dice1.left_side);
*/
}
//結果の出力
printf("%d\n", dice1.right_side);
}
return 0;
}
//北側に転がす関数
void moving_north(int *top, int *bottom, int *front, int *back)
{
int temp;
//各面の値をずらす
temp = *top;
*top = *front;
*front = *bottom;
*bottom = *back;
*back = temp;
}
//南側に転がす関数
void moving_south(int *top, int *bottom, int *front, int *back)
{
int temp;
//各面の値をずらす
temp = *top;
*top = *back;
*back = *bottom;
*bottom = *front;
*front = temp;
}
//東側に転がす関数
void moving_east(int *top, int *bottom, int *right_side, int *left_side)
{
int temp;
//各面の値をずらす
temp = *top;
*top = *left_side;
*left_side = *bottom;
*bottom = *right_side;
*right_side = temp;
}
//西側に転がす関数
void moving_west(int *top, int *bottom, int *right_side, int *left_side)
{
int temp;
//各面の値をずらす
temp = *top;
*top = *right_side;
*right_side = *bottom;
*bottom = *left_side;
*left_side = temp;
}
//上面と下面を軸とし右側へ回転する関数
void rotate_right(int *front, int *back, int *right_side, int *left_side)
{
int temp;
//各面の値をずらす
temp = *front;
*front = *left_side;
*left_side = *back;
*back = *right_side;
*right_side = temp;
}
//上面と下面を軸とし左側へ回転する関数
void rotate_left(int *front, int *back, int *right_side, int *left_side)
{
int temp;
//各面の値をずらす
temp = *front;
*front = *right_side;
*right_side = *back;
*back = *left_side;
*left_side = temp;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242470/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242470/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Dice = type { i32, i32, i32, i32, i32, i32 }
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dice1 = alloca %struct.Dice, align 8
%input_count = alloca i32, align 4
%input_top = alloca [100 x i32], align 16
%input_front = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dice1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input_count) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %input_top) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %input_front) #4
%front = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 4
%right_side = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 2
%left_side = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 3
%back = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 5
%bottom = getelementptr inbounds %struct.Dice, ptr %dice1, i64 0, i32 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dice1, ptr noundef nonnull %front, ptr noundef nonnull %right_side, ptr noundef nonnull %left_side, ptr noundef nonnull %back, ptr noundef nonnull %bottom)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %input_count)
%0 = load i32, ptr %input_count, align 4, !tbaa !5
%cmp118 = icmp sgt i32 %0, 0
br i1 %cmp118, label %for.body, label %for.end103
for.cond5.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body7, label %for.end103
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %input_top, i64 0, i64 %indvars.iv
%arrayidx3 = getelementptr inbounds [100 x i32], ptr %input_front, i64 0, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %input_count, 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.cond5.preheader, !llvm.loop !9
for.body7: ; preds = %for.cond5.preheader, %if.end98
%indvars.iv123 = phi i64 [ %indvars.iv.next124, %if.end98 ], [ 0, %for.cond5.preheader ]
%arrayidx9 = getelementptr inbounds [100 x i32], ptr %input_top, i64 0, i64 %indvars.iv123
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%5 = load i32, ptr %right_side, align 8, !tbaa !5
%cmp11 = icmp eq i32 %4, %5
br i1 %cmp11, label %if.then, label %if.else
if.then: ; preds = %for.body7
%6 = load i32, ptr %dice1, align 8, !tbaa !5
store i32 %4, ptr %dice1, align 8, !tbaa !5
%7 = load i32, ptr %bottom, align 4, !tbaa !5
store i32 %7, ptr %right_side, align 8, !tbaa !5
%8 = load i32, ptr %left_side, align 4, !tbaa !5
store i32 %8, ptr %bottom, align 4, !tbaa !5
store i32 %6, ptr %left_side, align 4, !tbaa !5
br label %if.end62
if.else: ; preds = %for.body7
%9 = load i32, ptr %left_side, align 4, !tbaa !5
%cmp19 = icmp eq i32 %4, %9
br i1 %cmp19, label %if.then20, label %if.else25
if.then20: ; preds = %if.else
%10 = load i32, ptr %dice1, align 8, !tbaa !5
store i32 %4, ptr %dice1, align 8, !tbaa !5
%11 = load i32, ptr %bottom, align 4, !tbaa !5
store i32 %11, ptr %left_side, align 4, !tbaa !5
store i32 %5, ptr %bottom, align 4, !tbaa !5
store i32 %10, ptr %right_side, align 8, !tbaa !5
br label %if.end62
if.else25: ; preds = %if.else
%12 = load i32, ptr %front, align 8, !tbaa !5
%cmp29 = icmp eq i32 %4, %12
br i1 %cmp29, label %if.then30, label %if.else35
if.then30: ; preds = %if.else25
%13 = load i32, ptr %back, align 4, !tbaa !5
%14 = load <2 x i32>, ptr %dice1, align 8, !tbaa !5
store i32 %4, ptr %dice1, align 8, !tbaa !5
store i32 %13, ptr %bottom, align 4, !tbaa !5
%15 = shufflevector <2 x i32> %14, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %15, ptr %front, align 8, !tbaa !5
br label %if.end62
if.else35: ; preds = %if.else25
%16 = load i32, ptr %back, align 4, !tbaa !5
%cmp39 = icmp eq i32 %4, %16
br i1 %cmp39, label %if.then40, label %if.else45
if.then40: ; preds = %if.else35
%17 = load <2 x i32>, ptr %dice1, align 8, !tbaa !5
store i32 %4, ptr %dice1, align 8, !tbaa !5
store i32 %12, ptr %bottom, align 4, !tbaa !5
store <2 x i32> %17, ptr %front, align 8, !tbaa !5
br label %if.end62
if.else45: ; preds = %if.else35
%18 = load i32, ptr %bottom, align 4, !tbaa !5
%cmp49 = icmp eq i32 %4, %18
br i1 %cmp49, label %if.then50, label %if.end62
if.then50: ; preds = %if.else45
%19 = load i32, ptr %dice1, align 8, !tbaa !5
store i32 %4, ptr %dice1, align 8, !tbaa !5
store i32 %16, ptr %front, align 8, !tbaa !5
store i32 %19, ptr %bottom, align 4, !tbaa !5
store i32 %12, ptr %back, align 4, !tbaa !5
br label %if.end62
if.end62: ; preds = %if.then20, %if.then40, %if.then50, %if.else45, %if.then30, %if.then
%20 = phi i32 [ %11, %if.then20 ], [ %9, %if.then40 ], [ %9, %if.then50 ], [ %9, %if.else45 ], [ %9, %if.then30 ], [ %6, %if.then ]
%21 = phi i32 [ %10, %if.then20 ], [ %5, %if.then40 ], [ %5, %if.then50 ], [ %5, %if.else45 ], [ %5, %if.then30 ], [ %7, %if.then ]
%arrayidx64 = getelementptr inbounds [100 x i32], ptr %input_front, i64 0, i64 %indvars.iv123
%22 = load i32, ptr %arrayidx64, align 4, !tbaa !5
%cmp66 = icmp eq i32 %22, %21
br i1 %cmp66, label %if.then67, label %if.else72
if.then67: ; preds = %if.end62
%23 = load i32, ptr %front, align 8, !tbaa !5
store i32 %21, ptr %front, align 8, !tbaa !5
%24 = load i32, ptr %back, align 4, !tbaa !5
store i32 %24, ptr %right_side, align 8, !tbaa !5
store i32 %20, ptr %back, align 4, !tbaa !5
store i32 %23, ptr %left_side, align 4, !tbaa !5
br label %if.end98
if.else72: ; preds = %if.end62
%cmp76 = icmp eq i32 %22, %20
br i1 %cmp76, label %if.then77, label %if.else82
if.then77: ; preds = %if.else72
%25 = load <2 x i32>, ptr %front, align 8, !tbaa !5
store i32 %20, ptr %front, align 8, !tbaa !5
store i32 %21, ptr %back, align 4, !tbaa !5
store <2 x i32> %25, ptr %right_side, align 8, !tbaa !5
%26 = extractelement <2 x i32> %25, i64 0
br label %if.end98
if.else82: ; preds = %if.else72
%27 = load i32, ptr %back, align 4, !tbaa !5
%cmp86 = icmp eq i32 %22, %27
br i1 %cmp86, label %if.then87, label %if.end98
if.then87: ; preds = %if.else82
%28 = load i32, ptr %front, align 8, !tbaa !5
store i32 %22, ptr %front, align 8, !tbaa !5
store i32 %20, ptr %right_side, align 8, !tbaa !5
store i32 %28, ptr %back, align 4, !tbaa !5
store i32 %21, ptr %left_side, align 4, !tbaa !5
br label %if.end98
if.end98: ; preds = %if.then77, %if.then87, %if.else82, %if.then67
%29 = phi i32 [ %26, %if.then77 ], [ %20, %if.then87 ], [ %21, %if.else82 ], [ %24, %if.then67 ]
%call100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %29)
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%30 = load i32, ptr %input_count, align 4, !tbaa !5
%31 = sext i32 %30 to i64
%cmp6 = icmp slt i64 %indvars.iv.next124, %31
br i1 %cmp6, label %for.body7, label %for.end103, !llvm.loop !11
for.end103: ; preds = %if.end98, %entry, %for.cond5.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %input_front) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %input_top) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input_count) #4
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dice1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @moving_west(ptr nocapture noundef %top, ptr nocapture noundef %bottom, ptr nocapture noundef %right_side, ptr nocapture noundef %left_side) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %top, align 4, !tbaa !5
%1 = load i32, ptr %right_side, align 4, !tbaa !5
store i32 %1, ptr %top, align 4, !tbaa !5
%2 = load i32, ptr %bottom, align 4, !tbaa !5
store i32 %2, ptr %right_side, align 4, !tbaa !5
%3 = load i32, ptr %left_side, align 4, !tbaa !5
store i32 %3, ptr %bottom, align 4, !tbaa !5
store i32 %0, ptr %left_side, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @moving_east(ptr nocapture noundef %top, ptr nocapture noundef %bottom, ptr nocapture noundef %right_side, ptr nocapture noundef %left_side) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %top, align 4, !tbaa !5
%1 = load i32, ptr %left_side, align 4, !tbaa !5
store i32 %1, ptr %top, align 4, !tbaa !5
%2 = load i32, ptr %bottom, align 4, !tbaa !5
store i32 %2, ptr %left_side, align 4, !tbaa !5
%3 = load i32, ptr %right_side, align 4, !tbaa !5
store i32 %3, ptr %bottom, align 4, !tbaa !5
store i32 %0, ptr %right_side, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @moving_north(ptr nocapture noundef %top, ptr nocapture noundef %bottom, ptr nocapture noundef %front, ptr nocapture noundef %back) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %top, align 4, !tbaa !5
%1 = load i32, ptr %front, align 4, !tbaa !5
store i32 %1, ptr %top, align 4, !tbaa !5
%2 = load i32, ptr %bottom, align 4, !tbaa !5
store i32 %2, ptr %front, align 4, !tbaa !5
%3 = load i32, ptr %back, align 4, !tbaa !5
store i32 %3, ptr %bottom, align 4, !tbaa !5
store i32 %0, ptr %back, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @moving_south(ptr nocapture noundef %top, ptr nocapture noundef %bottom, ptr nocapture noundef %front, ptr nocapture noundef %back) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %top, align 4, !tbaa !5
%1 = load i32, ptr %back, align 4, !tbaa !5
store i32 %1, ptr %top, align 4, !tbaa !5
%2 = load i32, ptr %bottom, align 4, !tbaa !5
store i32 %2, ptr %back, align 4, !tbaa !5
%3 = load i32, ptr %front, align 4, !tbaa !5
store i32 %3, ptr %bottom, align 4, !tbaa !5
store i32 %0, ptr %front, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rotate_left(ptr nocapture noundef %front, ptr nocapture noundef %back, ptr nocapture noundef %right_side, ptr nocapture noundef %left_side) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %front, align 4, !tbaa !5
%1 = load i32, ptr %right_side, align 4, !tbaa !5
store i32 %1, ptr %front, align 4, !tbaa !5
%2 = load i32, ptr %back, align 4, !tbaa !5
store i32 %2, ptr %right_side, align 4, !tbaa !5
%3 = load i32, ptr %left_side, align 4, !tbaa !5
store i32 %3, ptr %back, align 4, !tbaa !5
store i32 %0, ptr %left_side, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rotate_right(ptr nocapture noundef %front, ptr nocapture noundef %back, ptr nocapture noundef %right_side, ptr nocapture noundef %left_side) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %front, align 4, !tbaa !5
%1 = load i32, ptr %left_side, align 4, !tbaa !5
store i32 %1, ptr %front, align 4, !tbaa !5
%2 = load i32, ptr %back, align 4, !tbaa !5
store i32 %2, ptr %left_side, align 4, !tbaa !5
%3 = load i32, ptr %right_side, align 4, !tbaa !5
store i32 %3, ptr %back, align 4, !tbaa !5
store i32 %0, ptr %right_side, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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>
struct dice {
int label[7];
};
struct dice *make_dice(int *num) {
int i;
struct dice *dice1;
dice1 = (struct dice *)malloc(sizeof(struct dice));
for(i = 1;i <= 6;i++) {
dice1->label[i] = num[i];
}
return dice1;
}
void turnS(struct dice *a) {
int temp;
temp = a->label[1];
a->label[1] = a->label[5];
a->label[5] = a->label[6];
a->label[6] = a->label[2];
a->label[2] = temp;
}
void turnW(struct dice *a) {
int temp;
temp = a->label[1];
a->label[1] = a->label[3];
a->label[3] = a->label[6];
a->label[6] = a->label[4];
a->label[4] = temp;
}
void turnN(struct dice *a) {
int temp;
temp = a->label[1];
a->label[1] = a->label[2];
a->label[2] = a->label[6];
a->label[6] = a->label[5];
a->label[5] = temp;
}
void turnE(struct dice *a) {
int temp;
temp = a->label[1];
a->label[1] = a->label[4];
a->label[4] = a->label[6];
a->label[6] = a->label[3];
a->label[3] = temp;
}
void spin(struct dice *a) {
turnS(a);
turnE(a);
turnN(a);
}
int main() {
int i,j,a,b,q,num[7];
struct dice *dice1;
for(i = 1;i <= 6;i++) {
scanf("%d", num+i);
}
dice1 = make_dice(num);
scanf("%d",&q);
for(;q > 0;q--) {
scanf("%d %d", &a, &b);
for(i = 0;i < 4;i++) {
for(j = 0;j < 4;j++) {
if(dice1->label[1] == a && dice1->label[2] == b) break;
spin(dice1);
}
if(dice1->label[1] == a && dice1->label[2] == b) break;
turnW(dice1);
}
for(i = 0;i < 4;i++) {
for(j = 0;j < 4;j++) {
if(dice1->label[1] == a && dice1->label[2] == b) break;
spin(dice1);
}
if(dice1->label[1] == a && dice1->label[2] == b) break;
turnS(dice1);
}
printf("%d\n", dice1->label[3]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242513/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242513/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 nounwind willreturn uwtable
define dso_local noalias ptr @make_dice(ptr nocapture noundef readonly %num) local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(28) ptr @malloc(i64 noundef 28) #7
%scevgep = getelementptr i8, ptr %call, i64 4
%scevgep8 = getelementptr i8, ptr %num, i64 4
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %scevgep, ptr noundef nonnull align 4 dereferenceable(24) %scevgep8, i64 24, i1 false), !tbaa !5
ret ptr %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turnS(ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 5
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 6
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 2
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turnW(ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 3
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 6
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 4
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turnN(ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 2
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 6
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 5
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turnE(ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 4
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 6
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 3
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @spin(ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%arrayidx10.i = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 2
%0 = load <4 x i32>, ptr %arrayidx10.i, align 4, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2>
store <4 x i32> %1, ptr %arrayidx10.i, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%q = alloca i32, align 4
%num = alloca [7 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #8
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %num) #8
%add.ptr = getelementptr inbounds i32, ptr %num, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%add.ptr.1 = getelementptr inbounds i32, ptr %num, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1)
%add.ptr.2 = getelementptr inbounds i32, ptr %num, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2)
%add.ptr.3 = getelementptr inbounds i32, ptr %num, i64 4
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3)
%add.ptr.4 = getelementptr inbounds i32, ptr %num, i64 5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.4)
%add.ptr.5 = getelementptr inbounds i32, ptr %num, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.5)
%call.i = call noalias dereferenceable_or_null(28) ptr @malloc(i64 noundef 28) #7
%scevgep.i = getelementptr i8, ptr %call.i, i64 4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(24) %scevgep.i, ptr noundef nonnull align 4 dereferenceable(24) %add.ptr, i64 24, i1 false), !tbaa !5
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%.pr = load i32, ptr %q, align 4, !tbaa !5
%cmp5103 = icmp sgt i32 %.pr, 0
br i1 %cmp5103, label %for.body6.lr.ph, label %for.end67
for.body6.lr.ph: ; preds = %entry
%arrayidx26 = getelementptr inbounds [7 x i32], ptr %call.i, i64 0, i64 2
%arrayidx2.i.i = getelementptr inbounds [7 x i32], ptr %call.i, i64 0, i64 5
%arrayidx2.i4.i = getelementptr inbounds [7 x i32], ptr %call.i, i64 0, i64 4
%arrayidx10.i6.i = getelementptr inbounds [7 x i32], ptr %call.i, i64 0, i64 3
%arrayidx6.i = getelementptr inbounds [7 x i32], ptr %call.i, i64 0, i64 6
br label %for.body6
for.body6: ; preds = %for.body6.lr.ph, %for.end62
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4
%scevgep.i.promoted = load i32, ptr %scevgep.i, align 4, !tbaa !5
%2 = icmp eq i32 %scevgep.i.promoted, %0
%arrayidx16.promoted = load i32, ptr %arrayidx26, align 4, !tbaa !5
br i1 %2, label %for.cond11.preheader.split.us, label %for.end20
for.cond11.preheader.split.us: ; preds = %for.body6
%cmp17.us = icmp eq i32 %arrayidx16.promoted, %1
br i1 %cmp17.us, label %for.end32, label %if.end.us
if.end.us: ; preds = %for.cond11.preheader.split.us
%3 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.1 = icmp eq i32 %5, %1
br i1 %cmp17.us.1, label %for.end32, label %if.end.us.1
if.end.us.1: ; preds = %if.end.us
store i32 %5, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.2 = icmp eq i32 %3, %1
br i1 %cmp17.us.2, label %for.end32, label %if.end.us.2
if.end.us.2: ; preds = %if.end.us.1
store i32 %3, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.3 = icmp eq i32 %4, %1
br i1 %cmp17.us.3, label %for.end32, label %land.lhs.true24
for.end20: ; preds = %for.body6
%6 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted, ptr %arrayidx26, align 4, !tbaa !5
store i32 %6, ptr %arrayidx2.i.i, align 4, !tbaa !5
br label %if.end29
land.lhs.true24: ; preds = %if.end.us.2
store i32 %4, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted, ptr %arrayidx26, align 4, !tbaa !5
%cmp27 = icmp eq i32 %arrayidx16.promoted, %1
br i1 %cmp27, label %for.end32, label %if.end29
if.end29: ; preds = %for.end20, %land.lhs.true24
%7 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %scevgep.i.promoted, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%10 = icmp eq i32 %7, %0
%arrayidx16.promoted.1 = load i32, ptr %arrayidx26, align 4, !tbaa !5
br i1 %10, label %for.cond11.preheader.split.us.1, label %for.end20.1
for.end20.1: ; preds = %if.end29
%11 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.1, ptr %arrayidx26, align 4, !tbaa !5
store i32 %11, ptr %arrayidx2.i.i, align 4, !tbaa !5
br label %if.end29.1
for.cond11.preheader.split.us.1: ; preds = %if.end29
%cmp17.us.1117 = icmp eq i32 %arrayidx16.promoted.1, %1
br i1 %cmp17.us.1117, label %for.end32, label %if.end.us.1118
if.end.us.1118: ; preds = %for.cond11.preheader.split.us.1
%12 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%13 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.1, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %12, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %13, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.1.1 = icmp eq i32 %14, %1
br i1 %cmp17.us.1.1, label %for.end32, label %if.end.us.1.1
if.end.us.1.1: ; preds = %if.end.us.1118
store i32 %14, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %13, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.1, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.2.1 = icmp eq i32 %12, %1
br i1 %cmp17.us.2.1, label %for.end32, label %if.end.us.2.1
if.end.us.2.1: ; preds = %if.end.us.1.1
store i32 %12, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.1, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.3.1 = icmp eq i32 %13, %1
br i1 %cmp17.us.3.1, label %for.end32, label %land.lhs.true24.1
land.lhs.true24.1: ; preds = %if.end.us.2.1
store i32 %13, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.1, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.1 = icmp eq i32 %arrayidx16.promoted.1, %1
br i1 %cmp27.1, label %for.end32, label %if.end29.1
if.end29.1: ; preds = %land.lhs.true24.1, %for.end20.1
%15 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%16 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %16, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %17, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%18 = icmp eq i32 %15, %0
%arrayidx16.promoted.2 = load i32, ptr %arrayidx26, align 4, !tbaa !5
br i1 %18, label %for.cond11.preheader.split.us.2, label %for.end20.2
for.end20.2: ; preds = %if.end29.1
%19 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.2, ptr %arrayidx26, align 4, !tbaa !5
store i32 %19, ptr %arrayidx2.i.i, align 4, !tbaa !5
br label %if.end29.2
for.cond11.preheader.split.us.2: ; preds = %if.end29.1
%cmp17.us.2119 = icmp eq i32 %arrayidx16.promoted.2, %1
br i1 %cmp17.us.2119, label %for.end32, label %if.end.us.2120
if.end.us.2120: ; preds = %for.cond11.preheader.split.us.2
%20 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%21 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.2, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%22 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %20, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %21, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.1.2 = icmp eq i32 %22, %1
br i1 %cmp17.us.1.2, label %for.end32, label %if.end.us.1.2
if.end.us.1.2: ; preds = %if.end.us.2120
store i32 %22, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %21, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.2, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.2.2 = icmp eq i32 %20, %1
br i1 %cmp17.us.2.2, label %for.end32, label %if.end.us.2.2
if.end.us.2.2: ; preds = %if.end.us.1.2
store i32 %20, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.2, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %22, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.3.2 = icmp eq i32 %21, %1
br i1 %cmp17.us.3.2, label %for.end32, label %land.lhs.true24.2
land.lhs.true24.2: ; preds = %if.end.us.2.2
store i32 %21, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %22, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %20, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.2, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.2 = icmp eq i32 %arrayidx16.promoted.2, %1
br i1 %cmp27.2, label %for.end32, label %if.end29.2
if.end29.2: ; preds = %land.lhs.true24.2, %for.end20.2
%23 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%24 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %24, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%25 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %25, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %15, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%26 = icmp eq i32 %23, %0
%arrayidx16.promoted.3 = load i32, ptr %arrayidx26, align 4, !tbaa !5
br i1 %26, label %for.cond11.preheader.split.us.3, label %for.end20.3
for.end20.3: ; preds = %if.end29.2
%27 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.3, ptr %arrayidx26, align 4, !tbaa !5
store i32 %27, ptr %arrayidx2.i.i, align 4, !tbaa !5
br label %if.end29.3
for.cond11.preheader.split.us.3: ; preds = %if.end29.2
%cmp17.us.3121 = icmp eq i32 %arrayidx16.promoted.3, %1
br i1 %cmp17.us.3121, label %for.end32, label %if.end.us.3
if.end.us.3: ; preds = %for.cond11.preheader.split.us.3
%28 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%29 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.3, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%30 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %28, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %29, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.1.3 = icmp eq i32 %30, %1
br i1 %cmp17.us.1.3, label %for.end32, label %if.end.us.1.3
if.end.us.1.3: ; preds = %if.end.us.3
store i32 %30, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %29, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.3, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.2.3 = icmp eq i32 %28, %1
br i1 %cmp17.us.2.3, label %for.end32, label %if.end.us.2.3
if.end.us.2.3: ; preds = %if.end.us.1.3
store i32 %28, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.3, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %30, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp17.us.3.3 = icmp eq i32 %29, %1
br i1 %cmp17.us.3.3, label %for.end32, label %land.lhs.true24.3
land.lhs.true24.3: ; preds = %if.end.us.2.3
store i32 %29, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %30, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %28, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx16.promoted.3, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.3 = icmp eq i32 %arrayidx16.promoted.3, %1
br i1 %cmp27.3, label %for.end32, label %if.end29.3
if.end29.3: ; preds = %land.lhs.true24.3, %for.end20.3
%31 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%32 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%33 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %33, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %23, ptr %arrayidx2.i4.i, align 4, !tbaa !5
br label %for.end32
for.end32: ; preds = %if.end29.3, %land.lhs.true24.3, %if.end.us.2.3, %if.end.us.1.3, %if.end.us.3, %for.cond11.preheader.split.us.3, %land.lhs.true24.2, %if.end.us.2.2, %if.end.us.1.2, %if.end.us.2120, %for.cond11.preheader.split.us.2, %land.lhs.true24.1, %if.end.us.2.1, %if.end.us.1.1, %if.end.us.1118, %for.cond11.preheader.split.us.1, %land.lhs.true24, %if.end.us.2, %if.end.us.1, %if.end.us, %for.cond11.preheader.split.us
%arrayidx44.promoted109111 = phi i32 [ %1, %for.cond11.preheader.split.us ], [ %1, %if.end.us ], [ %1, %if.end.us.1 ], [ %1, %if.end.us.2 ], [ %arrayidx16.promoted, %land.lhs.true24 ], [ %1, %for.cond11.preheader.split.us.1 ], [ %1, %if.end.us.1118 ], [ %1, %if.end.us.1.1 ], [ %1, %if.end.us.2.1 ], [ %arrayidx16.promoted.1, %land.lhs.true24.1 ], [ %1, %for.cond11.preheader.split.us.2 ], [ %1, %if.end.us.2120 ], [ %1, %if.end.us.1.2 ], [ %1, %if.end.us.2.2 ], [ %arrayidx16.promoted.2, %land.lhs.true24.2 ], [ %1, %for.cond11.preheader.split.us.3 ], [ %1, %if.end.us.3 ], [ %1, %if.end.us.1.3 ], [ %1, %if.end.us.2.3 ], [ %arrayidx16.promoted.3, %land.lhs.true24.3 ], [ %arrayidx16.promoted.3, %if.end29.3 ]
%34 = phi i32 [ %0, %for.cond11.preheader.split.us ], [ %0, %if.end.us ], [ %0, %if.end.us.1 ], [ %0, %if.end.us.2 ], [ %0, %land.lhs.true24 ], [ %0, %for.cond11.preheader.split.us.1 ], [ %0, %if.end.us.1118 ], [ %0, %if.end.us.1.1 ], [ %0, %if.end.us.2.1 ], [ %0, %land.lhs.true24.1 ], [ %0, %for.cond11.preheader.split.us.2 ], [ %0, %if.end.us.2120 ], [ %0, %if.end.us.1.2 ], [ %0, %if.end.us.2.2 ], [ %0, %land.lhs.true24.2 ], [ %0, %for.cond11.preheader.split.us.3 ], [ %0, %if.end.us.3 ], [ %0, %if.end.us.1.3 ], [ %0, %if.end.us.2.3 ], [ %0, %land.lhs.true24.3 ], [ %31, %if.end29.3 ]
store i32 %34, ptr %scevgep.i, align 4, !tbaa !5
%35 = icmp eq i32 %34, %0
br i1 %35, label %for.cond36.preheader.split.us, label %if.end59
for.cond36.preheader.split.us: ; preds = %for.end32
%cmp45.us = icmp eq i32 %arrayidx44.promoted109111, %1
br i1 %cmp45.us, label %land.lhs.true54.thread, label %if.end47.us
if.end47.us: ; preds = %for.cond36.preheader.split.us
%36 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%37 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx44.promoted109111, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%38 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %36, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %37, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.1 = icmp eq i32 %38, %1
br i1 %cmp45.us.1, label %land.lhs.true54.thread, label %if.end47.us.1
if.end47.us.1: ; preds = %if.end47.us
store i32 %38, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %37, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %arrayidx44.promoted109111, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.2 = icmp eq i32 %36, %1
br i1 %cmp45.us.2, label %land.lhs.true54.thread, label %if.end47.us.2
if.end47.us.2: ; preds = %if.end47.us.1
store i32 %36, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %arrayidx44.promoted109111, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %38, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.3 = icmp eq i32 %37, %1
br i1 %cmp45.us.3, label %land.lhs.true54.thread, label %land.lhs.true54
land.lhs.true54.thread: ; preds = %if.end47.us.2.3, %if.end47.us.1.3, %if.end47.us.3, %for.cond36.preheader.split.us.3, %if.end47.us.2.2, %if.end47.us.1.2, %if.end47.us.2125, %for.cond36.preheader.split.us.2, %if.end47.us.2.1, %if.end47.us.1.1, %if.end47.us.1123, %for.cond36.preheader.split.us.1, %for.cond36.preheader.split.us, %if.end47.us, %if.end47.us.1, %if.end47.us.2
store i32 %1, ptr %arrayidx26, align 4, !tbaa !5
br label %for.end62
land.lhs.true54: ; preds = %if.end47.us.2
store i32 %37, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %38, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %36, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx44.promoted109111, ptr %arrayidx26, align 4, !tbaa !5
%cmp57 = icmp eq i32 %arrayidx44.promoted109111, %1
br i1 %cmp57, label %for.end62, label %if.end59
if.end59: ; preds = %for.end32, %land.lhs.true54
%39 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%40 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %40, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %arrayidx44.promoted109111, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %34, ptr %arrayidx26, align 4, !tbaa !5
%41 = icmp eq i32 %39, %0
br i1 %41, label %for.cond36.preheader.split.us.1, label %if.end59.1
for.cond36.preheader.split.us.1: ; preds = %if.end59
%cmp45.us.1122 = icmp eq i32 %34, %1
br i1 %cmp45.us.1122, label %land.lhs.true54.thread, label %if.end47.us.1123
if.end47.us.1123: ; preds = %for.cond36.preheader.split.us.1
%42 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%43 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %34, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%44 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %42, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %43, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.1.1 = icmp eq i32 %44, %1
br i1 %cmp45.us.1.1, label %land.lhs.true54.thread, label %if.end47.us.1.1
if.end47.us.1.1: ; preds = %if.end47.us.1123
store i32 %44, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %43, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %34, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.2.1 = icmp eq i32 %42, %1
br i1 %cmp45.us.2.1, label %land.lhs.true54.thread, label %if.end47.us.2.1
if.end47.us.2.1: ; preds = %if.end47.us.1.1
store i32 %42, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %34, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %44, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.3.1 = icmp eq i32 %43, %1
br i1 %cmp45.us.3.1, label %land.lhs.true54.thread, label %land.lhs.true54.1
land.lhs.true54.1: ; preds = %if.end47.us.2.1
store i32 %43, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %44, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %42, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %34, ptr %arrayidx26, align 4, !tbaa !5
%cmp57.1 = icmp eq i32 %34, %1
br i1 %cmp57.1, label %for.end62, label %if.end59.1
if.end59.1: ; preds = %if.end59, %land.lhs.true54.1
%45 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%46 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %46, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %34, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %39, ptr %arrayidx26, align 4, !tbaa !5
%47 = icmp eq i32 %45, %0
br i1 %47, label %for.cond36.preheader.split.us.2, label %if.end59.2
for.cond36.preheader.split.us.2: ; preds = %if.end59.1
%cmp45.us.2124 = icmp eq i32 %39, %1
br i1 %cmp45.us.2124, label %land.lhs.true54.thread, label %if.end47.us.2125
if.end47.us.2125: ; preds = %for.cond36.preheader.split.us.2
%48 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%49 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %39, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%50 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %48, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %49, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.1.2 = icmp eq i32 %50, %1
br i1 %cmp45.us.1.2, label %land.lhs.true54.thread, label %if.end47.us.1.2
if.end47.us.1.2: ; preds = %if.end47.us.2125
store i32 %50, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %49, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %39, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.2.2 = icmp eq i32 %48, %1
br i1 %cmp45.us.2.2, label %land.lhs.true54.thread, label %if.end47.us.2.2
if.end47.us.2.2: ; preds = %if.end47.us.1.2
store i32 %48, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %39, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %50, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.3.2 = icmp eq i32 %49, %1
br i1 %cmp45.us.3.2, label %land.lhs.true54.thread, label %land.lhs.true54.2
land.lhs.true54.2: ; preds = %if.end47.us.2.2
store i32 %49, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %50, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %48, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %39, ptr %arrayidx26, align 4, !tbaa !5
%cmp57.2 = icmp eq i32 %39, %1
br i1 %cmp57.2, label %for.end62, label %if.end59.2
if.end59.2: ; preds = %if.end59.1, %land.lhs.true54.2
%51 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%52 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %52, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %39, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %45, ptr %arrayidx26, align 4, !tbaa !5
%53 = icmp eq i32 %51, %0
br i1 %53, label %for.cond36.preheader.split.us.3, label %if.end59.3
for.cond36.preheader.split.us.3: ; preds = %if.end59.2
%cmp45.us.3126 = icmp eq i32 %45, %1
br i1 %cmp45.us.3126, label %land.lhs.true54.thread, label %if.end47.us.3
if.end47.us.3: ; preds = %for.cond36.preheader.split.us.3
%54 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%55 = load i32, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %45, ptr %arrayidx2.i4.i, align 4, !tbaa !5
%56 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %54, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %55, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.1.3 = icmp eq i32 %56, %1
br i1 %cmp45.us.1.3, label %land.lhs.true54.thread, label %if.end47.us.1.3
if.end47.us.1.3: ; preds = %if.end47.us.3
store i32 %56, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %55, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %45, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.2.3 = icmp eq i32 %54, %1
br i1 %cmp45.us.2.3, label %land.lhs.true54.thread, label %if.end47.us.2.3
if.end47.us.2.3: ; preds = %if.end47.us.1.3
store i32 %54, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %45, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %56, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp45.us.3.3 = icmp eq i32 %55, %1
br i1 %cmp45.us.3.3, label %land.lhs.true54.thread, label %land.lhs.true54.3
land.lhs.true54.3: ; preds = %if.end47.us.2.3
store i32 %55, ptr %arrayidx2.i4.i, align 4, !tbaa !5
store i32 %56, ptr %arrayidx10.i6.i, align 4, !tbaa !5
store i32 %54, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %45, ptr %arrayidx26, align 4, !tbaa !5
%cmp57.3 = icmp eq i32 %45, %1
br i1 %cmp57.3, label %for.end62, label %if.end59.3
if.end59.3: ; preds = %if.end59.2, %land.lhs.true54.3
%57 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%58 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %58, ptr %arrayidx2.i.i, align 4, !tbaa !5
store i32 %45, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %51, ptr %arrayidx26, align 4, !tbaa !5
br label %for.end62
for.end62: ; preds = %land.lhs.true54, %land.lhs.true54.1, %land.lhs.true54.2, %land.lhs.true54.3, %if.end59.3, %land.lhs.true54.thread
%59 = phi i32 [ %0, %land.lhs.true54.thread ], [ %0, %land.lhs.true54 ], [ %0, %land.lhs.true54.1 ], [ %0, %land.lhs.true54.2 ], [ %0, %land.lhs.true54.3 ], [ %57, %if.end59.3 ]
store i32 %59, ptr %scevgep.i, align 4, !tbaa !5
%60 = load i32, ptr %arrayidx10.i6.i, align 4, !tbaa !5
%call65 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %60)
%61 = load i32, ptr %q, align 4, !tbaa !5
%dec = add nsw i32 %61, -1
store i32 %dec, ptr %q, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %61, 1
br i1 %cmp5, label %for.body6, label %for.end67, !llvm.loop !9
for.end67: ; preds = %for.end62, %entry
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %num) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6
attributes #0 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind allocsize(0) }
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"}
|
#include <stdio.h>
int main(void){
int i, j;
int q;
int t, f;
int x, y;
int dice[6];
for (i=0; i<6; i++){
scanf("%d", &dice[i]);
} /* ??????????????????????????????????????????????????¢?????°????????\??? */
/* ???????????????????????°q?????\??? */
scanf("%d", &q);
for (j=0; j<q; j++) {
t=0;
f=0;
/* ?????¢??¨?????¢?????°????????¨??????????????´??°?????\??? */
scanf("%d %d", &x, &y);
for(i=0; i<6; i++){
if(x==dice[i]){
t=i;
}
else if(y==dice[i]){
f=i;
}
}
/* ?????????????????????????????¨?????¢????????£???????????¢????????? */
/* ?????????????????????????????¨?????¢????????£???????????¢????????? */
/* ???????????¢???????????????????????????????????§?????¢???????????????????????¢?????????????????? */
if (t==0) {
if(f==1){
printf("%d\n", dice[2]);
}
else if(f==2){
printf("%d\n", dice[4]);
}
else if(f==3){
printf("%d\n", dice[1]);
}
else if(f==4){
printf("%d\n", dice[3]);
}
}
else if(t==1){
if(f==0){
printf("%d\n", dice[3]);
}
else if(f==2){
printf("%d\n", dice[0]);
}
else if(f==3){
printf("%d\n", dice[5]);
}
else if(f==5){
printf("%d\n", dice[2]);
}
}
else if(t==2){
if(f==0){
printf("%d\n", dice[1]);
}
else if(f==1){
printf("%d\n", dice[5]);
}
else if(f==4){
printf("%d\n", dice[0]);
}
else if(f==5){
printf("%d\n", dice[4]);
}
}
else if(t==3){
if(f==0){
printf("%d\n", dice[4]);
}
else if(f==1){
printf("%d\n", dice[0]);
}
else if(f==4){
printf("%d\n", dice[5]);
}
else if(f==5){
printf("%d\n", dice[1]);
}
}
else if(t==4){
if(f==0){
printf("%d\n", dice[2]);
}
else if(f==2){
printf("%d\n", dice[5]);
}
else if(f==3){
printf("%d\n", dice[0]);
}
else if(f==5){
printf("%d\n", dice[3]);
}
}
else if(t==5){
if(f==1){
printf("%d\n", dice[3]);
}
else if(f==2){
printf("%d\n", dice[1]);
}
else if(f==3){
printf("%d\n", dice[4]);
}
else if(f==4){
printf("%d\n", dice[2]);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242564/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242564/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%q = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%dice = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #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 void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dice) #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
%cmp3225 = icmp sgt i32 %0, 0
br i1 %cmp3225, label %for.body4, label %for.end183
for.body4: ; preds = %entry, %for.inc181
%j.0226 = phi i32 [ %inc182, %for.inc181 ], [ 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 %y, align 4
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp11.1 = icmp eq i32 %1, %3
%cmp14.1 = icmp eq i32 %2, %3
%t.1.1 = zext i1 %cmp11.1 to i32
%not.cmp11.1 = xor i1 %cmp11.1, true
%narrow = select i1 %not.cmp11.1, i1 %cmp14.1, i1 false
%f.1.1 = zext i1 %narrow to i32
%4 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp11.2 = icmp eq i32 %1, %4
%cmp14.2 = icmp eq i32 %2, %4
%spec.select.2 = select i1 %cmp14.2, i32 2, i32 %f.1.1
%t.1.2 = select i1 %cmp11.2, i32 2, i32 %t.1.1
%f.1.2 = select i1 %cmp11.2, i32 %f.1.1, i32 %spec.select.2
%5 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp11.3 = icmp eq i32 %1, %5
%cmp14.3 = icmp eq i32 %2, %5
%spec.select.3 = select i1 %cmp14.3, i32 3, i32 %f.1.2
%t.1.3 = select i1 %cmp11.3, i32 3, i32 %t.1.2
%f.1.3 = select i1 %cmp11.3, i32 %f.1.2, i32 %spec.select.3
%6 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp11.4 = icmp eq i32 %1, %6
%cmp14.4 = icmp eq i32 %2, %6
%spec.select.4 = select i1 %cmp14.4, i32 4, i32 %f.1.3
%t.1.4 = select i1 %cmp11.4, i32 4, i32 %t.1.3
%f.1.4 = select i1 %cmp11.4, i32 %f.1.3, i32 %spec.select.4
%7 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp11.5 = icmp eq i32 %1, %7
%cmp14.5 = icmp eq i32 %2, %7
%spec.select.5 = select i1 %cmp14.5, i32 5, i32 %f.1.4
%t.1.5 = select i1 %cmp11.5, i32 5, i32 %t.1.4
%f.1.5 = select i1 %cmp11.5, i32 %f.1.4, i32 %spec.select.5
switch i32 %t.1.5, label %for.inc181 [
i32 0, label %if.then21
i32 1, label %if.then47
i32 2, label %if.then73
i32 3, label %if.then99
i32 4, label %if.then125
i32 5, label %if.then151
]
if.then21: ; preds = %for.body4
switch i32 %f.1.5, label %for.inc181 [
i32 1, label %for.inc181.sink.split
i32 2, label %if.then28
i32 3, label %if.then33
i32 4, label %if.then38
]
if.then28: ; preds = %if.then21
br label %for.inc181.sink.split
if.then33: ; preds = %if.then21
br label %for.inc181.sink.split
if.then38: ; preds = %if.then21
br label %for.inc181.sink.split
if.then47: ; preds = %for.body4
switch i32 %f.1.5, label %for.inc181 [
i32 0, label %for.inc181.sink.split
i32 2, label %if.then54
i32 3, label %if.then59
i32 5, label %if.then64
]
if.then54: ; preds = %if.then47
%8 = load i32, ptr %dice, align 16, !tbaa !5
br label %for.inc181.sink.split
if.then59: ; preds = %if.then47
br label %for.inc181.sink.split
if.then64: ; preds = %if.then47
br label %for.inc181.sink.split
if.then73: ; preds = %for.body4
switch i32 %f.1.5, label %for.inc181 [
i32 0, label %for.inc181.sink.split
i32 1, label %if.then80
i32 4, label %if.then85
i32 5, label %if.then90
]
if.then80: ; preds = %if.then73
br label %for.inc181.sink.split
if.then85: ; preds = %if.then73
%9 = load i32, ptr %dice, align 16, !tbaa !5
br label %for.inc181.sink.split
if.then90: ; preds = %if.then73
br label %for.inc181.sink.split
if.then99: ; preds = %for.body4
switch i32 %f.1.5, label %for.inc181 [
i32 0, label %for.inc181.sink.split
i32 1, label %if.then106
i32 4, label %if.then111
i32 5, label %if.then116
]
if.then106: ; preds = %if.then99
%10 = load i32, ptr %dice, align 16, !tbaa !5
br label %for.inc181.sink.split
if.then111: ; preds = %if.then99
br label %for.inc181.sink.split
if.then116: ; preds = %if.then99
br label %for.inc181.sink.split
if.then125: ; preds = %for.body4
switch i32 %f.1.5, label %for.inc181 [
i32 0, label %for.inc181.sink.split
i32 2, label %if.then132
i32 3, label %if.then137
i32 5, label %if.then142
]
if.then132: ; preds = %if.then125
br label %for.inc181.sink.split
if.then137: ; preds = %if.then125
%11 = load i32, ptr %dice, align 16, !tbaa !5
br label %for.inc181.sink.split
if.then142: ; preds = %if.then125
br label %for.inc181.sink.split
if.then151: ; preds = %for.body4
switch i32 %f.1.5, label %for.inc181 [
i32 1, label %for.inc181.sink.split
i32 2, label %if.then158
i32 3, label %if.then163
i32 4, label %if.then168
]
if.then158: ; preds = %if.then151
br label %for.inc181.sink.split
if.then163: ; preds = %if.then151
br label %for.inc181.sink.split
if.then168: ; preds = %if.then151
br label %for.inc181.sink.split
for.inc181.sink.split: ; preds = %if.then151, %if.then125, %if.then99, %if.then73, %if.then47, %if.then21, %if.then54, %if.then64, %if.then59, %if.then106, %if.then116, %if.then111, %if.then158, %if.then168, %if.then163, %if.then137, %if.then142, %if.then132, %if.then85, %if.then90, %if.then80, %if.then33, %if.then38, %if.then28
%.sink = phi i32 [ %6, %if.then28 ], [ %5, %if.then38 ], [ %3, %if.then33 ], [ %7, %if.then80 ], [ %6, %if.then90 ], [ %9, %if.then85 ], [ %7, %if.then132 ], [ %5, %if.then142 ], [ %11, %if.then137 ], [ %6, %if.then163 ], [ %4, %if.then168 ], [ %3, %if.then158 ], [ %7, %if.then111 ], [ %3, %if.then116 ], [ %10, %if.then106 ], [ %7, %if.then59 ], [ %4, %if.then64 ], [ %8, %if.then54 ], [ %4, %if.then21 ], [ %5, %if.then47 ], [ %3, %if.then73 ], [ %6, %if.then99 ], [ %4, %if.then125 ], [ %5, %if.then151 ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.sink)
br label %for.inc181
for.inc181: ; preds = %for.inc181.sink.split, %if.then151, %for.body4, %if.then125, %if.then99, %if.then73, %if.then47, %if.then21
%inc182 = add nuw nsw i32 %j.0226, 1
%12 = load i32, ptr %q, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc182, %12
br i1 %cmp3, label %for.body4, label %for.end183, !llvm.loop !9
for.end183: ; preds = %for.inc181, %entry
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dice) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
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"}
|
// AOJ ITP1_11_B Dice II
// 2018.4.29 bal4u
#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_242607/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242607/source.c"
target datalayout = "e-m:e-p270: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>
#include<string.h>
typedef struct {
int men[6];
}dice;
int dice_change(dice *d,int x,int y,int k)
{
if((x == d->men[1] && y == d->men[2]) ||(x == d->men[2] && y == d->men[4]) ||(x == d->men[4] && y == d->men[3]) ||(x == d->men[3] && y == d->men[1])){
k = d->men[0];
return k;
}
else if((x == d->men[0] && y == d->men[3]) ||(x == d->men[3] && y == d->men[5]) ||(x == d->men[5] && y == d->men[2]) ||(x == d->men[2] && y == d->men[0])){
k = d->men[1];
return k;
}
else if((x == d->men[0] && y == d->men[1]) ||(x == d->men[1] && y == d->men[5]) ||(x == d->men[5] && y == d->men[4]) ||(x == d->men[4] && y == d->men[0])){
k = d->men[2];
return k;
}
else if((x == d->men[0] && y == d->men[4]) ||(x == d->men[4] && y == d->men[5]) ||(x == d->men[5] && y == d->men[1]) ||(x == d->men[1] && y == d->men[0])){
k = d->men[3];
return k;
}
else if((x == d->men[0] && y == d->men[2]) ||(x == d->men[2] && y == d->men[5]) ||(x == d->men[5] && y == d->men[3]) ||(x == d->men[3] && y == d->men[0])){
k = d->men[4];
return k;
}
else if((x == d->men[1] && y == d->men[3]) ||(x == d->men[3] && y == d->men[4]) ||(x == d->men[4] && y == d->men[2]) ||(x == d->men[2] && y == d->men[1])){
k = d->men[5];
return k;
}
}
int main()
{
int i,n = 0;
int k = 9;
int x,y;
int dice_right = 0;
dice s;
for (i = 0; i < 6; i++)
scanf("%d", &s.men[i]);
scanf("%d",&n);
int dice_kekka[n];
for(i = 0;i < n;i++)
{
scanf("%d",&x);
scanf("%d",&y);
dice_kekka[i] = dice_change(&s,x,y,k);
}
for(i = 0;i < n;i++) printf("%d\n",dice_kekka[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242650/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242650/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.dice = type { [6 x i32] }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.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 @dice_change(ptr nocapture noundef readonly %d, i32 noundef %x, i32 noundef %y, i32 noundef %k) local_unnamed_addr #0 {
entry:
%arrayidx = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 1
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %x
%arrayidx2 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 2
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3 = icmp eq i32 %1, %y
%or.cond346 = select i1 %cmp, i1 %cmp3, i1 false
br i1 %or.cond346, label %if.then, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%cmp6 = icmp eq i32 %1, %x
%arrayidx9 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 4
%2 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %2, %y
%or.cond347 = select i1 %cmp6, i1 %cmp10, i1 false
br i1 %or.cond347, label %if.then, label %lor.lhs.false11
lor.lhs.false11: ; preds = %lor.lhs.false
%cmp14 = icmp eq i32 %2, %x
%arrayidx17 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 3
%3 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp eq i32 %3, %y
%or.cond348 = select i1 %cmp14, i1 %cmp18, i1 false
br i1 %or.cond348, label %if.then, label %lor.lhs.false19
lor.lhs.false19: ; preds = %lor.lhs.false11
%cmp22 = icmp eq i32 %3, %x
%cmp26 = icmp eq i32 %0, %y
%or.cond = and i1 %cmp26, %cmp22
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %lor.lhs.false11, %lor.lhs.false, %entry, %lor.lhs.false19
%4 = load i32, ptr %d, align 4, !tbaa !5
br label %if.end207
if.else: ; preds = %lor.lhs.false19
%5 = load i32, ptr %d, align 4, !tbaa !5
%cmp31 = icmp eq i32 %5, %x
%cmp35 = icmp eq i32 %3, %y
%or.cond312 = and i1 %cmp35, %cmp31
br i1 %or.cond312, label %if.end207, label %lor.lhs.false36
lor.lhs.false36: ; preds = %if.else
%arrayidx42 = getelementptr inbounds [6 x i32], ptr %d, i64 0, i64 5
%6 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%cmp43 = icmp eq i32 %6, %y
%or.cond349 = select i1 %cmp22, i1 %cmp43, i1 false
br i1 %or.cond349, label %if.end207, label %lor.lhs.false44
lor.lhs.false44: ; preds = %lor.lhs.false36
%cmp47 = icmp eq i32 %6, %x
%cmp51 = icmp eq i32 %1, %y
%or.cond313 = and i1 %cmp51, %cmp47
%cmp59 = icmp eq i32 %5, %y
%or.cond314 = and i1 %cmp6, %cmp59
%or.cond330 = or i1 %or.cond314, %or.cond313
br i1 %or.cond330, label %if.end207, label %if.else63
if.else63: ; preds = %lor.lhs.false44
%or.cond315 = and i1 %cmp26, %cmp31
%cmp78 = icmp eq i32 %6, %y
%or.cond316 = and i1 %cmp, %cmp78
%or.cond331 = or i1 %or.cond315, %or.cond316
%cmp86 = icmp eq i32 %2, %y
%or.cond317 = and i1 %cmp86, %cmp47
%or.cond332 = or i1 %or.cond317, %or.cond331
%or.cond318 = and i1 %cmp14, %cmp59
%or.cond333 = or i1 %or.cond318, %or.cond332
br i1 %or.cond333, label %if.end207, label %if.else98
if.else98: ; preds = %if.else63
%or.cond319 = and i1 %cmp86, %cmp31
%or.cond320 = and i1 %cmp14, %cmp78
%or.cond334 = or i1 %or.cond319, %or.cond320
%or.cond321 = and i1 %cmp26, %cmp47
%or.cond335 = or i1 %or.cond321, %or.cond334
%or.cond322 = and i1 %cmp, %cmp59
%or.cond336 = or i1 %or.cond322, %or.cond335
br i1 %or.cond336, label %if.end207, label %if.else133
if.else133: ; preds = %if.else98
%or.cond323 = and i1 %cmp51, %cmp31
%or.cond324 = and i1 %cmp6, %cmp78
%or.cond337 = or i1 %or.cond323, %or.cond324
%or.cond325 = and i1 %cmp35, %cmp47
%or.cond338 = or i1 %or.cond325, %or.cond337
%or.cond326 = and i1 %cmp22, %cmp59
%or.cond339 = or i1 %or.cond326, %or.cond338
%spec.select = select i1 %or.cond339, i32 %2, i32 %6
br label %if.end207
if.end207: ; preds = %lor.lhs.false36, %if.else133, %if.else98, %if.else63, %lor.lhs.false44, %if.else, %if.then
%retval.0 = phi i32 [ %4, %if.then ], [ %0, %if.else ], [ %0, %lor.lhs.false44 ], [ %1, %if.else63 ], [ %3, %if.else98 ], [ %spec.select, %if.else133 ], [ %0, %lor.lhs.false36 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%s = alloca %struct.dice, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
store i32 0, ptr %n, align 4, !tbaa !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 void @llvm.lifetime.start.p0(i64 24, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %s, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %s, 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 %s, 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 %s, 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 %s, 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
%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
%cmp331 = icmp sgt i32 %3, 0
br i1 %cmp331, label %for.body4, label %for.end21
for.cond13.preheader: ; preds = %dice_change.exit
%4 = icmp sgt i32 %14, 0
br i1 %4, label %for.body15, label %for.end21
for.body4: ; preds = %entry, %dice_change.exit
%indvars.iv = phi i64 [ %indvars.iv.next, %dice_change.exit ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%5 = load i32, ptr %x, align 4, !tbaa !5
%6 = load i32, ptr %y, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp.i = icmp eq i32 %7, %5
%8 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp3.i = icmp eq i32 %8, %6
%or.cond346.i = select i1 %cmp.i, i1 %cmp3.i, i1 false
br i1 %or.cond346.i, label %if.then.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %for.body4
%cmp6.i = icmp eq i32 %8, %5
%9 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%cmp10.i = icmp eq i32 %9, %6
%or.cond347.i = select i1 %cmp6.i, i1 %cmp10.i, i1 false
br i1 %or.cond347.i, label %if.then.i, label %lor.lhs.false11.i
lor.lhs.false11.i: ; preds = %lor.lhs.false.i
%cmp14.i = icmp eq i32 %9, %5
%10 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp18.i = icmp eq i32 %10, %6
%or.cond348.i = select i1 %cmp14.i, i1 %cmp18.i, i1 false
br i1 %or.cond348.i, label %if.then.i, label %lor.lhs.false19.i
lor.lhs.false19.i: ; preds = %lor.lhs.false11.i
%cmp22.i = icmp eq i32 %10, %5
%cmp26.i = icmp eq i32 %7, %6
%or.cond.i = and i1 %cmp26.i, %cmp22.i
br i1 %or.cond.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %lor.lhs.false19.i, %lor.lhs.false11.i, %lor.lhs.false.i, %for.body4
%11 = load i32, ptr %s, align 4, !tbaa !5
br label %dice_change.exit
if.else.i: ; preds = %lor.lhs.false19.i
%12 = load i32, ptr %s, align 4, !tbaa !5
%cmp31.i = icmp eq i32 %12, %5
%or.cond312.i = and i1 %cmp18.i, %cmp31.i
br i1 %or.cond312.i, label %dice_change.exit, label %lor.lhs.false36.i
lor.lhs.false36.i: ; preds = %if.else.i
%13 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp43.i = icmp eq i32 %13, %6
%or.cond349.i = select i1 %cmp22.i, i1 %cmp43.i, i1 false
br i1 %or.cond349.i, label %dice_change.exit, label %lor.lhs.false44.i
lor.lhs.false44.i: ; preds = %lor.lhs.false36.i
%cmp47.i = icmp eq i32 %13, %5
%or.cond313.i = and i1 %cmp3.i, %cmp47.i
%cmp59.i = icmp eq i32 %12, %6
%or.cond314.i = and i1 %cmp6.i, %cmp59.i
%or.cond330.i = or i1 %or.cond314.i, %or.cond313.i
br i1 %or.cond330.i, label %dice_change.exit, label %if.else63.i
if.else63.i: ; preds = %lor.lhs.false44.i
%or.cond315.i = and i1 %cmp26.i, %cmp31.i
%or.cond316.i = and i1 %cmp.i, %cmp43.i
%or.cond331.i = or i1 %or.cond315.i, %or.cond316.i
%or.cond317.i = and i1 %cmp10.i, %cmp47.i
%or.cond332.i = or i1 %or.cond317.i, %or.cond331.i
%or.cond318.i = and i1 %cmp14.i, %cmp59.i
%or.cond333.i = or i1 %or.cond318.i, %or.cond332.i
br i1 %or.cond333.i, label %dice_change.exit, label %if.else98.i
if.else98.i: ; preds = %if.else63.i
%or.cond319.i = and i1 %cmp10.i, %cmp31.i
%or.cond320.i = and i1 %cmp14.i, %cmp43.i
%or.cond334.i = or i1 %or.cond319.i, %or.cond320.i
%or.cond321.i = and i1 %cmp26.i, %cmp47.i
%or.cond335.i = or i1 %or.cond321.i, %or.cond334.i
%or.cond322.i = and i1 %cmp.i, %cmp59.i
%or.cond336.i = or i1 %or.cond322.i, %or.cond335.i
br i1 %or.cond336.i, label %dice_change.exit, label %if.else133.i
if.else133.i: ; preds = %if.else98.i
%or.cond323.i = and i1 %cmp3.i, %cmp31.i
%or.cond324.i = and i1 %cmp6.i, %cmp43.i
%or.cond337.i = or i1 %or.cond323.i, %or.cond324.i
%or.cond325.i = and i1 %cmp18.i, %cmp47.i
%or.cond338.i = or i1 %or.cond325.i, %or.cond337.i
%or.cond326.i = and i1 %cmp22.i, %cmp59.i
%or.cond339.i = or i1 %or.cond326.i, %or.cond338.i
%spec.select.i = select i1 %or.cond339.i, i32 %9, i32 %13
br label %dice_change.exit
dice_change.exit: ; preds = %if.then.i, %if.else.i, %lor.lhs.false36.i, %lor.lhs.false44.i, %if.else63.i, %if.else98.i, %if.else133.i
%retval.0.i = phi i32 [ %11, %if.then.i ], [ %7, %if.else.i ], [ %7, %lor.lhs.false44.i ], [ %8, %if.else63.i ], [ %10, %if.else98.i ], [ %spec.select.i, %if.else133.i ], [ %7, %lor.lhs.false36.i ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %retval.0.i, ptr %arrayidx9, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %15
br i1 %cmp3, label %for.body4, label %for.cond13.preheader, !llvm.loop !9
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv37 = phi i64 [ %indvars.iv.next38, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv37
%16 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16)
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp14 = icmp slt i64 %indvars.iv.next38, %18
br i1 %cmp14, label %for.body15, label %for.end21, !llvm.loop !11
for.end21: ; preds = %for.body15, %entry, %for.cond13.preheader
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %s) #5
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) #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
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
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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/* common define */
/* TODO create common.h */
#define U1 unsigned char
#define S1 char
#define S4 int
#define DU double
#define VD void
#define TRUE (1)
#define FALSE (0)
/* define */
#define MAX_COMMAND_BYTES (1)
#define MAX_COMMAND_COUNT (100)
#define NUM_KIND_OF_COMMAND (6)
#define NUM_FACE_OF_DICE (6)
typedef struct st_dice
{
S4 s4_top;
S4 s4_north;
S4 s4_east;
S4 s4_west;
S4 s4_south;
S4 s4_bottom;
}ST_DICE;
typedef struct st_commands_string
{
S4 s4_command_count;
U1 u1_commands_string[MAX_COMMAND_COUNT][MAX_COMMAND_BYTES + 1];
}ST_COMMANDS_STRING;
typedef VD(*COMMNAD_FUNC_TYPE)(ST_DICE*);
typedef struct st_command
{
U1 u1_command_string[MAX_COMMAND_BYTES + 1];
COMMNAD_FUNC_TYPE st_command_func;
}ST_COMMAND;
static VD vd_s_move_dice_to_answer_question(ST_DICE*, S4, S4);
static VD vd_s_move_dice_multiply(ST_COMMANDS_STRING*, ST_DICE*);
static VD vd_s_move_dice(U1[MAX_COMMAND_BYTES + 1], ST_DICE*);
static VD vd_s_North(ST_DICE*);
static VD vd_s_East(ST_DICE*);
static VD vd_s_West(ST_DICE*);
static VD vd_s_South(ST_DICE*);
static VD vd_s_Right(ST_DICE*);
static VD vd_s_Left(ST_DICE*);
const ST_COMMAND st_c_command[NUM_KIND_OF_COMMAND] =
{
{ "N", vd_s_North },
{ "E", vd_s_East },
{ "W", vd_s_West },
{ "S", vd_s_South },
{ "R", vd_s_Right },
{ "L", vd_s_Left }
};
S4 main()
{
ST_DICE st_t_dice;
S4 s4_t_index_dice_number;
S4 s4_t_dice_nubmers[NUM_FACE_OF_DICE + 1];
S4 s4_t_number_of_question;
S4 s4_t_question_count;
S4 s4_t_question_dice_top;
S4 s4_t_question_dice_front;
U1 u1_tp_commands_string[MAX_COMMAND_COUNT + 1];
ST_COMMANDS_STRING st_t_commands_string;
/* Input the dice numbers. */
for (s4_t_index_dice_number = (S4)1; s4_t_index_dice_number <= (S4)NUM_FACE_OF_DICE; s4_t_index_dice_number++)
{
(VD)scanf("%d ", &(s4_t_dice_nubmers[s4_t_index_dice_number]));
}
st_t_dice.s4_top = s4_t_dice_nubmers[1];
st_t_dice.s4_south = s4_t_dice_nubmers[2];
st_t_dice.s4_east = s4_t_dice_nubmers[3];
st_t_dice.s4_west = s4_t_dice_nubmers[4];
st_t_dice.s4_north = s4_t_dice_nubmers[5];
st_t_dice.s4_bottom = s4_t_dice_nubmers[6];
/* Input the number of questions */
(VD)scanf("%d ", &s4_t_number_of_question);
for (s4_t_question_count = (S4)0; s4_t_question_count < s4_t_number_of_question; s4_t_question_count++)
{
/* Input the top and front face for question */
(VD)scanf("%d ", &s4_t_question_dice_top);
(VD)scanf("%d ", &s4_t_question_dice_front);
/* Move the dice to answer question */
vd_s_move_dice_to_answer_question(&st_t_dice, s4_t_question_dice_top, s4_t_question_dice_front);
/* Print the number of the right of the dice. */
printf("%d\n", st_t_dice.s4_east);
}
return((S4)0);
}
static VD vd_s_move_dice_to_answer_question(ST_DICE* st_ap_dice, S4 s4_a_question_dice_top, S4 s4_a_question_dice_front)
{
S4 s4_t_dice_index;
/* Move the dice to meet top */
s4_t_dice_index = (S4)0;
while ((s4_t_dice_index < (S4)3) &&
(st_ap_dice->s4_top != s4_a_question_dice_top))
{
vd_s_North(st_ap_dice);
s4_t_dice_index++;
}
s4_t_dice_index = (S4)0;
while ((s4_t_dice_index < (S4)3) &&
(st_ap_dice->s4_top != s4_a_question_dice_top))
{
vd_s_West(st_ap_dice);
s4_t_dice_index++;
}
/* Move the dice to meet front */
s4_t_dice_index = (S4)0;
while ((s4_t_dice_index < (S4)3) &&
(st_ap_dice->s4_south != s4_a_question_dice_front))
{
vd_s_Right(st_ap_dice);
s4_t_dice_index++;
}
return;
}
static VD vd_s_move_dice_multiply(ST_COMMANDS_STRING* st_ap_commands_string, ST_DICE* st_ap_dice)
{
S4 s4_t_commandIndex;
/* Move the dice */
for (s4_t_commandIndex = (S4)0; s4_t_commandIndex < st_ap_commands_string->s4_command_count; s4_t_commandIndex++)
{
(VD)vd_s_move_dice(st_ap_commands_string->u1_commands_string[s4_t_commandIndex], st_ap_dice);
}
return;
}
static VD vd_s_move_dice(U1 u1_ap_command_string[MAX_COMMAND_BYTES + 1], ST_DICE* st_ap_dice)
{
S4 s4_t_command_index;
S4 s4_t_isMatch;
/* Excecute command. */
for (s4_t_command_index = (S4)0; s4_t_command_index < (S4)NUM_KIND_OF_COMMAND; s4_t_command_index++)
{
s4_t_isMatch = strcmp(u1_ap_command_string, st_c_command[s4_t_command_index].u1_command_string);
if (s4_t_isMatch == (S4)0)
{
st_c_command[s4_t_command_index].st_command_func(st_ap_dice);
}
}
return;
}
static VD vd_s_North(ST_DICE* st_ap_dice)
{
S4 s4_t_temp;
s4_t_temp = st_ap_dice->s4_north;
st_ap_dice->s4_north = st_ap_dice->s4_top;
st_ap_dice->s4_top = st_ap_dice->s4_south;
st_ap_dice->s4_south = st_ap_dice->s4_bottom;
st_ap_dice->s4_bottom = s4_t_temp;
}
static VD vd_s_East(ST_DICE* st_ap_dice)
{
S4 s4_t_temp;
s4_t_temp = st_ap_dice->s4_east;
st_ap_dice->s4_east = st_ap_dice->s4_top;
st_ap_dice->s4_top = st_ap_dice->s4_west;
st_ap_dice->s4_west = st_ap_dice->s4_bottom;
st_ap_dice->s4_bottom = s4_t_temp;
}
static VD vd_s_West(ST_DICE* st_ap_dice)
{
S4 s4_t_temp;
s4_t_temp = st_ap_dice->s4_west;
st_ap_dice->s4_west = st_ap_dice->s4_top;
st_ap_dice->s4_top = st_ap_dice->s4_east;
st_ap_dice->s4_east = st_ap_dice->s4_bottom;
st_ap_dice->s4_bottom = s4_t_temp;
}
static VD vd_s_South(ST_DICE* st_ap_dice)
{
S4 s4_t_temp;
s4_t_temp = st_ap_dice->s4_south;
st_ap_dice->s4_south = st_ap_dice->s4_top;
st_ap_dice->s4_top = st_ap_dice->s4_north;
st_ap_dice->s4_north = st_ap_dice->s4_bottom;
st_ap_dice->s4_bottom = s4_t_temp;
}
static VD vd_s_Right(ST_DICE* st_ap_dice)
{
S4 s4_t_temp;
s4_t_temp = st_ap_dice->s4_north;
st_ap_dice->s4_north = st_ap_dice->s4_west;
st_ap_dice->s4_west = st_ap_dice->s4_south;
st_ap_dice->s4_south = st_ap_dice->s4_east;
st_ap_dice->s4_east = s4_t_temp;
}
static VD vd_s_Left(ST_DICE* st_ap_dice)
{
S4 s4_t_temp;
s4_t_temp = st_ap_dice->s4_north;
st_ap_dice->s4_north = st_ap_dice->s4_east;
st_ap_dice->s4_east = st_ap_dice->s4_south;
st_ap_dice->s4_south = st_ap_dice->s4_west;
st_ap_dice->s4_west = s4_t_temp;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242694/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242694/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.st_command = type { [2 x i8], ptr }
%struct.st_dice = type { i32, i32, i32, i32, i32, i32 }
@st_c_command = dso_local local_unnamed_addr constant [6 x %struct.st_command] [%struct.st_command { [2 x i8] c"N\00", ptr @vd_s_North }, %struct.st_command { [2 x i8] c"E\00", ptr @vd_s_East }, %struct.st_command { [2 x i8] c"W\00", ptr @vd_s_West }, %struct.st_command { [2 x i8] c"S\00", ptr @vd_s_South }, %struct.st_command { [2 x i8] c"R\00", ptr @vd_s_Right }, %struct.st_command { [2 x i8] c"L\00", ptr @vd_s_Left }], align 16
@.str = private unnamed_addr constant [4 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: readwrite) uwtable
define internal void @vd_s_North(ptr nocapture noundef %st_ap_dice) #0 {
entry:
%s4_north = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 1
%0 = load i32, ptr %s4_north, align 4, !tbaa !5
%1 = load i32, ptr %st_ap_dice, align 4, !tbaa !10
store i32 %1, ptr %s4_north, align 4, !tbaa !5
%s4_south = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 4
%2 = load i32, ptr %s4_south, align 4, !tbaa !11
store i32 %2, ptr %st_ap_dice, align 4, !tbaa !10
%s4_bottom = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 5
%3 = load i32, ptr %s4_bottom, align 4, !tbaa !12
store i32 %3, ptr %s4_south, align 4, !tbaa !11
store i32 %0, ptr %s4_bottom, align 4, !tbaa !12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define internal void @vd_s_East(ptr nocapture noundef %st_ap_dice) #0 {
entry:
%s4_east = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 2
%0 = load i32, ptr %s4_east, align 4, !tbaa !13
%1 = load i32, ptr %st_ap_dice, align 4, !tbaa !10
store i32 %1, ptr %s4_east, align 4, !tbaa !13
%s4_west = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 3
%2 = load i32, ptr %s4_west, align 4, !tbaa !14
store i32 %2, ptr %st_ap_dice, align 4, !tbaa !10
%s4_bottom = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 5
%3 = load i32, ptr %s4_bottom, align 4, !tbaa !12
store i32 %3, ptr %s4_west, align 4, !tbaa !14
store i32 %0, ptr %s4_bottom, align 4, !tbaa !12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define internal void @vd_s_West(ptr nocapture noundef %st_ap_dice) #0 {
entry:
%s4_west = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 3
%0 = load i32, ptr %s4_west, align 4, !tbaa !14
%1 = load i32, ptr %st_ap_dice, align 4, !tbaa !10
store i32 %1, ptr %s4_west, align 4, !tbaa !14
%s4_east = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 2
%2 = load i32, ptr %s4_east, align 4, !tbaa !13
store i32 %2, ptr %st_ap_dice, align 4, !tbaa !10
%s4_bottom = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 5
%3 = load i32, ptr %s4_bottom, align 4, !tbaa !12
store i32 %3, ptr %s4_east, align 4, !tbaa !13
store i32 %0, ptr %s4_bottom, align 4, !tbaa !12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define internal void @vd_s_South(ptr nocapture noundef %st_ap_dice) #0 {
entry:
%s4_south = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 4
%0 = load i32, ptr %s4_south, align 4, !tbaa !11
%1 = load i32, ptr %st_ap_dice, align 4, !tbaa !10
store i32 %1, ptr %s4_south, align 4, !tbaa !11
%s4_north = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 1
%2 = load i32, ptr %s4_north, align 4, !tbaa !5
store i32 %2, ptr %st_ap_dice, align 4, !tbaa !10
%s4_bottom = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 5
%3 = load i32, ptr %s4_bottom, align 4, !tbaa !12
store i32 %3, ptr %s4_north, align 4, !tbaa !5
store i32 %0, ptr %s4_bottom, align 4, !tbaa !12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define internal void @vd_s_Right(ptr nocapture noundef %st_ap_dice) #0 {
entry:
%s4_north = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 1
%0 = load <4 x i32>, ptr %s4_north, align 4, !tbaa !15
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
store <4 x i32> %1, ptr %s4_north, align 4, !tbaa !15
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define internal void @vd_s_Left(ptr nocapture noundef %st_ap_dice) #0 {
entry:
%s4_north = getelementptr inbounds %struct.st_dice, ptr %st_ap_dice, i64 0, i32 1
%0 = load <4 x i32>, ptr %s4_north, align 4, !tbaa !15
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2>
store <4 x i32> %1, ptr %s4_north, align 4, !tbaa !15
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%s4_t_dice_nubmers = alloca [7 x i32], align 16
%s4_t_number_of_question = alloca i32, align 4
%s4_t_question_dice_top = alloca i32, align 4
%s4_t_question_dice_front = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %s4_t_dice_nubmers) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s4_t_number_of_question) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s4_t_question_dice_top) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s4_t_question_dice_front) #4
%arrayidx = getelementptr inbounds [7 x i32], ptr %s4_t_dice_nubmers, 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 %s4_t_dice_nubmers, 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 %s4_t_dice_nubmers, 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 %s4_t_dice_nubmers, 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 %s4_t_dice_nubmers, 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 %s4_t_dice_nubmers, i64 0, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !15
%1 = load i32, ptr %arrayidx.1, align 8, !tbaa !15
%2 = load i32, ptr %arrayidx.2, align 4, !tbaa !15
%3 = load i32, ptr %arrayidx.3, align 16, !tbaa !15
%4 = load i32, ptr %arrayidx.4, align 4, !tbaa !15
%5 = load i32, ptr %arrayidx.5, align 8, !tbaa !15
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s4_t_number_of_question)
%6 = load i32, ptr %s4_t_number_of_question, align 4, !tbaa !15
%cmp929 = icmp sgt i32 %6, 0
br i1 %cmp929, label %for.body10, label %for.end17
for.body10: ; preds = %entry, %vd_s_move_dice_to_answer_question.exit
%s4_t_question_count.036 = phi i32 [ %inc16, %vd_s_move_dice_to_answer_question.exit ], [ 0, %entry ]
%st_t_dice.sroa.0.035 = phi i32 [ %st_t_dice.sroa.0.2, %vd_s_move_dice_to_answer_question.exit ], [ %0, %entry ]
%st_t_dice.sroa.10.034 = phi i32 [ %st_t_dice.sroa.10.3, %vd_s_move_dice_to_answer_question.exit ], [ %4, %entry ]
%st_t_dice.sroa.40.033 = phi i32 [ %st_t_dice.sroa.40.3, %vd_s_move_dice_to_answer_question.exit ], [ %1, %entry ]
%st_t_dice.sroa.49.032 = phi i32 [ %st_t_dice.sroa.49.2, %vd_s_move_dice_to_answer_question.exit ], [ %5, %entry ]
%st_t_dice.sroa.30.031 = phi i32 [ %st_t_dice.sroa.30.2, %vd_s_move_dice_to_answer_question.exit ], [ %3, %entry ]
%st_t_dice.sroa.19.030 = phi i32 [ %st_t_dice.sroa.19.2, %vd_s_move_dice_to_answer_question.exit ], [ %2, %entry ]
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s4_t_question_dice_top)
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s4_t_question_dice_front)
%7 = load i32, ptr %s4_t_question_dice_top, align 4, !tbaa !15
%8 = load i32, ptr %s4_t_question_dice_front, align 4, !tbaa !15
%cmp1.not.i = icmp eq i32 %st_t_dice.sroa.0.035, %7
br i1 %cmp1.not.i, label %while.end10.i, label %while.body.i
while.body.i: ; preds = %for.body10
%cmp1.not.1.i = icmp eq i32 %st_t_dice.sroa.40.033, %7
br i1 %cmp1.not.1.i, label %while.end10.i, label %while.body.1.i
while.body.1.i: ; preds = %while.body.i
%cmp1.not.2.i = icmp eq i32 %st_t_dice.sroa.49.032, %7
br i1 %cmp1.not.2.i, label %while.end10.i, label %while.end.i
while.end.i: ; preds = %while.body.1.i
%cmp6.not.i = icmp eq i32 %st_t_dice.sroa.10.034, %7
br i1 %cmp6.not.i, label %while.end10.i, label %while.body8.i
while.body8.i: ; preds = %while.end.i
%cmp6.not.1.i = icmp eq i32 %st_t_dice.sroa.19.030, %7
br i1 %cmp6.not.1.i, label %while.end10.i, label %while.body8.2.i
while.body8.2.i: ; preds = %while.body8.i
br label %while.end10.i
while.end10.i: ; preds = %for.body10, %while.body.i, %while.body.1.i, %while.body8.2.i, %while.body8.i, %while.end.i
%st_t_dice.sroa.19.1 = phi i32 [ %st_t_dice.sroa.19.030, %while.end.i ], [ %st_t_dice.sroa.40.033, %while.body8.i ], [ %st_t_dice.sroa.10.034, %while.body8.2.i ], [ %st_t_dice.sroa.19.030, %while.body.1.i ], [ %st_t_dice.sroa.19.030, %while.body.i ], [ %st_t_dice.sroa.19.030, %for.body10 ]
%st_t_dice.sroa.30.1 = phi i32 [ %st_t_dice.sroa.30.031, %while.end.i ], [ %st_t_dice.sroa.10.034, %while.body8.i ], [ %st_t_dice.sroa.40.033, %while.body8.2.i ], [ %st_t_dice.sroa.30.031, %while.body.1.i ], [ %st_t_dice.sroa.30.031, %while.body.i ], [ %st_t_dice.sroa.30.031, %for.body10 ]
%st_t_dice.sroa.49.2 = phi i32 [ %st_t_dice.sroa.40.033, %while.end.i ], [ %st_t_dice.sroa.30.031, %while.body8.i ], [ %st_t_dice.sroa.19.030, %while.body8.2.i ], [ %st_t_dice.sroa.0.035, %while.body.1.i ], [ %st_t_dice.sroa.10.034, %while.body.i ], [ %st_t_dice.sroa.49.032, %for.body10 ]
%st_t_dice.sroa.40.2 = phi i32 [ %st_t_dice.sroa.0.035, %while.end.i ], [ %st_t_dice.sroa.0.035, %while.body8.i ], [ %st_t_dice.sroa.0.035, %while.body8.2.i ], [ %st_t_dice.sroa.10.034, %while.body.1.i ], [ %st_t_dice.sroa.49.032, %while.body.i ], [ %st_t_dice.sroa.40.033, %for.body10 ]
%st_t_dice.sroa.10.2 = phi i32 [ %st_t_dice.sroa.49.032, %while.end.i ], [ %st_t_dice.sroa.49.032, %while.body8.i ], [ %st_t_dice.sroa.49.032, %while.body8.2.i ], [ %st_t_dice.sroa.40.033, %while.body.1.i ], [ %st_t_dice.sroa.0.035, %while.body.i ], [ %st_t_dice.sroa.10.034, %for.body10 ]
%st_t_dice.sroa.0.2 = phi i32 [ %st_t_dice.sroa.10.034, %while.end.i ], [ %st_t_dice.sroa.19.030, %while.body8.i ], [ %st_t_dice.sroa.30.031, %while.body8.2.i ], [ %st_t_dice.sroa.49.032, %while.body.1.i ], [ %st_t_dice.sroa.40.033, %while.body.i ], [ %st_t_dice.sroa.0.035, %for.body10 ]
%cmp14.not.i = icmp eq i32 %st_t_dice.sroa.40.2, %8
br i1 %cmp14.not.i, label %vd_s_move_dice_to_answer_question.exit, label %while.body16.i
while.body16.i: ; preds = %while.end10.i
%cmp14.not.1.i = icmp eq i32 %st_t_dice.sroa.19.1, %8
br i1 %cmp14.not.1.i, label %vd_s_move_dice_to_answer_question.exit, label %while.body16.1.i
while.body16.1.i: ; preds = %while.body16.i
%cmp14.not.2.i = icmp eq i32 %st_t_dice.sroa.10.2, %8
br i1 %cmp14.not.2.i, label %vd_s_move_dice_to_answer_question.exit, label %while.body16.2.i
while.body16.2.i: ; preds = %while.body16.1.i
br label %vd_s_move_dice_to_answer_question.exit
vd_s_move_dice_to_answer_question.exit: ; preds = %while.end10.i, %while.body16.i, %while.body16.1.i, %while.body16.2.i
%st_t_dice.sroa.19.2 = phi i32 [ %st_t_dice.sroa.19.1, %while.end10.i ], [ %st_t_dice.sroa.10.2, %while.body16.i ], [ %st_t_dice.sroa.30.1, %while.body16.1.i ], [ %st_t_dice.sroa.40.2, %while.body16.2.i ]
%st_t_dice.sroa.30.2 = phi i32 [ %st_t_dice.sroa.30.1, %while.end10.i ], [ %st_t_dice.sroa.40.2, %while.body16.i ], [ %st_t_dice.sroa.19.1, %while.body16.1.i ], [ %st_t_dice.sroa.10.2, %while.body16.2.i ]
%st_t_dice.sroa.40.3 = phi i32 [ %8, %while.end10.i ], [ %8, %while.body16.i ], [ %8, %while.body16.1.i ], [ %st_t_dice.sroa.30.1, %while.body16.2.i ]
%st_t_dice.sroa.10.3 = phi i32 [ %st_t_dice.sroa.10.2, %while.end10.i ], [ %st_t_dice.sroa.30.1, %while.body16.i ], [ %st_t_dice.sroa.40.2, %while.body16.1.i ], [ %st_t_dice.sroa.19.1, %while.body16.2.i ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %st_t_dice.sroa.19.2)
%inc16 = add nuw nsw i32 %s4_t_question_count.036, 1
%9 = load i32, ptr %s4_t_number_of_question, align 4, !tbaa !15
%cmp9 = icmp slt i32 %inc16, %9
br i1 %cmp9, label %for.body10, label %for.end17, !llvm.loop !16
for.end17: ; preds = %vd_s_move_dice_to_answer_question.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s4_t_question_dice_front) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s4_t_question_dice_top) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s4_t_number_of_question) #4
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %s4_t_dice_nubmers) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"st_dice", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!6, !7, i64 16}
!12 = !{!6, !7, i64 20}
!13 = !{!6, !7, i64 8}
!14 = !{!6, !7, i64 12}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
//関数プロトタイプ宣言
void diceRoll(int *d,char *r);
int main(){
int dice[6]; //サイコロ
int q; //質問の数
int up; //サイコロの上面
int front; //サイコロの前面
//サイコロの作成
for(int i = 0;i < 6;i++){
scanf("%d",&dice[i]);
}
//質問の数の入力
scanf("%d",&q);
for(int i = 0;i < q;i++){
//上面と前面の入力
scanf("%d %d",&up,&front);
//サイコロの上面が入力されたものと違うとき
if(dice[0] != up){
//入力された上面が前面にあったとき
if(dice[1] == up){
diceRoll(dice,"N");
}
//右面にあったとき
else if(dice[2] == up){
diceRoll(dice,"W");
}
//左面にあったとき
else if(dice[3] == up){
diceRoll(dice,"E");
}
//後面にあったとき
else if(dice[4] == up){
diceRoll(dice,"S");
}
//底面にあったとき
else if(dice[5] == up){
diceRoll(dice,"NN");
}
}
//サイコロの前面が入力されたものと違うとき
if(dice[1] != front){
//入力された前面が右面にあったとき
if(dice[2] == front){
diceRoll(dice,"R");
}
//左面にあったとき
else if(dice[3] == front){
diceRoll(dice,"L");
}
//後面にあったとき
else if(dice[4] == front){
diceRoll(dice,"RR");
}
}
//右面を表示
printf("%d\n",dice[2]);
}
return 0;
}
void diceRoll(int *d,char *r){
int x; //入れ替え用変数
for(int i = 0;r[i] != '\0';i++){
switch(r[i]){
//右に転がす
case 'E':
x = d[0];
d[0] = d[3];
d[3] = d[5];
d[5] = d[2];
d[2] = x;
break;
//奥に転がす
case 'N':
x = d[0];
d[0] = d[1];
d[1] = d[5];
d[5] = d[4];
d[4] = x;
break;
//手前に転がす
case 'S':
x = d[0];
d[0] = d[4];
d[4] = d[5];
d[5] = d[1];
d[1] = x;
break;
//左に転がす
case 'W':
x = d[0];
d[0] = d[2];
d[2] = d[5];
d[5] = d[3];
d[3] = x;
break;
//右に90度回す
case 'R':
x = d[1];
d[1] = d[2];
d[2] = d[4];
d[4] = d[3];
d[3] = x;
break;
//左に90度回す
case 'L':
x = d[1];
d[1] = d[3];
d[3] = d[4];
d[4] = d[2];
d[2] = x;
break;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242737/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.10 = 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
%up = alloca i32, align 4
%front = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dice) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %up) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %front) #4
%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
%cmp4235 = icmp sgt i32 %0, 0
br i1 %cmp4235, label %for.body6, label %for.cond.cleanup5
for.cond.cleanup5: ; preds = %if.end57, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %front) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %up) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dice) #4
ret i32 0
for.body6: ; preds = %entry, %if.end57
%i2.0236 = phi i32 [ %inc61, %if.end57 ], [ 0, %entry ]
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %up, ptr noundef nonnull %front)
%1 = load i32, ptr %dice, align 16, !tbaa !5
%2 = load i32, ptr %up, align 4, !tbaa !5
%cmp9.not = icmp eq i32 %1, %2
br i1 %cmp9.not, label %if.end36, label %if.then
if.then: ; preds = %for.body6
%3 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp11 = icmp eq i32 %3, %2
br i1 %cmp11, label %for.inc.i, label %if.else
for.inc.i: ; preds = %if.then
%4 = load i32, ptr %dice, align 16, !tbaa !5
%5 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %5, ptr %dice, align 16, !tbaa !5
%6 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %6, ptr %arrayidx.1, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %7, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %4, ptr %arrayidx.4, align 16, !tbaa !5
br label %if.end36
if.else: ; preds = %if.then
%8 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp14 = icmp eq i32 %8, %2
br i1 %cmp14, label %for.inc.i81, label %if.else17
for.inc.i81: ; preds = %if.else
%9 = load i32, ptr %dice, align 16, !tbaa !5
%10 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
store i32 %10, ptr %dice, align 16, !tbaa !5
%11 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %11, ptr %arrayidx.2, align 8, !tbaa !5
%12 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %12, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.3, align 4, !tbaa !5
br label %if.end36
if.else17: ; preds = %if.else
%13 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp19 = icmp eq i32 %13, %2
br i1 %cmp19, label %for.inc.i104, label %if.else22
for.inc.i104: ; preds = %if.else17
%14 = load i32, ptr %dice, align 16, !tbaa !5
%15 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %15, ptr %dice, align 16, !tbaa !5
%16 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %16, ptr %arrayidx.3, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
store i32 %17, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.2, align 8, !tbaa !5
br label %if.end36
if.else22: ; preds = %if.else17
%18 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp24 = icmp eq i32 %18, %2
br i1 %cmp24, label %for.inc.i127, label %if.else27
for.inc.i127: ; preds = %if.else22
%19 = load i32, ptr %dice, align 16, !tbaa !5
%20 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %20, ptr %dice, align 16, !tbaa !5
%21 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %21, ptr %arrayidx.4, align 16, !tbaa !5
%22 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %22, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %19, ptr %arrayidx.1, align 4, !tbaa !5
br label %if.end36
if.else27: ; preds = %if.else22
%23 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%cmp29 = icmp eq i32 %23, %2
br i1 %cmp29, label %for.inc.i150.1, label %if.end36
for.inc.i150.1: ; preds = %if.else27
%24 = load i32, ptr %dice, align 16, !tbaa !5
%25 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %25, ptr %dice, align 16, !tbaa !5
%26 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %26, ptr %arrayidx.1, align 4, !tbaa !5
%27 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %27, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %24, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %26, ptr %dice, align 16, !tbaa !5
store i32 %27, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %24, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %25, ptr %arrayidx.4, align 16, !tbaa !5
br label %if.end36
if.end36: ; preds = %for.inc.i150.1, %for.inc.i127, %for.inc.i104, %for.inc.i81, %for.inc.i, %if.else27, %for.body6
%28 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%29 = load i32, ptr %front, align 4, !tbaa !5
%cmp38.not = icmp eq i32 %28, %29
br i1 %cmp38.not, label %if.end57, label %if.then39
if.then39: ; preds = %if.end36
%30 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%cmp41 = icmp eq i32 %30, %29
br i1 %cmp41, label %if.end57.sink.split, label %if.else44
if.else44: ; preds = %if.then39
%31 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%cmp46 = icmp eq i32 %31, %29
br i1 %cmp46, label %if.end57.sink.split, label %if.else49
if.else49: ; preds = %if.else44
%32 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp51 = icmp eq i32 %32, %29
br i1 %cmp51, label %for.inc.i219.1, label %if.end57
for.inc.i219.1: ; preds = %if.else49
%33 = load <4 x i32>, ptr %arrayidx.1, align 4, !tbaa !5
%34 = shufflevector <4 x i32> %33, <4 x i32> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2>
store <4 x i32> %34, ptr %arrayidx.1, align 4, !tbaa !5
br label %if.end57.sink.split
if.end57.sink.split: ; preds = %if.else44, %if.then39, %for.inc.i219.1
%arrayidx.2.sink248 = phi ptr [ %arrayidx.2, %for.inc.i219.1 ], [ %arrayidx.2, %if.then39 ], [ %arrayidx.3, %if.else44 ]
%arrayidx.3.sink245 = phi ptr [ %arrayidx.3, %for.inc.i219.1 ], [ %arrayidx.3, %if.then39 ], [ %arrayidx.2, %if.else44 ]
%35 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%36 = load i32, ptr %arrayidx.2.sink248, align 4, !tbaa !5
store i32 %36, ptr %arrayidx.1, align 4, !tbaa !5
%37 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %37, ptr %arrayidx.2.sink248, align 4, !tbaa !5
%38 = load i32, ptr %arrayidx.3.sink245, align 4, !tbaa !5
store i32 %38, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %35, ptr %arrayidx.3.sink245, align 4, !tbaa !5
br label %if.end57
if.end57: ; preds = %if.end57.sink.split, %if.else49, %if.end36
%39 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %39)
%inc61 = add nuw nsw i32 %i2.0236, 1
%40 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc61, %40
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @diceRoll(ptr nocapture noundef %d, ptr nocapture noundef readonly %r) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %r, align 1, !tbaa !11
%cmp.not113 = icmp eq i8 %0, 0
br i1 %cmp.not113, label %for.cond.cleanup, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%arrayidx50 = getelementptr inbounds i32, ptr %d, i64 1
%arrayidx51 = getelementptr inbounds i32, ptr %d, i64 3
%arrayidx53 = getelementptr inbounds i32, ptr %d, i64 4
%arrayidx55 = getelementptr inbounds i32, ptr %d, i64 2
%arrayidx35 = getelementptr inbounds i32, ptr %d, i64 5
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
ret void
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%1 = phi i8 [ %0, %for.body.lr.ph ], [ %6, %for.inc ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 69, label %for.inc.sink.split
i32 78, label %sw.bb13
i32 83, label %sw.bb22
i32 87, label %sw.bb31
i32 82, label %sw.bb40
i32 76, label %sw.bb49
]
sw.bb13: ; preds = %for.body
br label %for.inc.sink.split
sw.bb22: ; preds = %for.body
br label %for.inc.sink.split
sw.bb31: ; preds = %for.body
br label %for.inc.sink.split
sw.bb40: ; preds = %for.body
br label %for.inc.sink.split
sw.bb49: ; preds = %for.body
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %for.body, %sw.bb49, %sw.bb40, %sw.bb31, %sw.bb22, %sw.bb13
%d.sink121 = phi ptr [ %d, %sw.bb13 ], [ %d, %sw.bb22 ], [ %d, %sw.bb31 ], [ %arrayidx50, %sw.bb40 ], [ %arrayidx50, %sw.bb49 ], [ %d, %for.body ]
%arrayidx51.sink120 = phi ptr [ %arrayidx50, %sw.bb13 ], [ %arrayidx53, %sw.bb22 ], [ %arrayidx55, %sw.bb31 ], [ %arrayidx55, %sw.bb40 ], [ %arrayidx51, %sw.bb49 ], [ %arrayidx51, %for.body ]
%arrayidx35.sink118 = phi ptr [ %arrayidx35, %sw.bb13 ], [ %arrayidx35, %sw.bb22 ], [ %arrayidx35, %sw.bb31 ], [ %arrayidx53, %sw.bb40 ], [ %arrayidx53, %sw.bb49 ], [ %arrayidx35, %for.body ]
%arrayidx55.sink116 = phi ptr [ %arrayidx53, %sw.bb13 ], [ %arrayidx50, %sw.bb22 ], [ %arrayidx51, %sw.bb31 ], [ %arrayidx51, %sw.bb40 ], [ %arrayidx55, %sw.bb49 ], [ %arrayidx55, %for.body ]
%2 = load i32, ptr %d.sink121, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx51.sink120, align 4, !tbaa !5
store i32 %3, ptr %d.sink121, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx35.sink118, align 4, !tbaa !5
store i32 %4, ptr %arrayidx51.sink120, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx55.sink116, align 4, !tbaa !5
store i32 %5, ptr %arrayidx35.sink118, align 4, !tbaa !5
store i32 %2, ptr %arrayidx55.sink116, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds i8, ptr %r, i64 %indvars.iv.next
%6 = load i8, ptr %arrayidx, align 1, !tbaa !11
%cmp.not = icmp eq i8 %6, 0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
|
#include <stdio.h>
struct dice {
int area[6];
};
void diceroll(const char order, struct dice *dice)
{
int temp;
if (order == 'N') {
temp = dice->area[0];
dice->area[0] = dice->area[1];
dice->area[1] = dice->area[5];
dice->area[5] = dice->area[4];
dice->area[4] = temp;
}
else if (order == 'W') {
temp = dice->area[0];
dice->area[0] = dice->area[2];
dice->area[2] = dice->area[5];
dice->area[5] = dice->area[3];
dice->area[3] = temp;
}
else if (order == 'E') {
temp = dice->area[0];
dice->area[0] = dice->area[3];
dice->area[3] = dice->area[5];
dice->area[5] = dice->area[2];
dice->area[2] = temp;
}
else if (order == 'S') {
temp = dice->area[0];
dice->area[0] = dice->area[4];
dice->area[4] = dice->area[5];
dice->area[5] = dice->area[1];
dice->area[1] = temp;
}
}
int main() {
struct dice dice1;
int q;
int qon, qfront;
char order;
int i, j, k, l;
scanf("%d %d %d %d %d %d", &dice1.area[0], &dice1.area[1], &dice1.area[2], &dice1.area[3], &dice1.area[4], &dice1.area[5]);
scanf("%d", &q);
for (i = 0; i < q; i++) {
scanf("%d %d", &qon, &qfront);
for (l = 0; l < 2; l++) {
for (k = 0; k < 4; k++) {
for (j = 0; j < 4; j++) {
diceroll(order, &dice1);
if (dice1.area[0] == qon && dice1.area[1] == qfront) {
printf("%d\n", dice1.area[2]);
goto loopend;
}
order = 'W';
}
order = 'N';
}
for (k = 0; k < 4; k++) {
for (j = 0; j < 4; j++) {
diceroll(order, &dice1);
if (dice1.area[0] == qon && dice1.area[1] == qfront) {
printf("%d\n", dice1.area[2]);
goto loopend;
}
order = 'W';
}
order = 'S';
}
}
loopend:;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.dice = type { [6 x i32] }
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @diceroll(i8 noundef signext %order, ptr nocapture noundef %dice) local_unnamed_addr #0 {
entry:
switch i8 %order, label %if.end80 [
i8 78, label %if.then
i8 87, label %if.then19
i8 69, label %if.then40
i8 83, label %if.then61
]
if.then: ; preds = %entry
%0 = load i32, ptr %dice, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 1
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
store i32 %1, ptr %dice, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 5
%2 = load i32, ptr %arrayidx7, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3, align 4, !tbaa !5
%arrayidx11 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 4
%3 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
store i32 %0, ptr %arrayidx11, align 4, !tbaa !5
br label %if.end80
if.then19: ; preds = %entry
%4 = load i32, ptr %dice, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 2
%5 = load i32, ptr %arrayidx23, align 4, !tbaa !5
store i32 %5, ptr %dice, align 4, !tbaa !5
%arrayidx27 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 5
%6 = load i32, ptr %arrayidx27, align 4, !tbaa !5
store i32 %6, ptr %arrayidx23, align 4, !tbaa !5
%arrayidx31 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 3
%7 = load i32, ptr %arrayidx31, align 4, !tbaa !5
store i32 %7, ptr %arrayidx27, align 4, !tbaa !5
store i32 %4, ptr %arrayidx31, align 4, !tbaa !5
br label %if.end80
if.then40: ; preds = %entry
%8 = load i32, ptr %dice, align 4, !tbaa !5
%arrayidx44 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 3
%9 = load i32, ptr %arrayidx44, align 4, !tbaa !5
store i32 %9, ptr %dice, align 4, !tbaa !5
%arrayidx48 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 5
%10 = load i32, ptr %arrayidx48, align 4, !tbaa !5
store i32 %10, ptr %arrayidx44, align 4, !tbaa !5
%arrayidx52 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 2
%11 = load i32, ptr %arrayidx52, align 4, !tbaa !5
store i32 %11, ptr %arrayidx48, align 4, !tbaa !5
store i32 %8, ptr %arrayidx52, align 4, !tbaa !5
br label %if.end80
if.then61: ; preds = %entry
%12 = load i32, ptr %dice, align 4, !tbaa !5
%arrayidx65 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 4
%13 = load i32, ptr %arrayidx65, align 4, !tbaa !5
store i32 %13, ptr %dice, align 4, !tbaa !5
%arrayidx69 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 5
%14 = load i32, ptr %arrayidx69, align 4, !tbaa !5
store i32 %14, ptr %arrayidx65, align 4, !tbaa !5
%arrayidx73 = getelementptr inbounds [6 x i32], ptr %dice, i64 0, i64 1
%15 = load i32, ptr %arrayidx73, align 4, !tbaa !5
store i32 %15, ptr %arrayidx69, align 4, !tbaa !5
store i32 %12, ptr %arrayidx73, align 4, !tbaa !5
br label %if.end80
if.end80: ; preds = %entry, %if.then19, %if.then61, %if.then40, %if.then
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%dice1 = alloca %struct.dice, align 4
%q = alloca i32, align 4
%qon = alloca i32, align 4
%qfront = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dice1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %qon) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %qfront) #4
%arrayidx2 = getelementptr inbounds [6 x i32], ptr %dice1, i64 0, i64 1
%arrayidx4 = getelementptr inbounds [6 x i32], ptr %dice1, i64 0, i64 2
%arrayidx6 = getelementptr inbounds [6 x i32], ptr %dice1, i64 0, i64 3
%arrayidx8 = getelementptr inbounds [6 x i32], ptr %dice1, i64 0, i64 4
%arrayidx10 = getelementptr inbounds [6 x i32], ptr %dice1, i64 0, i64 5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dice1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx10)
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp238 = icmp sgt i32 %0, 0
br i1 %cmp238, label %for.cond16.preheader, label %for.end63
for.cond16.preheader: ; preds = %entry
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %qon, ptr noundef nonnull %qfront)
unreachable
for.end63: ; preds = %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %qfront) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %qon) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dice1) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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)
puts("a < b");
else if (a > b)
puts("a > b");
else
puts("a == b");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242845/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242845/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.3 = 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt 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 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(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_242889/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242889/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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",&a);
scanf("%d",&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_242931/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242931/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 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)
%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
%cmp3 = icmp eq i32 %0, %1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts10 = 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);
printf("%s\n",(a == b)?"a == b":((a > b)?"a > b":"a < b"));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_242975/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_242975/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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
@.str.4 = 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 eq i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%cond = select i1 %cmp1, ptr @.str.3, ptr @.str.4
%cond2 = select i1 %cmp, ptr @.str.2, ptr %cond
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond2)
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_243024/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243024/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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,x,y;
scanf("%d%d",&x,&y);
if (x<y){printf("a < b\n");
}else if (x>y){printf("a > b\n");
}else if (x==y){printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243068/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243068/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, 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 %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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_243110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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",&a);
scanf("%d",&b);
if(a<b){
printf("a < b");
}
if(a>b){
printf("a > b");
}
if(a==b){
printf("a == b");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243169/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243169/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"a < b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.3 = 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
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%.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 ]
%cmp3 = icmp sgt i32 %3, %2
br i1 %cmp3, label %if.then4, label %if.end6
if.then4: ; preds = %if.end
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%.pre13 = load i32, ptr %a, align 4, !tbaa !5
%.pre14 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then4, %if.end
%4 = phi i32 [ %.pre14, %if.then4 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre13, %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
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end10
if.end10: ; preds = %if.then8, %if.end6
%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(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_243226/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243226/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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()
{
float x,y;
scanf("%f %f",&x,&y);
float res=(y*y-x*x)/(2*x);
printf("%.9f",res);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24327/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24327/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%f %f\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%.9f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca float, align 4
%y = alloca float, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load float, ptr %y, align 4, !tbaa !5
%1 = load float, ptr %x, align 4, !tbaa !5
%2 = fneg float %1
%neg = fmul float %1, %2
%3 = call float @llvm.fmuladd.f32(float %0, float %0, float %neg)
%mul = fmul float %1, 2.000000e+00
%div = fdiv float %3, %mul
%conv = fpext float %div to double
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %conv)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !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_243312/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243312/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 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 eq 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 ) {
puts ("a == b");
} else {
a < b ? puts ("a < b") : puts ("a > b");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243356/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243356/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"a == b\00", align 1
@.str.2 = private unnamed_addr constant [6 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%cmp2 = icmp slt 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
%call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(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_243406/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243406/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#include <stdlib.h>
#include <stdbool.h>
long long arr[100005];
int main(void)
{
long long n, x, y, i, ans, j, xcount, ycount;
bool flag;
scanf("%lld %lld %lld", &n, &x, &y);
for(i=1; i<=n; i++)
scanf("%lld", &arr[i]);
for(i=1; i<=n; i++)
{
flag = true;
j = i-1;
xcount = x;
while(j >= 1 && xcount != 0)
{
if(arr[j] <= arr[i])
flag = false;
xcount--;
j--;
}
ycount = y;
j = i+1;
while(j <= n && ycount != 0)
{
if(arr[j] < arr[i])
flag = false;
ycount--;
j++;;
}
if(flag) {
ans = i;
break;
}
}
printf("%lld\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24345/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24345/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@arr = dso_local global [100005 x i64] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%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
%cmp.not48 = icmp slt i64 %0, 1
br i1 %cmp.not48, label %for.cond2.preheader, label %for.body
for.cond2.preheader: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %0, %entry ], [ %24, %for.body ]
%1 = load i64, ptr %x, align 8
%.fr = freeze i64 %1
%cmp651.not = icmp eq i64 %.fr, 0
%2 = load i64, ptr %y, align 8
%.fr77 = freeze i64 %2
%cmp1457.not = icmp eq i64 %.fr77, 0
br i1 %cmp651.not, label %for.cond2.preheader.split.us, label %for.cond2.preheader.split
for.cond2.preheader.split.us: ; preds = %for.cond2.preheader
br i1 %cmp1457.not, label %for.end29, label %for.cond2.us.preheader
for.cond2.us.preheader: ; preds = %for.cond2.preheader.split.us
%smax84 = call i64 @llvm.smax.i64(i64 %.lcssa, i64 0)
%3 = add nuw i64 %smax84, 1
%4 = add i64 %.lcssa, -2
%5 = add i64 %.fr77, -1
br label %for.cond2.us
for.cond2.us: ; preds = %for.cond2.us.preheader, %while.end24.us
%indvar130 = phi i64 [ 0, %for.cond2.us.preheader ], [ %indvar.next131, %while.end24.us ]
%i.1.us = phi i64 [ 1, %for.cond2.us.preheader ], [ %add.us, %while.end24.us ]
%6 = sub i64 %4, %indvar130
%umin132 = call i64 @llvm.umin.i64(i64 %6, i64 %5)
%7 = add i64 %umin132, 1
%exitcond85 = icmp eq i64 %i.1.us, %3
br i1 %exitcond85, label %for.end29, label %for.body4.us
for.body4.us: ; preds = %for.cond2.us
%add.us = add nuw i64 %i.1.us, 1
%cmp1256.us.not.not = icmp slt i64 %i.1.us, %.lcssa
br i1 %cmp1256.us.not.not, label %while.body16.lr.ph.us, label %for.end29
while.end24.us: ; preds = %while.body16.us, %middle.block133
%spec.select47.us.lcssa = phi i8 [ %rdx.select157, %middle.block133 ], [ %spec.select47.us, %while.body16.us ]
%8 = and i8 %spec.select47.us.lcssa, 1
%tobool.not.us = icmp eq i8 %8, 0
%indvar.next131 = add i64 %indvar130, 1
br i1 %tobool.not.us, label %for.cond2.us, label %for.end29, !llvm.loop !9
while.body16.us: ; preds = %while.body16.us.preheader, %while.body16.us
%flag.260.us = phi i8 [ %spec.select47.us, %while.body16.us ], [ %flag.260.us.ph, %while.body16.us.preheader ]
%ycount.059.us = phi i64 [ %dec22.us, %while.body16.us ], [ %ycount.059.us.ph, %while.body16.us.preheader ]
%j.158.us = phi i64 [ %inc23.us, %while.body16.us ], [ %j.158.us.ph, %while.body16.us.preheader ]
%arrayidx17.us = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %j.158.us
%9 = load i64, ptr %arrayidx17.us, align 8, !tbaa !5
%cmp19.us = icmp slt i64 %9, %11
%spec.select47.us = select i1 %cmp19.us, i8 0, i8 %flag.260.us
%dec22.us = add nsw i64 %ycount.059.us, -1
%inc23.us = add nuw nsw i64 %j.158.us, 1
%cmp12.us = icmp slt i64 %j.158.us, %.lcssa
%cmp14.us = icmp ne i64 %dec22.us, 0
%10 = select i1 %cmp12.us, i1 %cmp14.us, i1 false
br i1 %10, label %while.body16.us, label %while.end24.us, !llvm.loop !11
while.body16.lr.ph.us: ; preds = %for.body4.us
%arrayidx18.us = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %i.1.us
%11 = load i64, ptr %arrayidx18.us, align 8, !tbaa !5
%min.iters.check135 = icmp ult i64 %7, 4
br i1 %min.iters.check135, label %while.body16.us.preheader, label %vector.ph136
vector.ph136: ; preds = %while.body16.lr.ph.us
%n.vec138 = and i64 %7, -4
%ind.end139 = sub i64 %.fr77, %n.vec138
%ind.end141 = add i64 %add.us, %n.vec138
%broadcast.splatinsert151 = insertelement <2 x i64> poison, i64 %11, i64 0
%broadcast.splat152 = shufflevector <2 x i64> %broadcast.splatinsert151, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body144
vector.body144: ; preds = %vector.body144, %vector.ph136
%index145 = phi i64 [ 0, %vector.ph136 ], [ %index.next153, %vector.body144 ]
%vec.phi146 = phi <2 x i8> [ <i8 1, i8 1>, %vector.ph136 ], [ %16, %vector.body144 ]
%vec.phi147 = phi <2 x i8> [ <i8 1, i8 1>, %vector.ph136 ], [ %17, %vector.body144 ]
%offset.idx148 = add i64 %add.us, %index145
%12 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %offset.idx148
%wide.load149 = load <2 x i64>, ptr %12, align 8, !tbaa !5
%13 = getelementptr inbounds i64, ptr %12, i64 2
%wide.load150 = load <2 x i64>, ptr %13, align 8, !tbaa !5
%14 = icmp slt <2 x i64> %wide.load149, %broadcast.splat152
%15 = icmp slt <2 x i64> %wide.load150, %broadcast.splat152
%16 = select <2 x i1> %14, <2 x i8> zeroinitializer, <2 x i8> %vec.phi146
%17 = select <2 x i1> %15, <2 x i8> zeroinitializer, <2 x i8> %vec.phi147
%index.next153 = add nuw i64 %index145, 4
%18 = icmp eq i64 %index.next153, %n.vec138
br i1 %18, label %middle.block133, label %vector.body144, !llvm.loop !14
middle.block133: ; preds = %vector.body144
%rdx.select.cmp154.not = icmp ne <2 x i8> %16, <i8 1, i8 1>
%rdx.select.cmp156161 = icmp ne <2 x i8> %17, <i8 1, i8 1>
%rdx.select.cmp156 = select <2 x i1> %rdx.select.cmp154.not, <2 x i1> <i1 true, i1 true>, <2 x i1> %rdx.select.cmp156161
%19 = bitcast <2 x i1> %rdx.select.cmp156 to i2
%.not162 = icmp eq i2 %19, 0
%rdx.select157 = zext i1 %.not162 to i8
%cmp.n143 = icmp eq i64 %7, %n.vec138
br i1 %cmp.n143, label %while.end24.us, label %while.body16.us.preheader
while.body16.us.preheader: ; preds = %while.body16.lr.ph.us, %middle.block133
%flag.260.us.ph = phi i8 [ 1, %while.body16.lr.ph.us ], [ %rdx.select157, %middle.block133 ]
%ycount.059.us.ph = phi i64 [ %.fr77, %while.body16.lr.ph.us ], [ %ind.end139, %middle.block133 ]
%j.158.us.ph = phi i64 [ %add.us, %while.body16.lr.ph.us ], [ %ind.end141, %middle.block133 ]
br label %while.body16.us
for.cond2.preheader.split: ; preds = %for.cond2.preheader
br i1 %cmp1457.not, label %for.end29, label %for.cond2.preheader79
for.cond2.preheader79: ; preds = %for.cond2.preheader.split
%smax = call i64 @llvm.smax.i64(i64 %.lcssa, i64 0)
%20 = add nuw i64 %smax, 1
%21 = add i64 %.lcssa, -2
%22 = add i64 %.fr77, -1
%23 = add i64 %.fr, -1
br label %for.cond2
for.body: ; preds = %entry, %for.body
%i.049 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %i.049
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.049, 1
%24 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.049, %24
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !15
for.cond2: ; preds = %for.cond2.preheader79, %while.end24
%indvar = phi i64 [ 0, %for.cond2.preheader79 ], [ %indvar.next, %while.end24 ]
%i.1 = phi i64 [ 1, %for.cond2.preheader79 ], [ %add, %while.end24 ]
%smin = call i64 @llvm.smin.i64(i64 %i.1, i64 2)
%25 = sub i64 %i.1, %smin
%umin102 = call i64 @llvm.umin.i64(i64 %25, i64 %23)
%26 = add i64 %umin102, 1
%27 = sub i64 %21, %indvar
%umin = call i64 @llvm.umin.i64(i64 %27, i64 %22)
%28 = add i64 %umin, 1
%exitcond = icmp eq i64 %i.1, %20
br i1 %exitcond, label %for.end29, label %for.body4
for.body4: ; preds = %for.cond2
%cmp550 = icmp ugt i64 %i.1, 1
br i1 %cmp550, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %for.body4
%arrayidx8 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %i.1
%29 = load i64, ptr %arrayidx8, align 8, !tbaa !5
%min.iters.check105 = icmp ult i64 %26, 4
br i1 %min.iters.check105, label %while.body.preheader, label %vector.ph106
vector.ph106: ; preds = %while.body.lr.ph
%n.vec108 = and i64 %26, -4
%ind.end109 = sub i64 %.fr, %n.vec108
%ind.end111 = sub i64 %i.1, %n.vec108
%broadcast.splatinsert122 = insertelement <2 x i64> poison, i64 %29, i64 0
%broadcast.splat123 = shufflevector <2 x i64> %broadcast.splatinsert122, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body114
vector.body114: ; preds = %vector.body114, %vector.ph106
%index115 = phi i64 [ 0, %vector.ph106 ], [ %index.next124, %vector.body114 ]
%vec.phi116 = phi <2 x i8> [ <i8 1, i8 1>, %vector.ph106 ], [ %37, %vector.body114 ]
%vec.phi117 = phi <2 x i8> [ <i8 1, i8 1>, %vector.ph106 ], [ %38, %vector.body114 ]
%30 = xor i64 %index115, -1
%31 = add i64 %i.1, %30
%32 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %31
%33 = getelementptr inbounds i64, ptr %32, i64 -1
%wide.load119 = load <2 x i64>, ptr %33, align 8, !tbaa !5
%reverse = shufflevector <2 x i64> %wide.load119, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
%34 = getelementptr inbounds i64, ptr %32, i64 -3
%wide.load120 = load <2 x i64>, ptr %34, align 8, !tbaa !5
%reverse121 = shufflevector <2 x i64> %wide.load120, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
%35 = icmp sgt <2 x i64> %reverse, %broadcast.splat123
%36 = icmp sgt <2 x i64> %reverse121, %broadcast.splat123
%37 = select <2 x i1> %35, <2 x i8> %vec.phi116, <2 x i8> zeroinitializer
%38 = select <2 x i1> %36, <2 x i8> %vec.phi117, <2 x i8> zeroinitializer
%index.next124 = add nuw i64 %index115, 4
%39 = icmp eq i64 %index.next124, %n.vec108
br i1 %39, label %middle.block103, label %vector.body114, !llvm.loop !16
middle.block103: ; preds = %vector.body114
%rdx.select.cmp125.not = icmp ne <2 x i8> %37, <i8 1, i8 1>
%rdx.select.cmp127159 = icmp ne <2 x i8> %38, <i8 1, i8 1>
%rdx.select.cmp127 = select <2 x i1> %rdx.select.cmp125.not, <2 x i1> <i1 true, i1 true>, <2 x i1> %rdx.select.cmp127159
%40 = bitcast <2 x i1> %rdx.select.cmp127 to i2
%.not = icmp eq i2 %40, 0
%rdx.select128 = zext i1 %.not to i8
%cmp.n113 = icmp eq i64 %26, %n.vec108
br i1 %cmp.n113, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %while.body.lr.ph, %middle.block103
%flag.054.ph = phi i8 [ 1, %while.body.lr.ph ], [ %rdx.select128, %middle.block103 ]
%xcount.053.ph = phi i64 [ %.fr, %while.body.lr.ph ], [ %ind.end109, %middle.block103 ]
%j.0.in52.ph = phi i64 [ %i.1, %while.body.lr.ph ], [ %ind.end111, %middle.block103 ]
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%flag.054 = phi i8 [ %spec.select, %while.body ], [ %flag.054.ph, %while.body.preheader ]
%xcount.053 = phi i64 [ %dec, %while.body ], [ %xcount.053.ph, %while.body.preheader ]
%j.0.in52 = phi i64 [ %j.0, %while.body ], [ %j.0.in52.ph, %while.body.preheader ]
%j.0 = add nsw i64 %j.0.in52, -1
%arrayidx7 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %j.0
%41 = load i64, ptr %arrayidx7, align 8, !tbaa !5
%cmp9.not = icmp sgt i64 %41, %29
%spec.select = select i1 %cmp9.not, i8 %flag.054, i8 0
%dec = add nsw i64 %xcount.053, -1
%cmp5 = icmp sgt i64 %j.0.in52, 2
%cmp6 = icmp ne i64 %dec, 0
%42 = select i1 %cmp5, i1 %cmp6, i1 false
br i1 %42, label %while.body, label %while.end, !llvm.loop !17
while.end: ; preds = %while.body, %middle.block103, %for.body4
%flag.0.lcssa = phi i8 [ 1, %for.body4 ], [ %rdx.select128, %middle.block103 ], [ %spec.select, %while.body ]
%add = add nuw i64 %i.1, 1
%cmp1256.not.not = icmp slt i64 %i.1, %.lcssa
br i1 %cmp1256.not.not, label %while.body16.lr.ph, label %while.end24
while.body16.lr.ph: ; preds = %while.end
%arrayidx18 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %i.1
%43 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%min.iters.check = icmp ult i64 %28, 4
br i1 %min.iters.check, label %while.body16.preheader, label %vector.ph
vector.ph: ; preds = %while.body16.lr.ph
%n.vec = and i64 %28, -4
%ind.end = sub i64 %.fr77, %n.vec
%ind.end94 = add i64 %add, %n.vec
%minmax.ident.splatinsert = insertelement <2 x i8> poison, i8 %flag.0.lcssa, i64 0
%minmax.ident.splat = shufflevector <2 x i8> %minmax.ident.splatinsert, <2 x i8> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert = insertelement <2 x i64> poison, i64 %43, i64 0
%broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i8> [ %minmax.ident.splat, %vector.ph ], [ %48, %vector.body ]
%vec.phi96 = phi <2 x i8> [ %minmax.ident.splat, %vector.ph ], [ %49, %vector.body ]
%offset.idx = add i64 %add, %index
%44 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %offset.idx
%wide.load = load <2 x i64>, ptr %44, align 8, !tbaa !5
%45 = getelementptr inbounds i64, ptr %44, i64 2
%wide.load97 = load <2 x i64>, ptr %45, align 8, !tbaa !5
%46 = icmp slt <2 x i64> %wide.load, %broadcast.splat
%47 = icmp slt <2 x i64> %wide.load97, %broadcast.splat
%48 = select <2 x i1> %46, <2 x i8> zeroinitializer, <2 x i8> %vec.phi
%49 = select <2 x i1> %47, <2 x i8> zeroinitializer, <2 x i8> %vec.phi96
%index.next = add nuw i64 %index, 4
%50 = icmp eq i64 %index.next, %n.vec
br i1 %50, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%.splatinsert = insertelement <2 x i8> poison, i8 %flag.0.lcssa, i64 0
%.splat = shufflevector <2 x i8> %.splatinsert, <2 x i8> poison, <2 x i32> zeroinitializer
%rdx.select.cmp.not = icmp eq <2 x i8> %48, %.splat
%rdx.select = select <2 x i1> %rdx.select.cmp.not, <2 x i8> %49, <2 x i8> %48
%.splatinsert98 = insertelement <2 x i8> poison, i8 %flag.0.lcssa, i64 0
%.splat99 = shufflevector <2 x i8> %.splatinsert98, <2 x i8> poison, <2 x i32> zeroinitializer
%rdx.select.scalar = bitcast <2 x i8> %rdx.select to i16
%.splat99.scalar = bitcast <2 x i8> %.splat99 to i16
%.not160 = icmp eq i16 %rdx.select.scalar, %.splat99.scalar
%rdx.select101 = select i1 %.not160, i8 %flag.0.lcssa, i8 0
%cmp.n = icmp eq i64 %28, %n.vec
br i1 %cmp.n, label %while.end24, label %while.body16.preheader
while.body16.preheader: ; preds = %while.body16.lr.ph, %middle.block
%flag.260.ph = phi i8 [ %flag.0.lcssa, %while.body16.lr.ph ], [ %rdx.select101, %middle.block ]
%ycount.059.ph = phi i64 [ %.fr77, %while.body16.lr.ph ], [ %ind.end, %middle.block ]
%j.158.ph = phi i64 [ %add, %while.body16.lr.ph ], [ %ind.end94, %middle.block ]
br label %while.body16
while.body16: ; preds = %while.body16.preheader, %while.body16
%flag.260 = phi i8 [ %spec.select47, %while.body16 ], [ %flag.260.ph, %while.body16.preheader ]
%ycount.059 = phi i64 [ %dec22, %while.body16 ], [ %ycount.059.ph, %while.body16.preheader ]
%j.158 = phi i64 [ %inc23, %while.body16 ], [ %j.158.ph, %while.body16.preheader ]
%arrayidx17 = getelementptr inbounds [100005 x i64], ptr @arr, i64 0, i64 %j.158
%51 = load i64, ptr %arrayidx17, align 8, !tbaa !5
%cmp19 = icmp slt i64 %51, %43
%spec.select47 = select i1 %cmp19, i8 0, i8 %flag.260
%dec22 = add nsw i64 %ycount.059, -1
%inc23 = add nuw nsw i64 %j.158, 1
%cmp12 = icmp slt i64 %j.158, %.lcssa
%cmp14 = icmp ne i64 %dec22, 0
%52 = select i1 %cmp12, i1 %cmp14, i1 false
br i1 %52, label %while.body16, label %while.end24, !llvm.loop !19
while.end24: ; preds = %while.body16, %middle.block, %while.end
%flag.2.lcssa = phi i8 [ %flag.0.lcssa, %while.end ], [ %rdx.select101, %middle.block ], [ %spec.select47, %while.body16 ]
%53 = and i8 %flag.2.lcssa, 1
%tobool.not = icmp eq i8 %53, 0
%indvar.next = add i64 %indvar, 1
br i1 %tobool.not, label %for.cond2, label %for.end29, !llvm.loop !9
for.end29: ; preds = %while.end24, %for.cond2, %for.body4.us, %while.end24.us, %for.cond2.us, %for.cond2.preheader.split, %for.cond2.preheader.split.us
%.us-phi = phi i64 [ 1, %for.cond2.preheader.split.us ], [ 1, %for.cond2.preheader.split ], [ %i.1.us, %for.body4.us ], [ %i.1.us, %while.end24.us ], [ %3, %for.cond2.us ], [ %i.1, %while.end24 ], [ %20, %for.cond2 ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.us-phi)
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long 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, !13}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !13, !12}
!17 = distinct !{!17, !10, !12, !13}
!18 = distinct !{!18, !10, !13, !12}
!19 = distinct !{!19, !10, !12, !13}
|
#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_243493/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243493/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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_243536/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243536/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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 {
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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{
printf("a > b\n");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 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 eq 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");
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_243680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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(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_243723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
char *
to_relationship(int a, int b)
{
if (a == b) return "a == b";
else if (a < b) return "a < b";
else if (a > b) return "a > b";
return "";
}
int
main()
{
int a, b;
scanf("%d %d", &a, &b);
char *relation = to_relationship(a, b);
printf("%s\n", relation);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243767/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243767/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"a == b\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.3 = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local nonnull ptr @to_relationship(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %a, %b
br i1 %cmp, label %return, label %if.else
if.else: ; preds = %entry
%cmp1 = icmp slt i32 %a, %b
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%cmp4 = icmp sgt i32 %a, %b
%.str.2..str.3 = select i1 %cmp4, ptr @.str.2, ptr @.str.3
br label %return
return: ; preds = %if.else3, %if.else, %entry
%retval.0 = phi ptr [ @.str, %entry ], [ @.str.1, %if.else ], [ %.str.2..str.3, %if.else3 ]
ret ptr %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, 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.i = icmp eq i32 %0, %1
br i1 %cmp.i, label %to_relationship.exit, label %if.else.i
if.else.i: ; preds = %entry
%cmp1.i = icmp slt i32 %0, %1
br i1 %cmp1.i, label %to_relationship.exit, label %if.else3.i
if.else3.i: ; preds = %if.else.i
%cmp4.i = icmp sgt i32 %0, %1
%.str.2..str.3.i = select i1 %cmp4.i, ptr @.str.2, ptr @.str.3
br label %to_relationship.exit
to_relationship.exit: ; preds = %entry, %if.else.i, %if.else3.i
%retval.0.i = phi ptr [ @.str, %entry ], [ @.str.1, %if.else.i ], [ %.str.2..str.3.i, %if.else3.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %retval.0.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* Author : Sarvesh Mahajan
IIIT, Hyderabad */
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#define max(a,b) ((a)>(b))?(a):(b)
#define min(a,b) ((a)<(b))?(a):(b)
#define si(n) scanf("%d",&n)
#define ss(s) scanf("%s",s)
#define sort(a,n) qsort(a,n,sizeof(int),compare)
#define pi(n) printf("%d ",n)
#define ps(s) printf("%s",s)
#define loop(i,n) for(i=0;i<n;i++)
#define Loop(i,n) for(i=1;i<=n;i++)
#define For(i,j,n) for(i=j;i<=n;++i)
typedef long long int lld;
//#define MAX 100005
//int a[MAX];
int compare(const void *a,const void *b)
{
return *(int *)a-*(int *)b;
}
char s[110];
int a[105];
int main(void)
{
int ct1=0,ct2=0,ct3=0;
int i,n,ans,k,l,m,t;
ss(s);
l=strlen(s);
loop(i,l)
{
if(s[i]=='1')
ct1++;
else if(s[i]=='2')
ct2++;
else if(s[i]=='3')
ct3++;
}
loop(i,ct1)
{
a[i]=1;
}
for(i=ct1;i<ct2+ct1;++i)
a[i]=2;
for(i=ct1+ct2;i<ct1+ct2+ct3;++i)
a[i]=3;
int p=ct1+ct2+ct3;
loop(i,p-1)
{
printf("%d",a[i]);
putchar('+');
}
printf("%d",a[p-1]);
/* if(ct1)
{
while(ct1--)
{
putchar('1');
if(ct1)
putchar('+');
}
if(ct2)
putchar('+');
}
if(ct2)
{
while(ct2--)
{
putchar('2');
if(ct2)
putchar('+');
}
if(ct3)
putchar('+');
}
if(ct3)
{
while(ct3--)
{
putchar('3');
if(ct3)
putchar('+');
}
}
*/
// si(t);
// while(t--)
// {
// }
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24381/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24381/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@s = dso_local global [110 x i8] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global [105 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @s)
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @s) #5
%conv = trunc i64 %call1 to i32
%cmp100 = icmp sgt i32 %conv, 0
br i1 %cmp100, label %for.body.preheader, label %for.end66
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call1, 4294967295
%xtraiter = and i64 %call1, 1
%0 = icmp eq i64 %wide.trip.count, 1
br i1 %0, label %for.cond24.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.cond24.preheader.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%ct3.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %ct3.1.1, %for.inc.1 ]
%ct2.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %ct2.1.1, %for.inc.1 ]
%ct1.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %ct1.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%ct1.0104.unr = phi i32 [ 0, %for.body.preheader ], [ %ct1.1.1, %for.inc.1 ]
%ct2.0103.unr = phi i32 [ 0, %for.body.preheader ], [ %ct2.1.1, %for.inc.1 ]
%ct3.0102.unr = phi i32 [ 0, %for.body.preheader ], [ %ct3.1.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond24.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond24.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [110 x i8], ptr @s, i64 0, i64 %indvars.iv.unr
%1 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
switch i8 %1, label %for.cond24.preheader [
i8 49, label %if.then.epil
i8 50, label %if.then11.epil
i8 51, label %if.then19.epil
]
if.then19.epil: ; preds = %for.body.epil
%inc20.epil = add nsw i32 %ct3.0102.unr, 1
br label %for.cond24.preheader
if.then11.epil: ; preds = %for.body.epil
%inc12.epil = add nsw i32 %ct2.0103.unr, 1
br label %for.cond24.preheader
if.then.epil: ; preds = %for.body.epil
%inc.epil = add nsw i32 %ct1.0104.unr, 1
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.body.epil, %if.then19.epil, %if.then11.epil, %if.then.epil, %for.cond24.preheader.unr-lcssa
%ct3.1.lcssa = phi i32 [ %ct3.1.lcssa.ph, %for.cond24.preheader.unr-lcssa ], [ %ct3.0102.unr, %if.then.epil ], [ %ct3.0102.unr, %if.then11.epil ], [ %inc20.epil, %if.then19.epil ], [ %ct3.0102.unr, %for.body.epil ]
%ct2.1.lcssa = phi i32 [ %ct2.1.lcssa.ph, %for.cond24.preheader.unr-lcssa ], [ %ct2.0103.unr, %if.then.epil ], [ %inc12.epil, %if.then11.epil ], [ %ct2.0103.unr, %if.then19.epil ], [ %ct2.0103.unr, %for.body.epil ]
%ct1.1.lcssa = phi i32 [ %ct1.1.lcssa.ph, %for.cond24.preheader.unr-lcssa ], [ %inc.epil, %if.then.epil ], [ %ct1.0104.unr, %if.then11.epil ], [ %ct1.0104.unr, %if.then19.epil ], [ %ct1.0104.unr, %for.body.epil ]
%cmp25107 = icmp sgt i32 %ct1.1.lcssa, 0
br i1 %cmp25107, label %for.body27.preheader, label %for.cond33.preheader
for.body27.preheader: ; preds = %for.cond24.preheader
%wide.trip.count122 = zext i32 %ct1.1.lcssa to i64
%min.iters.check = icmp ult i32 %ct1.1.lcssa, 8
br i1 %min.iters.check, label %for.body27.preheader185, label %vector.ph
vector.ph: ; preds = %for.body27.preheader
%n.vec = and i64 %wide.trip.count122, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%2 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %index
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count122
br i1 %cmp.n, label %for.cond33.preheader, label %for.body27.preheader185
for.body27.preheader185: ; preds = %for.body27.preheader, %middle.block
%indvars.iv119.ph = phi i64 [ 0, %for.body27.preheader ], [ %n.vec, %middle.block ]
br label %for.body27
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%ct1.0104 = phi i32 [ 0, %for.body.preheader.new ], [ %ct1.1.1, %for.inc.1 ]
%ct2.0103 = phi i32 [ 0, %for.body.preheader.new ], [ %ct2.1.1, %for.inc.1 ]
%ct3.0102 = phi i32 [ 0, %for.body.preheader.new ], [ %ct3.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds [110 x i8], ptr @s, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !9
switch i8 %5, label %for.inc [
i8 49, label %if.then
i8 50, label %if.then11
i8 51, label %if.then19
]
if.then: ; preds = %for.body
%inc = add nsw i32 %ct1.0104, 1
br label %for.inc
if.then11: ; preds = %for.body
%inc12 = add nsw i32 %ct2.0103, 1
br label %for.inc
if.then19: ; preds = %for.body
%inc20 = add nsw i32 %ct3.0102, 1
br label %for.inc
for.inc: ; preds = %for.body, %if.then, %if.then19, %if.then11
%ct3.1 = phi i32 [ %ct3.0102, %if.then ], [ %ct3.0102, %if.then11 ], [ %inc20, %if.then19 ], [ %ct3.0102, %for.body ]
%ct2.1 = phi i32 [ %ct2.0103, %if.then ], [ %inc12, %if.then11 ], [ %ct2.0103, %if.then19 ], [ %ct2.0103, %for.body ]
%ct1.1 = phi i32 [ %inc, %if.then ], [ %ct1.0104, %if.then11 ], [ %ct1.0104, %if.then19 ], [ %ct1.0104, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [110 x i8], ptr @s, i64 0, i64 %indvars.iv.next
%6 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
switch i8 %6, label %for.inc.1 [
i8 49, label %if.then.1
i8 50, label %if.then11.1
i8 51, label %if.then19.1
]
if.then19.1: ; preds = %for.inc
%inc20.1 = add nsw i32 %ct3.1, 1
br label %for.inc.1
if.then11.1: ; preds = %for.inc
%inc12.1 = add nsw i32 %ct2.1, 1
br label %for.inc.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %ct1.1, 1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %if.then11.1, %if.then19.1, %for.inc
%ct3.1.1 = phi i32 [ %ct3.1, %if.then.1 ], [ %ct3.1, %if.then11.1 ], [ %inc20.1, %if.then19.1 ], [ %ct3.1, %for.inc ]
%ct2.1.1 = phi i32 [ %ct2.1, %if.then.1 ], [ %inc12.1, %if.then11.1 ], [ %ct2.1, %if.then19.1 ], [ %ct2.1, %for.inc ]
%ct1.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %ct1.1, %if.then11.1 ], [ %ct1.1, %if.then19.1 ], [ %ct1.1, %for.inc ]
%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.cond24.preheader.unr-lcssa, label %for.body, !llvm.loop !14
for.cond33.preheader: ; preds = %for.body27, %middle.block, %for.cond24.preheader
%add = add i32 %ct1.1.lcssa, %ct2.1.lcssa
%cmp34109 = icmp sgt i32 %ct2.1.lcssa, 0
br i1 %cmp34109, label %for.body36.preheader, label %for.cond43.preheader
for.body36.preheader: ; preds = %for.cond33.preheader
%7 = sext i32 %ct1.1.lcssa to i64
%8 = sext i32 %add to i64
%9 = add nsw i64 %7, 1
%smax = tail call i64 @llvm.smax.i64(i64 %9, i64 %8)
%10 = sub i64 %smax, %7
%min.iters.check160 = icmp ult i64 %10, 8
br i1 %min.iters.check160, label %for.body36.preheader184, label %vector.ph161
vector.ph161: ; preds = %for.body36.preheader
%n.vec163 = and i64 %10, -8
%ind.end = add i64 %n.vec163, %7
br label %vector.body166
vector.body166: ; preds = %vector.body166, %vector.ph161
%index167 = phi i64 [ 0, %vector.ph161 ], [ %index.next168, %vector.body166 ]
%offset.idx = add i64 %index167, %7
%11 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %offset.idx
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %11, align 4, !tbaa !5
%12 = getelementptr inbounds i32, ptr %11, i64 4
store <4 x i32> <i32 2, i32 2, i32 2, i32 2>, ptr %12, align 4, !tbaa !5
%index.next168 = add nuw i64 %index167, 8
%13 = icmp eq i64 %index.next168, %n.vec163
br i1 %13, label %middle.block158, label %vector.body166, !llvm.loop !15
middle.block158: ; preds = %vector.body166
%cmp.n165 = icmp eq i64 %10, %n.vec163
br i1 %cmp.n165, label %for.cond43.preheader, label %for.body36.preheader184
for.body36.preheader184: ; preds = %for.body36.preheader, %middle.block158
%indvars.iv124.ph = phi i64 [ %7, %for.body36.preheader ], [ %ind.end, %middle.block158 ]
br label %for.body36
for.body27: ; preds = %for.body27.preheader185, %for.body27
%indvars.iv119 = phi i64 [ %indvars.iv.next120, %for.body27 ], [ %indvars.iv119.ph, %for.body27.preheader185 ]
%arrayidx29 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv119
store i32 1, ptr %arrayidx29, align 4, !tbaa !5
%indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
%exitcond123.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count122
br i1 %exitcond123.not, label %for.cond33.preheader, label %for.body27, !llvm.loop !16
for.cond43.preheader: ; preds = %for.body36, %middle.block158, %for.cond33.preheader
%add45 = add i32 %add, %ct3.1.lcssa
%cmp46112 = icmp sgt i32 %ct3.1.lcssa, 0
br i1 %cmp46112, label %for.body48.preheader, label %for.cond56.preheader
for.body48.preheader: ; preds = %for.cond43.preheader
%14 = sext i32 %add to i64
%15 = sext i32 %add45 to i64
%16 = add nsw i64 %14, 1
%smax169 = tail call i64 @llvm.smax.i64(i64 %16, i64 %15)
%17 = sub i64 %smax169, %14
%min.iters.check172 = icmp ult i64 %17, 8
br i1 %min.iters.check172, label %for.body48.preheader183, label %vector.ph173
vector.ph173: ; preds = %for.body48.preheader
%n.vec175 = and i64 %17, -8
%ind.end176 = add i64 %n.vec175, %14
br label %vector.body179
vector.body179: ; preds = %vector.body179, %vector.ph173
%index180 = phi i64 [ 0, %vector.ph173 ], [ %index.next182, %vector.body179 ]
%offset.idx181 = add i64 %index180, %14
%18 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %offset.idx181
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
store <4 x i32> <i32 3, i32 3, i32 3, i32 3>, ptr %19, align 4, !tbaa !5
%index.next182 = add nuw i64 %index180, 8
%20 = icmp eq i64 %index.next182, %n.vec175
br i1 %20, label %middle.block170, label %vector.body179, !llvm.loop !17
middle.block170: ; preds = %vector.body179
%cmp.n178 = icmp eq i64 %17, %n.vec175
br i1 %cmp.n178, label %for.cond56.preheader, label %for.body48.preheader183
for.body48.preheader183: ; preds = %for.body48.preheader, %middle.block170
%indvars.iv127.ph = phi i64 [ %14, %for.body48.preheader ], [ %ind.end176, %middle.block170 ]
br label %for.body48
for.body36: ; preds = %for.body36.preheader184, %for.body36
%indvars.iv124 = phi i64 [ %indvars.iv.next125, %for.body36 ], [ %indvars.iv124.ph, %for.body36.preheader184 ]
%arrayidx38 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv124
store i32 2, ptr %arrayidx38, align 4, !tbaa !5
%indvars.iv.next125 = add nsw i64 %indvars.iv124, 1
%cmp34 = icmp slt i64 %indvars.iv.next125, %8
br i1 %cmp34, label %for.body36, label %for.cond43.preheader, !llvm.loop !18
for.cond56.preheader: ; preds = %for.body48, %middle.block170, %for.cond43.preheader
%sub = add i32 %add45, -1
%cmp57115 = icmp sgt i32 %add45, 1
br i1 %cmp57115, label %for.body59.preheader, label %for.end66
for.body59.preheader: ; preds = %for.cond56.preheader
%wide.trip.count133 = zext i32 %sub to i64
br label %for.body59
for.body48: ; preds = %for.body48.preheader183, %for.body48
%indvars.iv127 = phi i64 [ %indvars.iv.next128, %for.body48 ], [ %indvars.iv127.ph, %for.body48.preheader183 ]
%arrayidx50 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv127
store i32 3, ptr %arrayidx50, align 4, !tbaa !5
%indvars.iv.next128 = add nsw i64 %indvars.iv127, 1
%cmp46 = icmp slt i64 %indvars.iv.next128, %15
br i1 %cmp46, label %for.body48, label %for.cond56.preheader, !llvm.loop !19
for.body59: ; preds = %for.body59.preheader, %for.body59
%indvars.iv130 = phi i64 [ 0, %for.body59.preheader ], [ %indvars.iv.next131, %for.body59 ]
%arrayidx61 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv130
%21 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%call62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %21)
%22 = load ptr, ptr @stdout, align 8, !tbaa !20
%call.i = tail call i32 @putc(i32 noundef 43, ptr noundef %22)
%indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
%exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count133
br i1 %exitcond134.not, label %for.end66, label %for.body59, !llvm.loop !22
for.end66: ; preds = %for.body59, %entry, %for.cond56.preheader
%sub157 = phi i32 [ %sub, %for.cond56.preheader ], [ -1, %entry ], [ %sub, %for.body59 ]
%idxprom68 = sext i32 %sub157 to i64
%arrayidx69 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %idxprom68
%23 = load i32, ptr %arrayidx69, align 4, !tbaa !5
%call70 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %23)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11, !12, !13}
!16 = distinct !{!16, !11, !13, !12}
!17 = distinct !{!17, !11, !12, !13}
!18 = distinct !{!18, !11, !13, !12}
!19 = distinct !{!19, !11, !13, !12}
!20 = !{!21, !21, i64 0}
!21 = !{!"any pointer", !7, i64 0}
!22 = distinct !{!22, !11}
|
#include<stdio.h>
int main()
{
int a,b;
scanf("%d %d",&a,&b);
if(a < b){
printf("a < b");
}else if(a > b){
printf("a > b");
}else if(a == b){
printf("a == b");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_243853/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243853/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.3 = 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.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.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else5 ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
br label %if.end10
if.end10: ; preds = %if.end10.sink.split, %if.else5
%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 (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_243903/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243903/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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,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_243961/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_243961/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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_244032/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244032/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
printf("a == b\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244076/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244076/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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,b;
scanf("%d %d",&a ,&b);
if(a<b)printf("a < b\n",a,b);
if(a>b)printf("a > b\n",a,b);
if(a==b)printf("a == b\n",a,b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244119/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244119/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%.pre17 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %.pre17, %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
%puts15 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
%.pre18 = load i32, ptr %a, align 4, !tbaa !5
%.pre19 = load i32, ptr %b, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%4 = phi i32 [ %.pre19, %if.then3 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre18, %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
%puts16 = 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"}
|
/////////////////////////////////////
/// Made By : Saurabh Kathpalia ///
/// IIIT HYDERABAD ///
/////////////////////////////////////
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<limits.h>
#define sort(a,n) qsort(a,n,sizeof(int),compare)
#define max(a,b) ((a)>(b))?((a):(b))
#define min(a,b) ((a)<(b))?((a):(b))
int compare(const void*a,const void*b){ return *(int *)a-*(int *)b;}
int main()
{
char s[100];
int a[100],i,k=-1;
scanf("%s",s);
for(i=0;s[i]!='\0';i++)
{
if(s[i]!='+')
a[++k]=(int)(s[i]-'0');
}
sort(a,k+1);
for(i=0;i<k;i++)
printf("%d+",a[i]);
printf("%d\n",a[k]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24417/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24417/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d+\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(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:
%s = alloca [100 x i8], align 16
%a = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #5
%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 ]
%k.0 = phi i32 [ %k.1, %for.inc ], [ -1, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !9
switch i8 %0, label %if.then [
i8 0, label %for.end
i8 43, label %for.inc
]
if.then: ; preds = %for.cond
%conv = sext i8 %0 to i32
%sub = add nsw i32 %conv, -48
%inc = add nsw i32 %k.0, 1
%idxprom10 = sext i32 %inc to i64
%arrayidx11 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom10
store i32 %sub, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.cond, %if.then
%k.1 = phi i32 [ %inc, %if.then ], [ %k.0, %for.cond ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !10
for.end: ; preds = %for.cond
%add = add nsw i32 %k.0, 1
%conv14 = sext i32 %add to i64
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv14, i64 noundef 4, ptr noundef nonnull @compare) #5
%cmp1637 = icmp sgt i32 %k.0, 0
br i1 %cmp1637, label %for.body18.preheader, label %for.end24
for.body18.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %k.0 to i64
br label %for.body18
for.body18: ; preds = %for.body18.preheader, %for.body18
%indvars.iv40 = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next41, %for.body18 ]
%arrayidx20 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv40
%1 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count
br i1 %exitcond.not, label %for.end24, label %for.body18, !llvm.loop !12
for.end24: ; preds = %for.body18, %for.end
%idxprom25 = sext i32 %k.0 to i64
%arrayidx26 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom25
%2 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void)
{
int a,b;
scanf("%d%d\n",&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_244212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1
@str = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@str.4 = private unnamed_addr constant [7 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 eq 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 if(a==b){
printf("a == b\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244256/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244256/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#include<stdlib.h>
#include<math.h>
int key(char c)
{
if (c=='R')
return 0;
return 1;
}
char fun(int c)
{
if (c==0)
return 'R';
return 'W';
}
char not_of(int c)
{
if (c==0)
return 'W';
return 'R';
}
int main()
{
// Insert your code here.
int t;
scanf("%d",&t);
int m,n;
while(t--)
{
int flag=0; // 0 for yes 1 for no xD
scanf("%d %d\n",&m,&n);
int filled[m*n][3],len_filled=0;
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
char c=getchar();
if (c!='.')
{
filled[len_filled][0]=key(c);
filled[len_filled][1]=i;
filled[len_filled][2]=j;
len_filled++;
}
}
getchar();
}
for (int i=0;i<len_filled;i++)
{
for (int j = 0; j < len_filled; j++)
{
if (i!=j)
{
if (filled[i][0]-filled[j][0]==0)
{
if ((abs(filled[i][1]-filled[j][1])+abs(filled[i][2]-filled[j][2]))%2==1)
{
flag=1;
break;
}
}
else
{
if ((abs(filled[i][1]-filled[j][1])+abs(filled[i][2]-filled[j][2]))%2==0)
{
flag=1;
break;
}
}
}
}
}
if (flag)
printf("NO\n");
else
{
printf("YES\n");
if ((filled[0][1]+filled[0][2])%2==0)
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
if ((i+j)%2==1)
printf("%c",not_of(filled[0][0]));
else
printf("%c",fun(filled[0][0]));
}
printf("\n");
}
}
else
{
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
if ((i+j)%2==0)
printf("%c",not_of(filled[0][0]));
else
printf("%c",fun(filled[0][0]));
}
printf("\n");
}
}
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2443/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2443/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @key(i8 noundef signext %c) local_unnamed_addr #0 {
entry:
%cmp = icmp ne i8 %c, 82
%. = zext i1 %cmp to i32
ret i32 %.
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local signext i8 @fun(i32 noundef %c) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %c, 0
%. = select i1 %cmp, i8 82, i8 87
ret i8 %.
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local signext i8 @not_of(i32 noundef %c) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %c, 0
%. = select i1 %cmp, i8 87, i8 82
ret i8 %.
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%t = alloca i32, align 4
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec262 = add nsw i32 %0, -1
store i32 %dec262, ptr %t, align 4, !tbaa !5
%tobool.not263 = icmp eq i32 %0, 0
br i1 %tobool.not263, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end186
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%1 = load i32, ptr %m, align 4, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %2, %1
%3 = zext i32 %mul to i64
%4 = call ptr @llvm.stacksave.p0()
%vla = alloca [3 x i32], i64 %3, align 16
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp241 = icmp sgt i32 %5, 0
br i1 %cmp241, label %for.cond2.preheader, label %if.else97
for.cond24.preheader: ; preds = %for.cond.cleanup4
%cmp25250 = icmp sgt i32 %len_filled.1.lcssa, 0
br i1 %cmp25250, label %for.cond30.preheader.us.preheader, label %if.else97
for.cond30.preheader.us.preheader: ; preds = %for.cond24.preheader
%wide.trip.count269 = zext i32 %len_filled.1.lcssa to i64
br label %for.cond30.preheader.us
for.cond30.preheader.us: ; preds = %for.cond30.preheader.us.preheader, %cleanup.us
%indvars.iv266 = phi i64 [ 0, %for.cond30.preheader.us.preheader ], [ %indvars.iv.next267, %cleanup.us ]
%flag.0251.us = phi i32 [ 0, %for.cond30.preheader.us.preheader ], [ %flag.1.us, %cleanup.us ]
%arrayidx67.us = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv266, i64 1
%arrayidx39.us = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv266
%arrayidx74.us = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv266, i64 2
br label %for.body34.us
for.body34.us: ; preds = %for.cond30.preheader.us, %for.inc87.us
%indvars.iv = phi i64 [ 0, %for.cond30.preheader.us ], [ %indvars.iv.next, %for.inc87.us ]
%cmp35.not.us = icmp eq i64 %indvars.iv266, %indvars.iv
br i1 %cmp35.not.us, label %for.inc87.us, label %if.then37.us
if.then37.us: ; preds = %for.body34.us
%6 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5
%arrayidx42.us = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv
%7 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5
%cmp44.us = icmp eq i32 %6, %7
%8 = load i32, ptr %arrayidx67.us, align 4, !tbaa !5
%arrayidx52.us = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv, i64 1
%9 = load i32, ptr %arrayidx52.us, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx74.us, align 4, !tbaa !5
%arrayidx59.us = getelementptr inbounds [3 x i32], ptr %vla, i64 %indvars.iv, i64 2
%11 = load i32, ptr %arrayidx59.us, align 4, !tbaa !5
%12 = add i32 %8, %10
%13 = add i32 %9, %11
%add.us = sub i32 %12, %13
%rem.us = and i32 %add.us, 1
%cmp61.not.us = icmp eq i32 %rem.us, 0
br i1 %cmp44.us, label %if.then46.us, label %if.else.us
if.else.us: ; preds = %if.then37.us
br i1 %cmp61.not.us, label %cleanup.us, label %for.inc87.us
if.then46.us: ; preds = %if.then37.us
br i1 %cmp61.not.us, label %for.inc87.us, label %cleanup.us
cleanup.us: ; preds = %for.inc87.us, %if.then46.us, %if.else.us
%flag.1.us = phi i32 [ 1, %if.else.us ], [ 1, %if.then46.us ], [ %flag.0251.us, %for.inc87.us ]
%indvars.iv.next267 = add nuw nsw i64 %indvars.iv266, 1
%exitcond270.not = icmp eq i64 %indvars.iv.next267, %wide.trip.count269
br i1 %exitcond270.not, label %for.cond.cleanup27, label %for.cond30.preheader.us, !llvm.loop !9
for.inc87.us: ; preds = %if.then46.us, %if.else.us, %for.body34.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count269
br i1 %exitcond.not, label %cleanup.us, label %for.body34.us, !llvm.loop !11
for.cond2.preheader: ; preds = %while.body, %for.cond.cleanup4
%i.0243 = phi i32 [ %inc21, %for.cond.cleanup4 ], [ 0, %while.body ]
%len_filled.0242 = phi i32 [ %len_filled.1.lcssa, %for.cond.cleanup4 ], [ 0, %while.body ]
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp3238 = icmp sgt i32 %14, 0
br i1 %cmp3238, label %for.body5, label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %if.end, %for.cond2.preheader
%len_filled.1.lcssa = phi i32 [ %len_filled.0242, %for.cond2.preheader ], [ %len_filled.2, %if.end ]
%15 = load ptr, ptr @stdin, align 8, !tbaa !12
%call.i = call i32 @getc(ptr noundef %15)
%inc21 = add nuw nsw i32 %i.0243, 1
%16 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc21, %16
br i1 %cmp, label %for.cond2.preheader, label %for.cond24.preheader, !llvm.loop !14
for.body5: ; preds = %for.cond2.preheader, %if.end
%j.0240 = phi i32 [ %inc18, %if.end ], [ 0, %for.cond2.preheader ]
%len_filled.1239 = phi i32 [ %len_filled.2, %if.end ], [ %len_filled.0242, %for.cond2.preheader ]
%17 = load ptr, ptr @stdin, align 8, !tbaa !12
%call.i225 = call i32 @getc(ptr noundef %17)
%sext.mask = and i32 %call.i225, 255
%cmp8.not = icmp eq i32 %sext.mask, 46
br i1 %cmp8.not, label %if.end, label %if.then
if.then: ; preds = %for.body5
%cmp.i = icmp ne i32 %sext.mask, 82
%..i = zext i1 %cmp.i to i32
%idxprom = sext i32 %len_filled.1239 to i64
%arrayidx = getelementptr inbounds [3 x i32], ptr %vla, i64 %idxprom
store i32 %..i, ptr %arrayidx, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds [3 x i32], ptr %vla, i64 %idxprom, i64 1
store i32 %i.0243, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx17 = getelementptr inbounds [3 x i32], ptr %vla, i64 %idxprom, i64 2
store i32 %j.0240, ptr %arrayidx17, align 4, !tbaa !5
%inc = add nsw i32 %len_filled.1239, 1
br label %if.end
if.end: ; preds = %if.then, %for.body5
%len_filled.2 = phi i32 [ %inc, %if.then ], [ %len_filled.1239, %for.body5 ]
%inc18 = add nuw nsw i32 %j.0240, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc18, %18
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !15
for.cond.cleanup27: ; preds = %cleanup.us
%tobool94.not = icmp eq i32 %flag.1.us, 0
br i1 %tobool94.not, label %if.else97, label %if.then95
if.then95: ; preds = %for.cond.cleanup27
%puts224 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %if.end186
if.else97: ; preds = %while.body, %for.cond24.preheader, %for.cond.cleanup27
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%arrayidx100 = getelementptr inbounds [3 x i32], ptr %vla, i64 0, i64 1
%19 = load i32, ptr %arrayidx100, align 4, !tbaa !5
%arrayidx102 = getelementptr inbounds [3 x i32], ptr %vla, i64 0, i64 2
%20 = load i32, ptr %arrayidx102, align 8, !tbaa !5
%add103 = add nsw i32 %20, %19
%21 = and i32 %add103, 1
%cmp105 = icmp eq i32 %21, 0
%22 = load i32, ptr %m, align 4, !tbaa !5
%cmp110260 = icmp sgt i32 %22, 0
br i1 %cmp105, label %for.cond109.preheader, label %for.cond148.preheader
for.cond148.preheader: ; preds = %if.else97
br i1 %cmp110260, label %for.cond154.preheader, label %if.end186
for.cond109.preheader: ; preds = %if.else97
br i1 %cmp110260, label %for.cond115.preheader, label %if.end186
for.cond115.preheader: ; preds = %for.cond109.preheader, %for.cond.cleanup118
%i108.0261 = phi i32 [ %inc143, %for.cond.cleanup118 ], [ 0, %for.cond109.preheader ]
%23 = load i32, ptr %n, align 4, !tbaa !5
%cmp116258 = icmp sgt i32 %23, 0
br i1 %cmp116258, label %for.body119.preheader, label %for.cond.cleanup118
for.body119.preheader: ; preds = %for.cond115.preheader
%24 = load i32, ptr %vla, align 16, !tbaa !5
%cmp.i228 = icmp eq i32 %24, 0
%conv128 = select i1 %cmp.i228, i32 87, i32 82
%conv134 = select i1 %cmp.i228, i32 82, i32 87
br label %for.body119
for.cond.cleanup118: ; preds = %for.body119, %for.cond115.preheader
%putchar221 = call i32 @putchar(i32 10)
%inc143 = add nuw nsw i32 %i108.0261, 1
%25 = load i32, ptr %m, align 4, !tbaa !5
%cmp110 = icmp slt i32 %inc143, %25
br i1 %cmp110, label %for.cond115.preheader, label %if.end186, !llvm.loop !16
for.body119: ; preds = %for.body119.preheader, %for.body119
%j114.0259 = phi i32 [ %inc138, %for.body119 ], [ 0, %for.body119.preheader ]
%add120 = add nuw nsw i32 %j114.0259, %i108.0261
%rem121 = and i32 %add120, 1
%cmp122.not = icmp eq i32 %rem121, 0
%conv128.sink = select i1 %cmp122.not, i32 %conv134, i32 %conv128
%putchar223 = call i32 @putchar(i32 %conv128.sink)
%inc138 = add nuw nsw i32 %j114.0259, 1
%26 = load i32, ptr %n, align 4, !tbaa !5
%cmp116 = icmp slt i32 %inc138, %26
br i1 %cmp116, label %for.body119, label %for.cond.cleanup118, !llvm.loop !17
for.cond154.preheader: ; preds = %for.cond148.preheader, %for.cond.cleanup157
%i147.0257 = phi i32 [ %inc182, %for.cond.cleanup157 ], [ 0, %for.cond148.preheader ]
%27 = load i32, ptr %n, align 4, !tbaa !5
%cmp155254 = icmp sgt i32 %27, 0
br i1 %cmp155254, label %for.body158.preheader, label %for.cond.cleanup157
for.body158.preheader: ; preds = %for.cond154.preheader
%28 = load i32, ptr %vla, align 16, !tbaa !5
%cmp.i230 = icmp eq i32 %28, 0
%conv167 = select i1 %cmp.i230, i32 87, i32 82
%conv173 = select i1 %cmp.i230, i32 82, i32 87
br label %for.body158
for.cond.cleanup157: ; preds = %for.body158, %for.cond154.preheader
%putchar = call i32 @putchar(i32 10)
%inc182 = add nuw nsw i32 %i147.0257, 1
%29 = load i32, ptr %m, align 4, !tbaa !5
%cmp149 = icmp slt i32 %inc182, %29
br i1 %cmp149, label %for.cond154.preheader, label %if.end186, !llvm.loop !18
for.body158: ; preds = %for.body158.preheader, %for.body158
%j153.0255 = phi i32 [ %inc177, %for.body158 ], [ 0, %for.body158.preheader ]
%add159 = add nuw nsw i32 %j153.0255, %i147.0257
%rem160 = and i32 %add159, 1
%cmp161 = icmp eq i32 %rem160, 0
%conv167.sink = select i1 %cmp161, i32 %conv167, i32 %conv173
%putchar220 = call i32 @putchar(i32 %conv167.sink)
%inc177 = add nuw nsw i32 %j153.0255, 1
%30 = load i32, ptr %n, align 4, !tbaa !5
%cmp155 = icmp slt i32 %inc177, %30
br i1 %cmp155, label %for.body158, label %for.cond.cleanup157, !llvm.loop !19
if.end186: ; preds = %for.cond.cleanup157, %for.cond.cleanup118, %for.cond148.preheader, %for.cond109.preheader, %if.then95
call void @llvm.stackrestore.p0(ptr %4)
%31 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %31, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %31, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %if.end186, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
int main()
{
long long n,m, ans=0, curr=1, task;
scanf("%I64d", &n);
scanf("%I64d", &m);
while(m--)
{
scanf("%I64d", &task);
if(task >= curr)
{
ans+= task-curr;
curr = task;
}
if(task < curr)
{
ans += n-curr + task;
curr = task;
}
}
printf("%I64d", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_24435/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_24435/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%I64d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
%task = 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 %m) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %task) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i64, ptr %m, align 8, !tbaa !5
%dec16 = add nsw i64 %0, -1
store i64 %dec16, ptr %m, align 8, !tbaa !5
%tobool.not17 = icmp eq i64 %0, 0
br i1 %tobool.not17, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%curr.019 = phi i64 [ %1, %while.body ], [ 1, %entry ]
%ans.018 = phi i64 [ %ans.2, %while.body ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %task)
%1 = load i64, ptr %task, align 8, !tbaa !5
%cmp.not = icmp slt i64 %1, %curr.019
%sub = sub nsw i64 %1, %curr.019
%add = select i1 %cmp.not, i64 0, i64 %sub
%ans.1 = add nsw i64 %add, %ans.018
%curr.1 = call i64 @llvm.smax.i64(i64 %1, i64 %curr.019)
%2 = load i64, ptr %n, align 8
%sub5 = sub i64 %1, %curr.1
%add6 = add i64 %sub5, %2
%add7 = select i1 %cmp.not, i64 %add6, i64 0
%ans.2 = add nsw i64 %ans.1, %add7
%3 = load i64, ptr %m, align 8, !tbaa !5
%dec = add nsw i64 %3, -1
store i64 %dec, ptr %m, align 8, !tbaa !5
%tobool.not = icmp eq i64 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.2, %while.body ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %task) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a,b;
scanf("%d", &a);
scanf("%d", &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_244450/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244450/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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)
%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
%cmp3 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts10 = 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)
puts("a > b");
else if(a < b)
puts("a < b");
else
puts ("a == b");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244500/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244500/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a > b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@.str.3 = 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp2 = icmp slt 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 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b;
while(scanf("%d%d",&a,&b)==2){
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_244544/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244544/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp13 = icmp eq i32 %call12, 2
br i1 %cmp13, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp slt i32 %0, %1
%cmp3 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp1, ptr @str.5, ptr %str.4.str
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%cmp = icmp eq i32 %call, 2
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a>=-1000 && b<=1000){
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_244595/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244595/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp = icmp sgt i32 %0, -1001
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 1001
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.end11
if.then: ; preds = %entry
%cmp2 = icmp slt i32 %0, %1
%cmp5 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp5, ptr @str.4, ptr @str
%str.5.sink = select i1 %cmp2, ptr @str.5, ptr %str.4.str
%puts14 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
br label %if.end11
if.end11: ; preds = %if.then, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#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_244638/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244638/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 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 eq 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_244681/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244681/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 if(a<b)
{
printf("a < b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244724/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244724/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
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 slt 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) {
puts("a > b");
} else if ( a<b ) {
puts("a < b");
} else if ( a==b ) {
puts("a == b");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244775/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244775/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"a > b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@.str.3 = 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) #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)
%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 sgt i32 %0, %1
br i1 %cmp, label %if.end11.sink.split, label %if.else
if.else: ; preds = %entry
%cmp3 = icmp slt i32 %0, %1
br i1 %cmp3, label %if.end11.sink.split, label %if.else6
if.else6: ; preds = %if.else
%cmp7 = icmp eq i32 %0, %1
br i1 %cmp7, label %if.end11.sink.split, label %if.end11
if.end11.sink.split: ; preds = %if.else6, %if.else, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else6 ]
%call5 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
br label %if.end11
if.end11: ; preds = %if.end11.sink.split, %if.else6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d",&a);scanf("%d",&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_244818/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244818/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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)
%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
%cmp3 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts10 = 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{
printf( "a == b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244869/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244869/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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(int argc, char const *argv[])
{
int inputA;
int inputB;
scanf("%d %d", &inputA, &inputB);
if(inputA > inputB) {
printf("a > b\n");
}
else if (inputB > inputA)
{
printf("a < b\n");
}
else
{
printf("a == b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_244919/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244919/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%inputA = alloca i32, align 4
%inputB = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %inputA) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %inputB) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %inputA, ptr noundef nonnull %inputB)
%0 = load i32, ptr %inputA, align 4, !tbaa !5
%1 = load i32, ptr %inputB, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp2 = icmp sgt i32 %1, %0
%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 %inputB) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %inputA) #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_244962/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_244962/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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);
printf("%s\n", (a<b)? "a < b" : (a>b)? "a > b" : "a == b");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245011/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245011/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a < b\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.4 = 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
%cmp1 = icmp sgt i32 %0, %1
%cond = select i1 %cmp1, ptr @.str.3, ptr @.str.4
%cond2 = select i1 %cmp, ptr @.str.2, ptr %cond
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond2)
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=0,b=0;
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_245055/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245055/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
store i32 0, ptr %b, align 4, !tbaa !5
%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,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_245112/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245112/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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");return 0;}
if(a<b){printf("a < b\n");return 0;}
printf("a == b\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245156/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245156/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 sgt i32 %0, %1
%cmp2 = icmp slt i32 %0, %1
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c,d,i,j,k,t,ar[10000];
scanf("%d%d%d",&a,&b,&c);
k=0;
for(i=1;(i*b)<=c;i++)
{
d=i*b;
if(d>a)
{
printf("%d ",d-a);
k++;
}}
if(!k)
printf("-1");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2452/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2452/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%cmp.not12 = icmp sgt i32 %0, %1
br i1 %cmp.not12, label %if.then5, label %for.body
for.body: ; preds = %entry, %for.inc
%2 = phi i32 [ %5, %for.inc ], [ %1, %entry ]
%3 = phi i32 [ %6, %for.inc ], [ %0, %entry ]
%mul15 = phi i32 [ %mul, %for.inc ], [ %0, %entry ]
%i.014 = phi i32 [ %inc4, %for.inc ], [ 1, %entry ]
%k.013 = phi i32 [ %k.1, %for.inc ], [ 0, %entry ]
%4 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp sgt i32 %mul15, %4
br i1 %cmp2, label %if.then, label %for.inc
if.then: ; preds = %for.body
%sub = sub nsw i32 %mul15, %4
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%inc = add nsw i32 %k.013, 1
%.pre = load i32, ptr %b, align 4, !tbaa !5
%.pre16 = load i32, ptr %c, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%5 = phi i32 [ %.pre16, %if.then ], [ %2, %for.body ]
%6 = phi i32 [ %.pre, %if.then ], [ %3, %for.body ]
%k.1 = phi i32 [ %inc, %if.then ], [ %k.013, %for.body ]
%inc4 = add nuw nsw i32 %i.014, 1
%mul = mul nsw i32 %6, %inc4
%cmp.not = icmp sgt i32 %mul, %5
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc
%7 = icmp eq i32 %k.1, 0
br i1 %7, label %if.then5, label %if.end7
if.then5: ; preds = %entry, %for.end
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end7
if.end7: ; preds = %if.then5, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#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_245242/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245242/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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,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_245286/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245286/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 main(void)
{
int a, b;
scanf("%d", &a);
scanf("%d", &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_245329/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245329/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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)
%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
%cmp3 = icmp sgt i32 %0, %1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts10 = 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 x, y;
scanf("%d", &x);
scanf("%d", &y);
if (x > y) {
printf("a > b\n");
} else if (x < y) {
printf("a < b\n");
} else {
printf("a == b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245372/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245372/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp3 = icmp slt i32 %0, %1
%str.4.str = select i1 %cmp3, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts10 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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_245459/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245459/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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){
puts("a < b");
}else if (a > b){
puts("a > b");
}else{
puts("a == b");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"a < b\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"a > b\00", align 1
@.str.3 = 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) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp2 = icmp sgt 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 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(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_245552/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245552/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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_245617/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245617/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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_245660/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245660/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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");
}
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_245703/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245703/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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()
{
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_245747/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245747/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 sgt i32 %0, %1
br i1 %cmp, label %if.end10.sink.split, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp slt 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");
} else if (a > b ) {
printf("a > b\n");
} else {
printf("a == b\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 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()
{ float a, b;
scanf("%f %f", &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_245833/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245833/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%f %f\00", align 1
@str = 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 float, align 4
%b = alloca float, 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 float, ptr %a, align 4, !tbaa !5
%1 = load float, ptr %b, align 4, !tbaa !5
%cmp = fcmp ogt float %0, %1
%cmp2 = fcmp olt float %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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int su1[10],su2[10],n,keta,ai,aj,max,min;
int isu[1000000];
int i,j,k,f;
int temp;
while(1){
scanf("%d %d",&n,&keta);
if(n==0 && keta == 0) break;
isu[0] = n;
for(i=0;i<keta;i++){
su1[i] = n%10;
su2[i] = n%10;
n /= 10;
}
for(i=1;i<100000;i++){
for(j=0;j<keta;j++){
for(k=keta-1;k>0;k--){
if(su1[k]>su1[k-1]){
temp=su1[k];
su1[k]=su1[k-1];
su1[k-1]=temp;
}
if(su2[k]<su2[k-1]){
temp=su2[k];
su2[k]=su2[k-1];
su2[k-1]=temp;
}
}
}
max=0;
min=0;
for(j=0;j<keta;j++){
max = (max*10)+su1[j];
min = (min*10)+su2[j];
}
isu[i] = max-min;
f=0;
for(j=0;j<i;j++){
if(i != j && isu[j] == isu[i]){
aj = j;
ai = i;
f = 1;
}
}
if(f==1) break;
n=isu[i];
for(j=0;j<keta;j++){
su1[j] = n%10;
su2[j] = n%10;
n /= 10;
}
}
printf("%d %d %d\n",aj,isu[aj],ai-aj);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245877/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245877/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%su1 = alloca [10 x i32], align 16
%su2 = alloca [10 x i32], align 16
%n = alloca i32, align 4
%keta = alloca i32, align 4
%isu = alloca [1000000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %su1) #3
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %su2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %keta) #3
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %isu) #3
%call187 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %keta)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp188 = icmp eq i32 %0, 0
%1 = load i32, ptr %keta, align 4
%cmp1189 = icmp eq i32 %1, 0
%or.cond190 = select i1 %cmp188, i1 %cmp1189, i1 false
br i1 %or.cond190, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end107
%2 = phi i32 [ %37, %for.end107 ], [ %1, %entry ]
%n.promoted = phi i32 [ %36, %for.end107 ], [ %0, %entry ]
%aj.0192 = phi i32 [ %aj.3.lcssa, %for.end107 ], [ undef, %entry ]
%ai.0191 = phi i32 [ %ai.3.lcssa, %for.end107 ], [ undef, %entry ]
store i32 %n.promoted, ptr %isu, align 16, !tbaa !5
%cmp2160 = icmp sgt i32 %2, 0
%wide.trip.count = zext i32 %2 to i64
br i1 %cmp2160, label %for.body.preheader, label %for.cond7.preheader
for.body.preheader: ; preds = %if.end
%xtraiter = and i64 %wide.trip.count, 1
%3 = icmp eq i32 %2, 1
br i1 %3, label %for.cond.for.cond7.preheader_crit_edge.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond.for.cond7.preheader_crit_edge.unr-lcssa: ; preds = %for.body, %for.body.preheader
%div.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %div.1, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%div159161.unr = phi i32 [ %n.promoted, %for.body.preheader ], [ %div.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.for.cond7.preheader_crit_edge, label %for.body.epil
for.body.epil: ; preds = %for.cond.for.cond7.preheader_crit_edge.unr-lcssa
%rem.epil = srem i32 %div159161.unr, 10
%arrayidx3.epil = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv.unr
store i32 %rem.epil, ptr %arrayidx3.epil, align 4, !tbaa !5
%arrayidx6.epil = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv.unr
store i32 %rem.epil, ptr %arrayidx6.epil, align 4, !tbaa !5
%div.epil = sdiv i32 %div159161.unr, 10
br label %for.cond.for.cond7.preheader_crit_edge
for.cond.for.cond7.preheader_crit_edge: ; preds = %for.cond.for.cond7.preheader_crit_edge.unr-lcssa, %for.body.epil
%div.lcssa = phi i32 [ %div.lcssa.ph, %for.cond.for.cond7.preheader_crit_edge.unr-lcssa ], [ %div.epil, %for.body.epil ]
store i32 %div.lcssa, ptr %n, align 4, !tbaa !5
br label %for.cond7.preheader
for.cond7.preheader: ; preds = %if.end, %for.cond.for.cond7.preheader_crit_edge
%cmp14164 = icmp sgt i32 %2, 1
%xtraiter224 = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %2, 1
%unroll_iter228 = and i64 %wide.trip.count, 4294967294
%lcmp.mod225.not = icmp eq i64 %xtraiter224, 0
%xtraiter237 = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %2, 1
%unroll_iter241 = and i64 %wide.trip.count, 4294967294
%lcmp.mod239.not = icmp eq i64 %xtraiter237, 0
br label %for.cond10.preheader
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ]
%div159161 = phi i32 [ %n.promoted, %for.body.preheader.new ], [ %div.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%rem = srem i32 %div159161, 10
%arrayidx3 = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv
store i32 %rem, ptr %arrayidx3, align 8, !tbaa !5
%arrayidx6 = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv
store i32 %rem, ptr %arrayidx6, align 8, !tbaa !5
%div = sdiv i32 %div159161, 10
%indvars.iv.next = or i64 %indvars.iv, 1
%rem.1 = srem i32 %div, 10
%arrayidx3.1 = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv.next
store i32 %rem.1, ptr %arrayidx3.1, align 4, !tbaa !5
%arrayidx6.1 = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv.next
store i32 %rem.1, ptr %arrayidx6.1, align 4, !tbaa !5
%div.1 = sdiv i32 %div159161, 100
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.for.cond7.preheader_crit_edge.unr-lcssa, label %for.body, !llvm.loop !9
for.cond10.preheader: ; preds = %for.cond7.preheader, %for.inc105
%indvar = phi i64 [ 0, %for.cond7.preheader ], [ %indvar.next, %for.inc105 ]
%indvars.iv217 = phi i64 [ 1, %for.cond7.preheader ], [ %indvars.iv.next218, %for.inc105 ]
%aj.1185 = phi i32 [ %aj.0192, %for.cond7.preheader ], [ %aj.3.lcssa, %for.inc105 ]
%ai.1184 = phi i32 [ %ai.0191, %for.cond7.preheader ], [ %ai.3.lcssa, %for.inc105 ]
br i1 %cmp2160, label %for.cond13.preheader.lr.ph, label %for.end68
for.cond13.preheader.lr.ph: ; preds = %for.cond10.preheader
br i1 %cmp14164, label %for.cond13.preheader.us, label %for.body59.preheader
for.cond13.preheader.us: ; preds = %for.cond13.preheader.lr.ph, %for.cond13.for.inc54_crit_edge.us
%j.0168.us = phi i32 [ %inc55.us, %for.cond13.for.inc54_crit_edge.us ], [ 0, %for.cond13.preheader.lr.ph ]
br label %for.body15.us
for.body15.us: ; preds = %for.cond13.preheader.us, %for.inc52.us
%indvars.iv195 = phi i64 [ %wide.trip.count, %for.cond13.preheader.us ], [ %indvars.iv.next196, %for.inc52.us ]
%indvars.iv.next196 = add nsw i64 %indvars.iv195, -1
%idxprom16.us = and i64 %indvars.iv.next196, 4294967295
%arrayidx17.us = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %idxprom16.us
%6 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5
%sub18.us = add i64 %indvars.iv195, 4294967294
%idxprom19.us = and i64 %sub18.us, 4294967295
%arrayidx20.us = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %idxprom19.us
%7 = load i32, ptr %arrayidx20.us, align 4, !tbaa !5
%cmp21.us = icmp sgt i32 %6, %7
br i1 %cmp21.us, label %if.then22.us, label %if.end33.us
if.then22.us: ; preds = %for.body15.us
store i32 %7, ptr %arrayidx17.us, align 4, !tbaa !5
store i32 %6, ptr %arrayidx20.us, align 4, !tbaa !5
br label %if.end33.us
if.end33.us: ; preds = %if.then22.us, %for.body15.us
%arrayidx35.us = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %idxprom16.us
%8 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5
%arrayidx38.us = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %idxprom19.us
%9 = load i32, ptr %arrayidx38.us, align 4, !tbaa !5
%cmp39.us = icmp slt i32 %8, %9
br i1 %cmp39.us, label %if.then40.us, label %for.inc52.us
if.then40.us: ; preds = %if.end33.us
store i32 %9, ptr %arrayidx35.us, align 4, !tbaa !5
store i32 %8, ptr %arrayidx38.us, align 4, !tbaa !5
br label %for.inc52.us
for.inc52.us: ; preds = %if.then40.us, %if.end33.us
%cmp14.us = icmp sgt i64 %indvars.iv195, 2
br i1 %cmp14.us, label %for.body15.us, label %for.cond13.for.inc54_crit_edge.us, !llvm.loop !11
for.cond13.for.inc54_crit_edge.us: ; preds = %for.inc52.us
%inc55.us = add nuw nsw i32 %j.0168.us, 1
%exitcond198.not = icmp eq i32 %inc55.us, %2
br i1 %exitcond198.not, label %for.cond57.preheader, label %for.cond13.preheader.us, !llvm.loop !12
for.cond57.preheader: ; preds = %for.cond13.for.inc54_crit_edge.us
br i1 %cmp2160, label %for.body59.preheader, label %for.end68
for.body59.preheader: ; preds = %for.cond13.preheader.lr.ph, %for.cond57.preheader
br i1 %4, label %for.end68.loopexit.unr-lcssa, label %for.body59
for.body59: ; preds = %for.body59.preheader, %for.body59
%indvars.iv199 = phi i64 [ %indvars.iv.next200.1, %for.body59 ], [ 0, %for.body59.preheader ]
%min.0171 = phi i32 [ %add65.1, %for.body59 ], [ 0, %for.body59.preheader ]
%max.0170 = phi i32 [ %add.1, %for.body59 ], [ 0, %for.body59.preheader ]
%niter229 = phi i64 [ %niter229.next.1, %for.body59 ], [ 0, %for.body59.preheader ]
%mul = mul nsw i32 %max.0170, 10
%arrayidx61 = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv199
%10 = load i32, ptr %arrayidx61, align 8, !tbaa !5
%add = add nsw i32 %10, %mul
%mul62 = mul nsw i32 %min.0171, 10
%arrayidx64 = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv199
%11 = load i32, ptr %arrayidx64, align 8, !tbaa !5
%add65 = add nsw i32 %11, %mul62
%indvars.iv.next200 = or i64 %indvars.iv199, 1
%mul.1 = mul nsw i32 %add, 10
%arrayidx61.1 = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv.next200
%12 = load i32, ptr %arrayidx61.1, align 4, !tbaa !5
%add.1 = add nsw i32 %12, %mul.1
%mul62.1 = mul nsw i32 %add65, 10
%arrayidx64.1 = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv.next200
%13 = load i32, ptr %arrayidx64.1, align 4, !tbaa !5
%add65.1 = add nsw i32 %13, %mul62.1
%indvars.iv.next200.1 = add nuw nsw i64 %indvars.iv199, 2
%niter229.next.1 = add i64 %niter229, 2
%niter229.ncmp.1 = icmp eq i64 %niter229.next.1, %unroll_iter228
br i1 %niter229.ncmp.1, label %for.end68.loopexit.unr-lcssa, label %for.body59, !llvm.loop !13
for.end68.loopexit.unr-lcssa: ; preds = %for.body59, %for.body59.preheader
%add.lcssa.ph = phi i32 [ undef, %for.body59.preheader ], [ %add.1, %for.body59 ]
%add65.lcssa.ph = phi i32 [ undef, %for.body59.preheader ], [ %add65.1, %for.body59 ]
%indvars.iv199.unr = phi i64 [ 0, %for.body59.preheader ], [ %indvars.iv.next200.1, %for.body59 ]
%min.0171.unr = phi i32 [ 0, %for.body59.preheader ], [ %add65.1, %for.body59 ]
%max.0170.unr = phi i32 [ 0, %for.body59.preheader ], [ %add.1, %for.body59 ]
br i1 %lcmp.mod225.not, label %for.end68.loopexit, label %for.body59.epil
for.body59.epil: ; preds = %for.end68.loopexit.unr-lcssa
%mul.epil = mul nsw i32 %max.0170.unr, 10
%arrayidx61.epil = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv199.unr
%14 = load i32, ptr %arrayidx61.epil, align 4, !tbaa !5
%add.epil = add nsw i32 %14, %mul.epil
%mul62.epil = mul nsw i32 %min.0171.unr, 10
%arrayidx64.epil = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv199.unr
%15 = load i32, ptr %arrayidx64.epil, align 4, !tbaa !5
%add65.epil = add nsw i32 %15, %mul62.epil
br label %for.end68.loopexit
for.end68.loopexit: ; preds = %for.end68.loopexit.unr-lcssa, %for.body59.epil
%add.lcssa = phi i32 [ %add.lcssa.ph, %for.end68.loopexit.unr-lcssa ], [ %add.epil, %for.body59.epil ]
%add65.lcssa = phi i32 [ %add65.lcssa.ph, %for.end68.loopexit.unr-lcssa ], [ %add65.epil, %for.body59.epil ]
%16 = sub nsw i32 %add.lcssa, %add65.lcssa
br label %for.end68
for.end68: ; preds = %for.cond10.preheader, %for.end68.loopexit, %for.cond57.preheader
%sub69 = phi i32 [ 0, %for.cond57.preheader ], [ %16, %for.end68.loopexit ], [ 0, %for.cond10.preheader ]
%arrayidx71 = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %indvars.iv217
store i32 %sub69, ptr %arrayidx71, align 4, !tbaa !5
%17 = trunc i64 %indvars.iv217 to i32
%xtraiter230 = and i64 %indvars.iv217, 3
%18 = icmp ult i64 %indvar, 3
br i1 %18, label %for.end86.unr-lcssa, label %for.end68.new
for.end68.new: ; preds = %for.end68
%unroll_iter235 = and i64 %indvars.iv217, 9223372036854775804
br label %land.lhs.true76
land.lhs.true76: ; preds = %land.lhs.true76, %for.end68.new
%indvars.iv205 = phi i64 [ 0, %for.end68.new ], [ %indvars.iv.next206.3, %land.lhs.true76 ]
%f.0177 = phi i32 [ 0, %for.end68.new ], [ %f.1.3, %land.lhs.true76 ]
%aj.2175 = phi i32 [ %aj.1185, %for.end68.new ], [ %aj.3.3, %land.lhs.true76 ]
%ai.2174 = phi i32 [ %ai.1184, %for.end68.new ], [ %ai.3.3, %land.lhs.true76 ]
%niter236 = phi i64 [ 0, %for.end68.new ], [ %niter236.next.3, %land.lhs.true76 ]
%arrayidx78 = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %indvars.iv205
%19 = load i32, ptr %arrayidx78, align 16, !tbaa !5
%cmp81 = icmp eq i32 %19, %sub69
%20 = trunc i64 %indvars.iv205 to i32
%aj.3 = select i1 %cmp81, i32 %20, i32 %aj.2175
%indvars.iv.next206 = or i64 %indvars.iv205, 1
%arrayidx78.1 = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %indvars.iv.next206
%21 = load i32, ptr %arrayidx78.1, align 4, !tbaa !5
%cmp81.1 = icmp eq i32 %21, %sub69
%22 = trunc i64 %indvars.iv.next206 to i32
%aj.3.1 = select i1 %cmp81.1, i32 %22, i32 %aj.3
%indvars.iv.next206.1 = or i64 %indvars.iv205, 2
%arrayidx78.2 = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %indvars.iv.next206.1
%23 = load i32, ptr %arrayidx78.2, align 8, !tbaa !5
%cmp81.2 = icmp eq i32 %23, %sub69
%24 = trunc i64 %indvars.iv.next206.1 to i32
%aj.3.2 = select i1 %cmp81.2, i32 %24, i32 %aj.3.1
%indvars.iv.next206.2 = or i64 %indvars.iv205, 3
%arrayidx78.3 = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %indvars.iv.next206.2
%25 = load i32, ptr %arrayidx78.3, align 4, !tbaa !5
%cmp81.3 = icmp eq i32 %25, %sub69
%26 = select i1 %cmp81.3, i1 true, i1 %cmp81.2
%27 = select i1 %26, i1 true, i1 %cmp81.1
%28 = select i1 %27, i1 true, i1 %cmp81
%ai.3.3 = select i1 %28, i32 %17, i32 %ai.2174
%29 = trunc i64 %indvars.iv.next206.2 to i32
%aj.3.3 = select i1 %cmp81.3, i32 %29, i32 %aj.3.2
%30 = select i1 %cmp81.3, i1 true, i1 %cmp81.2
%31 = select i1 %30, i1 true, i1 %cmp81.1
%32 = select i1 %31, i1 true, i1 %cmp81
%f.1.3 = select i1 %32, i32 1, i32 %f.0177
%indvars.iv.next206.3 = add nuw nsw i64 %indvars.iv205, 4
%niter236.next.3 = add nuw i64 %niter236, 4
%niter236.ncmp.3 = icmp eq i64 %niter236.next.3, %unroll_iter235
br i1 %niter236.ncmp.3, label %for.end86.unr-lcssa, label %land.lhs.true76, !llvm.loop !14
for.end86.unr-lcssa: ; preds = %land.lhs.true76, %for.end68
%ai.3.lcssa.ph = phi i32 [ undef, %for.end68 ], [ %ai.3.3, %land.lhs.true76 ]
%aj.3.lcssa.ph = phi i32 [ undef, %for.end68 ], [ %aj.3.3, %land.lhs.true76 ]
%f.1.lcssa.ph = phi i32 [ undef, %for.end68 ], [ %f.1.3, %land.lhs.true76 ]
%indvars.iv205.unr = phi i64 [ 0, %for.end68 ], [ %indvars.iv.next206.3, %land.lhs.true76 ]
%f.0177.unr = phi i32 [ 0, %for.end68 ], [ %f.1.3, %land.lhs.true76 ]
%aj.2175.unr = phi i32 [ %aj.1185, %for.end68 ], [ %aj.3.3, %land.lhs.true76 ]
%ai.2174.unr = phi i32 [ %ai.1184, %for.end68 ], [ %ai.3.3, %land.lhs.true76 ]
%lcmp.mod231.not = icmp eq i64 %xtraiter230, 0
br i1 %lcmp.mod231.not, label %for.end86, label %land.lhs.true76.epil
land.lhs.true76.epil: ; preds = %for.end86.unr-lcssa, %land.lhs.true76.epil
%indvars.iv205.epil = phi i64 [ %indvars.iv.next206.epil, %land.lhs.true76.epil ], [ %indvars.iv205.unr, %for.end86.unr-lcssa ]
%f.0177.epil = phi i32 [ %f.1.epil, %land.lhs.true76.epil ], [ %f.0177.unr, %for.end86.unr-lcssa ]
%aj.2175.epil = phi i32 [ %aj.3.epil, %land.lhs.true76.epil ], [ %aj.2175.unr, %for.end86.unr-lcssa ]
%ai.2174.epil = phi i32 [ %ai.3.epil, %land.lhs.true76.epil ], [ %ai.2174.unr, %for.end86.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %land.lhs.true76.epil ], [ 0, %for.end86.unr-lcssa ]
%arrayidx78.epil = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %indvars.iv205.epil
%33 = load i32, ptr %arrayidx78.epil, align 4, !tbaa !5
%cmp81.epil = icmp eq i32 %33, %sub69
%ai.3.epil = select i1 %cmp81.epil, i32 %17, i32 %ai.2174.epil
%34 = trunc i64 %indvars.iv205.epil to i32
%aj.3.epil = select i1 %cmp81.epil, i32 %34, i32 %aj.2175.epil
%f.1.epil = select i1 %cmp81.epil, i32 1, i32 %f.0177.epil
%indvars.iv.next206.epil = add nuw nsw i64 %indvars.iv205.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter230
br i1 %epil.iter.cmp.not, label %for.end86, label %land.lhs.true76.epil, !llvm.loop !15
for.end86: ; preds = %land.lhs.true76.epil, %for.end86.unr-lcssa
%ai.3.lcssa = phi i32 [ %ai.3.lcssa.ph, %for.end86.unr-lcssa ], [ %ai.3.epil, %land.lhs.true76.epil ]
%aj.3.lcssa = phi i32 [ %aj.3.lcssa.ph, %for.end86.unr-lcssa ], [ %aj.3.epil, %land.lhs.true76.epil ]
%f.1.lcssa = phi i32 [ %f.1.lcssa.ph, %for.end86.unr-lcssa ], [ %f.1.epil, %land.lhs.true76.epil ]
%cmp87 = icmp eq i32 %f.1.lcssa, 1
br i1 %cmp87, label %for.end107, label %if.end89
if.end89: ; preds = %for.end86
store i32 %sub69, ptr %n, align 4, !tbaa !5
br i1 %cmp2160, label %for.body94.preheader, label %for.inc105
for.body94.preheader: ; preds = %if.end89
br i1 %5, label %for.cond92.for.inc105_crit_edge.unr-lcssa, label %for.body94
for.body94: ; preds = %for.body94.preheader, %for.body94
%indvars.iv211 = phi i64 [ %indvars.iv.next212.1, %for.body94 ], [ 0, %for.body94.preheader ]
%div101179181 = phi i32 [ %div101.1, %for.body94 ], [ %sub69, %for.body94.preheader ]
%niter242 = phi i64 [ %niter242.next.1, %for.body94 ], [ 0, %for.body94.preheader ]
%rem95 = srem i32 %div101179181, 10
%arrayidx97 = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv211
store i32 %rem95, ptr %arrayidx97, align 8, !tbaa !5
%arrayidx100 = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv211
store i32 %rem95, ptr %arrayidx100, align 8, !tbaa !5
%div101 = sdiv i32 %div101179181, 10
%indvars.iv.next212 = or i64 %indvars.iv211, 1
%rem95.1 = srem i32 %div101, 10
%arrayidx97.1 = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv.next212
store i32 %rem95.1, ptr %arrayidx97.1, align 4, !tbaa !5
%arrayidx100.1 = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv.next212
store i32 %rem95.1, ptr %arrayidx100.1, align 4, !tbaa !5
%div101.1 = sdiv i32 %div101179181, 100
%indvars.iv.next212.1 = add nuw nsw i64 %indvars.iv211, 2
%niter242.next.1 = add i64 %niter242, 2
%niter242.ncmp.1 = icmp eq i64 %niter242.next.1, %unroll_iter241
br i1 %niter242.ncmp.1, label %for.cond92.for.inc105_crit_edge.unr-lcssa, label %for.body94, !llvm.loop !17
for.cond92.for.inc105_crit_edge.unr-lcssa: ; preds = %for.body94, %for.body94.preheader
%div101.lcssa.ph = phi i32 [ undef, %for.body94.preheader ], [ %div101.1, %for.body94 ]
%indvars.iv211.unr = phi i64 [ 0, %for.body94.preheader ], [ %indvars.iv.next212.1, %for.body94 ]
%div101179181.unr = phi i32 [ %sub69, %for.body94.preheader ], [ %div101.1, %for.body94 ]
br i1 %lcmp.mod239.not, label %for.cond92.for.inc105_crit_edge, label %for.body94.epil
for.body94.epil: ; preds = %for.cond92.for.inc105_crit_edge.unr-lcssa
%rem95.epil = srem i32 %div101179181.unr, 10
%arrayidx97.epil = getelementptr inbounds [10 x i32], ptr %su1, i64 0, i64 %indvars.iv211.unr
store i32 %rem95.epil, ptr %arrayidx97.epil, align 4, !tbaa !5
%arrayidx100.epil = getelementptr inbounds [10 x i32], ptr %su2, i64 0, i64 %indvars.iv211.unr
store i32 %rem95.epil, ptr %arrayidx100.epil, align 4, !tbaa !5
%div101.epil = sdiv i32 %div101179181.unr, 10
br label %for.cond92.for.inc105_crit_edge
for.cond92.for.inc105_crit_edge: ; preds = %for.cond92.for.inc105_crit_edge.unr-lcssa, %for.body94.epil
%div101.lcssa = phi i32 [ %div101.lcssa.ph, %for.cond92.for.inc105_crit_edge.unr-lcssa ], [ %div101.epil, %for.body94.epil ]
store i32 %div101.lcssa, ptr %n, align 4, !tbaa !5
br label %for.inc105
for.inc105: ; preds = %for.cond92.for.inc105_crit_edge, %if.end89
%indvars.iv.next218 = add nuw nsw i64 %indvars.iv217, 1
%exitcond221.not = icmp eq i64 %indvars.iv.next218, 100000
%indvar.next = add i64 %indvar, 1
br i1 %exitcond221.not, label %for.end107, label %for.cond10.preheader, !llvm.loop !18
for.end107: ; preds = %for.end86, %for.inc105
%idxprom108 = sext i32 %aj.3.lcssa to i64
%arrayidx109 = getelementptr inbounds [1000000 x i32], ptr %isu, i64 0, i64 %idxprom108
%35 = load i32, ptr %arrayidx109, align 4, !tbaa !5
%sub110 = sub nsw i32 %ai.3.lcssa, %aj.3.lcssa
%call111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %aj.3.lcssa, i32 noundef %35, i32 noundef %sub110)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %keta)
%36 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %36, 0
%37 = load i32, ptr %keta, align 4
%cmp1 = icmp eq i32 %37, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %for.end107, %entry
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %isu) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %keta) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %su2) #3
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %su1) #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}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
|
#include<stdio.h>
#include <stdlib.h>
#include<string.h>
#define M 1000003
//#define M 1046527
long long H[M];
void getChar(char *ch){
for(int i = 0; i < strlen(ch); i++){
if ( ch[i] == 'A') ch[i] = '1';
else if ( ch[i] == 'C') ch[i] = '2';
else if ( ch[i] == 'G') ch[i] = '3';
else if ( ch[i] == 'T') ch[i] = '4';
}
}
long long getKey(char str[]){
long long sum = 0, p = 1, i;
for ( i = 0; i < strlen(str); i++ ){
sum += p*(str[i]);
p *= 5;
}
return sum;
}
int h1(int key){ return key % M; }
int h2(int key){ return 1 + (key % (M-1)); }
int h(int key, int i) {return (h1(key) + i * h2(key)) % M;}
int find(char str[]){
long long key,i = 0;
key = getKey(str);
while(i <= M)
{
int t = h(key, i);
if(H[t] == key){
return 1;
}
else if(H[t] == -1){
return 0;
}
i++;
}
return 0;
}
void insert(char str[]){
long long i = 0,key;
key = getKey(str);
while(1)
{
int t = h(key, i);
if(H[t] == key){
return ;
}
else if(H[t] == -1 )
{
H[t] = key;
return ;
}
i++;
}
}
int main(){
int i, n;
char str[14], com[9];
for ( i = 0; i < M; i++ ) H[i] = -1;
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf(" %s %s", com, str);
if ( com[0] == 'i' ){
getChar(str);
insert(str);
} else {
getChar(str);
if (find(str)){
printf("yes\n");
} else {
printf("no\n");
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_245934/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_245934/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@H = dso_local local_unnamed_addr global [1000003 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c" %s %s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree nounwind memory(argmem: readwrite) uwtable
define dso_local void @getChar(ptr nocapture noundef %ch) local_unnamed_addr #0 {
entry:
%char0 = load i8, ptr %ch, align 1
%cmp54.not = icmp eq i8 %char0, 0
br i1 %cmp54.not, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
ret void
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i8, ptr %ch, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %for.inc [
i8 65, label %for.inc.sink.split
i8 67, label %if.then12
i8 71, label %if.then21
i8 84, label %if.then30
]
if.then12: ; preds = %for.body
br label %for.inc.sink.split
if.then21: ; preds = %for.body
br label %for.inc.sink.split
if.then30: ; preds = %for.body
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %for.body, %if.then12, %if.then30, %if.then21
%.sink = phi i8 [ 51, %if.then21 ], [ 52, %if.then30 ], [ 50, %if.then12 ], [ 49, %for.body ]
store i8 %.sink, ptr %arrayidx, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %ch) #11
%cmp = icmp ugt i64 %call, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind memory(argmem: read) uwtable
define dso_local i64 @getKey(ptr nocapture noundef readonly %str) local_unnamed_addr #3 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp7.not = icmp eq i64 %call, 0
br i1 %cmp7.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call, 3
%0 = icmp ult i64 %call, 4
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %call, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%i.010 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.3, %for.body ]
%p.09 = phi i64 [ 1, %for.body.preheader.new ], [ %mul1.3, %for.body ]
%sum.08 = phi i64 [ 0, %for.body.preheader.new ], [ %add.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%arrayidx = getelementptr inbounds i8, ptr %str, i64 %i.010
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv = sext i8 %1 to i64
%mul = mul nsw i64 %p.09, %conv
%add = add nsw i64 %mul, %sum.08
%mul1 = mul nsw i64 %p.09, 5
%inc = or i64 %i.010, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %str, i64 %inc
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %2 to i64
%mul.1 = mul nsw i64 %mul1, %conv.1
%add.1 = add nsw i64 %mul.1, %add
%mul1.1 = mul i64 %p.09, 25
%inc.1 = or i64 %i.010, 2
%arrayidx.2 = getelementptr inbounds i8, ptr %str, i64 %inc.1
%3 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%conv.2 = sext i8 %3 to i64
%mul.2 = mul nsw i64 %mul1.1, %conv.2
%add.2 = add nsw i64 %mul.2, %add.1
%mul1.2 = mul i64 %p.09, 125
%inc.2 = or i64 %i.010, 3
%arrayidx.3 = getelementptr inbounds i8, ptr %str, i64 %inc.2
%4 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv.3 = sext i8 %4 to i64
%mul.3 = mul nsw i64 %mul1.2, %conv.3
%add.3 = add nsw i64 %mul.3, %add.2
%mul1.3 = mul i64 %p.09, 625
%inc.3 = add nuw nsw i64 %i.010, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !10
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%add.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %add.3, %for.body ]
%i.010.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.3, %for.body ]
%p.09.unr = phi i64 [ 1, %for.body.preheader ], [ %mul1.3, %for.body ]
%sum.08.unr = phi i64 [ 0, %for.body.preheader ], [ %add.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%i.010.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.010.unr, %for.end.loopexit.unr-lcssa ]
%p.09.epil = phi i64 [ %mul1.epil, %for.body.epil ], [ %p.09.unr, %for.end.loopexit.unr-lcssa ]
%sum.08.epil = phi i64 [ %add.epil, %for.body.epil ], [ %sum.08.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%arrayidx.epil = getelementptr inbounds i8, ptr %str, i64 %i.010.epil
%5 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv.epil = sext i8 %5 to i64
%mul.epil = mul nsw i64 %p.09.epil, %conv.epil
%add.epil = add nsw i64 %mul.epil, %sum.08.epil
%mul1.epil = mul nsw i64 %p.09.epil, 5
%inc.epil = add nuw nsw i64 %i.010.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %add.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %for.body.epil ]
ret i64 %sum.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @h1(i32 noundef %key) local_unnamed_addr #4 {
entry:
%rem = srem i32 %key, 1000003
ret i32 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @h2(i32 noundef %key) local_unnamed_addr #4 {
entry:
%rem = srem i32 %key, 1000002
%add = add nsw i32 %rem, 1
ret i32 %add
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @h(i32 noundef %key, i32 noundef %i) local_unnamed_addr #4 {
entry:
%rem.i = srem i32 %key, 1000003
%rem.i3 = srem i32 %key, 1000002
%add.i = add nsw i32 %rem.i3, 1
%mul = mul nsw i32 %add.i, %i
%add = add nsw i32 %mul, %rem.i
%rem = srem i32 %add, 1000003
ret i32 %rem
}
; Function Attrs: nofree nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @find(ptr nocapture noundef readonly %str) local_unnamed_addr #5 {
entry:
%call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp7.not.i = icmp eq i64 %call.i, 0
br i1 %cmp7.not.i, label %getKey.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %call.i, 3
%0 = icmp ult i64 %call.i, 4
br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %call.i, -4
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%i.010.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.3, %for.body.i ]
%p.09.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul1.i.3, %for.body.i ]
%sum.08.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %add.i.3, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.3, %for.body.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.010.i
%1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%conv.i = sext i8 %1 to i64
%mul.i = mul nsw i64 %p.09.i, %conv.i
%add.i = add nsw i64 %mul.i, %sum.08.i
%mul1.i = mul nsw i64 %p.09.i, 5
%inc.i = or i64 %i.010.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i
%2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5
%conv.i.1 = sext i8 %2 to i64
%mul.i.1 = mul nsw i64 %mul1.i, %conv.i.1
%add.i.1 = add nsw i64 %mul.i.1, %add.i
%mul1.i.1 = mul i64 %p.09.i, 25
%inc.i.1 = or i64 %i.010.i, 2
%arrayidx.i.2 = getelementptr inbounds i8, ptr %str, i64 %inc.i.1
%3 = load i8, ptr %arrayidx.i.2, align 1, !tbaa !5
%conv.i.2 = sext i8 %3 to i64
%mul.i.2 = mul nsw i64 %mul1.i.1, %conv.i.2
%add.i.2 = add nsw i64 %mul.i.2, %add.i.1
%mul1.i.2 = mul i64 %p.09.i, 125
%inc.i.2 = or i64 %i.010.i, 3
%arrayidx.i.3 = getelementptr inbounds i8, ptr %str, i64 %inc.i.2
%4 = load i8, ptr %arrayidx.i.3, align 1, !tbaa !5
%conv.i.3 = sext i8 %4 to i64
%mul.i.3 = mul nsw i64 %mul1.i.2, %conv.i.3
%add.i.3 = add nsw i64 %mul.i.3, %add.i.2
%mul1.i.3 = mul i64 %p.09.i, 625
%inc.i.3 = add nuw nsw i64 %i.010.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !10
getKey.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%add.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %add.i.3, %for.body.i ]
%i.010.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.3, %for.body.i ]
%p.09.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul1.i.3, %for.body.i ]
%sum.08.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %add.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa, %for.body.i.epil
%i.010.i.epil = phi i64 [ %inc.i.epil, %for.body.i.epil ], [ %i.010.i.unr, %getKey.exit.loopexit.unr-lcssa ]
%p.09.i.epil = phi i64 [ %mul1.i.epil, %for.body.i.epil ], [ %p.09.i.unr, %getKey.exit.loopexit.unr-lcssa ]
%sum.08.i.epil = phi i64 [ %add.i.epil, %for.body.i.epil ], [ %sum.08.i.unr, %getKey.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %getKey.exit.loopexit.unr-lcssa ]
%arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.010.i.epil
%5 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5
%conv.i.epil = sext i8 %5 to i64
%mul.i.epil = mul nsw i64 %p.09.i.epil, %conv.i.epil
%add.i.epil = add nsw i64 %mul.i.epil, %sum.08.i.epil
%mul1.i.epil = mul nsw i64 %p.09.i.epil, 5
%inc.i.epil = add nuw nsw i64 %i.010.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %getKey.exit, label %for.body.i.epil, !llvm.loop !13
getKey.exit: ; preds = %getKey.exit.loopexit.unr-lcssa, %for.body.i.epil, %entry
%sum.0.lcssa.i = phi i64 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %for.body.i.epil ]
%conv = trunc i64 %sum.0.lcssa.i to i32
%rem.i.i = srem i32 %conv, 1000003
%rem.i3.i = srem i32 %conv, 1000002
%add.i.i = add nsw i32 %rem.i3.i, 1
br label %while.body
while.body: ; preds = %if.else, %getKey.exit
%i.022 = phi i64 [ 0, %getKey.exit ], [ %inc, %if.else ]
%conv1 = trunc i64 %i.022 to i32
%mul.i17 = mul nsw i32 %add.i.i, %conv1
%add.i18 = add nsw i32 %mul.i17, %rem.i.i
%rem.i = srem i32 %add.i18, 1000003
%idxprom = sext i32 %rem.i to i64
%arrayidx = getelementptr inbounds [1000003 x i64], ptr @H, i64 0, i64 %idxprom
%6 = load i64, ptr %arrayidx, align 8, !tbaa !14
%cmp3 = icmp eq i64 %6, %sum.0.lcssa.i
br i1 %cmp3, label %cleanup11, label %if.else
if.else: ; preds = %while.body
%cmp7 = icmp eq i64 %6, -1
%inc = add nuw nsw i64 %i.022, 1
%exitcond.not = icmp eq i64 %inc, 1000004
%or.cond = select i1 %cmp7, i1 true, i1 %exitcond.not
br i1 %or.cond, label %cleanup11, label %while.body, !llvm.loop !16
cleanup11: ; preds = %if.else, %while.body
%retval.2 = phi i32 [ 0, %if.else ], [ 1, %while.body ]
ret i32 %retval.2
}
; Function Attrs: nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insert(ptr nocapture noundef readonly %str) local_unnamed_addr #6 {
entry:
%call.i = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp7.not.i = icmp eq i64 %call.i, 0
br i1 %cmp7.not.i, label %getKey.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %call.i, 3
%0 = icmp ult i64 %call.i, 4
br i1 %0, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %call.i, -4
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%i.010.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %inc.i.3, %for.body.i ]
%p.09.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %mul1.i.3, %for.body.i ]
%sum.08.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %add.i.3, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.3, %for.body.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %i.010.i
%1 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
%conv.i = sext i8 %1 to i64
%mul.i = mul nsw i64 %p.09.i, %conv.i
%add.i = add nsw i64 %mul.i, %sum.08.i
%mul1.i = mul nsw i64 %p.09.i, 5
%inc.i = or i64 %i.010.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i
%2 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5
%conv.i.1 = sext i8 %2 to i64
%mul.i.1 = mul nsw i64 %mul1.i, %conv.i.1
%add.i.1 = add nsw i64 %mul.i.1, %add.i
%mul1.i.1 = mul i64 %p.09.i, 25
%inc.i.1 = or i64 %i.010.i, 2
%arrayidx.i.2 = getelementptr inbounds i8, ptr %str, i64 %inc.i.1
%3 = load i8, ptr %arrayidx.i.2, align 1, !tbaa !5
%conv.i.2 = sext i8 %3 to i64
%mul.i.2 = mul nsw i64 %mul1.i.1, %conv.i.2
%add.i.2 = add nsw i64 %mul.i.2, %add.i.1
%mul1.i.2 = mul i64 %p.09.i, 125
%inc.i.2 = or i64 %i.010.i, 3
%arrayidx.i.3 = getelementptr inbounds i8, ptr %str, i64 %inc.i.2
%4 = load i8, ptr %arrayidx.i.3, align 1, !tbaa !5
%conv.i.3 = sext i8 %4 to i64
%mul.i.3 = mul nsw i64 %mul1.i.2, %conv.i.3
%add.i.3 = add nsw i64 %mul.i.3, %add.i.2
%mul1.i.3 = mul i64 %p.09.i, 625
%inc.i.3 = add nuw nsw i64 %i.010.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %getKey.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !10
getKey.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%add.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %add.i.3, %for.body.i ]
%i.010.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %inc.i.3, %for.body.i ]
%p.09.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %mul1.i.3, %for.body.i ]
%sum.08.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %add.i.3, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %getKey.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %getKey.exit.loopexit.unr-lcssa, %for.body.i.epil
%i.010.i.epil = phi i64 [ %inc.i.epil, %for.body.i.epil ], [ %i.010.i.unr, %getKey.exit.loopexit.unr-lcssa ]
%p.09.i.epil = phi i64 [ %mul1.i.epil, %for.body.i.epil ], [ %p.09.i.unr, %getKey.exit.loopexit.unr-lcssa ]
%sum.08.i.epil = phi i64 [ %add.i.epil, %for.body.i.epil ], [ %sum.08.i.unr, %getKey.exit.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.epil ], [ 0, %getKey.exit.loopexit.unr-lcssa ]
%arrayidx.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.010.i.epil
%5 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5
%conv.i.epil = sext i8 %5 to i64
%mul.i.epil = mul nsw i64 %p.09.i.epil, %conv.i.epil
%add.i.epil = add nsw i64 %mul.i.epil, %sum.08.i.epil
%mul1.i.epil = mul nsw i64 %p.09.i.epil, 5
%inc.i.epil = add nuw nsw i64 %i.010.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %getKey.exit, label %for.body.i.epil, !llvm.loop !17
getKey.exit: ; preds = %getKey.exit.loopexit.unr-lcssa, %for.body.i.epil, %entry
%sum.0.lcssa.i = phi i64 [ 0, %entry ], [ %add.i.lcssa.ph, %getKey.exit.loopexit.unr-lcssa ], [ %add.i.epil, %for.body.i.epil ]
%conv = trunc i64 %sum.0.lcssa.i to i32
%rem.i.i = srem i32 %conv, 1000003
%rem.i3.i = srem i32 %conv, 1000002
%add.i.i = add nsw i32 %rem.i3.i, 1
%idxprom24 = sext i32 %rem.i.i to i64
%arrayidx25 = getelementptr inbounds [1000003 x i64], ptr @H, i64 0, i64 %idxprom24
%6 = load i64, ptr %arrayidx25, align 8, !tbaa !14
%cmp26 = icmp eq i64 %6, %sum.0.lcssa.i
br i1 %cmp26, label %cleanup12, label %if.else.preheader
if.else.preheader: ; preds = %getKey.exit
%cmp632 = icmp eq i64 %6, -1
br i1 %cmp632, label %if.then8, label %while.cond
while.cond: ; preds = %if.else.preheader, %if.else
%i.02733 = phi i32 [ %inc, %if.else ], [ 0, %if.else.preheader ]
%inc = add i32 %i.02733, 1
%mul.i19 = mul nsw i32 %inc, %add.i.i
%add.i20 = add nsw i32 %mul.i19, %rem.i.i
%rem.i = srem i32 %add.i20, 1000003
%idxprom = sext i32 %rem.i to i64
%arrayidx = getelementptr inbounds [1000003 x i64], ptr @H, i64 0, i64 %idxprom
%7 = load i64, ptr %arrayidx, align 8, !tbaa !14
%cmp = icmp eq i64 %7, %sum.0.lcssa.i
br i1 %cmp, label %cleanup12, label %if.else
if.else: ; preds = %while.cond
%cmp6 = icmp eq i64 %7, -1
br i1 %cmp6, label %if.then8, label %while.cond
if.then8: ; preds = %if.else, %if.else.preheader
%arrayidx28.lcssa = phi ptr [ %arrayidx25, %if.else.preheader ], [ %arrayidx, %if.else ]
store i64 %sum.0.lcssa.i, ptr %arrayidx28.lcssa, align 8, !tbaa !14
br label %cleanup12
cleanup12: ; preds = %while.cond, %getKey.exit, %if.then8
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%n = alloca i32, align 4
%str = alloca [14 x i8], align 1
%com = alloca [9 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #12
call void @llvm.lifetime.start.p0(i64 14, ptr nonnull %str) #12
call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %com) #12
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000024) @H, i8 -1, i64 8000024, i1 false), !tbaa !14
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !18
%cmp274 = icmp sgt i32 %0, 0
br i1 %cmp274, label %for.body3, label %for.end21
for.body3: ; preds = %entry, %for.inc19
%i.175 = phi i32 [ %inc20, %for.inc19 ], [ 0, %entry ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com, ptr noundef nonnull %str)
%1 = load i8, ptr %com, align 1, !tbaa !5
%cmp7 = icmp eq i8 %1, 105
%char0.i = load i8, ptr %str, align 1
%cmp54.not.i = icmp eq i8 %char0.i, 0
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.body3
br i1 %cmp54.not.i, label %getChar.exit, label %for.body.i
for.body.i: ; preds = %if.then, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %if.then ]
%arrayidx.i = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i
%2 = load i8, ptr %arrayidx.i, align 1, !tbaa !5
switch i8 %2, label %for.inc.i [
i8 65, label %for.inc.sink.split.i
i8 67, label %if.then12.i
i8 71, label %if.then21.i
i8 84, label %if.then30.i
]
if.then12.i: ; preds = %for.body.i
br label %for.inc.sink.split.i
if.then21.i: ; preds = %for.body.i
br label %for.inc.sink.split.i
if.then30.i: ; preds = %for.body.i
br label %for.inc.sink.split.i
for.inc.sink.split.i: ; preds = %if.then30.i, %if.then21.i, %if.then12.i, %for.body.i
%.sink.i = phi i8 [ 51, %if.then21.i ], [ 52, %if.then30.i ], [ 50, %if.then12.i ], [ 49, %for.body.i ]
store i8 %.sink.i, ptr %arrayidx.i, align 1, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %for.inc.sink.split.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp.i = icmp ugt i64 %call.i, %indvars.iv.next.i
br i1 %cmp.i, label %for.body.i, label %getChar.exit, !llvm.loop !8
getChar.exit: ; preds = %for.inc.i, %if.then
%call.i.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp7.not.i.i = icmp eq i64 %call.i.i, 0
br i1 %cmp7.not.i.i, label %getKey.exit.i, label %for.body.i.i.preheader
for.body.i.i.preheader: ; preds = %getChar.exit
%xtraiter82 = and i64 %call.i.i, 3
%3 = icmp ult i64 %call.i.i, 4
br i1 %3, label %getKey.exit.i.loopexit.unr-lcssa, label %for.body.i.i.preheader.new
for.body.i.i.preheader.new: ; preds = %for.body.i.i.preheader
%unroll_iter86 = and i64 %call.i.i, -4
br label %for.body.i.i
for.body.i.i: ; preds = %for.body.i.i, %for.body.i.i.preheader.new
%i.010.i.i = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %inc.i.i.3, %for.body.i.i ]
%p.09.i.i = phi i64 [ 1, %for.body.i.i.preheader.new ], [ %mul1.i.i.3, %for.body.i.i ]
%sum.08.i.i = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %add.i.i.3, %for.body.i.i ]
%niter87 = phi i64 [ 0, %for.body.i.i.preheader.new ], [ %niter87.next.3, %for.body.i.i ]
%arrayidx.i.i = getelementptr inbounds i8, ptr %str, i64 %i.010.i.i
%4 = load i8, ptr %arrayidx.i.i, align 1, !tbaa !5
%conv.i.i = sext i8 %4 to i64
%mul.i.i = mul nsw i64 %p.09.i.i, %conv.i.i
%add.i.i = add nsw i64 %mul.i.i, %sum.08.i.i
%mul1.i.i = mul nsw i64 %p.09.i.i, 5
%inc.i.i = or i64 %i.010.i.i, 1
%arrayidx.i.i.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i
%5 = load i8, ptr %arrayidx.i.i.1, align 1, !tbaa !5
%conv.i.i.1 = sext i8 %5 to i64
%mul.i.i.1 = mul nsw i64 %mul1.i.i, %conv.i.i.1
%add.i.i.1 = add nsw i64 %mul.i.i.1, %add.i.i
%mul1.i.i.1 = mul i64 %p.09.i.i, 25
%inc.i.i.1 = or i64 %i.010.i.i, 2
%arrayidx.i.i.2 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i.1
%6 = load i8, ptr %arrayidx.i.i.2, align 1, !tbaa !5
%conv.i.i.2 = sext i8 %6 to i64
%mul.i.i.2 = mul nsw i64 %mul1.i.i.1, %conv.i.i.2
%add.i.i.2 = add nsw i64 %mul.i.i.2, %add.i.i.1
%mul1.i.i.2 = mul i64 %p.09.i.i, 125
%inc.i.i.2 = or i64 %i.010.i.i, 3
%arrayidx.i.i.3 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i.2
%7 = load i8, ptr %arrayidx.i.i.3, align 1, !tbaa !5
%conv.i.i.3 = sext i8 %7 to i64
%mul.i.i.3 = mul nsw i64 %mul1.i.i.2, %conv.i.i.3
%add.i.i.3 = add nsw i64 %mul.i.i.3, %add.i.i.2
%mul1.i.i.3 = mul i64 %p.09.i.i, 625
%inc.i.i.3 = add nuw nsw i64 %i.010.i.i, 4
%niter87.next.3 = add i64 %niter87, 4
%niter87.ncmp.3 = icmp eq i64 %niter87.next.3, %unroll_iter86
br i1 %niter87.ncmp.3, label %getKey.exit.i.loopexit.unr-lcssa, label %for.body.i.i, !llvm.loop !10
getKey.exit.i.loopexit.unr-lcssa: ; preds = %for.body.i.i, %for.body.i.i.preheader
%add.i.i.lcssa.ph = phi i64 [ undef, %for.body.i.i.preheader ], [ %add.i.i.3, %for.body.i.i ]
%i.010.i.i.unr = phi i64 [ 0, %for.body.i.i.preheader ], [ %inc.i.i.3, %for.body.i.i ]
%p.09.i.i.unr = phi i64 [ 1, %for.body.i.i.preheader ], [ %mul1.i.i.3, %for.body.i.i ]
%sum.08.i.i.unr = phi i64 [ 0, %for.body.i.i.preheader ], [ %add.i.i.3, %for.body.i.i ]
%lcmp.mod84.not = icmp eq i64 %xtraiter82, 0
br i1 %lcmp.mod84.not, label %getKey.exit.i, label %for.body.i.i.epil
for.body.i.i.epil: ; preds = %getKey.exit.i.loopexit.unr-lcssa, %for.body.i.i.epil
%i.010.i.i.epil = phi i64 [ %inc.i.i.epil, %for.body.i.i.epil ], [ %i.010.i.i.unr, %getKey.exit.i.loopexit.unr-lcssa ]
%p.09.i.i.epil = phi i64 [ %mul1.i.i.epil, %for.body.i.i.epil ], [ %p.09.i.i.unr, %getKey.exit.i.loopexit.unr-lcssa ]
%sum.08.i.i.epil = phi i64 [ %add.i.i.epil, %for.body.i.i.epil ], [ %sum.08.i.i.unr, %getKey.exit.i.loopexit.unr-lcssa ]
%epil.iter83 = phi i64 [ %epil.iter83.next, %for.body.i.i.epil ], [ 0, %getKey.exit.i.loopexit.unr-lcssa ]
%arrayidx.i.i.epil = getelementptr inbounds i8, ptr %str, i64 %i.010.i.i.epil
%8 = load i8, ptr %arrayidx.i.i.epil, align 1, !tbaa !5
%conv.i.i.epil = sext i8 %8 to i64
%mul.i.i.epil = mul nsw i64 %p.09.i.i.epil, %conv.i.i.epil
%add.i.i.epil = add nsw i64 %mul.i.i.epil, %sum.08.i.i.epil
%mul1.i.i.epil = mul nsw i64 %p.09.i.i.epil, 5
%inc.i.i.epil = add nuw nsw i64 %i.010.i.i.epil, 1
%epil.iter83.next = add i64 %epil.iter83, 1
%epil.iter83.cmp.not = icmp eq i64 %epil.iter83.next, %xtraiter82
br i1 %epil.iter83.cmp.not, label %getKey.exit.i, label %for.body.i.i.epil, !llvm.loop !20
getKey.exit.i: ; preds = %getKey.exit.i.loopexit.unr-lcssa, %for.body.i.i.epil, %getChar.exit
%sum.0.lcssa.i.i = phi i64 [ 0, %getChar.exit ], [ %add.i.i.lcssa.ph, %getKey.exit.i.loopexit.unr-lcssa ], [ %add.i.i.epil, %for.body.i.i.epil ]
%conv.i = trunc i64 %sum.0.lcssa.i.i to i32
%rem.i.i.i = srem i32 %conv.i, 1000003
%rem.i3.i.i = srem i32 %conv.i, 1000002
%add.i.i.i = add nsw i32 %rem.i3.i.i, 1
%idxprom24.i = sext i32 %rem.i.i.i to i64
%arrayidx25.i = getelementptr inbounds [1000003 x i64], ptr @H, i64 0, i64 %idxprom24.i
%9 = load i64, ptr %arrayidx25.i, align 8, !tbaa !14
%cmp26.i = icmp eq i64 %9, %sum.0.lcssa.i.i
br i1 %cmp26.i, label %for.inc19, label %if.else.i.preheader
if.else.i.preheader: ; preds = %getKey.exit.i
%cmp6.i72 = icmp eq i64 %9, -1
br i1 %cmp6.i72, label %if.then8.i, label %while.cond.i
while.cond.i: ; preds = %if.else.i.preheader, %if.else.i
%i.027.i73 = phi i32 [ %inc.i, %if.else.i ], [ 0, %if.else.i.preheader ]
%inc.i = add i32 %i.027.i73, 1
%mul.i19.i = mul nsw i32 %inc.i, %add.i.i.i
%add.i20.i = add nsw i32 %mul.i19.i, %rem.i.i.i
%rem.i.i = srem i32 %add.i20.i, 1000003
%idxprom.i = sext i32 %rem.i.i to i64
%arrayidx.i27 = getelementptr inbounds [1000003 x i64], ptr @H, i64 0, i64 %idxprom.i
%10 = load i64, ptr %arrayidx.i27, align 8, !tbaa !14
%cmp.i28 = icmp eq i64 %10, %sum.0.lcssa.i.i
br i1 %cmp.i28, label %for.inc19, label %if.else.i
if.else.i: ; preds = %while.cond.i
%cmp6.i = icmp eq i64 %10, -1
br i1 %cmp6.i, label %if.then8.i, label %while.cond.i
if.then8.i: ; preds = %if.else.i, %if.else.i.preheader
%arrayidx28.i.lcssa = phi ptr [ %arrayidx25.i, %if.else.i.preheader ], [ %arrayidx.i27, %if.else.i ]
store i64 %sum.0.lcssa.i.i, ptr %arrayidx28.i.lcssa, align 8, !tbaa !14
br label %for.inc19
if.else: ; preds = %for.body3
br i1 %cmp54.not.i, label %getChar.exit43, label %for.body.i31
for.body.i31: ; preds = %if.else, %for.inc.i37
%indvars.iv.i32 = phi i64 [ %indvars.iv.next.i38, %for.inc.i37 ], [ 0, %if.else ]
%arrayidx.i33 = getelementptr inbounds i8, ptr %str, i64 %indvars.iv.i32
%11 = load i8, ptr %arrayidx.i33, align 1, !tbaa !5
switch i8 %11, label %for.inc.i37 [
i8 65, label %for.inc.sink.split.i35
i8 67, label %if.then12.i42
i8 71, label %if.then21.i41
i8 84, label %if.then30.i34
]
if.then12.i42: ; preds = %for.body.i31
br label %for.inc.sink.split.i35
if.then21.i41: ; preds = %for.body.i31
br label %for.inc.sink.split.i35
if.then30.i34: ; preds = %for.body.i31
br label %for.inc.sink.split.i35
for.inc.sink.split.i35: ; preds = %if.then30.i34, %if.then21.i41, %if.then12.i42, %for.body.i31
%.sink.i36 = phi i8 [ 51, %if.then21.i41 ], [ 52, %if.then30.i34 ], [ 50, %if.then12.i42 ], [ 49, %for.body.i31 ]
store i8 %.sink.i36, ptr %arrayidx.i33, align 1, !tbaa !5
br label %for.inc.i37
for.inc.i37: ; preds = %for.inc.sink.split.i35, %for.body.i31
%indvars.iv.next.i38 = add nuw nsw i64 %indvars.iv.i32, 1
%call.i39 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp.i40 = icmp ugt i64 %call.i39, %indvars.iv.next.i38
br i1 %cmp.i40, label %for.body.i31, label %getChar.exit43, !llvm.loop !8
getChar.exit43: ; preds = %for.inc.i37, %if.else
%call.i.i44 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #11
%cmp7.not.i.i45 = icmp eq i64 %call.i.i44, 0
br i1 %cmp7.not.i.i45, label %getKey.exit.i57, label %for.body.i.i46.preheader
for.body.i.i46.preheader: ; preds = %getChar.exit43
%xtraiter = and i64 %call.i.i44, 3
%12 = icmp ult i64 %call.i.i44, 4
br i1 %12, label %getKey.exit.i57.loopexit.unr-lcssa, label %for.body.i.i46.preheader.new
for.body.i.i46.preheader.new: ; preds = %for.body.i.i46.preheader
%unroll_iter = and i64 %call.i.i44, -4
br label %for.body.i.i46
for.body.i.i46: ; preds = %for.body.i.i46, %for.body.i.i46.preheader.new
%i.010.i.i47 = phi i64 [ 0, %for.body.i.i46.preheader.new ], [ %inc.i.i55.3, %for.body.i.i46 ]
%p.09.i.i48 = phi i64 [ 1, %for.body.i.i46.preheader.new ], [ %mul1.i.i54.3, %for.body.i.i46 ]
%sum.08.i.i49 = phi i64 [ 0, %for.body.i.i46.preheader.new ], [ %add.i.i53.3, %for.body.i.i46 ]
%niter = phi i64 [ 0, %for.body.i.i46.preheader.new ], [ %niter.next.3, %for.body.i.i46 ]
%arrayidx.i.i50 = getelementptr inbounds i8, ptr %str, i64 %i.010.i.i47
%13 = load i8, ptr %arrayidx.i.i50, align 1, !tbaa !5
%conv.i.i51 = sext i8 %13 to i64
%mul.i.i52 = mul nsw i64 %p.09.i.i48, %conv.i.i51
%add.i.i53 = add nsw i64 %mul.i.i52, %sum.08.i.i49
%mul1.i.i54 = mul nsw i64 %p.09.i.i48, 5
%inc.i.i55 = or i64 %i.010.i.i47, 1
%arrayidx.i.i50.1 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i55
%14 = load i8, ptr %arrayidx.i.i50.1, align 1, !tbaa !5
%conv.i.i51.1 = sext i8 %14 to i64
%mul.i.i52.1 = mul nsw i64 %mul1.i.i54, %conv.i.i51.1
%add.i.i53.1 = add nsw i64 %mul.i.i52.1, %add.i.i53
%mul1.i.i54.1 = mul i64 %p.09.i.i48, 25
%inc.i.i55.1 = or i64 %i.010.i.i47, 2
%arrayidx.i.i50.2 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i55.1
%15 = load i8, ptr %arrayidx.i.i50.2, align 1, !tbaa !5
%conv.i.i51.2 = sext i8 %15 to i64
%mul.i.i52.2 = mul nsw i64 %mul1.i.i54.1, %conv.i.i51.2
%add.i.i53.2 = add nsw i64 %mul.i.i52.2, %add.i.i53.1
%mul1.i.i54.2 = mul i64 %p.09.i.i48, 125
%inc.i.i55.2 = or i64 %i.010.i.i47, 3
%arrayidx.i.i50.3 = getelementptr inbounds i8, ptr %str, i64 %inc.i.i55.2
%16 = load i8, ptr %arrayidx.i.i50.3, align 1, !tbaa !5
%conv.i.i51.3 = sext i8 %16 to i64
%mul.i.i52.3 = mul nsw i64 %mul1.i.i54.2, %conv.i.i51.3
%add.i.i53.3 = add nsw i64 %mul.i.i52.3, %add.i.i53.2
%mul1.i.i54.3 = mul i64 %p.09.i.i48, 625
%inc.i.i55.3 = add nuw nsw i64 %i.010.i.i47, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %getKey.exit.i57.loopexit.unr-lcssa, label %for.body.i.i46, !llvm.loop !10
getKey.exit.i57.loopexit.unr-lcssa: ; preds = %for.body.i.i46, %for.body.i.i46.preheader
%add.i.i53.lcssa.ph = phi i64 [ undef, %for.body.i.i46.preheader ], [ %add.i.i53.3, %for.body.i.i46 ]
%i.010.i.i47.unr = phi i64 [ 0, %for.body.i.i46.preheader ], [ %inc.i.i55.3, %for.body.i.i46 ]
%p.09.i.i48.unr = phi i64 [ 1, %for.body.i.i46.preheader ], [ %mul1.i.i54.3, %for.body.i.i46 ]
%sum.08.i.i49.unr = phi i64 [ 0, %for.body.i.i46.preheader ], [ %add.i.i53.3, %for.body.i.i46 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %getKey.exit.i57, label %for.body.i.i46.epil
for.body.i.i46.epil: ; preds = %getKey.exit.i57.loopexit.unr-lcssa, %for.body.i.i46.epil
%i.010.i.i47.epil = phi i64 [ %inc.i.i55.epil, %for.body.i.i46.epil ], [ %i.010.i.i47.unr, %getKey.exit.i57.loopexit.unr-lcssa ]
%p.09.i.i48.epil = phi i64 [ %mul1.i.i54.epil, %for.body.i.i46.epil ], [ %p.09.i.i48.unr, %getKey.exit.i57.loopexit.unr-lcssa ]
%sum.08.i.i49.epil = phi i64 [ %add.i.i53.epil, %for.body.i.i46.epil ], [ %sum.08.i.i49.unr, %getKey.exit.i57.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.i.i46.epil ], [ 0, %getKey.exit.i57.loopexit.unr-lcssa ]
%arrayidx.i.i50.epil = getelementptr inbounds i8, ptr %str, i64 %i.010.i.i47.epil
%17 = load i8, ptr %arrayidx.i.i50.epil, align 1, !tbaa !5
%conv.i.i51.epil = sext i8 %17 to i64
%mul.i.i52.epil = mul nsw i64 %p.09.i.i48.epil, %conv.i.i51.epil
%add.i.i53.epil = add nsw i64 %mul.i.i52.epil, %sum.08.i.i49.epil
%mul1.i.i54.epil = mul nsw i64 %p.09.i.i48.epil, 5
%inc.i.i55.epil = add nuw nsw i64 %i.010.i.i47.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %getKey.exit.i57, label %for.body.i.i46.epil, !llvm.loop !21
getKey.exit.i57: ; preds = %getKey.exit.i57.loopexit.unr-lcssa, %for.body.i.i46.epil, %getChar.exit43
%sum.0.lcssa.i.i58 = phi i64 [ 0, %getChar.exit43 ], [ %add.i.i53.lcssa.ph, %getKey.exit.i57.loopexit.unr-lcssa ], [ %add.i.i53.epil, %for.body.i.i46.epil ]
%conv.i59 = trunc i64 %sum.0.lcssa.i.i58 to i32
%rem.i.i.i60 = srem i32 %conv.i59, 1000003
%rem.i3.i.i61 = srem i32 %conv.i59, 1000002
%add.i.i.i62 = add nsw i32 %rem.i3.i.i61, 1
br label %while.body.i
while.body.i: ; preds = %if.else.i66, %getKey.exit.i57
%i.022.i = phi i64 [ 0, %getKey.exit.i57 ], [ %inc.i67, %if.else.i66 ]
%conv1.i = trunc i64 %i.022.i to i32
%mul.i17.i = mul nsw i32 %add.i.i.i62, %conv1.i
%add.i18.i = add nsw i32 %mul.i17.i, %rem.i.i.i60
%rem.i.i63 = srem i32 %add.i18.i, 1000003
%idxprom.i64 = sext i32 %rem.i.i63 to i64
%arrayidx.i65 = getelementptr inbounds [1000003 x i64], ptr @H, i64 0, i64 %idxprom.i64
%18 = load i64, ptr %arrayidx.i65, align 8, !tbaa !14
%cmp3.i = icmp eq i64 %18, %sum.0.lcssa.i.i58
br i1 %cmp3.i, label %if.then14, label %if.else.i66
if.else.i66: ; preds = %while.body.i
%cmp7.i = icmp eq i64 %18, -1
%inc.i67 = add nuw nsw i64 %i.022.i, 1
%exitcond.not.i = icmp eq i64 %inc.i67, 1000004
%or.cond.i = select i1 %cmp7.i, i1 true, i1 %exitcond.not.i
br i1 %or.cond.i, label %if.else16, label %while.body.i, !llvm.loop !16
if.then14: ; preds = %while.body.i
%puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %for.inc19
if.else16: ; preds = %if.else.i66
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc19
for.inc19: ; preds = %while.cond.i, %if.then8.i, %getKey.exit.i, %if.else16, %if.then14
%inc20 = add nuw nsw i32 %i.175, 1
%19 = load i32, ptr %n, align 4, !tbaa !18
%cmp2 = icmp slt i32 %inc20, %19
br i1 %cmp2, label %for.body3, label %for.end21, !llvm.loop !22
for.end21: ; preds = %for.inc19, %entry
call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %com) #12
call void @llvm.lifetime.end.p0(i64 14, ptr nonnull %str) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #12
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10
attributes #0 = { nofree nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !6, i64 0}
!16 = distinct !{!16, !9}
!17 = distinct !{!17, !12}
!18 = !{!19, !19, i64 0}
!19 = !{!"int", !6, i64 0}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !9}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.