Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(){
int n;
scanf("%d",&n);
printf("%d\n",n*n*n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166785/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166785/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){int n;scanf("%d",&n);printf("%d\n",n*n*n);return 0;} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166828/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166828/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main()
{
int n;
while(~scanf("%d",&n))
{
printf("%d\n",n*n*n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166871/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166871/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not4 = icmp eq i32 %call3, -1
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int N;
scanf("%d",&N);
printf("%d\n",N*N*N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166914/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166914/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
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
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int N;
scanf("%d", &N);
printf("%d", N*N*N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_166958/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_166958/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{ int n,m;
scanf("%d %d", &n, &m);
if(m==0)
printf("1");
else if(n>=2*m)
printf("%d",m);
else
{
printf("%d",n-m);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16700/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16700/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 49)
br label %if.end7
if.else: ; preds = %entry
%1 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %0, 1
%cmp2.not = icmp slt i32 %1, %mul
br i1 %cmp2.not, label %if.else5, label %if.then3
if.then3: ; preds = %if.else
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %0)
br label %if.end7
if.else5: ; preds = %if.else
%sub = sub nsw i32 %1, %0
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %if.end7
if.end7: ; preds = %if.then3, %if.else5, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 N;
scanf("%d",&N);
printf("%d",N*N*N);
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167043/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167043/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(){
int N;
scanf("%d",&N);
printf("%d",N*N*N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167087/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167087/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
int x;
if(m==0){
printf("1\n");
return 0;
}
if(n%2==0){
x=n/2;
if(x>=m){
printf("%d\n",m);
return 0;
}
else{
x=x-(m-x);
printf("%d\n",x);
return 0;
}
}
else{
x=n/2;
if(x>=m){
printf("%d\n",m);
return 0;
}
else{
printf("%d\n",n-m);
return 0;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16713/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16713/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.end: ; preds = %entry
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = and i32 %1, 1
%cmp2 = icmp eq i32 %2, 0
%div = sdiv i32 %1, 2
%cmp4.not = icmp slt i32 %div, %0
br i1 %cmp2, label %if.then3, label %if.else9
if.then3: ; preds = %if.end
br i1 %cmp4.not, label %if.else, label %if.then5
if.then5: ; preds = %if.then3
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %0)
br label %cleanup
if.else: ; preds = %if.then3
%factor = shl nsw i32 %div, 1
%sub7 = sub i32 %factor, %0
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub7)
br label %cleanup
if.else9: ; preds = %if.end
br i1 %cmp4.not, label %if.else14, label %if.then12
if.then12: ; preds = %if.else9
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %0)
br label %cleanup
if.else14: ; preds = %if.else9
%sub15 = sub nsw i32 %1, %0
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub15)
br label %cleanup
cleanup: ; preds = %if.else14, %if.then12, %if.else, %if.then5, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int N,res;
scanf("%d",&N);
res = N*N*N;
printf("%d\n",res);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167173/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167173/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
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
%mul = mul nsw i32 %0, %0
%mul1 = mul nsw i32 %mul, %0
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#define EPS 0.0000000002
#define MAX 1010001000
typedef struct point{
double x, y;
}point;
typedef struct line{
point st, en;
}line;
double norm(point a);
double norm2(point a);
double distans(point a, point b);
point sum_vector(point a, point b);
point diff_vector(point a, point b);
point minus_vector(point a);
point prod_vector(point a, double t);
double dot(point a, point b);
double cross(point a, point b);
point reflection(line a, point p);
point projection(line a, point p);
int ccw(line a, point p);
int parallel(line a, line b);
int orthogonal(line a, line b);
int intersection(line a, line b);
point cross_point(line a, line b);
double distanceLP(line a, point b);
double distanceLL(line a, line b);
double fmin(double a, double b);
////////////////////////////////////////////
double fmin(double a, double b)
{
return a < b ? a : b;
}
double norm(point a)
{
//原点からの距離
return sqrt((a.x * a.x) + (a.y * a.y));
}
double norm2(point a)
{
//原点からの距離の二乗
return (a.x * a.x) + (a.y * a.y);
}
double distans(point a, point b)
{
//二点間の距離
point tmp = sum_vector(b, minus_vector(a));
return norm(tmp);
}
point sum_vector(point a, point b)
{
//ベクトルの和
a.x += b.x;
a.y += b.y;
return a;
}
point diff_vector(point a, point b)
{
//ベクトルの差
a.x -= b.x;
a.y -= b.y;
return a;
}
point prod_vector(point a, double t)
{
//ベクトルのスカラー倍
a.x *= t;
a.y *= t;
return a;
}
point minus_vector(point a)
{
//逆ベクトル
a.x *= -1;
a.y *= -1;
return a;
}
double dot(point a, point b)
{
//内積
return (a.x * b.x) + (a.y * b.y);
}
double cross(point a, point b)
{
//外積
return (a.x * b.y) - (b.x * a.y);
}
///////////////////////////////////////////
point reflection(line a, point p)
{
//直線aについて点pと線対称な点を返す
return sum_vector(projection(a, p), diff_vector(projection(a, p), p));
}
point projection(line a, point p)
{
//直線ab上に点pから垂線を下ろしたときの点h//
point h;
double k = dot(diff_vector(a.st, p), diff_vector(a.st, a.en))
/ dot(diff_vector(a.en, a.st), diff_vector(a.en, a.st));
h.x = k * (a.en.x - a.st.x) + a.st.x;
h.y = k * (a.en.y - a.st.y) + a.st.y;
return h;
}
int ccw(line a, point p)
{
//counter clockwise == 1
//clockwise == -1
//online back == 2
//online front == -2
//on segment == 0
int cls = cross(diff_vector(a.en, a.st), diff_vector(p, a.st));
if (cls > 0) {
return 1;
} else if (cls < 0) {
return -1;
} else if (dot(diff_vector(a.en, a.st), diff_vector(p, a.st)) < 0) {
return 2;
} else if (norm(diff_vector(a.st, a.en)) < norm(diff_vector(a.st, p))) {
return -2;
} else {
return 0;
}
}
int parallel(line a, line b)
{
//並行で1,そうでなくて0
if (!cross(diff_vector(a.en, a.st), diff_vector(b.en, b.st))) {
return 1;
} else {
return 0;
}
}
int orthogonal(line a, line b)
{
//直行で1,そうでなくて0
if (!dot(diff_vector(a.en, a.st), diff_vector(b.en, b.st))) {
return 1;
} else {
return 0;
}
}
int intersection(line a, line b)
{
//線分a, bが交差するとき1,そうでなくて0
if (ccw(a,b.st) * ccw(a,b.en) <= 0 &&
ccw(b,a.st) * ccw(b,a.en) <= 0) {
return 1;
} else {
return 0;
}
}
point cross_point(line a, line b)
{
//交差する線分の交点の座標
double c1 = cross(diff_vector(b.st, a.st), diff_vector(b.en, a.st));
double c2 = cross(diff_vector(b.st, a.en), diff_vector(b.en, a.en));
double t = fabs(c1) / (fabs(c1) + fabs(c2));
return sum_vector(prod_vector(diff_vector(a.en, a.st), t), a.st);
}
double distanceLP(line a, point b)
{
if (dot(diff_vector(a.en, a.st), diff_vector(b, a.st)) < 0.0) {
return fabs(norm(diff_vector(b, a.st)));
}
if (dot(diff_vector(a.st, a.en), diff_vector(b, a.en)) < 0.0) {
return fabs(norm(diff_vector(b, a.en)));
}
point h = projection(a, b);
return norm(diff_vector(h, b));
}
double distanceLL(line a, line b)
{
double ans1, ans2, ans3, ans4;
if (intersection(a, b)) {
return 0.00000000000;
} else {
ans1 = distanceLP(a, b.st);
ans2 = distanceLP(a, b.en);
ans3 = distanceLP(b, a.st);
ans4 = distanceLP(b, a.en);
}
return fmin(ans1, fmin(ans2, fmin(ans3, ans4)));
}
///////////////////////////////////////
int main(void)
{
line a, b;
double ans;
int n, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%lf%lf%lf%lf%lf%lf%lf%lf"
, &a.st.x, &a.st.y, &a.en.x, &a.en.y
, &b.st.x, &b.st.y, &b.en.x, &b.en.y);
ans = distanceLL(a, b);
printf("%.10lf\n", ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167216/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167216/source.c"
target datalayout = "e-m:e-p270: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.line = type { %struct.point, %struct.point }
%struct.point = type { double, double }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [25 x i8] c"%lf%lf%lf%lf%lf%lf%lf%lf\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"%.10lf\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @fmin(double noundef %a, double noundef %b) local_unnamed_addr #0 {
entry:
%cmp = fcmp olt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @norm(double %a.coerce0, double %a.coerce1) local_unnamed_addr #1 {
entry:
%mul3 = fmul double %a.coerce1, %a.coerce1
%0 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %a.coerce0, double %mul3)
%sqrt = tail call double @llvm.sqrt.f64(double %0)
ret double %sqrt
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @norm2(double %a.coerce0, double %a.coerce1) local_unnamed_addr #1 {
entry:
%mul3 = fmul double %a.coerce1, %a.coerce1
%0 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %a.coerce0, double %mul3)
ret double %0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @distans(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #1 {
entry:
%add.i = fsub double %b.coerce0, %a.coerce0
%add3.i = fsub double %b.coerce1, %a.coerce1
%mul3.i = fmul double %add3.i, %add3.i
%0 = tail call double @llvm.fmuladd.f64(double %add.i, double %add.i, double %mul3.i)
%sqrt.i = tail call double @llvm.sqrt.f64(double %0)
ret double %sqrt.i
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @sum_vector(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #0 {
entry:
%add = fadd double %a.coerce0, %b.coerce0
%add3 = fadd double %a.coerce1, %b.coerce1
%.fca.0.insert = insertvalue { double, double } poison, double %add, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %add3, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @minus_vector(double %a.coerce0, double %a.coerce1) local_unnamed_addr #0 {
entry:
%mul = fneg double %a.coerce0
%mul1 = fneg double %a.coerce1
%.fca.0.insert = insertvalue { double, double } poison, double %mul, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %mul1, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @diff_vector(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #0 {
entry:
%sub = fsub double %a.coerce0, %b.coerce0
%sub3 = fsub double %a.coerce1, %b.coerce1
%.fca.0.insert = insertvalue { double, double } poison, double %sub, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %sub3, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { double, double } @prod_vector(double %a.coerce0, double %a.coerce1, double noundef %t) local_unnamed_addr #0 {
entry:
%mul = fmul double %a.coerce0, %t
%mul1 = fmul double %a.coerce1, %t
%.fca.0.insert = insertvalue { double, double } poison, double %mul, 0
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %mul1, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @dot(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #1 {
entry:
%mul3 = fmul double %a.coerce1, %b.coerce1
%0 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %b.coerce0, double %mul3)
ret double %0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local double @cross(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) local_unnamed_addr #1 {
entry:
%0 = fneg double %b.coerce0
%neg = fmul double %0, %a.coerce1
%1 = tail call double @llvm.fmuladd.f64(double %a.coerce0, double %b.coerce1, double %neg)
ret double %1
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local { double, double } @reflection(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, double %p.coerce0, double %p.coerce1) local_unnamed_addr #4 {
entry:
%en.i = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%0 = load <2 x double>, ptr %a, align 8
%1 = extractelement <2 x double> %0, i64 0
%sub.i.i = fsub double %1, %p.coerce0
%2 = load <2 x double>, ptr %en.i, align 8
%3 = fsub <2 x double> %0, %2
%4 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%5 = insertelement <2 x double> %2, double %p.coerce1, i64 0
%6 = fsub <2 x double> %4, %5
%7 = fsub <2 x double> %2, %0
%8 = shufflevector <2 x double> %6, <2 x double> %7, <2 x i32> <i32 0, i32 3>
%9 = shufflevector <2 x double> %6, <2 x double> %7, <2 x i32> <i32 1, i32 3>
%10 = fmul <2 x double> %8, %9
%11 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
%12 = insertelement <2 x double> %11, double %sub.i.i, i64 0
%13 = shufflevector <2 x double> %3, <2 x double> %11, <2 x i32> <i32 0, i32 3>
%14 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %13, <2 x double> %10)
%15 = extractelement <2 x double> %14, i64 0
%16 = extractelement <2 x double> %14, i64 1
%div.i = fdiv double %15, %16
%17 = insertelement <2 x double> poison, double %div.i, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %7, <2 x double> %0)
%20 = insertelement <2 x double> poison, double %p.coerce0, i64 0
%21 = insertelement <2 x double> %20, double %p.coerce1, i64 1
%22 = fsub <2 x double> %19, %21
%23 = fadd <2 x double> %19, %22
%24 = extractelement <2 x double> %23, i64 0
%.fca.0.insert.i24 = insertvalue { double, double } poison, double %24, 0
%25 = extractelement <2 x double> %23, i64 1
%.fca.1.insert.i25 = insertvalue { double, double } %.fca.0.insert.i24, double %25, 1
ret { double, double } %.fca.1.insert.i25
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local { double, double } @projection(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, double %p.coerce0, double %p.coerce1) local_unnamed_addr #4 {
entry:
%en = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%0 = load <2 x double>, ptr %a, align 8
%1 = extractelement <2 x double> %0, i64 0
%sub.i = fsub double %1, %p.coerce0
%2 = load <2 x double>, ptr %en, align 8
%3 = fsub <2 x double> %0, %2
%4 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> <i32 1, i32 1>
%5 = insertelement <2 x double> %2, double %p.coerce1, i64 0
%6 = fsub <2 x double> %4, %5
%7 = fsub <2 x double> %2, %0
%8 = shufflevector <2 x double> %6, <2 x double> %7, <2 x i32> <i32 0, i32 3>
%9 = shufflevector <2 x double> %6, <2 x double> %7, <2 x i32> <i32 1, i32 3>
%10 = fmul <2 x double> %8, %9
%11 = shufflevector <2 x double> %7, <2 x double> poison, <2 x i32> <i32 poison, i32 0>
%12 = insertelement <2 x double> %11, double %sub.i, i64 0
%13 = shufflevector <2 x double> %3, <2 x double> %11, <2 x i32> <i32 0, i32 3>
%14 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %13, <2 x double> %10)
%15 = extractelement <2 x double> %14, i64 0
%16 = extractelement <2 x double> %14, i64 1
%div = fdiv double %15, %16
%17 = insertelement <2 x double> poison, double %div, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> %7, <2 x double> %0)
%20 = extractelement <2 x double> %19, i64 0
%.fca.0.insert = insertvalue { double, double } poison, double %20, 0
%21 = extractelement <2 x double> %19, i64 1
%.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %21, 1
ret { double, double } %.fca.1.insert
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ccw(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, double %p.coerce0, double %p.coerce1) local_unnamed_addr #4 {
entry:
%en = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%0 = load double, ptr %en, align 8
%1 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr %a, align 8
%4 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%5 = load double, ptr %4, align 8
%sub.i = fsub double %0, %3
%sub3.i = fsub double %2, %5
%sub.i40 = fsub double %p.coerce0, %3
%sub3.i41 = fsub double %p.coerce1, %5
%6 = fneg double %sub.i40
%neg.i = fmul double %sub3.i, %6
%7 = tail call double @llvm.fmuladd.f64(double %sub.i, double %sub3.i41, double %neg.i)
%conv = fptosi double %7 to i32
%cmp = icmp sgt i32 %conv, 0
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp6 = icmp slt i32 %conv, 0
br i1 %cmp6, label %cleanup, label %if.else9
if.else9: ; preds = %if.else
%mul3.i = fmul double %sub3.i, %sub3.i41
%8 = tail call double @llvm.fmuladd.f64(double %sub.i, double %sub.i40, double %mul3.i)
%cmp18 = fcmp olt double %8, 0.000000e+00
br i1 %cmp18, label %cleanup, label %if.else21
if.else21: ; preds = %if.else9
%9 = insertelement <2 x double> poison, double %3, i64 0
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
%11 = insertelement <2 x double> poison, double %0, i64 0
%12 = insertelement <2 x double> %11, double %p.coerce0, i64 1
%13 = fsub <2 x double> %10, %12
%14 = insertelement <2 x double> poison, double %5, i64 0
%15 = shufflevector <2 x double> %14, <2 x double> poison, <2 x i32> zeroinitializer
%16 = insertelement <2 x double> poison, double %2, i64 0
%17 = insertelement <2 x double> %16, double %p.coerce1, i64 1
%18 = fsub <2 x double> %15, %17
%19 = fmul <2 x double> %18, %18
%20 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %13, <2 x double> %13, <2 x double> %19)
%21 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %20)
%22 = extractelement <2 x double> %21, i64 0
%23 = extractelement <2 x double> %21, i64 1
%cmp31 = fcmp olt double %22, %23
%. = select i1 %cmp31, i32 -2, i32 0
br label %cleanup
cleanup: ; preds = %if.else21, %if.else9, %if.else, %entry
%retval.0 = phi i32 [ 1, %entry ], [ -1, %if.else ], [ 2, %if.else9 ], [ %., %if.else21 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @parallel(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, ptr nocapture noundef readonly byval(%struct.line) align 8 %b) local_unnamed_addr #4 {
entry:
%en = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%0 = load double, ptr %en, align 8
%1 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr %a, align 8
%4 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%5 = load double, ptr %4, align 8
%sub.i = fsub double %0, %3
%sub3.i = fsub double %2, %5
%en2 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1
%6 = load double, ptr %en2, align 8
%7 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1, i32 1
%8 = load double, ptr %7, align 8
%9 = load double, ptr %b, align 8
%10 = getelementptr inbounds { double, double }, ptr %b, i64 0, i32 1
%11 = load double, ptr %10, align 8
%sub.i6 = fsub double %6, %9
%sub3.i7 = fsub double %8, %11
%12 = fneg double %sub.i6
%neg.i = fmul double %sub3.i, %12
%13 = tail call double @llvm.fmuladd.f64(double %sub.i, double %sub3.i7, double %neg.i)
%tobool = fcmp oeq double %13, 0.000000e+00
%. = zext i1 %tobool to i32
ret i32 %.
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @orthogonal(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, ptr nocapture noundef readonly byval(%struct.line) align 8 %b) local_unnamed_addr #4 {
entry:
%en = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%0 = load double, ptr %en, align 8
%1 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr %a, align 8
%4 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%5 = load double, ptr %4, align 8
%sub.i = fsub double %0, %3
%sub3.i = fsub double %2, %5
%en2 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1
%6 = load double, ptr %en2, align 8
%7 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1, i32 1
%8 = load double, ptr %7, align 8
%9 = load double, ptr %b, align 8
%10 = getelementptr inbounds { double, double }, ptr %b, i64 0, i32 1
%11 = load double, ptr %10, align 8
%sub.i6 = fsub double %6, %9
%sub3.i7 = fsub double %8, %11
%mul3.i = fmul double %sub3.i, %sub3.i7
%12 = tail call double @llvm.fmuladd.f64(double %sub.i, double %sub.i6, double %mul3.i)
%tobool = fcmp oeq double %12, 0.000000e+00
%. = zext i1 %tobool to i32
ret i32 %.
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @intersection(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, ptr nocapture noundef readonly byval(%struct.line) align 8 %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %b, align 8
%1 = getelementptr inbounds { double, double }, ptr %b, i64 0, i32 1
%2 = load double, ptr %1, align 8
%en.i = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%3 = load double, ptr %en.i, align 8
%4 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%5 = load double, ptr %4, align 8
%6 = load double, ptr %a, align 8
%7 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%8 = load double, ptr %7, align 8
%sub.i.i = fsub double %3, %6
%sub3.i.i = fsub double %5, %8
%sub.i40.i = fsub double %0, %6
%sub3.i41.i = fsub double %2, %8
%9 = fneg double %sub.i40.i
%neg.i.i = fmul double %sub3.i.i, %9
%10 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub3.i41.i, double %neg.i.i)
%conv.i = fptosi double %10 to i32
%cmp.i = icmp sgt i32 %conv.i, 0
br i1 %cmp.i, label %ccw.exit, label %if.else.i
if.else.i: ; preds = %entry
%cmp6.i = icmp slt i32 %conv.i, 0
br i1 %cmp6.i, label %ccw.exit, label %if.else9.i
if.else9.i: ; preds = %if.else.i
%mul3.i.i = fmul double %sub3.i.i, %sub3.i41.i
%11 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub.i40.i, double %mul3.i.i)
%cmp18.i = fcmp olt double %11, 0.000000e+00
br i1 %cmp18.i, label %ccw.exit, label %if.else21.i
if.else21.i: ; preds = %if.else9.i
%12 = insertelement <2 x double> poison, double %6, i64 0
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> zeroinitializer
%14 = insertelement <2 x double> poison, double %3, i64 0
%15 = insertelement <2 x double> %14, double %0, i64 1
%16 = fsub <2 x double> %13, %15
%17 = insertelement <2 x double> poison, double %8, i64 0
%18 = shufflevector <2 x double> %17, <2 x double> poison, <2 x i32> zeroinitializer
%19 = insertelement <2 x double> poison, double %5, i64 0
%20 = insertelement <2 x double> %19, double %2, i64 1
%21 = fsub <2 x double> %18, %20
%22 = fmul <2 x double> %21, %21
%23 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %16, <2 x double> %16, <2 x double> %22)
%24 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %23)
%25 = extractelement <2 x double> %24, i64 0
%26 = extractelement <2 x double> %24, i64 1
%cmp31.i = fcmp olt double %25, %26
%..i = select i1 %cmp31.i, i32 -2, i32 0
br label %ccw.exit
ccw.exit: ; preds = %entry, %if.else.i, %if.else9.i, %if.else21.i
%retval.0.i = phi i32 [ 1, %entry ], [ -1, %if.else.i ], [ 2, %if.else9.i ], [ %..i, %if.else21.i ]
%en = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1
%27 = load double, ptr %en, align 8
%28 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1, i32 1
%29 = load double, ptr %28, align 8
%sub.i40.i11 = fsub double %27, %6
%sub3.i41.i12 = fsub double %29, %8
%30 = fneg double %sub.i40.i11
%neg.i.i13 = fmul double %sub3.i.i, %30
%31 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub3.i41.i12, double %neg.i.i13)
%conv.i14 = fptosi double %31 to i32
%cmp.i15 = icmp sgt i32 %conv.i14, 0
br i1 %cmp.i15, label %ccw.exit33, label %if.else.i16
if.else.i16: ; preds = %ccw.exit
%cmp6.i17 = icmp slt i32 %conv.i14, 0
br i1 %cmp6.i17, label %ccw.exit33, label %if.else9.i18
if.else9.i18: ; preds = %if.else.i16
%mul3.i.i19 = fmul double %sub3.i.i, %sub3.i41.i12
%32 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub.i40.i11, double %mul3.i.i19)
%cmp18.i20 = fcmp olt double %32, 0.000000e+00
br i1 %cmp18.i20, label %ccw.exit33, label %if.else21.i21
if.else21.i21: ; preds = %if.else9.i18
%33 = insertelement <2 x double> poison, double %6, i64 0
%34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
%35 = insertelement <2 x double> poison, double %3, i64 0
%36 = insertelement <2 x double> %35, double %27, i64 1
%37 = fsub <2 x double> %34, %36
%38 = insertelement <2 x double> poison, double %8, i64 0
%39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
%40 = insertelement <2 x double> poison, double %5, i64 0
%41 = insertelement <2 x double> %40, double %29, i64 1
%42 = fsub <2 x double> %39, %41
%43 = fmul <2 x double> %42, %42
%44 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %37, <2 x double> %37, <2 x double> %43)
%45 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %44)
%46 = extractelement <2 x double> %45, i64 0
%47 = extractelement <2 x double> %45, i64 1
%cmp31.i30 = fcmp olt double %46, %47
%..i31 = select i1 %cmp31.i30, i32 -2, i32 0
br label %ccw.exit33
ccw.exit33: ; preds = %ccw.exit, %if.else.i16, %if.else9.i18, %if.else21.i21
%retval.0.i32 = phi i32 [ 1, %ccw.exit ], [ -1, %if.else.i16 ], [ 2, %if.else9.i18 ], [ %..i31, %if.else21.i21 ]
%mul = mul nsw i32 %retval.0.i32, %retval.0.i
%cmp = icmp slt i32 %mul, 1
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %ccw.exit33
%sub.i.i35 = fsub double %27, %0
%sub3.i.i36 = fsub double %29, %2
%sub.i40.i37 = fsub double %6, %0
%sub3.i41.i38 = fsub double %8, %2
%48 = fneg double %sub.i40.i37
%neg.i.i39 = fmul double %sub3.i.i36, %48
%49 = tail call double @llvm.fmuladd.f64(double %sub.i.i35, double %sub3.i41.i38, double %neg.i.i39)
%conv.i40 = fptosi double %49 to i32
%cmp.i41 = icmp sgt i32 %conv.i40, 0
br i1 %cmp.i41, label %ccw.exit59, label %if.else.i42
if.else.i42: ; preds = %land.lhs.true
%cmp6.i43 = icmp slt i32 %conv.i40, 0
br i1 %cmp6.i43, label %ccw.exit59, label %if.else9.i44
if.else9.i44: ; preds = %if.else.i42
%mul3.i.i45 = fmul double %sub3.i41.i38, %sub3.i.i36
%50 = tail call double @llvm.fmuladd.f64(double %sub.i.i35, double %sub.i40.i37, double %mul3.i.i45)
%cmp18.i46 = fcmp olt double %50, 0.000000e+00
br i1 %cmp18.i46, label %ccw.exit59, label %if.else21.i47
if.else21.i47: ; preds = %if.else9.i44
%sub.i52.i48 = fsub double %0, %27
%sub3.i53.i49 = fsub double %2, %29
%51 = insertelement <2 x double> poison, double %sub3.i53.i49, i64 0
%52 = insertelement <2 x double> %51, double %sub3.i41.i, i64 1
%53 = fmul <2 x double> %52, %52
%54 = insertelement <2 x double> poison, double %sub.i52.i48, i64 0
%55 = insertelement <2 x double> %54, double %sub.i40.i, i64 1
%56 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %55, <2 x double> %55, <2 x double> %53)
%57 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %56)
%58 = extractelement <2 x double> %57, i64 0
%59 = extractelement <2 x double> %57, i64 1
%cmp31.i56 = fcmp olt double %58, %59
%..i57 = select i1 %cmp31.i56, i32 -2, i32 0
br label %ccw.exit59
ccw.exit59: ; preds = %land.lhs.true, %if.else.i42, %if.else9.i44, %if.else21.i47
%retval.0.i58 = phi i32 [ 1, %land.lhs.true ], [ -1, %if.else.i42 ], [ 2, %if.else9.i44 ], [ %..i57, %if.else21.i47 ]
%sub.i40.i63 = fsub double %3, %0
%sub3.i41.i64 = fsub double %5, %2
%60 = fneg double %sub.i40.i63
%neg.i.i65 = fmul double %sub3.i.i36, %60
%61 = tail call double @llvm.fmuladd.f64(double %sub.i.i35, double %sub3.i41.i64, double %neg.i.i65)
%conv.i66 = fptosi double %61 to i32
%cmp.i67 = icmp sgt i32 %conv.i66, 0
br i1 %cmp.i67, label %ccw.exit85, label %if.else.i68
if.else.i68: ; preds = %ccw.exit59
%cmp6.i69 = icmp slt i32 %conv.i66, 0
br i1 %cmp6.i69, label %ccw.exit85, label %if.else9.i70
if.else9.i70: ; preds = %if.else.i68
%mul3.i.i71 = fmul double %sub3.i41.i64, %sub3.i.i36
%62 = tail call double @llvm.fmuladd.f64(double %sub.i.i35, double %sub.i40.i63, double %mul3.i.i71)
%cmp18.i72 = fcmp olt double %62, 0.000000e+00
br i1 %cmp18.i72, label %ccw.exit85, label %if.else21.i73
if.else21.i73: ; preds = %if.else9.i70
%63 = insertelement <2 x double> poison, double %0, i64 0
%64 = shufflevector <2 x double> %63, <2 x double> poison, <2 x i32> zeroinitializer
%65 = insertelement <2 x double> poison, double %27, i64 0
%66 = insertelement <2 x double> %65, double %3, i64 1
%67 = fsub <2 x double> %64, %66
%68 = insertelement <2 x double> poison, double %2, i64 0
%69 = shufflevector <2 x double> %68, <2 x double> poison, <2 x i32> zeroinitializer
%70 = insertelement <2 x double> poison, double %29, i64 0
%71 = insertelement <2 x double> %70, double %5, i64 1
%72 = fsub <2 x double> %69, %71
%73 = fmul <2 x double> %72, %72
%74 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %67, <2 x double> %67, <2 x double> %73)
%75 = tail call <2 x double> @llvm.sqrt.v2f64(<2 x double> %74)
%76 = extractelement <2 x double> %75, i64 0
%77 = extractelement <2 x double> %75, i64 1
%cmp31.i82 = fcmp olt double %76, %77
%..i83 = select i1 %cmp31.i82, i32 -2, i32 0
br label %ccw.exit85
ccw.exit85: ; preds = %ccw.exit59, %if.else.i68, %if.else9.i70, %if.else21.i73
%retval.0.i84 = phi i32 [ 1, %ccw.exit59 ], [ -1, %if.else.i68 ], [ 2, %if.else9.i70 ], [ %..i83, %if.else21.i73 ]
%mul6 = mul nsw i32 %retval.0.i84, %retval.0.i58
%cmp7 = icmp slt i32 %mul6, 1
br i1 %cmp7, label %return, label %if.else
if.else: ; preds = %ccw.exit85, %ccw.exit33
br label %return
return: ; preds = %ccw.exit85, %if.else
%retval.0 = phi i32 [ 0, %if.else ], [ 1, %ccw.exit85 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local { double, double } @cross_point(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, ptr nocapture noundef readonly byval(%struct.line) align 8 %b) local_unnamed_addr #4 {
entry:
%0 = load <2 x double>, ptr %b, align 8
%1 = getelementptr inbounds { double, double }, ptr %b, i64 0, i32 1
%2 = load <2 x double>, ptr %1, align 8
%en = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1
%3 = load <2 x double>, ptr %en, align 8
%4 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1, i32 1
%5 = load double, ptr %4, align 8
%en8 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%6 = load <2 x double>, ptr %a, align 8
%7 = load <2 x double>, ptr %en8, align 8
%8 = shufflevector <2 x double> %0, <2 x double> poison, <2 x i32> zeroinitializer
%9 = shufflevector <2 x double> %6, <2 x double> %7, <2 x i32> <i32 0, i32 2>
%10 = fsub <2 x double> %8, %9
%11 = shufflevector <2 x double> %2, <2 x double> poison, <2 x i32> zeroinitializer
%12 = shufflevector <2 x double> %6, <2 x double> %7, <2 x i32> <i32 1, i32 3>
%13 = fsub <2 x double> %11, %12
%14 = shufflevector <2 x double> %3, <2 x double> poison, <2 x i32> zeroinitializer
%15 = fsub <2 x double> %14, %9
%16 = insertelement <2 x double> poison, double %5, i64 0
%17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
%18 = fsub <2 x double> %17, %12
%19 = fneg <2 x double> %15
%20 = fmul <2 x double> %13, %19
%21 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %10, <2 x double> %18, <2 x double> %20)
%22 = tail call <2 x double> @llvm.fabs.v2f64(<2 x double> %21)
%23 = extractelement <2 x double> %22, i64 0
%shift = shufflevector <2 x double> %22, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%24 = fadd <2 x double> %22, %shift
%add = extractelement <2 x double> %24, i64 0
%div = fdiv double %23, %add
%25 = fsub <2 x double> %7, %6
%26 = insertelement <2 x double> poison, double %div, i64 0
%27 = shufflevector <2 x double> %26, <2 x double> poison, <2 x i32> zeroinitializer
%28 = fmul <2 x double> %25, %27
%29 = fadd <2 x double> %6, %28
%30 = extractelement <2 x double> %29, i64 0
%.fca.0.insert.i43 = insertvalue { double, double } poison, double %30, 0
%31 = extractelement <2 x double> %29, i64 1
%.fca.1.insert.i44 = insertvalue { double, double } %.fca.0.insert.i43, double %31, 1
ret { double, double } %.fca.1.insert.i44
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local double @distanceLP(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, double %b.coerce0, double %b.coerce1) local_unnamed_addr #4 {
entry:
%en = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%0 = load double, ptr %en, align 8
%1 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%2 = load double, ptr %1, align 8
%3 = load double, ptr %a, align 8
%4 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%5 = load double, ptr %4, align 8
%sub.i = fsub double %0, %3
%sub3.i = fsub double %2, %5
%sub.i38 = fsub double %b.coerce0, %3
%sub3.i39 = fsub double %b.coerce1, %5
%mul3.i = fmul double %sub3.i, %sub3.i39
%6 = tail call double @llvm.fmuladd.f64(double %sub.i, double %sub.i38, double %mul3.i)
%cmp = fcmp olt double %6, 0.000000e+00
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%mul3.i46 = fmul double %sub3.i39, %sub3.i39
%7 = tail call double @llvm.fmuladd.f64(double %sub.i38, double %sub.i38, double %mul3.i46)
%sqrt.i = tail call double @llvm.sqrt.f64(double %7)
%8 = tail call double @llvm.fabs.f64(double %sqrt.i)
br label %return
if.end: ; preds = %entry
%sub.i47 = fsub double %3, %0
%sub3.i48 = fsub double %5, %2
%sub.i51 = fsub double %b.coerce0, %0
%sub3.i52 = fsub double %b.coerce1, %2
%mul3.i55 = fmul double %sub3.i52, %sub3.i48
%9 = tail call double @llvm.fmuladd.f64(double %sub.i47, double %sub.i51, double %mul3.i55)
%cmp17 = fcmp olt double %9, 0.000000e+00
br i1 %cmp17, label %if.then18, label %if.end23
if.then18: ; preds = %if.end
%mul3.i60 = fmul double %sub3.i52, %sub3.i52
%10 = tail call double @llvm.fmuladd.f64(double %sub.i51, double %sub.i51, double %mul3.i60)
%sqrt.i61 = tail call double @llvm.sqrt.f64(double %10)
%11 = tail call double @llvm.fabs.f64(double %sqrt.i61)
br label %return
if.end23: ; preds = %if.end
%sub.i.i = fsub double %3, %b.coerce0
%sub3.i.i = fsub double %5, %b.coerce1
%12 = insertelement <2 x double> poison, double %sub3.i.i, i64 0
%13 = insertelement <2 x double> %12, double %sub3.i, i64 1
%14 = insertelement <2 x double> %13, double %sub3.i48, i64 0
%15 = fmul <2 x double> %13, %14
%16 = insertelement <2 x double> poison, double %sub.i.i, i64 0
%17 = insertelement <2 x double> %16, double %sub.i, i64 1
%18 = insertelement <2 x double> %17, double %sub.i47, i64 0
%19 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> %18, <2 x double> %15)
%20 = extractelement <2 x double> %19, i64 0
%21 = extractelement <2 x double> %19, i64 1
%div.i = fdiv double %20, %21
%22 = tail call double @llvm.fmuladd.f64(double %div.i, double %sub.i, double %3)
%23 = tail call double @llvm.fmuladd.f64(double %div.i, double %sub3.i, double %5)
%sub.i64 = fsub double %22, %b.coerce0
%sub3.i65 = fsub double %23, %b.coerce1
%mul3.i68 = fmul double %sub3.i65, %sub3.i65
%24 = tail call double @llvm.fmuladd.f64(double %sub.i64, double %sub.i64, double %mul3.i68)
%sqrt.i69 = tail call double @llvm.sqrt.f64(double %24)
br label %return
return: ; preds = %if.end23, %if.then18, %if.then
%retval.0 = phi double [ %8, %if.then ], [ %11, %if.then18 ], [ %sqrt.i69, %if.end23 ]
ret double %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local double @distanceLL(ptr nocapture noundef readonly byval(%struct.line) align 8 %a, ptr nocapture noundef readonly byval(%struct.line) align 8 %b) local_unnamed_addr #4 {
entry:
%call = tail call i32 @intersection(ptr noundef nonnull byval(%struct.line) align 8 %a, ptr noundef nonnull byval(%struct.line) align 8 %b), !range !5
%tobool.not = icmp eq i32 %call, 0
br i1 %tobool.not, label %if.else, label %cleanup
if.else: ; preds = %entry
%0 = load double, ptr %b, align 8
%1 = getelementptr inbounds { double, double }, ptr %b, i64 0, i32 1
%2 = load double, ptr %1, align 8
%en.i = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%3 = load double, ptr %en.i, align 8
%4 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%5 = load double, ptr %4, align 8
%6 = load double, ptr %a, align 8
%7 = getelementptr inbounds { double, double }, ptr %a, i64 0, i32 1
%8 = load double, ptr %7, align 8
%sub.i.i = fsub double %3, %6
%sub3.i.i = fsub double %5, %8
%sub.i38.i = fsub double %0, %6
%sub3.i39.i = fsub double %2, %8
%mul3.i.i = fmul double %sub3.i.i, %sub3.i39.i
%9 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub.i38.i, double %mul3.i.i)
%cmp.i = fcmp olt double %9, 0.000000e+00
br i1 %cmp.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %if.else
%mul3.i46.i = fmul double %sub3.i39.i, %sub3.i39.i
%10 = tail call double @llvm.fmuladd.f64(double %sub.i38.i, double %sub.i38.i, double %mul3.i46.i)
%sqrt.i.i = tail call double @llvm.sqrt.f64(double %10)
%11 = tail call double @llvm.fabs.f64(double %sqrt.i.i)
br label %distanceLP.exit
if.end.i: ; preds = %if.else
%sub.i47.i = fsub double %6, %3
%sub3.i48.i = fsub double %8, %5
%sub.i51.i = fsub double %0, %3
%sub3.i52.i = fsub double %2, %5
%mul3.i55.i = fmul double %sub3.i52.i, %sub3.i48.i
%12 = tail call double @llvm.fmuladd.f64(double %sub.i47.i, double %sub.i51.i, double %mul3.i55.i)
%cmp17.i = fcmp olt double %12, 0.000000e+00
br i1 %cmp17.i, label %if.then18.i, label %if.end23.i
if.then18.i: ; preds = %if.end.i
%mul3.i60.i = fmul double %sub3.i52.i, %sub3.i52.i
%13 = tail call double @llvm.fmuladd.f64(double %sub.i51.i, double %sub.i51.i, double %mul3.i60.i)
%sqrt.i61.i = tail call double @llvm.sqrt.f64(double %13)
%14 = tail call double @llvm.fabs.f64(double %sqrt.i61.i)
br label %distanceLP.exit
if.end23.i: ; preds = %if.end.i
%sub.i.i.i = fsub double %6, %0
%sub3.i.i.i = fsub double %8, %2
%15 = insertelement <2 x double> poison, double %sub3.i.i.i, i64 0
%16 = insertelement <2 x double> %15, double %sub3.i.i, i64 1
%17 = insertelement <2 x double> %16, double %sub3.i48.i, i64 0
%18 = fmul <2 x double> %16, %17
%19 = insertelement <2 x double> poison, double %sub.i.i.i, i64 0
%20 = insertelement <2 x double> %19, double %sub.i.i, i64 1
%21 = insertelement <2 x double> %20, double %sub.i47.i, i64 0
%22 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %20, <2 x double> %21, <2 x double> %18)
%23 = extractelement <2 x double> %22, i64 0
%24 = extractelement <2 x double> %22, i64 1
%div.i.i = fdiv double %23, %24
%25 = tail call double @llvm.fmuladd.f64(double %div.i.i, double %sub.i.i, double %6)
%26 = tail call double @llvm.fmuladd.f64(double %div.i.i, double %sub3.i.i, double %8)
%sub.i64.i = fsub double %25, %0
%sub3.i65.i = fsub double %26, %2
%mul3.i68.i = fmul double %sub3.i65.i, %sub3.i65.i
%27 = tail call double @llvm.fmuladd.f64(double %sub.i64.i, double %sub.i64.i, double %mul3.i68.i)
%sqrt.i69.i = tail call double @llvm.sqrt.f64(double %27)
br label %distanceLP.exit
distanceLP.exit: ; preds = %if.then.i, %if.then18.i, %if.end23.i
%retval.0.i = phi double [ %11, %if.then.i ], [ %14, %if.then18.i ], [ %sqrt.i69.i, %if.end23.i ]
%en = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1
%28 = load double, ptr %en, align 8
%29 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1, i32 1
%30 = load double, ptr %29, align 8
%sub.i38.i13 = fsub double %28, %6
%sub3.i39.i14 = fsub double %30, %8
%mul3.i.i15 = fmul double %sub3.i.i, %sub3.i39.i14
%31 = tail call double @llvm.fmuladd.f64(double %sub.i.i, double %sub.i38.i13, double %mul3.i.i15)
%cmp.i16 = fcmp olt double %31, 0.000000e+00
br i1 %cmp.i16, label %if.then.i38, label %if.end.i17
if.then.i38: ; preds = %distanceLP.exit
%mul3.i46.i39 = fmul double %sub3.i39.i14, %sub3.i39.i14
%32 = tail call double @llvm.fmuladd.f64(double %sub.i38.i13, double %sub.i38.i13, double %mul3.i46.i39)
%sqrt.i.i40 = tail call double @llvm.sqrt.f64(double %32)
%33 = tail call double @llvm.fabs.f64(double %sqrt.i.i40)
br label %distanceLP.exit41
if.end.i17: ; preds = %distanceLP.exit
%sub.i47.i18 = fsub double %6, %3
%sub3.i48.i19 = fsub double %8, %5
%sub.i51.i20 = fsub double %28, %3
%sub3.i52.i21 = fsub double %30, %5
%mul3.i55.i22 = fmul double %sub3.i48.i19, %sub3.i52.i21
%34 = tail call double @llvm.fmuladd.f64(double %sub.i47.i18, double %sub.i51.i20, double %mul3.i55.i22)
%cmp17.i23 = fcmp olt double %34, 0.000000e+00
br i1 %cmp17.i23, label %if.then18.i35, label %if.end23.i24
if.then18.i35: ; preds = %if.end.i17
%mul3.i60.i36 = fmul double %sub3.i52.i21, %sub3.i52.i21
%35 = tail call double @llvm.fmuladd.f64(double %sub.i51.i20, double %sub.i51.i20, double %mul3.i60.i36)
%sqrt.i61.i37 = tail call double @llvm.sqrt.f64(double %35)
%36 = tail call double @llvm.fabs.f64(double %sqrt.i61.i37)
br label %distanceLP.exit41
if.end23.i24: ; preds = %if.end.i17
%sub.i.i.i25 = fsub double %6, %28
%sub3.i.i.i26 = fsub double %8, %30
%37 = insertelement <2 x double> poison, double %sub3.i48.i19, i64 0
%38 = insertelement <2 x double> %37, double %sub3.i.i, i64 1
%39 = insertelement <2 x double> %38, double %sub3.i.i.i26, i64 0
%40 = fmul <2 x double> %38, %39
%41 = insertelement <2 x double> poison, double %sub.i.i.i25, i64 0
%42 = insertelement <2 x double> %41, double %sub.i.i, i64 1
%43 = insertelement <2 x double> %42, double %sub.i47.i18, i64 0
%44 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %42, <2 x double> %43, <2 x double> %40)
%45 = extractelement <2 x double> %44, i64 0
%46 = extractelement <2 x double> %44, i64 1
%div.i.i29 = fdiv double %45, %46
%47 = tail call double @llvm.fmuladd.f64(double %div.i.i29, double %sub.i.i, double %6)
%48 = tail call double @llvm.fmuladd.f64(double %div.i.i29, double %sub3.i.i, double %8)
%sub.i64.i30 = fsub double %47, %28
%sub3.i65.i31 = fsub double %48, %30
%mul3.i68.i32 = fmul double %sub3.i65.i31, %sub3.i65.i31
%49 = tail call double @llvm.fmuladd.f64(double %sub.i64.i30, double %sub.i64.i30, double %mul3.i68.i32)
%sqrt.i69.i33 = tail call double @llvm.sqrt.f64(double %49)
br label %distanceLP.exit41
distanceLP.exit41: ; preds = %if.then.i38, %if.then18.i35, %if.end23.i24
%retval.0.i34 = phi double [ %33, %if.then.i38 ], [ %36, %if.then18.i35 ], [ %sqrt.i69.i33, %if.end23.i24 ]
%sub.i.i43 = fsub double %28, %0
%sub3.i.i44 = fsub double %30, %2
%sub.i38.i45 = fsub double %6, %0
%sub3.i39.i46 = fsub double %8, %2
%mul3.i.i47 = fmul double %sub3.i39.i46, %sub3.i.i44
%50 = tail call double @llvm.fmuladd.f64(double %sub.i.i43, double %sub.i38.i45, double %mul3.i.i47)
%cmp.i48 = fcmp olt double %50, 0.000000e+00
br i1 %cmp.i48, label %if.then.i70, label %if.end.i49
if.then.i70: ; preds = %distanceLP.exit41
%mul3.i46.i71 = fmul double %sub3.i39.i46, %sub3.i39.i46
%51 = tail call double @llvm.fmuladd.f64(double %sub.i38.i45, double %sub.i38.i45, double %mul3.i46.i71)
%sqrt.i.i72 = tail call double @llvm.sqrt.f64(double %51)
%52 = tail call double @llvm.fabs.f64(double %sqrt.i.i72)
br label %distanceLP.exit73
if.end.i49: ; preds = %distanceLP.exit41
%sub.i47.i50 = fsub double %0, %28
%sub3.i48.i51 = fsub double %2, %30
%sub.i51.i52 = fsub double %6, %28
%sub3.i52.i53 = fsub double %8, %30
%mul3.i55.i54 = fmul double %sub3.i52.i53, %sub3.i48.i51
%53 = tail call double @llvm.fmuladd.f64(double %sub.i47.i50, double %sub.i51.i52, double %mul3.i55.i54)
%cmp17.i55 = fcmp olt double %53, 0.000000e+00
br i1 %cmp17.i55, label %if.then18.i67, label %if.end23.i56
if.then18.i67: ; preds = %if.end.i49
%mul3.i60.i68 = fmul double %sub3.i52.i53, %sub3.i52.i53
%54 = tail call double @llvm.fmuladd.f64(double %sub.i51.i52, double %sub.i51.i52, double %mul3.i60.i68)
%sqrt.i61.i69 = tail call double @llvm.sqrt.f64(double %54)
%55 = tail call double @llvm.fabs.f64(double %sqrt.i61.i69)
br label %distanceLP.exit73
if.end23.i56: ; preds = %if.end.i49
%56 = insertelement <2 x double> poison, double %sub3.i39.i, i64 0
%57 = insertelement <2 x double> %56, double %sub3.i.i44, i64 1
%58 = insertelement <2 x double> %57, double %sub3.i48.i51, i64 0
%59 = fmul <2 x double> %57, %58
%60 = insertelement <2 x double> poison, double %sub.i38.i, i64 0
%61 = insertelement <2 x double> %60, double %sub.i.i43, i64 1
%62 = insertelement <2 x double> %61, double %sub.i47.i50, i64 0
%63 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %61, <2 x double> %62, <2 x double> %59)
%64 = extractelement <2 x double> %63, i64 0
%65 = extractelement <2 x double> %63, i64 1
%div.i.i61 = fdiv double %64, %65
%66 = tail call double @llvm.fmuladd.f64(double %div.i.i61, double %sub.i.i43, double %0)
%67 = tail call double @llvm.fmuladd.f64(double %div.i.i61, double %sub3.i.i44, double %2)
%sub.i64.i62 = fsub double %66, %6
%sub3.i65.i63 = fsub double %67, %8
%mul3.i68.i64 = fmul double %sub3.i65.i63, %sub3.i65.i63
%68 = tail call double @llvm.fmuladd.f64(double %sub.i64.i62, double %sub.i64.i62, double %mul3.i68.i64)
%sqrt.i69.i65 = tail call double @llvm.sqrt.f64(double %68)
br label %distanceLP.exit73
distanceLP.exit73: ; preds = %if.then.i70, %if.then18.i67, %if.end23.i56
%retval.0.i66 = phi double [ %52, %if.then.i70 ], [ %55, %if.then18.i67 ], [ %sqrt.i69.i65, %if.end23.i56 ]
%sub.i38.i77 = fsub double %3, %0
%sub3.i39.i78 = fsub double %5, %2
%mul3.i.i79 = fmul double %sub3.i39.i78, %sub3.i.i44
%69 = tail call double @llvm.fmuladd.f64(double %sub.i.i43, double %sub.i38.i77, double %mul3.i.i79)
%cmp.i80 = fcmp olt double %69, 0.000000e+00
br i1 %cmp.i80, label %if.then.i102, label %if.end.i81
if.then.i102: ; preds = %distanceLP.exit73
%mul3.i46.i103 = fmul double %sub3.i39.i78, %sub3.i39.i78
%70 = tail call double @llvm.fmuladd.f64(double %sub.i38.i77, double %sub.i38.i77, double %mul3.i46.i103)
%sqrt.i.i104 = tail call double @llvm.sqrt.f64(double %70)
%71 = tail call double @llvm.fabs.f64(double %sqrt.i.i104)
br label %distanceLP.exit105
if.end.i81: ; preds = %distanceLP.exit73
%sub.i47.i82 = fsub double %0, %28
%sub3.i48.i83 = fsub double %2, %30
%sub.i51.i84 = fsub double %3, %28
%sub3.i52.i85 = fsub double %5, %30
%mul3.i55.i86 = fmul double %sub3.i52.i85, %sub3.i48.i83
%72 = tail call double @llvm.fmuladd.f64(double %sub.i47.i82, double %sub.i51.i84, double %mul3.i55.i86)
%cmp17.i87 = fcmp olt double %72, 0.000000e+00
br i1 %cmp17.i87, label %if.then18.i99, label %if.end23.i88
if.then18.i99: ; preds = %if.end.i81
%mul3.i60.i100 = fmul double %sub3.i52.i85, %sub3.i52.i85
%73 = tail call double @llvm.fmuladd.f64(double %sub.i51.i84, double %sub.i51.i84, double %mul3.i60.i100)
%sqrt.i61.i101 = tail call double @llvm.sqrt.f64(double %73)
%74 = tail call double @llvm.fabs.f64(double %sqrt.i61.i101)
br label %distanceLP.exit105
if.end23.i88: ; preds = %if.end.i81
%sub.i.i.i89 = fsub double %0, %3
%sub3.i.i.i90 = fsub double %2, %5
%75 = insertelement <2 x double> poison, double %sub3.i.i.i90, i64 0
%76 = insertelement <2 x double> %75, double %sub3.i.i44, i64 1
%77 = insertelement <2 x double> %76, double %sub3.i48.i83, i64 0
%78 = fmul <2 x double> %76, %77
%79 = insertelement <2 x double> poison, double %sub.i.i.i89, i64 0
%80 = insertelement <2 x double> %79, double %sub.i.i43, i64 1
%81 = insertelement <2 x double> %80, double %sub.i47.i82, i64 0
%82 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %80, <2 x double> %81, <2 x double> %78)
%83 = extractelement <2 x double> %82, i64 0
%84 = extractelement <2 x double> %82, i64 1
%div.i.i93 = fdiv double %83, %84
%85 = tail call double @llvm.fmuladd.f64(double %div.i.i93, double %sub.i.i43, double %0)
%86 = tail call double @llvm.fmuladd.f64(double %div.i.i93, double %sub3.i.i44, double %2)
%sub.i64.i94 = fsub double %85, %3
%sub3.i65.i95 = fsub double %86, %5
%mul3.i68.i96 = fmul double %sub3.i65.i95, %sub3.i65.i95
%87 = tail call double @llvm.fmuladd.f64(double %sub.i64.i94, double %sub.i64.i94, double %mul3.i68.i96)
%sqrt.i69.i97 = tail call double @llvm.sqrt.f64(double %87)
br label %distanceLP.exit105
distanceLP.exit105: ; preds = %if.then.i102, %if.then18.i99, %if.end23.i88
%retval.0.i98 = phi double [ %71, %if.then.i102 ], [ %74, %if.then18.i99 ], [ %sqrt.i69.i97, %if.end23.i88 ]
%88 = tail call double @llvm.minnum.f64(double %retval.0.i66, double %retval.0.i98)
%89 = tail call double @llvm.minnum.f64(double %retval.0.i34, double %88)
%90 = tail call double @llvm.minnum.f64(double %retval.0.i, double %89)
br label %cleanup
cleanup: ; preds = %entry, %distanceLP.exit105
%retval.0 = phi double [ %90, %distanceLP.exit105 ], [ 0.000000e+00, %entry ]
ret double %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.minnum.f64(double, double) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%a = alloca %struct.line, align 8
%b = alloca %struct.line, align 8
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %b) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !6
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%y = getelementptr inbounds %struct.point, ptr %a, i64 0, i32 1
%en = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1
%y4 = getelementptr inbounds %struct.line, ptr %a, i64 0, i32 1, i32 1
%y8 = getelementptr inbounds %struct.point, ptr %b, i64 0, i32 1
%en9 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1
%y12 = getelementptr inbounds %struct.line, ptr %b, i64 0, i32 1, i32 1
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.body
%i.018 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.body ]
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %y, ptr noundef nonnull %en, ptr noundef nonnull %y4, ptr noundef nonnull %b, ptr noundef nonnull %y8, ptr noundef nonnull %en9, ptr noundef nonnull %y12)
%call14 = call double @distanceLL(ptr noundef nonnull byval(%struct.line) align 8 %a, ptr noundef nonnull byval(%struct.line) align 8 %b)
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %call14)
%inc = add nuw nsw i32 %i.018, 1
%1 = load i32, ptr %n, align 4, !tbaa !6
%cmp = icmp slt i32 %inc, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %a) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.sqrt.v2f64(<2 x double>) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fabs.v2f64(<2 x double>) #7
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 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{i32 0, i32 2}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int a,b,t,n;
scanf("%d%d",&a,&b);
if(b==0)
n=1;
else if(b>(a/2))
n=a-b;
else
n=b;
printf("%d\n",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16726/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16726/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %if.end4, label %if.else
if.else: ; preds = %entry
%1 = load i32, ptr %a, align 4, !tbaa !5
%div = sdiv i32 %1, 2
%cmp1 = icmp sgt i32 %0, %div
%sub = sub nsw i32 %1, %0
%spec.select = select i1 %cmp1, i32 %sub, i32 %0
br label %if.end4
if.end4: ; preds = %if.else, %entry
%n.0 = phi i32 [ 1, %entry ], [ %spec.select, %if.else ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %n.0)
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"}
|
/* ex6_2
B30095 */
#include <stdio.h>
#include <string.h>
#define LEN 100
int main(void){
int len;
char str[LEN];
scanf("%s", str);
len = strlen(str);
printf("%c%d%c", str[0], len - 2, str[len - 1]); // chars between the first and the last are replaced by its numbers. ex: "example" -> "e5e"
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167302/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167302/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%c%d%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #5
%conv = trunc i64 %call2 to i32
%0 = load i8, ptr %str, align 16, !tbaa !5
%conv3 = sext i8 %0 to i32
%sub = add nsw i32 %conv, -2
%sub4 = shl i64 %call2, 32
%sext = add i64 %sub4, -4294967296
%idxprom = ashr exact i64 %sext, 32
%arrayidx5 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%conv6 = sext i8 %1 to i32
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3, i32 noundef %sub, i32 noundef %conv6)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
/* ex6-2
Sagzar1993 */
#include <stdio.h>
#include <string.h>
#define SIZE 256
int main(void) {
int length, mid;
char words[SIZE];
//文字列の入力
fgets(words, SIZE, stdin);
//文字列の長さを取得
length = strlen(words);
//先頭と語尾の間の文字数
mid = length - 3;
putchar(words[0]); //先頭文字を出力
printf("%d", mid); //間の文字数を出力
putchar(words[length-2]); //最後の文字を出力
printf("\n"); //改行
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167346/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167346/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%words = alloca [256 x i8], align 16
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %words) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %words, i32 noundef 256, ptr noundef %0)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %words) #5
%conv = trunc i64 %call2 to i32
%sub = add nsw i32 %conv, -3
%1 = load i8, ptr %words, align 16, !tbaa !9
%conv3 = sext i8 %1 to i32
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i = call noundef i32 @putc(i32 noundef %conv3, ptr noundef %2)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
%sub6 = shl i64 %call2, 32
%sext = add i64 %sub6, -8589934592
%idxprom = ashr exact i64 %sext, 32
%arrayidx7 = getelementptr inbounds [256 x i8], ptr %words, i64 0, i64 %idxprom
%3 = load i8, ptr %arrayidx7, align 1, !tbaa !9
%conv8 = sext i8 %3 to i32
%4 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i12 = call noundef i32 @putc(i32 noundef %conv8, ptr noundef %4)
%5 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i13 = call noundef i32 @putc(i32 noundef 10, ptr noundef %5)
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %words) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
#include<stdlib.h>
int dsu[200005];
int par(int x){
if(dsu[x] < 0) return x;
return dsu[x] = par(dsu[x]);
}
void join(int x, int y){
int px, py;
px = par(x);
py = par(y);
if(px == py) return;
if(dsu[px] > dsu[py])join(py, px);
else {
dsu[px] += dsu[py];
dsu[py] = x;
}
}
int main(){
int n, m, i;
scanf("%d %d", &n, &m);
for(i = 0;i < n;i++)dsu[i] = -1;
for(i = 0;i < m;i++){
int x, y;
scanf("%d %d", &x, &y);
x--;y--;
join(x, y);
}
int curg, sz, ans;
ans = 0;
curg = -1;
for(i = 0;i < n;i++){
if(curg == -1){
curg = par(i);
sz = 1;
} else {
if(par(i) != curg) {
join(curg, i);
curg = par(i);
ans++;
}
sz++;
}
if(sz == -dsu[curg]) curg = -1;
}
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@dsu = dso_local local_unnamed_addr global [200005 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @par(i32 noundef %x) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 0
br i1 %cmp, label %common.ret8, label %if.end
common.ret8: ; preds = %entry, %if.end
%common.ret8.op = phi i32 [ %call, %if.end ], [ %x, %entry ]
ret i32 %common.ret8.op
if.end: ; preds = %entry
%call = tail call i32 @par(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
br label %common.ret8
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @join(i32 noundef %x, i32 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%x.tr = phi i32 [ %x, %entry ], [ %call1, %if.end ]
%y.tr = phi i32 [ %y, %entry ], [ %call, %if.end ]
%call = tail call i32 @par(i32 noundef %x.tr)
%call1 = tail call i32 @par(i32 noundef %y.tr)
%cmp = icmp eq i32 %call, %call1
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %tailrecurse
%idxprom = sext i32 %call to i64
%arrayidx = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom2 = sext i32 %call1 to i64
%arrayidx3 = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, %1
br i1 %cmp4, label %tailrecurse, label %if.else
if.else: ; preds = %if.end
%add = add nsw i32 %1, %0
store i32 %add, ptr %arrayidx, align 4, !tbaa !5
store i32 %x.tr, ptr %arrayidx3, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %tailrecurse, %if.else
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 0
br i1 %cmp65, label %for.body.preheader, label %for.cond1.preheader
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%2 = shl nuw nsw i64 %1, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 @dsu, i8 -1, i64 %2, i1 false), !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.body.preheader, %entry
%3 = load i32, ptr %m, align 4, !tbaa !5
%cmp267 = icmp sgt i32 %3, 0
br i1 %cmp267, label %for.body3, label %for.cond9.preheader
for.cond9.preheader.loopexit: ; preds = %join.exit
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.cond9.preheader.loopexit, %for.cond1.preheader
%4 = phi i32 [ %.pre, %for.cond9.preheader.loopexit ], [ %0, %for.cond1.preheader ]
%cmp1069 = icmp sgt i32 %4, 0
br i1 %cmp1069, label %for.body11, label %for.end28
for.body3: ; preds = %for.cond1.preheader, %join.exit
%i.168 = phi i32 [ %inc7, %join.exit ], [ 0, %for.cond1.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%5 = load i32, ptr %x, align 4, !tbaa !5
%dec = add nsw i32 %5, -1
store i32 %dec, ptr %x, align 4, !tbaa !5
%6 = load i32, ptr %y, align 4, !tbaa !5
%dec5 = add nsw i32 %6, -1
store i32 %dec5, ptr %y, align 4, !tbaa !5
br label %tailrecurse.i
tailrecurse.i: ; preds = %if.end.i, %for.body3
%x.tr.i = phi i32 [ %dec, %for.body3 ], [ %call1.i, %if.end.i ]
%y.tr.i = phi i32 [ %dec5, %for.body3 ], [ %call.i, %if.end.i ]
%call.i = call i32 @par(i32 noundef %x.tr.i)
%call1.i = call i32 @par(i32 noundef %y.tr.i)
%cmp.i = icmp eq i32 %call.i, %call1.i
br i1 %cmp.i, label %join.exit, label %if.end.i
if.end.i: ; preds = %tailrecurse.i
%idxprom.i = sext i32 %call.i to i64
%arrayidx.i = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom.i
%7 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%idxprom2.i = sext i32 %call1.i to i64
%arrayidx3.i = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom2.i
%8 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %7, %8
br i1 %cmp4.i, label %tailrecurse.i, label %if.else.i
if.else.i: ; preds = %if.end.i
%add.i = add nsw i32 %8, %7
store i32 %add.i, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %x.tr.i, ptr %arrayidx3.i, align 4, !tbaa !5
br label %join.exit
join.exit: ; preds = %tailrecurse.i, %if.else.i
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6
%inc7 = add nuw nsw i32 %i.168, 1
%9 = load i32, ptr %m, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc7, %9
br i1 %cmp2, label %for.body3, label %for.cond9.preheader.loopexit, !llvm.loop !9
for.body11: ; preds = %for.cond9.preheader, %if.end20
%ans.074 = phi i32 [ %ans.2, %if.end20 ], [ 0, %for.cond9.preheader ]
%sz.073 = phi i32 [ %sz.1, %if.end20 ], [ undef, %for.cond9.preheader ]
%curg.072 = phi i32 [ %spec.store.select, %if.end20 ], [ -1, %for.cond9.preheader ]
%i.270 = phi i32 [ %inc27, %if.end20 ], [ 0, %for.cond9.preheader ]
%cmp12 = icmp eq i32 %curg.072, -1
%call13 = call i32 @par(i32 noundef %i.270)
br i1 %cmp12, label %if.end20, label %if.else
if.else: ; preds = %for.body11
%cmp15.not = icmp eq i32 %call13, %curg.072
br i1 %cmp15.not, label %if.end, label %tailrecurse.i45
tailrecurse.i45: ; preds = %if.else, %if.end.i51
%x.tr.i46 = phi i32 [ %call1.i49, %if.end.i51 ], [ %curg.072, %if.else ]
%y.tr.i47 = phi i32 [ %call.i48, %if.end.i51 ], [ %i.270, %if.else ]
%call.i48 = call i32 @par(i32 noundef %x.tr.i46)
%call1.i49 = call i32 @par(i32 noundef %y.tr.i47)
%cmp.i50 = icmp eq i32 %call.i48, %call1.i49
br i1 %cmp.i50, label %join.exit59, label %if.end.i51
if.end.i51: ; preds = %tailrecurse.i45
%idxprom.i52 = sext i32 %call.i48 to i64
%arrayidx.i53 = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom.i52
%10 = load i32, ptr %arrayidx.i53, align 4, !tbaa !5
%idxprom2.i54 = sext i32 %call1.i49 to i64
%arrayidx3.i55 = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom2.i54
%11 = load i32, ptr %arrayidx3.i55, align 4, !tbaa !5
%cmp4.i56 = icmp sgt i32 %10, %11
br i1 %cmp4.i56, label %tailrecurse.i45, label %if.else.i57
if.else.i57: ; preds = %if.end.i51
%add.i58 = add nsw i32 %11, %10
store i32 %add.i58, ptr %arrayidx.i53, align 4, !tbaa !5
store i32 %x.tr.i46, ptr %arrayidx3.i55, align 4, !tbaa !5
br label %join.exit59
join.exit59: ; preds = %tailrecurse.i45, %if.else.i57
%call17 = call i32 @par(i32 noundef %i.270)
%inc18 = add nsw i32 %ans.074, 1
br label %if.end
if.end: ; preds = %join.exit59, %if.else
%curg.1 = phi i32 [ %call17, %join.exit59 ], [ %curg.072, %if.else ]
%ans.1 = phi i32 [ %inc18, %join.exit59 ], [ %ans.074, %if.else ]
%inc19 = add nsw i32 %sz.073, 1
br label %if.end20
if.end20: ; preds = %for.body11, %if.end
%curg.2 = phi i32 [ %curg.1, %if.end ], [ %call13, %for.body11 ]
%sz.1 = phi i32 [ %inc19, %if.end ], [ 1, %for.body11 ]
%ans.2 = phi i32 [ %ans.1, %if.end ], [ %ans.074, %for.body11 ]
%idxprom21 = sext i32 %curg.2 to i64
%arrayidx22 = getelementptr inbounds [200005 x i32], ptr @dsu, i64 0, i64 %idxprom21
%12 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%sub = sub nsw i32 0, %12
%cmp23 = icmp eq i32 %sz.1, %sub
%spec.store.select = select i1 %cmp23, i32 -1, i32 %curg.2
%inc27 = add nuw nsw i32 %i.270, 1
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp slt i32 %inc27, %13
br i1 %cmp10, label %for.body11, label %for.end28, !llvm.loop !11
for.end28: ; preds = %if.end20, %for.cond9.preheader
%ans.0.lcssa = phi i32 [ 0, %for.cond9.preheader ], [ %ans.2, %if.end20 ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(){
int qnt, sz;
int a[100001], b[100001], dif, has, st, end, possi;
scanf("%d", &qnt);
for(int i = 0; i < qnt; ++i){
scanf("%d", &sz);
for(int j = 0; j < sz; ++j){
scanf("%d", &a[j]);
}
for(int j = 0; j < sz; ++j){
scanf("%d", &b[j]);
}
has = 0;
st = end = sz;
possi = 1;
for(int j = 0; j < sz; ++j){
if(a[j] - b [j]){
if(!has){
has = 1;
st = j;
dif = - a[j] + b[j];
if(dif < 0){
possi = 0;
break;
}
}else{
if(j > end){
possi = 0;
break;
}else if(-a[j] + b[j] != dif){
possi = 0;
}
}
}else{
if(has && end > j){
end = j;
}
}
}
printf("%s\n", possi ? "YES": "NO");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16744/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16744/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%qnt = alloca i32, align 4
%sz = alloca i32, align 4
%a = alloca [100001 x i32], align 16
%b = alloca [100001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %qnt) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sz) #5
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %qnt)
%0 = load i32, ptr %qnt, align 4, !tbaa !5
%cmp105 = icmp sgt i32 %0, 0
br i1 %cmp105, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond, %entry
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sz) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %qnt) #5
ret i32 0
for.body: ; preds = %entry, %for.cond
%i.0107 = phi i32 [ %inc62, %for.cond ], [ 0, %entry ]
%dif.0106 = phi i32 [ %dif.389, %for.cond ], [ undef, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sz)
%1 = load i32, ptr %sz, align 4, !tbaa !5
%cmp393 = icmp sgt i32 %1, 0
br i1 %cmp393, label %for.body5, label %for.cond
for.cond8.preheader: ; preds = %for.body5
%cmp995 = icmp sgt i32 %2, 0
br i1 %cmp995, label %for.body11, label %for.cond
for.body5: ; preds = %for.body, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %sz, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp3, label %for.body5, label %for.cond8.preheader, !llvm.loop !9
for.cond19.preheader: ; preds = %for.body11
%cmp2097 = icmp sgt i32 %4, 0
br i1 %cmp2097, label %for.body22.preheader, label %for.cond
for.body22.preheader: ; preds = %for.cond19.preheader
%wide.trip.count = zext i32 %4 to i64
br label %for.body22
for.body11: ; preds = %for.cond8.preheader, %for.body11
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body11 ], [ 0, %for.cond8.preheader ]
%arrayidx13 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv111
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx13)
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%4 = load i32, ptr %sz, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp9 = icmp slt i64 %indvars.iv.next112, %5
br i1 %cmp9, label %for.body11, label %for.cond19.preheader, !llvm.loop !11
for.body22: ; preds = %for.body22.preheader, %for.inc56
%indvars.iv114 = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next115, %for.inc56 ]
%possi.0.fr102 = phi i32 [ 1, %for.body22.preheader ], [ %possi.0.fr, %for.inc56 ]
%end.0100 = phi i32 [ %4, %for.body22.preheader ], [ %end.1, %for.inc56 ]
%has.099 = phi i32 [ 0, %for.body22.preheader ], [ %has.1, %for.inc56 ]
%dif.198 = phi i32 [ %dif.0106, %for.body22.preheader ], [ %dif.2, %for.inc56 ]
%arrayidx24 = getelementptr inbounds [100001 x i32], ptr %a, i64 0, i64 %indvars.iv114
%6 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx26 = getelementptr inbounds [100001 x i32], ptr %b, i64 0, i64 %indvars.iv114
%7 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, %7
%tobool51.not = icmp eq i32 %has.099, 0
br i1 %tobool.not, label %if.else50, label %if.then
if.then: ; preds = %for.body22
br i1 %tobool51.not, label %if.then28, label %if.else
if.then28: ; preds = %if.then
%add = sub i32 %7, %6
%cmp34 = icmp slt i32 %add, 0
br i1 %cmp34, label %cleanup.thread, label %for.inc56
if.else: ; preds = %if.then
%8 = sext i32 %end.0100 to i64
%cmp36 = icmp sgt i64 %indvars.iv114, %8
br i1 %cmp36, label %cleanup.thread, label %if.else38
if.else38: ; preds = %if.else
%add44 = sub i32 %7, %6
%cmp45.not = icmp eq i32 %add44, %dif.198
%spec.select = select i1 %cmp45.not, i32 %possi.0.fr102, i32 0
br label %for.inc56
if.else50: ; preds = %for.body22
br i1 %tobool51.not, label %for.inc56, label %land.lhs.true
land.lhs.true: ; preds = %if.else50
%9 = trunc i64 %indvars.iv114 to i32
%spec.select84 = call i32 @llvm.smin.i32(i32 %end.0100, i32 %9)
br label %for.inc56
for.inc56: ; preds = %land.lhs.true, %if.else38, %if.then28, %if.else50
%dif.2 = phi i32 [ %add, %if.then28 ], [ %dif.198, %if.else50 ], [ %dif.198, %if.else38 ], [ %dif.198, %land.lhs.true ]
%has.1 = phi i32 [ 1, %if.then28 ], [ 0, %if.else50 ], [ 1, %if.else38 ], [ 1, %land.lhs.true ]
%end.1 = phi i32 [ %end.0100, %if.then28 ], [ %end.0100, %if.else50 ], [ %end.0100, %if.else38 ], [ %spec.select84, %land.lhs.true ]
%possi.1 = phi i32 [ %possi.0.fr102, %if.then28 ], [ %possi.0.fr102, %if.else50 ], [ %spec.select, %if.else38 ], [ %possi.0.fr102, %land.lhs.true ]
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%possi.0.fr = freeze i32 %possi.1
%exitcond.not = icmp eq i64 %indvars.iv.next115, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body22, !llvm.loop !12
cleanup: ; preds = %for.inc56
%tobool59.not = icmp eq i32 %possi.0.fr, 0
br i1 %tobool59.not, label %cleanup.thread, label %for.cond
cleanup.thread: ; preds = %if.else, %if.then28, %cleanup
%dif.390 = phi i32 [ %dif.2, %cleanup ], [ %add, %if.then28 ], [ %dif.198, %if.else ]
br label %for.cond
for.cond: ; preds = %for.body, %for.cond8.preheader, %for.cond19.preheader, %cleanup, %cleanup.thread
%dif.389 = phi i32 [ %dif.390, %cleanup.thread ], [ %dif.2, %cleanup ], [ %dif.0106, %for.cond19.preheader ], [ %dif.0106, %for.cond8.preheader ], [ %dif.0106, %for.body ]
%10 = phi ptr [ @.str.3, %cleanup.thread ], [ @.str.2, %cleanup ], [ @.str.2, %for.cond19.preheader ], [ @.str.2, %for.cond8.preheader ], [ @.str.2, %for.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %10)
%inc62 = add nuw nsw i32 %i.0107, 1
%11 = load i32, ptr %qnt, align 4, !tbaa !5
%cmp = icmp slt i32 %inc62, %11
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
int n=0;
char s[102];
scanf("%s",s);
while(s[n]!='\0'){
n++;
}
printf("%c%d%c\n",s[0],n-2,s[n-1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%c%d%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [102 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%2 = load i8, ptr %s, align 16, !tbaa !5
%conv3 = sext i8 %2 to i32
%sub = add nsw i32 %1, -2
%sub4 = shl i64 %indvars.iv, 32
%sext = add i64 %sub4, -4294967296
%idxprom5 = ashr exact i64 %sext, 32
%arrayidx6 = getelementptr inbounds [102 x i8], ptr %s, i64 0, i64 %idxprom5
%3 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%conv7 = sext i8 %3 to i32
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3, i32 noundef %sub, i32 noundef %conv7)
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(){
int i;
char S[101];
scanf("%s",S);
for(i=0;S[i]!='\0';i++){
}
printf("%c%d%c",S[0],i-2,S[i-1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167562/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167562/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%c%d%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !8
for.end: ; preds = %for.cond
%1 = trunc i64 %indvars.iv to i32
%2 = load i8, ptr %S, align 16, !tbaa !5
%conv3 = sext i8 %2 to i32
%sub = add nsw i32 %1, -2
%sub4 = shl i64 %indvars.iv, 32
%sext = add i64 %sub4, -4294967296
%idxprom5 = ashr exact i64 %sext, 32
%arrayidx6 = getelementptr inbounds [101 x i8], ptr %S, i64 0, i64 %idxprom5
%3 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%conv7 = sext i8 %3 to i32
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv3, i32 noundef %sub, i32 noundef %conv7)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
void swap(int *a, int *b);
int main() {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if(a > b) {
swap(&a, &b);
}
if(b > c) {
swap(&b, &c);
}
if(a > b) {
swap(&a, &b);
}
printf("%d %d %d\n", a, b, c);
return 0;
}
void swap(int *a, int *b) {
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167605/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167605/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !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
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if(a <= b && b <= c){
printf("%d %d %d\n", a, b, c);
}else if(a <= c && c <= b){
printf("%d %d %d\n", a, c, b);
}else if(b <= a && a <= c){
printf("%d %d %d\n", b, a, c);
}else if(b <= c && c <= a){
printf("%d %d %d\n", b, c, a);
}else if(c <= a && a <= b){
printf("%d %d %d\n", c, a, b);
}else if(c <= b && b <= a){
printf("%d %d %d\n", c, b, a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167649/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167649/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %.pre
%or.cond59 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond59, label %if.else, label %if.then
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end36
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %0, %.pre
br i1 %cmp3.not, label %if.else8, label %land.lhs.true4
land.lhs.true4: ; preds = %if.else
%cmp5.not = icmp sgt i32 %.pre, %1
br i1 %cmp5.not, label %if.else8.thread, label %if.then6
if.then6: ; preds = %land.lhs.true4
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end36
if.else8: ; preds = %if.else
%cmp9.not = icmp sgt i32 %1, %0
br label %if.else14
if.else8.thread: ; preds = %land.lhs.true4
%cmp9.not54 = icmp sgt i32 %1, %0
br i1 %cmp9.not54, label %if.else14, label %if.then12
if.then12: ; preds = %if.else8.thread
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end36
if.else14: ; preds = %if.else8, %if.else8.thread
%cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ]
%cmp15.not = icmp sgt i32 %1, %.pre
%cmp17.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp15.not, %cmp17.not
br i1 %or.cond, label %if.else20, label %if.then18
if.then18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end36
if.else20: ; preds = %if.else14
%brmerge = or i1 %cmp.not, %cmp17.not
br i1 %brmerge, label %if.else26, label %if.then24
if.then24: ; preds = %if.else20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end36
if.else26: ; preds = %if.else20
%cmp27.not = icmp sgt i32 %.pre, %1
%brmerge58 = or i1 %cmp27.not, %cmp9.not56
br i1 %brmerge58, label %if.end36, label %if.then30
if.then30: ; preds = %if.else26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end36
if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d\n",&a,&b,&c);
if(a <= b && b <= c)
printf("%d %d %d\n",a ,b ,c);
else if(a <= c && c <= b)
printf("%d %d %d\n",a ,c ,b);
else if(b <= a && a <= c)
printf("%d %d %d\n",b ,a ,c);
else if(b <= c && c <= a)
printf("%d %d %d\n",b ,c ,a);
else if(c <= a && a <= b)
printf("%d %d %d\n",c ,a ,b);
else if(c <= b && b <= a)
printf("%d %d %d\n",c ,b ,a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167692/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167692/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %.pre
%or.cond59 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond59, label %if.else, label %if.then
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end36
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %0, %.pre
br i1 %cmp3.not, label %if.else8, label %land.lhs.true4
land.lhs.true4: ; preds = %if.else
%cmp5.not = icmp sgt i32 %.pre, %1
br i1 %cmp5.not, label %if.else8.thread, label %if.then6
if.then6: ; preds = %land.lhs.true4
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end36
if.else8: ; preds = %if.else
%cmp9.not = icmp sgt i32 %1, %0
br label %if.else14
if.else8.thread: ; preds = %land.lhs.true4
%cmp9.not54 = icmp sgt i32 %1, %0
br i1 %cmp9.not54, label %if.else14, label %if.then12
if.then12: ; preds = %if.else8.thread
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end36
if.else14: ; preds = %if.else8, %if.else8.thread
%cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ]
%cmp15.not = icmp sgt i32 %1, %.pre
%cmp17.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp15.not, %cmp17.not
br i1 %or.cond, label %if.else20, label %if.then18
if.then18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end36
if.else20: ; preds = %if.else14
%brmerge = or i1 %cmp.not, %cmp17.not
br i1 %brmerge, label %if.else26, label %if.then24
if.then24: ; preds = %if.else20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end36
if.else26: ; preds = %if.else20
%cmp27.not = icmp sgt i32 %.pre, %1
%brmerge58 = or i1 %cmp27.not, %cmp9.not56
br i1 %brmerge58, label %if.end36, label %if.then30
if.then30: ; preds = %if.else26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end36
if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if((a>=b)&&(a>=c))
{
if(b>=c)
{
printf("%d %d %d\n",c,b,a);
}
else
{
printf("%d %d %d\n",b,c,a);
}
}
else if((b>=a)&&(b>=c))
{
if(a>=c)
{
printf("%d %d %d\n",c,a,b);
}
else
{
printf("%d %d %d\n",a,c,b);
}
}
else if((c>=a)&&(c>=b))
{
if(a>=b)
{
printf("%d %d %d\n",b,a,c);
}
else
{
printf("%d %d %d\n",a,b,c);
}
}
return 0 ;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167735/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167735/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %0, %.pre.pre
%or.cond39 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond39, label %if.else6, label %if.then
if.then: ; preds = %entry
%cmp2.not = icmp slt i32 %1, %.pre.pre
br i1 %cmp2.not, label %if.else, label %if.then3
if.then3: ; preds = %if.then
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.pre, i32 noundef %1, i32 noundef %0)
br label %if.end30
if.else: ; preds = %if.then
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre.pre, i32 noundef %0)
br label %if.end30
if.else6: ; preds = %entry
%cmp7.not = icmp slt i32 %1, %0
%cmp9.not = icmp slt i32 %1, %.pre.pre
%or.cond40 = select i1 %cmp7.not, i1 true, i1 %cmp9.not
br i1 %or.cond40, label %if.else17, label %if.then10
if.then10: ; preds = %if.else6
%cmp11.not = icmp slt i32 %0, %.pre.pre
br i1 %cmp11.not, label %if.else14, label %if.then12
if.then12: ; preds = %if.then10
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.pre, i32 noundef %0, i32 noundef %1)
br label %if.end30
if.else14: ; preds = %if.then10
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre.pre, i32 noundef %1)
br label %if.end30
if.else17: ; preds = %if.else6
%cmp18.not = icmp slt i32 %.pre.pre, %0
%cmp20.not = icmp slt i32 %.pre.pre, %1
%or.cond = or i1 %cmp18.not, %cmp20.not
br i1 %or.cond, label %if.end30, label %if.then21
if.then21: ; preds = %if.else17
br i1 %cmp.not, label %if.else25, label %if.then23
if.then23: ; preds = %if.then21
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre.pre)
br label %if.end30
if.else25: ; preds = %if.then21
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre.pre)
br label %if.end30
if.end30: ; preds = %if.else14, %if.then12, %if.then23, %if.else25, %if.else17, %if.then3, %if.else
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define SWAP(a,b) a += b;b = a - b;a -= b
int main()
{
int a[3];
scanf("%d%d%d", &a[0], &a[1], &a[2]);
if (a[0] > a[1]){
SWAP(a[0], a[1]);
}
if (a[1] > a[2]){
SWAP(a[1], a[2]);
}
if (a[0] > a[1]){
SWAP(a[0], a[1]);
}
if (a[1] > a[2]){
SWAP(a[1], a[2]);
}
printf("%d %d %d\n", a[0], a[1], a[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167786/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167786/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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 [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %0, ptr %arrayidx1, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %3, %4
br i1 %cmp15, label %if.then16, label %if.end27
if.then16: ; preds = %if.end
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
store i32 %4, ptr %arrayidx1, align 4, !tbaa !5
br label %if.end27
if.end27: ; preds = %if.then16, %if.end
%5 = phi i32 [ %3, %if.then16 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then16 ], [ %3, %if.end ]
%cmp30 = icmp sgt i32 %2, %6
br i1 %cmp30, label %if.then31, label %if.end42
if.then31: ; preds = %if.end27
store i32 %2, ptr %arrayidx1, align 4, !tbaa !5
store i32 %6, ptr %a, align 4, !tbaa !5
br label %if.end42
if.end42: ; preds = %if.then31, %if.end27
%7 = phi i32 [ %6, %if.then31 ], [ %2, %if.end27 ]
%8 = phi i32 [ %2, %if.then31 ], [ %6, %if.end27 ]
%cmp45 = icmp sgt i32 %8, %5
br i1 %cmp45, label %if.then46, label %if.end57
if.then46: ; preds = %if.end42
store i32 %8, ptr %arrayidx2, align 4, !tbaa !5
store i32 %5, ptr %arrayidx1, align 4, !tbaa !5
br label %if.end57
if.end57: ; preds = %if.then46, %if.end42
%9 = phi i32 [ %8, %if.then46 ], [ %5, %if.end42 ]
%10 = phi i32 [ %5, %if.then46 ], [ %8, %if.end42 ]
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %10, i32 noundef %9)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c,d;
scanf("%d %d %d", &a, &b, &c);
if(a > b){
d = b;
b = a;
a = d;
}
if(b > c){
d = c;
c = b;
b = d;
}
if(a > b){
d = b;
b = a;
a = d;
}
printf("%d %d %d\n", a, b, c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167829/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167829/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %0, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %3, ptr %c, align 4, !tbaa !5
store i32 %4, ptr %b, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %2, ptr %b, align 4, !tbaa !5
store i32 %6, ptr %a, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c,x;
scanf("%d %d %d",&a,&b,&c);
if(a > b){
x=a;
a=b;
b=x;
}
if(b > c){
x=b;
b=c;
c=x;
}
if(a > b){
x=a;
a=b;
b=x;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167872/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167872/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a, b, c, w;
scanf("%d %d %d", &a, &b, &c);
if (a > b) {
w = a;
a = b;
b = w;
}
if (b < c) printf("%d %d %d\n", a, b, c);
if (a <= c && c <= b) printf("%d %d %d\n", a, c, b);
if (a > c) printf("%d %d %d\n", c, a, b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167922/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167922/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp slt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end4
if.then2: ; preds = %if.end
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %3, i32 noundef %4)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre22 = load i32, ptr %c, align 4, !tbaa !5
br label %if.end4
if.end4: ; preds = %if.then2, %if.end
%5 = phi i32 [ %.pre22, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %.pre, %if.then2 ], [ %2, %if.end ]
%cmp5.not = icmp sgt i32 %6, %5
br i1 %cmp5.not, label %if.end9, label %land.lhs.true
land.lhs.true: ; preds = %if.end4
%7 = load i32, ptr %b, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %5, %7
br i1 %cmp6.not, label %if.end9, label %if.then7
if.then7: ; preds = %land.lhs.true
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %5, i32 noundef %7)
%.pre23 = load i32, ptr %a, align 4, !tbaa !5
%.pre24 = load i32, ptr %c, align 4, !tbaa !5
br label %if.end9
if.end9: ; preds = %if.then7, %land.lhs.true, %if.end4
%8 = phi i32 [ %.pre24, %if.then7 ], [ %5, %land.lhs.true ], [ %5, %if.end4 ]
%9 = phi i32 [ %.pre23, %if.then7 ], [ %6, %land.lhs.true ], [ %6, %if.end4 ]
%cmp10 = icmp sgt i32 %9, %8
br i1 %cmp10, label %if.then11, label %if.end13
if.then11: ; preds = %if.end9
%10 = load i32, ptr %b, align 4, !tbaa !5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %9, i32 noundef %10)
br label %if.end13
if.end13: ; preds = %if.then11, %if.end9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c;
int tmp;
scanf("%d %d %d",&a,&b,&c);
if(a>b){
tmp=a;
a=b;
b=tmp;
}
if(b>c){
tmp=b;
b=c;
c=tmp;
}
if(a>b){
tmp=a;
a=b;
b=tmp;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_167973/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_167973/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include "stdio.h"
int main()
{
int x, y, z;
scanf("%d %d %d\n", &x, &y, &z);
if (x <= y && y <= z) {
printf("%d %d %d\n", x, y, z);
}
else if (y <= z && z <= x) {
printf("%d %d %d\n", y, z, x);
}
else if (z <= x && x <= y) {
printf("%d %d %d\n", z, x, y);
}
else if (x <= z && z <= y) {
printf("%d %d %d\n", x, z, y);
}
else if (y <= x && x <= z) {
printf("%d %d %d\n", y, x, z);
}
else if (z <= y && y <= x) {
printf("%d %d %d\n", z, y, x);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168015/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168015/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; 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
%z = alloca i32, align 4
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 4, ptr nonnull %z) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %z, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %.pre
%or.cond62 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond62, label %if.else, label %if.then
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end36
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %1, %.pre
%cmp5.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp3.not, %cmp5.not
br i1 %or.cond, label %if.else8, label %if.then6
if.then6: ; preds = %if.else
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end36
if.else8: ; preds = %if.else
%brmerge = or i1 %cmp.not, %cmp5.not
br i1 %brmerge, label %if.else14, label %if.then12
if.then12: ; preds = %if.else8
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end36
if.else14: ; preds = %if.else8
%cmp15.not = icmp sgt i32 %0, %.pre
br i1 %cmp15.not, label %if.else26, label %land.lhs.true16
land.lhs.true16: ; preds = %if.else14
%cmp17.not = icmp sgt i32 %.pre, %1
br i1 %cmp17.not, label %if.else20.thread, label %if.then18
if.then18: ; preds = %land.lhs.true16
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end36
if.else20.thread: ; preds = %land.lhs.true16
%cmp21.not54 = icmp sgt i32 %1, %0
br i1 %cmp21.not54, label %if.end36, label %if.then24
if.then24: ; preds = %if.else20.thread
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end36
if.else26: ; preds = %if.else14
%cmp21.not = icmp sgt i32 %1, %0
%cmp27.not = icmp sgt i32 %.pre, %1
%brmerge58 = or i1 %cmp27.not, %cmp21.not
br i1 %brmerge58, label %if.end36, label %if.then30
if.then30: ; preds = %if.else26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end36
if.end36: ; preds = %if.else20.thread, %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #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
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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)
{
char str[20];
int a;
int b;
int c;
int d;
int x;
int y;
int z;
fgets(str, sizeof(str), stdin);
sscanf(str, "%d %d %d",&a, &b, &c);
if(a < b){
} else if(a > b){
x = a;
a = b;
b = x;
}
if(b < c){
}else if(b > c){
y = b;
b = c;
c = y;
}
if(a < b){
}else if(a > b){
z = a;
a = b;
b = z;
}
printf("%d %d %d\n", a, b, c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168066/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168066/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [20 x i8], align 16
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %str) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 20, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) #3
%1 = load i32, ptr %a, align 4, !tbaa !9
%2 = load i32, ptr %b, align 4, !tbaa !9
%cmp3 = icmp sgt i32 %1, %2
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %entry
store i32 %2, ptr %a, align 4, !tbaa !9
store i32 %1, ptr %b, align 4, !tbaa !9
br label %if.end5
if.end5: ; preds = %if.then4, %entry
%3 = phi i32 [ %2, %if.then4 ], [ %1, %entry ]
%4 = phi i32 [ %1, %if.then4 ], [ %2, %entry ]
%5 = load i32, ptr %c, align 4, !tbaa !9
%cmp9 = icmp sgt i32 %4, %5
br i1 %cmp9, label %if.then10, label %if.end12
if.then10: ; preds = %if.end5
store i32 %5, ptr %b, align 4, !tbaa !9
store i32 %4, ptr %c, align 4, !tbaa !9
br label %if.end12
if.end12: ; preds = %if.then10, %if.end5
%6 = phi i32 [ %4, %if.then10 ], [ %5, %if.end5 ]
%7 = phi i32 [ %5, %if.then10 ], [ %4, %if.end5 ]
%cmp16 = icmp sgt i32 %3, %7
br i1 %cmp16, label %if.then17, label %if.end19
if.then17: ; preds = %if.end12
store i32 %7, ptr %a, align 4, !tbaa !9
store i32 %3, ptr %b, align 4, !tbaa !9
br label %if.end19
if.end19: ; preds = %if.then17, %if.end12
%8 = phi i32 [ %3, %if.then17 ], [ %7, %if.end12 ]
%9 = phi i32 [ %7, %if.then17 ], [ %3, %if.end12 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9, i32 noundef %8, i32 noundef %6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %str) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main (void)
{
int a,b,c;
scanf("%d %d %d\n",&a,&b,&c);
if(a<=b && b<=c)
{
printf("%d %d %d\n",a,b,c);
}
else if(a<=c && c<=b)
{
printf("%d %d %d\n",a,c,b);
}
else if(b<=a && a<=c)
{
printf("%d %d %d\n",b,a,c);
}
else if(c<=a && a<=b)
{
printf("%d %d %d\n",c,a,b);
}
else if(c<=b && b<=a)
{
printf("%d %d %d\n",c,b,a);
}
else if(b<=c && c<=a)
{
printf("%d %d %d\n",b,c,a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168109/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168109/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %.pre
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end36
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %0, %.pre
br i1 %cmp3.not, label %if.else8, label %land.lhs.true4
land.lhs.true4: ; preds = %if.else
%cmp5.not = icmp sgt i32 %.pre, %1
br i1 %cmp5.not, label %if.else8.thread, label %if.then6
if.then6: ; preds = %land.lhs.true4
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end36
if.else8: ; preds = %if.else
%cmp9.not = icmp sgt i32 %1, %0
br label %if.else14
if.else8.thread: ; preds = %land.lhs.true4
%cmp9.not54 = icmp sgt i32 %1, %0
br i1 %cmp9.not54, label %if.else14, label %if.then12
if.then12: ; preds = %if.else8.thread
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end36
if.else14: ; preds = %if.else8, %if.else8.thread
%cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ]
%cmp15.not = icmp sgt i32 %.pre, %0
%brmerge = or i1 %cmp.not, %cmp15.not
br i1 %brmerge, label %if.else20, label %if.then18
if.then18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end36
if.else20: ; preds = %if.else14
%cmp21.not = icmp sgt i32 %.pre, %1
%brmerge58 = or i1 %cmp21.not, %cmp9.not56
br i1 %brmerge58, label %if.else26, label %if.then24
if.then24: ; preds = %if.else20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end36
if.else26: ; preds = %if.else20
%cmp27.not = icmp sgt i32 %1, %.pre
%brmerge59 = or i1 %cmp27.not, %cmp15.not
br i1 %brmerge59, label %if.end36, label %if.then30
if.then30: ; preds = %if.else26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end36
if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,c,z;
scanf("%d %d %d",&a,&b,&c);
if(a>b){
z=b; b=a; a=z;
}
if(a>c){
z=c; c=a; a=z;
}
if(b>c){
z=c; c=b; b=z;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168152/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168152/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %0, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %3, ptr %c, align 4, !tbaa !5
store i32 %4, ptr %a, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %2, ptr %c, align 4, !tbaa !5
store i32 %6, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int x, y, a, b, c;
scanf("%d %d %d", &a, &b, &c);
if(a>b){
x=a;
a=b;
b=x;
}
if(b>c){
y=b;
b=c;
c=y;
}
if(a>b){
x=a;
a=b;
b=x;
}
printf("%d %d %d\n", a, b, c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c,i;
scanf("%d %d %d",&a,&b,&c);
if(a>b){
i=a;
a=b;
b=i;
}
if(a>c){
i=a;
a=c;
c=i;
}
if(b>c){
i=b;
b=c;
c=i;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168239/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %b, align 4, !tbaa !5
store i32 %2, ptr %c, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, c, tmp;
int i, j,t;
int Arry[3];
scanf( "%d %d %d", &a, &b, &c );
Arry[0] = a;
Arry[1] = b;
Arry[2] = c;
for( i = 0; i < 3; i++ )
{
for( j = i+1; j < 3; j++ )
{
if( Arry[i] > Arry[j] )
{
tmp = Arry[i];
Arry[i] = Arry[j];
Arry[j] = tmp;
}
}
}
printf( "%d %d %d\n", Arry[0], Arry[1], Arry[2] );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168297/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168297/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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 {
for.body5.lr.ph:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%spec.select56 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%Arry.sroa.14.3 = call i32 @llvm.smax.i32(i32 %spec.select56, i32 %2)
%Arry.sroa.0.2 = call i32 @llvm.smin.i32(i32 %spec.select56, i32 %2)
%Arry.sroa.14.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %Arry.sroa.14.3)
%Arry.sroa.8.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %Arry.sroa.14.3)
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %Arry.sroa.0.2, i32 noundef %Arry.sroa.8.1, i32 noundef %Arry.sroa.14.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a,b,c,x,y,z,o,p;
scanf("%d %d %d\n",&a,&b,&c);
x=a;y=b;z=c;
if(x>y)
{x=b;y=a;}
if(y>z)
{o=y;y=c;z=o;}
if(x>y)
{p=x;x=y;y=p;}
printf("%d %d %d\n",x,y,z);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168383/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168383/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%spec.select20 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%z.0 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%y.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %2)
%cmp4 = icmp slt i32 %2, %spec.select20
%y.2 = select i1 %cmp4, i32 %spec.select20, i32 %y.1
%x.1 = select i1 %cmp4, i32 %y.1, i32 %spec.select20
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %x.1, i32 noundef %y.2, i32 noundef %z.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c,d ;
scanf("%d",&a) ;
scanf("%d",&b) ;
scanf("%d",&c) ;
if(a>b){
d = b ; b = a ; a = d ;
}
if(a>c){
d = c ; c = a ; a = d ;
}
if(b>c){
d = c ; c = b ; b = d ;
}
printf("%d %d %d\n",a,b,c) ;
return 0 ;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168426/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168426/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load 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
store i32 %0, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %3, %4
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %3, ptr %c, align 4, !tbaa !5
store i32 %4, ptr %a, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%5 = phi i32 [ %4, %if.then4 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then4 ], [ %4, %if.end ]
%cmp6 = icmp sgt i32 %2, %6
br i1 %cmp6, label %if.then7, label %if.end8
if.then7: ; preds = %if.end5
store i32 %2, ptr %c, align 4, !tbaa !5
store i32 %6, ptr %b, align 4, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then7, %if.end5
%7 = phi i32 [ %2, %if.then7 ], [ %6, %if.end5 ]
%8 = phi i32 [ %6, %if.then7 ], [ %2, %if.end5 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int t , n ,i , j , k , flag , size;
scanf("%d",&t) ;
while(t--) {
scanf("%d",&n) ;
size=2*n ;
int arr[size] ;
for(i=0;i<size;i++) {
scanf("%d",&arr[i]) ;
}
for(i=0;i<n-1;i++) {
j=0 ;
while(arr[j]==0)
j++ ;
if(arr[j]%2==0)
flag=2 ;
else
flag=1 ;
arr[j]=0 ;
k=j+1 ;
if(flag==1) {
while(arr[k]%2!=1) {
k++ ;
if(k==size) {
flag=0 ;
break ;
}
}
}
else if(flag==2) {
while(arr[k]==0 || arr[k]%2!=0 ) {
k++ ;
if(k==size) {
flag=0 ;
break ;
}
}
}
if(flag==0) {
i-- ;
continue ;
}
arr[k]=0 ;
printf("%d %d\n",j+1,k+1) ;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16847/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16847/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec97 = add nsw i32 %0, -1
store i32 %dec97, ptr %t, align 4, !tbaa !5
%tobool.not98 = icmp eq i32 %0, 0
br i1 %tobool.not98, label %while.end61, label %while.body
while.body: ; preds = %entry, %for.end60
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl i32 %1, 1
%2 = zext i32 %mul to i64
%3 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %2, align 16
%cmp92 = icmp sgt i32 %1, 0
br i1 %cmp92, label %for.body.preheader, label %for.cond3.preheader
for.body.preheader: ; preds = %while.body
%smax = call i32 @llvm.smax.i32(i32 %mul, i32 1)
%wide.trip.count = zext i32 %smax to i64
br label %for.body
for.cond3.preheader: ; preds = %for.body, %while.body
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp495 = icmp sgt i32 %4, 1
br i1 %cmp495, label %while.cond6.preheader, label %for.end60
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond3.preheader, label %for.body, !llvm.loop !9
while.cond6.preheader: ; preds = %for.cond3.preheader, %for.inc58
%5 = phi i32 [ %13, %for.inc58 ], [ %4, %for.cond3.preheader ]
%i.196 = phi i32 [ %inc59, %for.inc58 ], [ 0, %for.cond3.preheader ]
br label %while.cond6
while.cond6: ; preds = %while.cond6, %while.cond6.preheader
%indvars.iv107 = phi i64 [ %indvars.iv.next108, %while.cond6 ], [ 1, %while.cond6.preheader ]
%indvars.iv104 = phi i64 [ %indvars.iv.next105, %while.cond6 ], [ 0, %while.cond6.preheader ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv104
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %6, 0
%indvars.iv.next105 = add nuw i64 %indvars.iv104, 1
%indvars.iv.next108 = add nuw i64 %indvars.iv107, 1
br i1 %cmp9, label %while.cond6, label %while.end, !llvm.loop !11
while.end: ; preds = %while.cond6
%arrayidx8.le = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv104
%7 = trunc i64 %indvars.iv104 to i32
%8 = and i32 %6, 1
%cmp14.not = icmp eq i32 %8, 0
store i32 0, ptr %arrayidx8.le, align 4, !tbaa !5
%add = add nuw nsw i32 %7, 1
br i1 %cmp14.not, label %while.cond33, label %while.cond19
while.cond19: ; preds = %while.end, %while.body24
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %while.body24 ], [ %indvars.iv107, %while.end ]
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv109
%9 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%10 = and i32 %9, -2147483647
%cmp23.not = icmp eq i32 %10, 1
br i1 %cmp23.not, label %if.end52, label %while.body24
while.body24: ; preds = %while.cond19
%indvars.iv.next110 = add i64 %indvars.iv109, 1
%cmp26 = icmp eq i64 %indvars.iv.next110, %2
br i1 %cmp26, label %if.then50, label %while.cond19, !llvm.loop !12
while.cond33: ; preds = %while.end, %while.body41
%indvars.iv113 = phi i64 [ %indvars.iv.next114, %while.body41 ], [ %indvars.iv107, %while.end ]
%arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv113
%11 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%cmp36 = icmp ne i32 %11, 0
%12 = and i32 %11, 1
%cmp40.not = icmp eq i32 %12, 0
%or.cond = and i1 %cmp36, %cmp40.not
br i1 %or.cond, label %if.end52, label %while.body41
while.body41: ; preds = %while.cond33
%indvars.iv.next114 = add i64 %indvars.iv113, 1
%cmp43 = icmp eq i64 %indvars.iv.next114, %2
br i1 %cmp43, label %if.then50, label %while.cond33, !llvm.loop !13
if.then50: ; preds = %while.body24, %while.body41
%dec51 = add nsw i32 %i.196, -1
br label %for.inc58
if.end52: ; preds = %while.cond19, %while.cond33
%k.2.in = phi i64 [ %indvars.iv113, %while.cond33 ], [ %indvars.iv109, %while.cond19 ]
%k.2 = trunc i64 %k.2.in to i32
%sext = shl i64 %k.2.in, 32
%idxprom53 = ashr exact i64 %sext, 32
%arrayidx54 = getelementptr inbounds i32, ptr %vla, i64 %idxprom53
store i32 0, ptr %arrayidx54, align 4, !tbaa !5
%add56 = add nsw i32 %k.2, 1
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add, i32 noundef %add56)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc58
for.inc58: ; preds = %if.end52, %if.then50
%13 = phi i32 [ %5, %if.then50 ], [ %.pre, %if.end52 ]
%i.2 = phi i32 [ %dec51, %if.then50 ], [ %i.196, %if.end52 ]
%inc59 = add nsw i32 %i.2, 1
%sub = add nsw i32 %13, -1
%cmp4 = icmp slt i32 %inc59, %sub
br i1 %cmp4, label %while.cond6.preheader, label %for.end60, !llvm.loop !14
for.end60: ; preds = %for.inc58, %for.cond3.preheader
call void @llvm.stackrestore.p0(ptr %3)
%14 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %14, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %14, 0
br i1 %tobool.not, label %while.end61, label %while.body, !llvm.loop !15
while.end61: ; preds = %for.end60, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(){
int a,b,c,x,y,z;
scanf("%d%d%d",&a,&b,&c);
if(a > b){
x = a;
a = b;
b = x;
}
if(b > c){
y = b;
b = c;
c = y;
}
if(a > b){
z = a;
a = b;
b = z;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168512/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168512/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d %d %d", &a,&b,&c);
if(a <=b && b <= c)
printf("%d %d %d\n", a, b, c);
else if(a <= c && c <= b)
printf("%d %d %d\n", a,c, b);
else if(b <= a && a <= c)
printf("%d %d %d\n", b, a, c);
else if(b <= c && c <= a)
printf("%d %d %d\n", b, c, a);
else if(c <= a && a <= b)
printf("%d %d %d\n", c ,a, b);
else if(c <= b && b <= a)
printf("%d %d %d\n", c ,b, a);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %.pre
%or.cond59 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond59, label %if.else, label %if.then
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end36
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %0, %.pre
br i1 %cmp3.not, label %if.else8, label %land.lhs.true4
land.lhs.true4: ; preds = %if.else
%cmp5.not = icmp sgt i32 %.pre, %1
br i1 %cmp5.not, label %if.else8.thread, label %if.then6
if.then6: ; preds = %land.lhs.true4
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end36
if.else8: ; preds = %if.else
%cmp9.not = icmp sgt i32 %1, %0
br label %if.else14
if.else8.thread: ; preds = %land.lhs.true4
%cmp9.not54 = icmp sgt i32 %1, %0
br i1 %cmp9.not54, label %if.else14, label %if.then12
if.then12: ; preds = %if.else8.thread
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end36
if.else14: ; preds = %if.else8, %if.else8.thread
%cmp9.not56 = phi i1 [ true, %if.else8.thread ], [ %cmp9.not, %if.else8 ]
%cmp15.not = icmp sgt i32 %1, %.pre
%cmp17.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp15.not, %cmp17.not
br i1 %or.cond, label %if.else20, label %if.then18
if.then18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end36
if.else20: ; preds = %if.else14
%brmerge = or i1 %cmp.not, %cmp17.not
br i1 %brmerge, label %if.else26, label %if.then24
if.then24: ; preds = %if.else20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end36
if.else26: ; preds = %if.else20
%cmp27.not = icmp sgt i32 %.pre, %1
%brmerge58 = or i1 %cmp27.not, %cmp9.not56
br i1 %brmerge58, label %if.end36, label %if.then30
if.then30: ; preds = %if.else26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end36
if.end36: ; preds = %if.else26, %if.then6, %if.then18, %if.then30, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,c,temp;
scanf("%d\n",&a);
scanf("%d\n",&b);
scanf("%d",&c);
if(a>b){
temp=a;
a=b;
b=temp;
}
if(a>c){
temp=a;
a=c;
c=temp;
}
if(b>c){
temp=b;
b=c;
c=temp;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168664/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168664/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1
@.str.2 = 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
%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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c)
%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
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %3, %4
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.end
store i32 %4, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then4, %if.end
%5 = phi i32 [ %4, %if.then4 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then4 ], [ %4, %if.end ]
%cmp6 = icmp sgt i32 %2, %6
br i1 %cmp6, label %if.then7, label %if.end8
if.then7: ; preds = %if.end5
store i32 %6, ptr %b, align 4, !tbaa !5
store i32 %2, ptr %c, align 4, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then7, %if.end5
%7 = phi i32 [ %2, %if.then7 ], [ %6, %if.end5 ]
%8 = phi i32 [ %6, %if.then7 ], [ %2, %if.end5 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,c;
scanf("%d %d %d\n", &a, &b, &c);
if(c > b && b > a){
printf("%d %d %d\n", a, b, c);
}
if(b > c && c > a){
printf("%d %d %d\n", a, c, b);
}
if(a > c && c > b){
printf("%d %d %d\n", b, c, a);
}
if(c > a && a > b){
printf("%d %d %d\n", b, a, c);
}
if(b > a && a > c){
printf("%d %d %d\n", c, a, b);
}
if(a > b && b > c){
printf("%d %d %d\n", c, b, a);
}
if(a == b && b == c){
printf("%d %d %d\n", a, a, a);
}
if(a == b && b > c){
printf("%d %d %d\n", c, a, a);
}
if(a == b && c > b){
printf("%d %d %d\n", a, a, c);
}
if(a > c && b == c){
printf("%d %d %d\n", b, b, a);
}
if(c > a && b == c){
printf("%d %d %d\n", a, b, b);
}
if(a == c && b > c){
printf("%d %d %d\n", a, a, b);
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168721/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168721/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %c, align 4
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%.pre105.pre129 = load i32, ptr %a, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %1, %.pre105.pre129
%or.cond143 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond143, label %if.then, label %if.end
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre105.pre129, i32 noundef %1, i32 noundef %0)
%.pre = load i32, ptr %b, align 4, !tbaa !5
%.pre103 = load i32, ptr %c, align 4
%.pre105.pre = load i32, ptr %a, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%.pre105 = phi i32 [ %.pre105.pre, %if.then ], [ %.pre105.pre129, %entry ]
%2 = phi i32 [ %.pre103, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %1, %entry ]
%cmp3 = icmp sgt i32 %3, %2
%cmp5 = icmp sgt i32 %2, %.pre105
%or.cond144 = select i1 %cmp3, i1 %cmp5, i1 false
br i1 %or.cond144, label %if.then6, label %if.end8
if.then6: ; preds = %if.end
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre105, i32 noundef %2, i32 noundef %3)
%.pre104 = load i32, ptr %a, align 4, !tbaa !5
%.pre106 = load i32, ptr %c, align 4
%.pre110.pre131.pre = load i32, ptr %b, align 4, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then6, %if.end
%.pre110.pre131 = phi i32 [ %.pre110.pre131.pre, %if.then6 ], [ %3, %if.end ]
%4 = phi i32 [ %.pre106, %if.then6 ], [ %2, %if.end ]
%5 = phi i32 [ %.pre104, %if.then6 ], [ %.pre105, %if.end ]
%cmp9 = icmp sgt i32 %5, %4
%cmp11 = icmp sgt i32 %4, %.pre110.pre131
%or.cond145 = select i1 %cmp9, i1 %cmp11, i1 false
br i1 %or.cond145, label %if.then12, label %if.end14
if.then12: ; preds = %if.end8
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre110.pre131, i32 noundef %4, i32 noundef %5)
%.pre107 = load i32, ptr %c, align 4
%.pre108 = load i32, ptr %a, align 4, !tbaa !5
%.pre110.pre = load i32, ptr %b, align 4, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %if.end8
%.pre110 = phi i32 [ %.pre110.pre, %if.then12 ], [ %.pre110.pre131, %if.end8 ]
%6 = phi i32 [ %.pre108, %if.then12 ], [ %5, %if.end8 ]
%7 = phi i32 [ %.pre107, %if.then12 ], [ %4, %if.end8 ]
%cmp15 = icmp sgt i32 %7, %6
%cmp17 = icmp sgt i32 %6, %.pre110
%or.cond146 = select i1 %cmp15, i1 %cmp17, i1 false
br i1 %or.cond146, label %if.then18, label %if.end20
if.then18: ; preds = %if.end14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre110, i32 noundef %6, i32 noundef %7)
%.pre109 = load i32, ptr %b, align 4, !tbaa !5
%.pre111 = load i32, ptr %a, align 4, !tbaa !5
%.pre117.pre133.pre = load i32, ptr %c, align 4
br label %if.end20
if.end20: ; preds = %if.then18, %if.end14
%.pre117.pre133 = phi i32 [ %.pre117.pre133.pre, %if.then18 ], [ %7, %if.end14 ]
%8 = phi i32 [ %.pre111, %if.then18 ], [ %6, %if.end14 ]
%9 = phi i32 [ %.pre109, %if.then18 ], [ %.pre110, %if.end14 ]
%cmp21 = icmp sgt i32 %9, %8
%cmp23 = icmp sgt i32 %8, %.pre117.pre133
%or.cond147 = select i1 %cmp21, i1 %cmp23, i1 false
br i1 %or.cond147, label %if.then24, label %if.end26
if.then24: ; preds = %if.end20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre117.pre133, i32 noundef %8, i32 noundef %9)
%.pre112 = load i32, ptr %a, align 4, !tbaa !5
%.pre113 = load i32, ptr %b, align 4, !tbaa !5
%.pre117.pre = load i32, ptr %c, align 4
br label %if.end26
if.end26: ; preds = %if.then24, %if.end20
%.pre117 = phi i32 [ %.pre117.pre, %if.then24 ], [ %.pre117.pre133, %if.end20 ]
%10 = phi i32 [ %.pre113, %if.then24 ], [ %9, %if.end20 ]
%11 = phi i32 [ %.pre112, %if.then24 ], [ %8, %if.end20 ]
%cmp27 = icmp sgt i32 %11, %10
%cmp29 = icmp sgt i32 %10, %.pre117
%or.cond148 = select i1 %cmp27, i1 %cmp29, i1 false
br i1 %or.cond148, label %if.then30, label %if.end32
if.then30: ; preds = %if.end26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre117, i32 noundef %10, i32 noundef %11)
%.pre114 = load i32, ptr %a, align 4, !tbaa !5
%.pre115 = load i32, ptr %b, align 4, !tbaa !5
%.pre116 = load i32, ptr %c, align 4
br label %if.end32
if.end32: ; preds = %if.then30, %if.end26
%12 = phi i32 [ %.pre116, %if.then30 ], [ %.pre117, %if.end26 ]
%13 = phi i32 [ %.pre115, %if.then30 ], [ %10, %if.end26 ]
%14 = phi i32 [ %.pre114, %if.then30 ], [ %11, %if.end26 ]
%cmp33 = icmp eq i32 %14, %13
%cmp35 = icmp eq i32 %13, %12
%or.cond = select i1 %cmp33, i1 %cmp35, i1 false
br i1 %or.cond, label %if.then36, label %if.end38
if.then36: ; preds = %if.end32
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12, i32 noundef %12, i32 noundef %12)
%.pre118 = load i32, ptr %a, align 4, !tbaa !5
%.pre119 = load i32, ptr %b, align 4, !tbaa !5
%.pre124.pre135.pre = load i32, ptr %c, align 4, !tbaa !5
br label %if.end38
if.end38: ; preds = %if.then36, %if.end32
%.pre124.pre135 = phi i32 [ %.pre124.pre135.pre, %if.then36 ], [ %12, %if.end32 ]
%15 = phi i32 [ %.pre119, %if.then36 ], [ %13, %if.end32 ]
%16 = phi i32 [ %.pre118, %if.then36 ], [ %14, %if.end32 ]
%cmp39 = icmp eq i32 %16, %15
br i1 %cmp39, label %land.lhs.true40, label %if.end44
land.lhs.true40: ; preds = %if.end38
%cmp41 = icmp sgt i32 %15, %.pre124.pre135
br i1 %cmp41, label %if.then42, label %land.lhs.true46
if.then42: ; preds = %land.lhs.true40
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre124.pre135, i32 noundef %15, i32 noundef %15)
%.pre120 = load i32, ptr %a, align 4, !tbaa !5
%.pre121 = load i32, ptr %b, align 4, !tbaa !5
%.pre124.pre = load i32, ptr %c, align 4, !tbaa !5
br label %if.end44
if.end44: ; preds = %if.then42, %if.end38
%.pre124 = phi i32 [ %.pre124.pre, %if.then42 ], [ %.pre124.pre135, %if.end38 ]
%17 = phi i32 [ %.pre121, %if.then42 ], [ %15, %if.end38 ]
%18 = phi i32 [ %.pre120, %if.then42 ], [ %16, %if.end38 ]
%cmp45 = icmp eq i32 %18, %17
br i1 %cmp45, label %land.lhs.true46, label %if.end50
land.lhs.true46: ; preds = %land.lhs.true40, %if.end44
%19 = phi i32 [ %17, %if.end44 ], [ %15, %land.lhs.true40 ]
%.pre124142 = phi i32 [ %.pre124, %if.end44 ], [ %.pre124.pre135, %land.lhs.true40 ]
%cmp47 = icmp sgt i32 %.pre124142, %19
br i1 %cmp47, label %if.then48, label %if.end50
if.then48: ; preds = %land.lhs.true46
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19, i32 noundef %19, i32 noundef %.pre124142)
%.pre122 = load i32, ptr %a, align 4, !tbaa !5
%.pre123 = load i32, ptr %c, align 4, !tbaa !5
br label %if.end50
if.end50: ; preds = %if.then48, %land.lhs.true46, %if.end44
%20 = phi i32 [ %.pre123, %if.then48 ], [ %.pre124142, %land.lhs.true46 ], [ %.pre124, %if.end44 ]
%21 = phi i32 [ %.pre122, %if.then48 ], [ %19, %land.lhs.true46 ], [ %18, %if.end44 ]
%cmp51 = icmp sgt i32 %21, %20
%22 = load i32, ptr %b, align 4
%cmp53 = icmp eq i32 %22, %20
%or.cond149 = select i1 %cmp51, i1 %cmp53, i1 false
br i1 %or.cond149, label %if.then54, label %if.end56
if.then54: ; preds = %if.end50
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20, i32 noundef %20, i32 noundef %21)
%.pre125 = load i32, ptr %c, align 4, !tbaa !5
%.pre126 = load i32, ptr %a, align 4, !tbaa !5
br label %if.end56
if.end56: ; preds = %if.then54, %if.end50
%23 = phi i32 [ %.pre126, %if.then54 ], [ %21, %if.end50 ]
%24 = phi i32 [ %.pre125, %if.then54 ], [ %20, %if.end50 ]
%cmp57 = icmp sgt i32 %24, %23
%25 = load i32, ptr %b, align 4
%cmp59 = icmp eq i32 %25, %24
%or.cond150 = select i1 %cmp57, i1 %cmp59, i1 false
br i1 %or.cond150, label %if.then60, label %if.end62
if.then60: ; preds = %if.end56
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23, i32 noundef %24, i32 noundef %24)
%.pre127 = load i32, ptr %a, align 4, !tbaa !5
%.pre128 = load i32, ptr %c, align 4, !tbaa !5
br label %if.end62
if.end62: ; preds = %if.then60, %if.end56
%26 = phi i32 [ %.pre128, %if.then60 ], [ %24, %if.end56 ]
%27 = phi i32 [ %.pre127, %if.then60 ], [ %23, %if.end56 ]
%cmp63 = icmp eq i32 %27, %26
br i1 %cmp63, label %land.lhs.true64, label %if.end68
land.lhs.true64: ; preds = %if.end62
%28 = load i32, ptr %b, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %28, %26
br i1 %cmp65, label %if.then66, label %if.end68
if.then66: ; preds = %land.lhs.true64
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %26, i32 noundef %26, i32 noundef %28)
br label %if.end68
if.end68: ; preds = %if.then66, %land.lhs.true64, %if.end62
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a[3],x,i,j;
scanf("%d %d %d",&a[0],&a[1],&a[2]);
for(i=0;i<2;i++){
for(j=i+1;j<3;j++){
if(a[i]>a[j]){
x=a[i]; a[i]=a[j]; a[j]=x;
}
}
}
printf("%d %d %d\n",a[0],a[1],a[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168772/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168772/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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 {
for.body5.lr.ph:
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, %1
br i1 %cmp9, label %if.then, label %for.inc
for.body5.lr.ph.1: ; preds = %if.then.147, %for.inc
%2 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp9.1 = icmp sgt i32 %2, %3
br i1 %cmp9.1, label %if.then.1, label %for.cond.loopexit.1
if.then.1: ; preds = %for.body5.lr.ph.1
store i32 %3, ptr %arrayidx1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
br label %for.cond.loopexit.1
for.cond.loopexit.1: ; preds = %for.body5.lr.ph.1, %if.then.1
%4 = phi i32 [ %2, %if.then.1 ], [ %3, %for.body5.lr.ph.1 ]
%5 = phi i32 [ %3, %if.then.1 ], [ %2, %for.body5.lr.ph.1 ]
%6 = load i32, ptr %a, align 4, !tbaa !5
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %5, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
if.then: ; preds = %for.body5.lr.ph
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body5.lr.ph, %if.then
%7 = phi i32 [ %0, %for.body5.lr.ph ], [ %1, %if.then ]
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp9.145 = icmp sgt i32 %7, %8
br i1 %cmp9.145, label %if.then.147, label %for.body5.lr.ph.1
if.then.147: ; preds = %for.inc
store i32 %8, ptr %a, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2, align 4, !tbaa !5
br label %for.body5.lr.ph.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b,c,d;
scanf("%d %d %d",&a,&b,&c);
if(a>b) d=a,a=b,b=d;
if(b>c) d=b,b=c,c=d;
if(a>b) d=a,a=b,b=d;
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168815/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168815/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int x=0,y=0,z=0;
1<=x,y,z&&x,y,z<=10000;
scanf("%d %d %d",&x,&y,&z);
if(x<=y&&y<=z)
{
printf("%d %d %d\n",x,y,z);
}
else if(x<=z&&z<=y)
{
printf("%d %d %d\n",x,z,y);
}
else if(y<=x&&x<=z)
{
printf("%d %d %d\n",y,x,z);
}
else if(y<=z&&z<=x)
{
printf("%d %d %d\n",y,z,x);
}
else if(z<=x&&x<=y)
{
printf("%d %d %d\n",z,x,y);
}
else if(x<=z&&z<=y)
{
printf("%d %d %d\n",x,z,y);
}
else if(y<=x&&x<=z)
{
printf("%d %d %d\n",y,x,z);
}
else if(y<=z&&z<=x)
{
printf("%d %d %d\n",y,z,x);
}
else if(z<=x&&x<=y)
{
printf("%d %d %d\n",z,x,y);
}
else if(z<=y&&y<=x)
{
printf("%d %d %d\n",z,y,x);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168859/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168859/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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:
%x = alloca i32, align 4
%y = alloca i32, align 4
%z = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
store i32 0, ptr %x, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
store i32 0, ptr %y, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #3
store i32 0, ptr %z, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %z, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %1, %.pre
%or.cond124 = select i1 %cmp4.not, i1 true, i1 %cmp6.not
br i1 %or.cond124, label %if.else, label %if.then
if.then: ; preds = %entry
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end88
if.else: ; preds = %entry
%cmp9.not = icmp sgt i32 %0, %.pre
br i1 %cmp9.not, label %if.else16, label %land.lhs.true11
land.lhs.true11: ; preds = %if.else
%cmp12.not = icmp sgt i32 %.pre, %1
br i1 %cmp12.not, label %if.else16.thread, label %if.then14
if.then14: ; preds = %land.lhs.true11
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end88
if.else16: ; preds = %if.else
%cmp17.not = icmp sgt i32 %1, %0
br label %if.else24
if.else16.thread: ; preds = %land.lhs.true11
%cmp17.not118 = icmp sgt i32 %1, %0
br i1 %cmp17.not118, label %if.else24, label %if.then22
if.then22: ; preds = %if.else16.thread
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end88
if.else24: ; preds = %if.else16, %if.else16.thread
%cmp17.not120 = phi i1 [ true, %if.else16.thread ], [ %cmp17.not, %if.else16 ]
%cmp25.not = icmp sgt i32 %1, %.pre
%cmp28.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp25.not, %cmp28.not
br i1 %or.cond, label %if.else32, label %if.then30
if.then30: ; preds = %if.else24
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end88
if.else32: ; preds = %if.else24
%brmerge = or i1 %cmp4.not, %cmp28.not
br i1 %brmerge, label %if.else40, label %if.then38
if.then38: ; preds = %if.else32
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end88
if.else40: ; preds = %if.else32
br i1 %cmp9.not, label %if.else56, label %land.lhs.true43
land.lhs.true43: ; preds = %if.else40
%cmp44.not = icmp sgt i32 %.pre, %1
br i1 %cmp44.not, label %if.else48.thread, label %if.then46
if.then46: ; preds = %land.lhs.true43
%call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end88
if.else48.thread: ; preds = %land.lhs.true43
br i1 %cmp17.not120, label %if.else56, label %if.then54
if.then54: ; preds = %if.else48.thread
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end88
if.else56: ; preds = %if.else40, %if.else48.thread
%brmerge125 = or i1 %cmp25.not, %cmp28.not
br i1 %brmerge125, label %if.else72, label %if.then62
if.then62: ; preds = %if.else56
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end88
if.else72: ; preds = %if.else56
%cmp73.not = icmp sgt i32 %.pre, %1
%brmerge123 = or i1 %cmp73.not, %cmp17.not120
br i1 %brmerge123, label %if.end88, label %if.then78
if.then78: ; preds = %if.else72
%call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end88
if.end88: ; preds = %if.else72, %if.then14, %if.then30, %if.then46, %if.then62, %if.then78, %if.then54, %if.then38, %if.then22, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #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
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,c,tmp=0;
scanf("%d %d %d",&a,&b,&c);
if(a>c){
tmp=a;
a=c;
c=tmp;
}
if(a>b){
tmp=a;
a=b;
b=tmp;
}
if(b>c){
tmp=b;
b=c;
c=tmp;
}
printf("%d %d %d\n",a,b,c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_168901/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_168901/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %c, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %b, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%cmp4 = icmp sgt i32 %6, %2
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %2, ptr %b, align 4, !tbaa !5
store i32 %6, ptr %c, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%8 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7)
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"}
|
/*
Amit Kumar Bala Antu
Bangladesh
Remember the name. Best is yet to come.
National Anthem of Bangladesh
Written By: Rabindranath Tagore
আমার সোনার বাংলা
আমি তোমায় ভালবাসি
চিরদিন তোমার আকাশ
চিরদিন তোমার আকাশ
তোমার বাতাস আমার প্রাণে
ও মা
আমার প্রাণে বাজায় বাঁশি
সোনার বাংলা
আমি তোমায় ভালবাসি
ও মা
ফাগুনে তোর আমের বনে
ঘ্রাণে পাগল করে
মরি হায়, হায় রে
ও মা
ফাগুনে তোর আমের বনে
ঘ্রাণে পাগল করে
ও মা
অঘ্রানে তোর ভরা খেতে
কি দেখেছি
আমি কী দেখেছি মধুর হাসি
সোনার বাংলা
আমি তোমায় ভালবাসি
কী শোভা, কী ছায়া গো
কী স্নেহ, কী মায়া গো
কী আঁচল বিছায়েছ
বটের মূলে
নদীর কূলে কূলে
কী শোভা, কী ছায়া গো
কী স্নেহ, কী মায়া গো
কী আঁচল বিছায়েছ
বটের মূলে
নদীর কূলে কূলে
মা তোর মুখের বাণী
আমার কানে লাগে
সুধার মতো
মরি হায়, হায় রে
মা তোর মুখের বাণী
আমার কানে লাগে
সুধার মতো
মা তোর বদন খানি মলিন হলে
আমি নয়ন
ও মা আমি নয়ন জলে ভাসি
সোনার বাংলা
আমি তোমায় ভালবাসি
আমার সোনার বাংলা
আমি তোমায় ভালবাসি
চিরদিন তোমার আকাশ
চিরদিন তোমার আকাশ
তোমার বাতাস আমার প্রাণে
ও মা
আমার প্রাণে বাজায় বাঁশি
সোনার বাংলা
আমি তোমায় ভালবাসি
. -------------------------------------------------------------------.
| [Esc] [F1][F2][F3][F4][F5][F6][F7][F8][F9][F0][F10][F11][F12] o o o|
| |
| [`][1][2][3][4][5][6][7][8][9][0][-][=][_<_] [I][H][U] [N][/][*][-]|
| [|-][Q][W][E][R][T][Y][U][I][O][P][{][}] | | [D][E][D] [7][8][9]|+||
| [CAP][A][S][D][F][G][H][J][K][L][;]['][#]|_| [4][5][6]|_||
| [^][\][Z][X][C][V][B][N][M][,][.][/] [__^__] [^] [1][2][3]| ||
| [c] [a][________________________][a] [c] [<][V][>] [ 0 ][.]|_||
`--------------------------------------------------------------------'
Come up to meet you
Tell you I'm sorry
You don't know how lovely you are
I had to find you
Tell you I need you
Tell you I set you apart
Tell me your secrets
And ask me your questions
Oh let's go back to the start
Running in circles, coming up tails
Heads on a science apart
Nobody said it was easy
It's such a shame for us to part
Nobody said it was easy
No one ever said it would be this hard
Oh take me back to the start
I was just guessing at numbers and figures
Pulling your puzzles apart
Questions of science, science and progress
Do not speak as loud as my heart
Tell me you love me
Come back and haunt me
Oh and I rush to the start
Running in circles, chasing our tails
Coming back as we are
Nobody said it was easy
Oh it's such a shame for us to part
Nobody said it was easy
No one ever said it would be so hard
I'm going back to the start
If you see her, say hello
She might be in Tangier
She left here last early spring
Is livin' there, I hear
Say for me that I'm all right
Though things get kind of slow
She might think that I've forgotten her
Don't tell her it isn't so
We had a falling-out
Like lovers often will
And to think of how she left that night
It still brings me a chill
And though our separation
It pierced me to the heart
She still lives inside of me
We've never been apart
If you get close to her
Kiss her once for me
I always have respected her
For doin' what she did and gettin' free
Oh, whatever makes her happy
I won't stand in the way
Though the bitter taste still lingers on
From the night I tried to make her stay
I see a lot of people
As I make the rounds
And I hear her name here and there
As I go from town to town
And I've never gotten used to it
I've just learned to turn it off
Either I'm too sensitive
Or else I'm gettin' soft
Sundown, yellow moon
I replay the past
I know every scene by heart
They all went by so fast
If she's passin' back this way
I'm not that hard to find
Tell her she can look me up
If she's got the time
*/
#include<stdio.h>
#include<string.h>
#include<math.h>
#define sf scanf
#define pf printf
#define ll long long int
#define iMIN -2147483648
#define iMAX 2147483647
#define lMIN -9223372036854775808
#define lMAX 9223372036854775807
void swap(int* a, int* b)
{
int t = *a;
*a = *b;
*b = t;
}
int partition (int arr[], int low, int high)
{
int pivot = arr[high];
int i = (low - 1),j;
for (j = low; j <= high- 1; j++)
{
if (arr[j] < pivot)
{
i++;
swap(&arr[i], &arr[j]);
}
}
swap(&arr[i + 1], &arr[high]);
return (i + 1);
}
void quickSort(int arr[], int low, int high)
{
if (low < high)
{
int pi = partition(arr, low, high);
quickSort(arr, low, pi - 1);
quickSort(arr, pi + 1, high);
}
}
int max(int x,int y){
if(x>y){
return x;
}
return y;
}
void solve()
{
int n;
sf(" %d",&n);
pf("%d\n",n/2);
}
int main()
{
ll tc;
sf(" %lld",&tc);
while(tc--){
solve();
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16896/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16896/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c" %lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %arr, i32 noundef %low, i32 noundef %high) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %high to i64
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not29 = icmp slt i32 %low, %high
br i1 %cmp.not.not29, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %low, -1
%1 = sext i32 %low to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx3.prol = getelementptr inbounds i32, ptr %arr, i64 %1
%3 = load i32, ptr %arrayidx3.prol, align 4, !tbaa !5
%cmp4.prol = icmp slt i32 %3, %0
br i1 %cmp4.prol, label %if.then.prol, label %for.inc.prol
if.then.prol: ; preds = %for.body.prol
%idxprom5.prol = sext i32 %low to i64
%arrayidx6.prol = getelementptr inbounds i32, ptr %arr, i64 %idxprom5.prol
%4 = load i32, ptr %arrayidx6.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx3.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %low, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.030.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %arr, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.030 = phi i32 [ %i.030.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx3 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%8 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp slt i32 %8, %0
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %for.body
%inc = add nsw i32 %i.030, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds i32, ptr %arr, i64 %idxprom5
%9 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %8, ptr %arrayidx6, align 4, !tbaa !5
store i32 %9, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.030, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp4.1 = icmp slt i32 %10, %0
br i1 %cmp4.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds i32, ptr %arr, i64 %idxprom5.1
%11 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx6.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %low, %entry ], [ %12, %for.end.loopexit ]
%idxprom10 = sext i32 %i.0.lcssa to i64
%arrayidx11 = getelementptr inbounds i32, ptr %arr, i64 %idxprom10
%14 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %13, ptr %arrayidx11, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @quickSort(ptr nocapture noundef %arr, i32 noundef %low, i32 noundef %high) local_unnamed_addr #3 {
entry:
%cmp8 = icmp slt i32 %low, %high
br i1 %cmp8, label %for.body.preheader.i.lr.ph, label %if.end
for.body.preheader.i.lr.ph: ; preds = %entry
%idxprom.i = sext i32 %high to i64
%arrayidx.i = getelementptr inbounds i32, ptr %arr, i64 %idxprom.i
%0 = sub nsw i64 0, %idxprom.i
%invariant.gep = getelementptr i32, ptr %arr, i64 1
br label %for.body.preheader.i
for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %partition.exit
%low.tr9 = phi i32 [ %low, %for.body.preheader.i.lr.ph ], [ %add, %partition.exit ]
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%sub.i = add nsw i32 %low.tr9, -1
%2 = sext i32 %low.tr9 to i64
%3 = sub nsw i64 %idxprom.i, %2
%xtraiter = and i64 %3, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.i.prol.loopexit, label %for.body.i.prol
for.body.i.prol: ; preds = %for.body.preheader.i
%arrayidx3.i.prol = getelementptr inbounds i32, ptr %arr, i64 %2
%4 = load i32, ptr %arrayidx3.i.prol, align 4, !tbaa !5
%cmp4.i.prol = icmp slt i32 %4, %1
br i1 %cmp4.i.prol, label %if.then.i.prol, label %for.inc.i.prol
if.then.i.prol: ; preds = %for.body.i.prol
%idxprom5.i.prol = sext i32 %low.tr9 to i64
%arrayidx6.i.prol = getelementptr inbounds i32, ptr %arr, i64 %idxprom5.i.prol
%5 = load i32, ptr %arrayidx6.i.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx6.i.prol, align 4, !tbaa !5
store i32 %5, ptr %arrayidx3.i.prol, align 4, !tbaa !5
br label %for.inc.i.prol
for.inc.i.prol: ; preds = %if.then.i.prol, %for.body.i.prol
%i.1.i.prol = phi i32 [ %low.tr9, %if.then.i.prol ], [ %sub.i, %for.body.i.prol ]
%indvars.iv.next.i.prol = add nsw i64 %2, 1
br label %for.body.i.prol.loopexit
for.body.i.prol.loopexit: ; preds = %for.inc.i.prol, %for.body.preheader.i
%i.1.i.lcssa.unr = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%indvars.iv.i.unr = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i.prol, %for.inc.i.prol ]
%i.030.i.unr = phi i32 [ %sub.i, %for.body.preheader.i ], [ %i.1.i.prol, %for.inc.i.prol ]
%6 = xor i64 %2, %0
%7 = icmp eq i64 %6, -1
br i1 %7, label %partition.exit, label %for.body.i
for.body.i: ; preds = %for.body.i.prol.loopexit, %for.inc.i.1
%indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc.i.1 ], [ %indvars.iv.i.unr, %for.body.i.prol.loopexit ]
%i.030.i = phi i32 [ %i.1.i.1, %for.inc.i.1 ], [ %i.030.i.unr, %for.body.i.prol.loopexit ]
%arrayidx3.i = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.i
%8 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp slt i32 %8, %1
br i1 %cmp4.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.030.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds i32, ptr %arr, i64 %idxprom5.i
%9 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx3.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.030.i, %for.body.i ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.i
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp4.i.1 = icmp slt i32 %10, %1
br i1 %cmp4.i.1, label %if.then.i.1, label %for.inc.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds i32, ptr %arr, i64 %idxprom5.i.1
%11 = load i32, ptr %arrayidx6.i.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx6.i.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%indvars.iv.next.i.1 = add nsw i64 %indvars.iv.i, 2
%exitcond.not.i.1 = icmp eq i64 %indvars.iv.next.i.1, %idxprom.i
br i1 %exitcond.not.i.1, label %partition.exit, label %for.body.i, !llvm.loop !9
partition.exit: ; preds = %for.inc.i.1, %for.body.i.prol.loopexit
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.unr, %for.body.i.prol.loopexit ], [ %i.1.i.1, %for.inc.i.1 ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%12 = add nsw i32 %i.1.i.lcssa, 1
%idxprom10.i = sext i32 %12 to i64
%arrayidx11.i = getelementptr inbounds i32, ptr %arr, i64 %idxprom10.i
%13 = load i32, ptr %arrayidx11.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx11.i, align 4, !tbaa !5
store i32 %13, ptr %arrayidx.i, align 4, !tbaa !5
tail call void @quickSort(ptr noundef nonnull %arr, i32 noundef %low.tr9, i32 noundef %i.1.i.lcssa)
%add = add nsw i32 %i.1.i.lcssa, 2
%cmp = icmp slt i32 %add, %high
br i1 %cmp, label %for.body.preheader.i, label %if.end
if.end: ; preds = %partition.exit, %entry
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %x, i32 noundef %y) local_unnamed_addr #4 {
entry:
%x.y = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
ret i32 %x.y
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @solve() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %0, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n.i = alloca i32, align 4
%tc = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %tc) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %tc)
%0 = load i64, ptr %tc, align 8, !tbaa !11
%dec1 = add nsw i64 %0, -1
store i64 %dec1, ptr %tc, align 8, !tbaa !11
%tobool.not2 = icmp eq i64 %0, 0
br i1 %tobool.not2, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n.i) #8
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n.i)
%1 = load i32, ptr %n.i, align 4, !tbaa !5
%div.i = sdiv i32 %1, 2
%call1.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n.i) #8
%2 = load i64, ptr %tc, align 8, !tbaa !11
%dec = add nsw i64 %2, -1
store i64 %dec, ptr %tc, align 8, !tbaa !11
%tobool.not = icmp eq i64 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tc) #8
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree norecurse nosync nounwind memory(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 #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
int a, b, c;
scanf("%d %d %d" ,&a, &b, &c);
if(a < b ){
if(b < c){
printf("%d %d %d\n" ,a, b, c);
}
else {
if(a < c ){
printf("%d %d %d\n",a, c, b);
}
else{
printf("%d %d %d\n",c, a, b);
}
}
}
else{
if(a < c){
printf("%d %d %d\n" ,b, a, c);
}
else{
if(b < c){
printf("%d %d %d\n" ,b, c, a);
}
else{
printf("%d %d %d\n" ,c, b, a);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169001/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169001/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.else10
if.then: ; preds = %entry
%cmp1 = icmp slt i32 %1, %2
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %2)
br label %if.end22
if.else: ; preds = %if.then
%cmp4 = icmp slt i32 %0, %2
br i1 %cmp4, label %if.then5, label %if.else7
if.then5: ; preds = %if.else
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %2, i32 noundef %1)
br label %if.end22
if.else7: ; preds = %if.else
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %0, i32 noundef %1)
br label %if.end22
if.else10: ; preds = %entry
%cmp11 = icmp slt i32 %0, %2
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else10
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %2)
br label %if.end22
if.else14: ; preds = %if.else10
%cmp15 = icmp slt i32 %1, %2
br i1 %cmp15, label %if.then16, label %if.else18
if.then16: ; preds = %if.else14
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %2, i32 noundef %0)
br label %if.end22
if.else18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %1, i32 noundef %0)
br label %if.end22
if.end22: ; preds = %if.then12, %if.else18, %if.then16, %if.then2, %if.else7, %if.then5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,c,min,max,middle;
scanf("%d %d %d",&a,&b,&c);
if(a<b && a<c){
min=a;
if(b<c){
middle=b;
max=c;
}else{
middle=c;
max=b;
}
}else if(b<a && b<c){
min=b;
if(a<c){
middle=a;
max=c;
}else{
middle=c;
max=a;
}
}else{
min=c;
if(a<b){
middle=a;
max=b;
}else{
middle=b;
max=a;
}
}
printf("%d %d %d\n",min,middle,max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp slt i32 %0, %.pre.pre
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else4
if.then: ; preds = %entry
%. = call i32 @llvm.smax.i32(i32 %1, i32 %.pre.pre)
%.29 = call i32 @llvm.smin.i32(i32 %1, i32 %.pre.pre)
br label %if.end19
if.else4: ; preds = %entry
%cmp5 = icmp slt i32 %1, %0
%cmp7 = icmp slt i32 %1, %.pre.pre
%or.cond34 = select i1 %cmp5, i1 %cmp7, i1 false
br i1 %or.cond34, label %if.then8, label %if.else13
if.then8: ; preds = %if.else4
%.30 = call i32 @llvm.smax.i32(i32 %0, i32 %.pre.pre)
%.31 = call i32 @llvm.smin.i32(i32 %0, i32 %.pre.pre)
br label %if.end19
if.else13: ; preds = %if.else4
%.32 = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%.33 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
br label %if.end19
if.end19: ; preds = %if.else13, %if.then8, %if.then
%min.0 = phi i32 [ %0, %if.then ], [ %1, %if.then8 ], [ %.pre.pre, %if.else13 ]
%max.0 = phi i32 [ %., %if.then ], [ %.30, %if.then8 ], [ %.32, %if.else13 ]
%middle.0 = phi i32 [ %.29, %if.then ], [ %.31, %if.then8 ], [ %.33, %if.else13 ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0, i32 noundef %middle.0, i32 noundef %max.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main() {
int a,b,c;
int max,min,mid;
scanf("%d %d %d",&a,&b,&c);
if (a > b && a > c) {
max = a;
if (b > c) {
mid = b;
min = c;
} else {
mid = c;
min = b;
}
} else if (b > c) {
max = b;
mid = c;
min = a;
} else {
max = c;
mid = b;
min = a;
}
printf("%d %d %d\n",min,mid,max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169096/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169096/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %0, %.pre
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else4
if.then: ; preds = %entry
%. = call i32 @llvm.smin.i32(i32 %1, i32 %.pre)
%.16 = call i32 @llvm.smax.i32(i32 %1, i32 %.pre)
br label %if.end9
if.else4: ; preds = %entry
%spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %.pre)
%spec.select17 = call i32 @llvm.smin.i32(i32 %1, i32 %.pre)
br label %if.end9
if.end9: ; preds = %if.else4, %if.then
%max.0 = phi i32 [ %0, %if.then ], [ %spec.select, %if.else4 ]
%min.0 = phi i32 [ %., %if.then ], [ %0, %if.else4 ]
%mid.0 = phi i32 [ %.16, %if.then ], [ %spec.select17, %if.else4 ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0, i32 noundef %mid.0, i32 noundef %max.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
int a,b,c,m;
scanf("%d %d %d\n",&a,&b,&c);
if(a>c){
m=a;
a=c;
c=m;}
if(a>b){
m=a;
a=b;
b=m;}
if(b>c){
m=b;
b=c;
c=m;}
printf("%d %d %d\n",a,b,c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169139/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169139/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %c, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %b, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%cmp4 = icmp sgt i32 %6, %2
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %2, ptr %b, align 4, !tbaa !5
store i32 %6, ptr %c, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%8 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d %d %d", &a, &b, &c);
if(a >= b){
if(a < c){
printf("%d %d %d\n",b,a,c);
}
else if(b > c){
printf("%d %d %d\n",c,b,a);
}
else if(a > c && b < c){
printf("%d %d %d\n",b,c,a);
}
else if(a == b){
if(a > c){
printf("%d %d %d\n",c,a,b);
}
else if(a < c){
printf("%d %d %d\n",a,b,c);
}
}
else if(b == c){
if(a > b){
printf("%d %d %d\n",b,c,a);
}
else if(a < b){
printf("%d %d %d\n",a,b,c);
}
}
}
else if(a == c){
if(a < b){
printf("%d %d %d\n",a,c,b);
}
else if(a > b){
printf("%d %d %d\n",b,a,c);
}
}
else if(a < b){
if(b < c){
printf("%d %d %d\n",a,b,c);
}
else if(a > c){
printf("%d %d %d\n",c,a,b);
}
else if(b > c && a < c){
printf("%d %d %d\n",a,c,b);
}
}
else{
printf("%d %d %d\n",a,b,c);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169197/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169197/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp.not, label %if.else40, label %if.then
if.then: ; preds = %entry
%cmp1 = icmp slt i32 %0, %2
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %2)
br label %if.end75
if.else: ; preds = %if.then
%cmp4 = icmp sgt i32 %1, %2
br i1 %cmp4, label %if.then5, label %if.else7
if.then5: ; preds = %if.else
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %1, i32 noundef %0)
br label %if.end75
if.else7: ; preds = %if.else
%cmp8 = icmp sgt i32 %0, %2
%cmp9 = icmp slt i32 %1, %2
%or.cond = and i1 %cmp8, %cmp9
br i1 %or.cond, label %if.then10, label %if.else12
if.then10: ; preds = %if.else7
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %2, i32 noundef %0)
br label %if.end75
if.else12: ; preds = %if.else7
%cmp13 = icmp eq i32 %0, %1
br i1 %cmp13, label %if.then14, label %if.else23
if.then14: ; preds = %if.else12
br i1 %cmp8, label %if.then16, label %if.end75
if.then16: ; preds = %if.then14
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %0, i32 noundef %0)
br label %if.end75
if.else23: ; preds = %if.else12
%cmp24 = icmp eq i32 %1, %2
%cmp26 = icmp sgt i32 %0, %1
%or.cond89 = and i1 %cmp26, %cmp24
br i1 %or.cond89, label %if.then27, label %if.end75
if.then27: ; preds = %if.else23
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %1, i32 noundef %0)
br label %if.end75
if.else40: ; preds = %entry
%cmp41 = icmp eq i32 %0, %2
br i1 %cmp41, label %if.then44, label %if.then54
if.then44: ; preds = %if.else40
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %0, i32 noundef %1)
br label %if.end75
if.then54: ; preds = %if.else40
%cmp55 = icmp slt i32 %1, %2
br i1 %cmp55, label %if.then56, label %if.else58
if.then56: ; preds = %if.then54
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %2)
br label %if.end75
if.else58: ; preds = %if.then54
%cmp59 = icmp sgt i32 %0, %2
br i1 %cmp59, label %if.then60, label %if.else62
if.then60: ; preds = %if.else58
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %0, i32 noundef %1)
br label %if.end75
if.else62: ; preds = %if.else58
%cmp63 = icmp sgt i32 %1, %2
%cmp65 = icmp slt i32 %0, %2
%or.cond88 = and i1 %cmp63, %cmp65
br i1 %or.cond88, label %if.then66, label %if.end75
if.then66: ; preds = %if.else62
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %2, i32 noundef %1)
br label %if.end75
if.end75: ; preds = %if.then14, %if.then44, %if.then56, %if.else62, %if.then66, %if.then60, %if.then2, %if.then10, %if.else23, %if.then27, %if.then16, %if.then5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a<b) {
if(b<c) printf("%d %d %d\n",a,b,c);
else if(a<c) printf("%d %d %d\n",a,c,b);
else printf("%d %d %d\n",c,a,b);
}
else if(a<c) printf("%d %d %d\n",b,a,c);
else if(b<c) printf("%d %d %d\n",b,c,a);
else printf("%d %d %d\n",c,b,a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169254/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169254/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.else10
if.then: ; preds = %entry
%cmp1 = icmp slt i32 %1, %2
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %2)
br label %if.end22
if.else: ; preds = %if.then
%cmp4 = icmp slt i32 %0, %2
br i1 %cmp4, label %if.then5, label %if.else7
if.then5: ; preds = %if.else
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %2, i32 noundef %1)
br label %if.end22
if.else7: ; preds = %if.else
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %0, i32 noundef %1)
br label %if.end22
if.else10: ; preds = %entry
%cmp11 = icmp slt i32 %0, %2
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else10
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %2)
br label %if.end22
if.else14: ; preds = %if.else10
%cmp15 = icmp slt i32 %1, %2
br i1 %cmp15, label %if.then16, label %if.else18
if.then16: ; preds = %if.else14
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %2, i32 noundef %0)
br label %if.end22
if.else18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %1, i32 noundef %0)
br label %if.end22
if.end22: ; preds = %if.then12, %if.else18, %if.then16, %if.then2, %if.else7, %if.then5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#define N 3
int main(void){
int i = 0;
int wk = 0;
int num[3] = {0};
int sortflag = 0;
scanf("%d %d %d", &num[0], &num[1], &num[2]);
do{
sortflag = 0;
for(i = 0 ; i < N - 1 ; i++){
if(num[i] > num[i + 1]){
wk = num[i];
num[i] = num[i + 1];
num[i + 1] = wk;
sortflag = 1;
}
}
}while(sortflag == 1);
printf("%d %d %d\n", num[0], num[1], num[2]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169298/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169298/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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:
%num = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %num) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %num, i8 0, i64 12, i1 false)
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %num, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%.pre = load i32, ptr %num, align 4, !tbaa !5
%.pre33 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx2.promoted = load i32, ptr %arrayidx2, align 4, !tbaa !5
br label %do.body
do.body: ; preds = %for.inc.1, %entry
%0 = phi i32 [ %5, %for.inc.1 ], [ %arrayidx2.promoted, %entry ]
%1 = phi i32 [ %6, %for.inc.1 ], [ %.pre33, %entry ]
%2 = phi i32 [ %4, %for.inc.1 ], [ %.pre, %entry ]
%cmp6 = icmp sgt i32 %2, %1
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %do.body
store i32 %1, ptr %num, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %do.body, %if.then
%3 = phi i32 [ %2, %if.then ], [ %1, %do.body ]
%4 = phi i32 [ %1, %if.then ], [ %2, %do.body ]
%sortflag.1 = phi i32 [ 1, %if.then ], [ 0, %do.body ]
%cmp6.1 = icmp sgt i32 %3, %0
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 %0, ptr %arrayidx1, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%5 = phi i32 [ %3, %if.then.1 ], [ %0, %for.inc ]
%6 = phi i32 [ %0, %if.then.1 ], [ %3, %for.inc ]
%sortflag.1.1 = phi i32 [ 1, %if.then.1 ], [ %sortflag.1, %for.inc ]
%cmp17 = icmp eq i32 %sortflag.1.1, 1
br i1 %cmp17, label %do.body, label %do.end, !llvm.loop !9
do.end: ; preds = %for.inc.1
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %6, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int a, b, c;
int temp;
scanf("%d %d %d", &a, &b, &c);
if(a > b){
temp = a;
a = b;
b = temp;
}
if(b > c){
temp = b;
b = c;
c = temp;
}
if(a > b){
temp = a;
a = b;
b = temp;
}
printf("%d %d %d\n", a, b, c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a[3];
int b,c,d;
for(d = 0;d < 3;d++){
scanf("%d",&a[d]);
}
for(b=0;b<2;b++){
for(c=b+1;c<=2;c++){
if(a[b]>a[c]){
d = a[b];
a[b] = a[c];
a[c] = d;
}
}
}
printf("%d %d %d\n",a[0],a[1],a[2]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169399/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169399/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 {
for.body6.lr.ph:
%a = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, %1
br i1 %cmp11, label %if.then, label %for.inc20
for.body6.lr.ph.1: ; preds = %if.then.157, %for.inc20
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp11.1 = icmp sgt i32 %2, %3
br i1 %cmp11.1, label %if.then.1, label %for.cond1.loopexit.1
if.then.1: ; preds = %for.body6.lr.ph.1
store i32 %3, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.2, align 4, !tbaa !5
br label %for.cond1.loopexit.1
for.cond1.loopexit.1: ; preds = %for.body6.lr.ph.1, %if.then.1
%4 = phi i32 [ %2, %if.then.1 ], [ %3, %for.body6.lr.ph.1 ]
%5 = phi i32 [ %3, %if.then.1 ], [ %2, %for.body6.lr.ph.1 ]
%6 = load i32, ptr %a, align 4, !tbaa !5
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6, i32 noundef %5, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %a) #3
ret i32 0
if.then: ; preds = %for.body6.lr.ph
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5
br label %for.inc20
for.inc20: ; preds = %for.body6.lr.ph, %if.then
%7 = phi i32 [ %0, %for.body6.lr.ph ], [ %1, %if.then ]
%8 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%cmp11.155 = icmp sgt i32 %7, %8
br i1 %cmp11.155, label %if.then.157, label %for.body6.lr.ph.1
if.then.157: ; preds = %for.inc20
store i32 %8, ptr %a, align 4, !tbaa !5
store i32 %7, ptr %arrayidx.2, align 4, !tbaa !5
br label %for.body6.lr.ph.1
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
void iswap(int *a, int *b);
int main() {
int a;
int b;
int c;
scanf("%d %d %d", &a, &b, &c);
if (a > b) {
iswap(&a, &b);
}
if (a > c) {
iswap(&a, &c);
}
if (b > c) {
iswap(&b, &c);
}
printf("%d %d %d\n", a, b, c);
return 0;
}
void iswap(int *a, int *b) {
int t;
t = *a;
*a = *b;
*b = t;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169441/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169441/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !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
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%6 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %b, align 4, !tbaa !5
store i32 %2, ptr %c, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @iswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
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"}
|
#include <stdio.h>
void swap(int *a, int *b) {
int tmp;
tmp = *a;
*a = *b;
*b = tmp;
}
int main(void) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (a > b) {
swap(&a, &b);
}
if (b > c) {
swap(&b, &c);
}
if (a > b) {
swap(&a, &b);
}
printf("%d %d %d\n", a, b, c);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169492/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169492/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !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
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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,c,d;
scanf("%d %d %d\n",&a,&b,&c);
if(a>b){
d=a;
a=b;
b=d;
}
if(b>c){
d=b;
b=c;
c=d;
}
if(a>b){
d=a;
a=b;
b=d;
}
printf("%d %d %d\n",a,b,c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169564/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169564/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a>=b&&a>=c){
if(b>=c)printf("%d %d %d\n",c,b,a);
else if(c>=b)printf("%d %d %d\n",b,c,a);
}
else if(b>=a&&b>=c){
if(a>=c)printf("%d %d %d\n",c,a,b);
else if(c>=a)printf("%d %d %d\n",a,c,b);
}
else if (c>=b&&c>=a){
if(b>=a)printf("%d %d %d\n",a,b,c);
else if(a>=b)printf("%d %d %d\n",b,a,c);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169607/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169607/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.pre.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp slt i32 %0, %.pre.pre
%or.cond51 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond51, label %if.else9, label %if.then
if.then: ; preds = %entry
%cmp2.not = icmp slt i32 %1, %.pre.pre
br i1 %cmp2.not, label %if.then6, label %if.then3
if.then3: ; preds = %if.then
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.pre, i32 noundef %1, i32 noundef %0)
br label %if.end39
if.then6: ; preds = %if.then
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre.pre, i32 noundef %0)
br label %if.end39
if.else9: ; preds = %entry
%cmp10.not = icmp slt i32 %1, %0
br i1 %cmp10.not, label %if.else23, label %land.lhs.true11
land.lhs.true11: ; preds = %if.else9
%cmp12.not = icmp slt i32 %1, %.pre.pre
br i1 %cmp12.not, label %if.else23.thread, label %if.then13
if.then13: ; preds = %land.lhs.true11
%cmp14.not = icmp slt i32 %0, %.pre.pre
br i1 %cmp14.not, label %if.then19, label %if.then15
if.then15: ; preds = %if.then13
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.pre, i32 noundef %0, i32 noundef %1)
br label %if.end39
if.then19: ; preds = %if.then13
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre.pre, i32 noundef %1)
br label %if.end39
if.else23: ; preds = %if.else9
%cmp24.not = icmp slt i32 %.pre.pre, %1
%cmp26.not = icmp slt i32 %.pre.pre, %0
%or.cond = or i1 %cmp24.not, %cmp26.not
br i1 %or.cond, label %if.end39, label %if.then33
if.else23.thread: ; preds = %land.lhs.true11
%cmp26.not49 = icmp slt i32 %.pre.pre, %0
br i1 %cmp26.not49, label %if.end39, label %if.then29
if.then29: ; preds = %if.else23.thread
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre.pre)
br label %if.end39
if.then33: ; preds = %if.else23
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre.pre)
br label %if.end39
if.end39: ; preds = %if.else23.thread, %if.then19, %if.then15, %if.then29, %if.then33, %if.else23, %if.then3, %if.then6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int Nums[3];
scanf("%d %d %d", &Nums[0], &Nums[1], &Nums[2]);
for(int i=0;i<3;i++){
for(int j=0;j<i;j++){
if(Nums[i]<Nums[j]){
int temp=Nums[i];
Nums[i]=Nums[j];
Nums[j]=temp;
}
}
}
printf("%d %d %d\n", Nums[0], Nums[1], Nums[2]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169650/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169650/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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 {
for.body6.lr.ph.1:
%Nums = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %Nums) #3
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %Nums, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [3 x i32], ptr %Nums, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Nums, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%1 = load i32, ptr %Nums, align 4, !tbaa !5
%cmp10.1 = icmp slt i32 %0, %1
br i1 %cmp10.1, label %if.then.1, label %for.body6.lr.ph.2
if.then.1: ; preds = %for.body6.lr.ph.1
store i32 %1, ptr %arrayidx1, align 4, !tbaa !5
store i32 %0, ptr %Nums, align 4, !tbaa !5
br label %for.body6.lr.ph.2
for.body6.lr.ph.2: ; preds = %if.then.1, %for.body6.lr.ph.1
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%3 = load i32, ptr %Nums, align 4, !tbaa !5
%cmp10.2 = icmp slt i32 %2, %3
br i1 %cmp10.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.body6.lr.ph.2
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
store i32 %2, ptr %Nums, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.body6.lr.ph.2
%4 = phi i32 [ %2, %if.then.2 ], [ %3, %for.body6.lr.ph.2 ]
%5 = phi i32 [ %3, %if.then.2 ], [ %2, %for.body6.lr.ph.2 ]
%6 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp10.2.1 = icmp slt i32 %5, %6
br i1 %cmp10.2.1, label %if.then.2.1, label %for.cond.cleanup5.2
if.then.2.1: ; preds = %for.inc.2
store i32 %6, ptr %arrayidx2, align 4, !tbaa !5
store i32 %5, ptr %arrayidx1, align 4, !tbaa !5
br label %for.cond.cleanup5.2
for.cond.cleanup5.2: ; preds = %for.inc.2, %if.then.2.1
%7 = phi i32 [ %6, %if.then.2.1 ], [ %5, %for.inc.2 ]
%8 = phi i32 [ %5, %if.then.2.1 ], [ %6, %for.inc.2 ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %Nums) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a,b,c,tmp;
scanf("%d%d%d",&a,&b,&c);
if(a>b)
{
tmp=a;
a=b;
b=tmp;
}
if(b>c)
{
tmp=b;
b=c;
c=tmp;
}
if(a>b)
{
tmp=a;
a=b;
b=tmp;
}
printf("%d %d %d\n",a,b,c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169708/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169708/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int a, b, c;
int main(){
scanf("%d %d %d", &a, &b, &c);
if (a <= b && b <= c){
printf("%d %d %d\n", a, b, c);}
else if (a <= b && b >= c && a >= c){
printf ("%d %d %d\n", c, a, b);}
else if (a >= b && b >= c){
printf ("%d %d %d\n", c, b, a);}
else if (a >= b && b <= c && a >= c){
printf ("%d %d %d\n", b, c, a);}
else if (a >= b && b <= c && c >= a){
printf ("%d %d %d\n", b, a, c);}
else if (a <= b && b >= c && a < c){
printf ("%d %d %d\n",a ,c ,b );}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169759/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169759/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@a = dso_local global i32 0, align 4
@b = dso_local global i32 0, align 4
@c = dso_local 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 @a, ptr noundef nonnull @b, ptr noundef nonnull @c)
%0 = load i32, ptr @a, align 4, !tbaa !5
%1 = load i32, ptr @b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
br i1 %cmp.not, label %land.lhs.true12, label %land.lhs.true
land.lhs.true: ; preds = %entry
%2 = load i32, ptr @c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %2
br i1 %cmp1.not, label %land.lhs.true4, label %if.then
if.then: ; preds = %land.lhs.true
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %2)
br label %if.end44
land.lhs.true4: ; preds = %land.lhs.true
%cmp7.not = icmp slt i32 %0, %2
br i1 %cmp7.not, label %if.else10.thread, label %if.then8
if.then8: ; preds = %land.lhs.true4
%call9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2, i32 noundef %0, i32 noundef %1)
br label %if.end44
if.else10.thread: ; preds = %land.lhs.true4
%cmp11.not65 = icmp slt i32 %0, %1
br i1 %cmp11.not65, label %land.lhs.true34, label %land.lhs.true12
land.lhs.true12: ; preds = %entry, %if.else10.thread
%3 = load i32, ptr @c, align 4, !tbaa !5
%cmp13.not = icmp slt i32 %1, %3
br i1 %cmp13.not, label %land.lhs.true18, label %if.then14
if.then14: ; preds = %land.lhs.true12
%call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3, i32 noundef %1, i32 noundef %0)
br label %if.end44
land.lhs.true18: ; preds = %land.lhs.true12
%cmp21.not = icmp slt i32 %0, %3
br i1 %cmp21.not, label %if.then30, label %if.then22
if.then22: ; preds = %land.lhs.true18
%call23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %3, i32 noundef %0)
br label %if.end44
if.then30: ; preds = %land.lhs.true18
%call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %3)
br label %if.end44
land.lhs.true34: ; preds = %if.else10.thread
%4 = load i32, ptr @c, align 4, !tbaa !5
%cmp35.not = icmp sge i32 %1, %4
%cmp37 = icmp slt i32 %0, %4
%or.cond64 = and i1 %cmp35.not, %cmp37
br i1 %or.cond64, label %if.then38, label %if.end44
if.then38: ; preds = %land.lhs.true34
%call39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %4, i32 noundef %1)
br label %if.end44
if.end44: ; preds = %if.then8, %if.then22, %land.lhs.true34, %if.then38, %if.then30, %if.then14, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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>
void sort(int number[]) {
int i, j,tmp;
for (i = 0; i < 3; i++) {
for (j = 2; j > i; j--) {
if (number[j] < number[j - 1]) {
tmp = number[j];
number[j] = number[j - 1];
number[j - 1] = tmp;
}
}
}
printf("%d %d %d\n", number[0],number[1],number[2]);
}
int main(void) {
int number[3],i;
for (i = 0; i < 3; i++)
scanf("%d", &number[i]);
sort(number);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169809/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169809/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort(ptr nocapture noundef %number) local_unnamed_addr #0 {
for.body3.preheader:
%arrayidx = getelementptr inbounds i32, ptr %number, i64 2
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %number, i64 1
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp slt i32 %0, %1
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3.preheader
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body3.preheader, %if.then
%2 = phi i32 [ %1, %for.body3.preheader ], [ %0, %if.then ]
%3 = load i32, ptr %number, align 4, !tbaa !5
%cmp6.149 = icmp slt i32 %2, %3
br i1 %cmp6.149, label %if.then.151, label %for.body3.preheader.1
if.then.151: ; preds = %for.inc
store i32 %3, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %number, align 4, !tbaa !5
br label %for.body3.preheader.1
for.body3.preheader.1: ; preds = %if.then.151, %for.inc
%arrayidx.1 = getelementptr inbounds i32, ptr %number, i64 2
%4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx5.1 = getelementptr inbounds i32, ptr %number, i64 1
%5 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp slt i32 %4, %5
br i1 %cmp6.1, label %if.then.1, label %for.inc17.2
if.then.1: ; preds = %for.body3.preheader.1
store i32 %5, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5.1, align 4, !tbaa !5
br label %for.inc17.2
for.inc17.2: ; preds = %if.then.1, %for.body3.preheader.1
%6 = load i32, ptr %number, align 4, !tbaa !5
%arrayidx20 = getelementptr inbounds i32, ptr %number, i64 1
%7 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%arrayidx21 = getelementptr inbounds i32, ptr %number, i64 2
%8 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6, i32 noundef %7, i32 noundef %8)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%number = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %number) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %number)
%arrayidx.1 = getelementptr inbounds [3 x i32], ptr %number, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [3 x i32], ptr %number, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.2)
%0 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%cmp6.i = icmp slt i32 %0, %1
br i1 %cmp6.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %entry
store i32 %1, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %entry
%2 = phi i32 [ %0, %entry ], [ %1, %if.then.i ]
%3 = phi i32 [ %1, %entry ], [ %0, %if.then.i ]
%4 = load i32, ptr %number, align 4, !tbaa !5
%cmp6.149.i = icmp slt i32 %3, %4
br i1 %cmp6.149.i, label %if.then.151.i, label %for.body3.preheader.1.i
if.then.151.i: ; preds = %for.inc.i
store i32 %4, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %3, ptr %number, align 4, !tbaa !5
br label %for.body3.preheader.1.i
for.body3.preheader.1.i: ; preds = %if.then.151.i, %for.inc.i
%5 = phi i32 [ %3, %if.then.151.i ], [ %4, %for.inc.i ]
%6 = phi i32 [ %4, %if.then.151.i ], [ %3, %for.inc.i ]
%cmp6.1.i = icmp slt i32 %2, %6
br i1 %cmp6.1.i, label %if.then.1.i, label %sort.exit
if.then.1.i: ; preds = %for.body3.preheader.1.i
store i32 %6, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.1, align 4, !tbaa !5
br label %sort.exit
sort.exit: ; preds = %for.body3.preheader.1.i, %if.then.1.i
%7 = phi i32 [ %2, %for.body3.preheader.1.i ], [ %6, %if.then.1.i ]
%8 = phi i32 [ %6, %for.body3.preheader.1.i ], [ %2, %if.then.1.i ]
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5, i32 noundef %8, i32 noundef %7)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %number) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int x1, x2, x3, y1, y2, y3;
scanf("%d %d %d %d %d %d", &x1, &y1, &x2, &y2, &x3, &y3);
printf("3\n");
printf("%d %d\n", x1 + x3 - x2, y1 + y3 - y2);
printf("%d %d\n", x3 + x2 - x1, y3 + y2 - y1);
printf("%d %d\n", x2 + x1 - x3, y2 + y1 - y3);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16986/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16986/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"3\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x1 = alloca i32, align 4
%x2 = alloca i32, align 4
%x3 = alloca i32, align 4
%y1 = alloca i32, align 4
%y2 = alloca i32, align 4
%y3 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x3) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y3) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2, ptr noundef nonnull %x3, ptr noundef nonnull %y3)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%0 = load i32, ptr %x1, align 4, !tbaa !5
%1 = load i32, ptr %x3, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %x2, align 4, !tbaa !5
%sub = sub i32 %add, %2
%3 = load i32, ptr %y1, align 4, !tbaa !5
%4 = load i32, ptr %y3, align 4, !tbaa !5
%add2 = add nsw i32 %4, %3
%5 = load i32, ptr %y2, align 4, !tbaa !5
%sub3 = sub i32 %add2, %5
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub, i32 noundef %sub3)
%6 = load i32, ptr %x3, align 4, !tbaa !5
%7 = load i32, ptr %x2, align 4, !tbaa !5
%add5 = add nsw i32 %7, %6
%8 = load i32, ptr %x1, align 4, !tbaa !5
%sub6 = sub i32 %add5, %8
%9 = load i32, ptr %y3, align 4, !tbaa !5
%10 = load i32, ptr %y2, align 4, !tbaa !5
%add7 = add nsw i32 %10, %9
%11 = load i32, ptr %y1, align 4, !tbaa !5
%sub8 = sub i32 %add7, %11
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub6, i32 noundef %sub8)
%12 = load i32, ptr %x2, align 4, !tbaa !5
%13 = load i32, ptr %x1, align 4, !tbaa !5
%add10 = add nsw i32 %13, %12
%14 = load i32, ptr %x3, align 4, !tbaa !5
%sub11 = sub i32 %add10, %14
%15 = load i32, ptr %y2, align 4, !tbaa !5
%16 = load i32, ptr %y1, align 4, !tbaa !5
%add12 = add nsw i32 %16, %15
%17 = load i32, ptr %y3, align 4, !tbaa !5
%sub13 = sub i32 %add12, %17
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub11, i32 noundef %sub13)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x3) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int n, temp;
scanf("%d", &n);
if (n % 2 == 0)
{
printf("%d\n", n / 2);
for(int i = 0; i < n / 2; i++)
{
printf("2 ");
}
puts("");
return 0;
}
else
{
temp = n - 3;
printf("%d\n", temp / 2 + 1);
printf("3 ");
for(int i = 0; i < temp / 2; i++)
{
printf("2 ");
}
puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"2 \00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c"3 \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %0, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp328 = icmp sgt i32 %2, 1
br i1 %cmp328, label %for.body, label %cleanup
for.body: ; preds = %if.then, %for.body
%i.029 = phi i32 [ %inc, %for.body ], [ 0, %if.then ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%inc = add nuw nsw i32 %i.029, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%div2 = sdiv i32 %3, 2
%cmp3 = icmp slt i32 %inc, %div2
br i1 %cmp3, label %for.body, label %cleanup, !llvm.loop !9
if.else: ; preds = %entry
%sub = add nsw i32 %0, -3
%div6 = sdiv i32 %sub, 2
%add = add nsw i32 %div6, 1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
%cmp1225 = icmp sgt i32 %0, 4
br i1 %cmp1225, label %for.body14.preheader, label %cleanup
for.body14.preheader: ; preds = %if.else
%smax = call i32 @llvm.smax.i32(i32 %div6, i32 1)
br label %for.body14
for.body14: ; preds = %for.body14.preheader, %for.body14
%i9.026 = phi i32 [ %inc17, %for.body14 ], [ 0, %for.body14.preheader ]
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%inc17 = add nuw nsw i32 %i9.026, 1
%exitcond.not = icmp eq i32 %inc17, %smax
br i1 %exitcond.not, label %cleanup, label %for.body14, !llvm.loop !11
cleanup: ; preds = %for.body14, %for.body, %if.else, %if.then
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main()
{
int a, b, c, tmp;
scanf("%d %d %d", &a, &b, &c);
if(a > b){
tmp = a;
a = b;
b = tmp;
}
if(b > c){
tmp = b;
b = c;
c = tmp;
}
if(a > b){
tmp = a;
a = b;
b = tmp;
}
printf("%d %d %d\n", a, b, c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169953/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169953/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%3 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp sgt i32 %3, %4
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
store i32 %4, ptr %b, align 4, !tbaa !5
store i32 %3, ptr %c, align 4, !tbaa !5
br label %if.end3
if.end3: ; preds = %if.then2, %if.end
%5 = phi i32 [ %3, %if.then2 ], [ %4, %if.end ]
%6 = phi i32 [ %4, %if.then2 ], [ %3, %if.end ]
%cmp4 = icmp sgt i32 %2, %6
br i1 %cmp4, label %if.then5, label %if.end6
if.then5: ; preds = %if.end3
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %2, ptr %b, align 4, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then5, %if.end3
%7 = phi i32 [ %2, %if.then5 ], [ %6, %if.end3 ]
%8 = phi i32 [ %6, %if.then5 ], [ %2, %if.end3 ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8, i32 noundef %7, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a,b,c,t;
scanf("%d %d %d",&a,&b,&c);
if (a>b) {
t=a;
a=b;
b=t;
}
if (c<a) {
t=c;
c=b;
b=a;
a=t;
} else if (a<=c && c<b) {
t=c;
c=b;
b=t;
}
printf("%d %d %d\n",a,b,c);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_169997/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_169997/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi i32 [ %0, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %1, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp slt i32 %4, %3
br i1 %cmp1, label %if.then2, label %land.lhs.true
if.then2: ; preds = %if.end
store i32 %2, ptr %c, align 4, !tbaa !5
store i32 %3, ptr %b, align 4, !tbaa !5
store i32 %4, ptr %a, align 4, !tbaa !5
br label %if.end7
land.lhs.true: ; preds = %if.end
%cmp4 = icmp slt i32 %4, %2
br i1 %cmp4, label %if.then5, label %if.end7
if.then5: ; preds = %land.lhs.true
store i32 %2, ptr %c, align 4, !tbaa !5
store i32 %4, ptr %b, align 4, !tbaa !5
br label %if.end7
if.end7: ; preds = %land.lhs.true, %if.then5, %if.then2
%5 = phi i32 [ %4, %land.lhs.true ], [ %2, %if.then5 ], [ %2, %if.then2 ]
%6 = phi i32 [ %2, %land.lhs.true ], [ %4, %if.then5 ], [ %3, %if.then2 ]
%7 = phi i32 [ %3, %land.lhs.true ], [ %3, %if.then5 ], [ %4, %if.then2 ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %6, i32 noundef %5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a, b, c;
scanf("%d" , &a);
scanf("%d" , &b);
scanf("%d" , &c);
if(a <= b&&b <= c){
printf("%d %d %d\n" , a, b, c);
}
else if(a <= c&&c <= b){
printf("%d %d %d\n" , a, c, b);
}
else if(b <=a&&a <= c){
printf("%d %d %d\n" , b, a, c);
}
else if(b <= c&&c <= a){
printf("%d %d %d\n" , b, c, a);
}
else if(c <= a&&a <= b){
printf("%d %d %d\n" , c, a, b);
}
else if(c <= b&&b <= a){
printf("%d %d %d\n" , c, b, a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %1, %.pre
%or.cond61 = select i1 %cmp.not, i1 true, i1 %cmp3.not
br i1 %or.cond61, label %if.else, label %if.then
if.then: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end38
if.else: ; preds = %entry
%cmp5.not = icmp sgt i32 %0, %.pre
br i1 %cmp5.not, label %if.else10, label %land.lhs.true6
land.lhs.true6: ; preds = %if.else
%cmp7.not = icmp sgt i32 %.pre, %1
br i1 %cmp7.not, label %if.else10.thread, label %if.then8
if.then8: ; preds = %land.lhs.true6
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end38
if.else10: ; preds = %if.else
%cmp11.not = icmp sgt i32 %1, %0
br label %if.else16
if.else10.thread: ; preds = %land.lhs.true6
%cmp11.not56 = icmp sgt i32 %1, %0
br i1 %cmp11.not56, label %if.else16, label %if.then14
if.then14: ; preds = %if.else10.thread
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end38
if.else16: ; preds = %if.else10, %if.else10.thread
%cmp11.not58 = phi i1 [ true, %if.else10.thread ], [ %cmp11.not, %if.else10 ]
%cmp17.not = icmp sgt i32 %1, %.pre
%cmp19.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp17.not, %cmp19.not
br i1 %or.cond, label %if.else22, label %if.then20
if.then20: ; preds = %if.else16
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end38
if.else22: ; preds = %if.else16
%brmerge = or i1 %cmp.not, %cmp19.not
br i1 %brmerge, label %if.else28, label %if.then26
if.then26: ; preds = %if.else22
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end38
if.else28: ; preds = %if.else22
%cmp29.not = icmp sgt i32 %.pre, %1
%brmerge60 = or i1 %cmp29.not, %cmp11.not58
br i1 %brmerge60, label %if.end38, label %if.then32
if.then32: ; preds = %if.else28
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end38
if.end38: ; preds = %if.else28, %if.then8, %if.then20, %if.then32, %if.then26, %if.then14, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a<b && b<c){
printf("%d %d %d\n",a,b,c);
}
else if(a<c && c<b){
printf("%d %d %d\n",a,c,b);
}
else if(b<c && c<a){
printf("%d %d %d\n",b,c,a);
}
else if(b<a && a<c){
printf("%d %d %d\n",b,a,c);
}
else if(c<a && a<b){
printf("%d %d %d\n",c,a,b);
}
else if(c<b && b<a){
printf("%d %d %d\n",c,b,a);
}
else if(a==b && b==c){
printf("%d %d %d\n",a,b,c);
}
else if(a==b && b<c){
printf("%d %d %d\n",a,b,c);
}
else if(a<b && b==c){
printf("%d %d %d\n",a,b,c);
}
else if(a==c && c<b){
printf("%d %d %d\n",a,c,b);
}
else if(a<c && c==b){
printf("%d %d %d\n",a,c,b);
}
else if(b==a && a<c){
printf("%d %d %d\n",b,a,c);
}
else if(b<a && a==c){
printf("%d %d %d\n",b,a,c);
}
else if(b==c && c<a){
printf("%d %d %d\n",b,c,a);
}
else if(b<c && c==a){
printf("%d %d %d\n",b,c,a);
}
else if(c==a && a<b){
printf("%d %d %d\n",c,a,b);
}
else if(c<a && a==b){
printf("%d %d %d\n",c,a,b);
}
else if(c==b && b<a){
printf("%d %d %d\n",c,b,a);
}
else{
printf("%d %d %d\n",c,b,a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1 = icmp slt i32 %1, %.pre
%or.cond196 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond196, label %if.then, label %if.else
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end122
if.else: ; preds = %entry
%cmp3 = icmp slt i32 %0, %.pre
%cmp5 = icmp slt i32 %.pre, %1
%or.cond = and i1 %cmp3, %cmp5
br i1 %or.cond, label %if.then6, label %if.else8
if.then6: ; preds = %if.else
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end122
if.else8: ; preds = %if.else
%cmp9 = icmp slt i32 %1, %.pre
%cmp11 = icmp slt i32 %.pre, %0
%or.cond176 = and i1 %cmp9, %cmp11
br i1 %or.cond176, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end122
if.else14: ; preds = %if.else8
%cmp15 = icmp sge i32 %1, %0
%cmp3.not = xor i1 %cmp3, true
%brmerge = or i1 %cmp15, %cmp3.not
br i1 %brmerge, label %if.else20, label %if.then18
if.then18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end122
if.else20: ; preds = %if.else14
%cmp21 = icmp sge i32 %.pre, %0
%cmp.not = xor i1 %cmp, true
%brmerge177 = or i1 %cmp21, %cmp.not
br i1 %brmerge177, label %if.else26, label %if.then24
if.then24: ; preds = %if.else20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end122
if.else26: ; preds = %if.else20
%cmp27 = icmp sge i32 %.pre, %1
%brmerge179 = or i1 %cmp15, %cmp27
br i1 %brmerge179, label %if.else32, label %if.then30
if.then30: ; preds = %if.else26
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end122
if.else32: ; preds = %if.else26
%cmp33 = icmp ne i32 %0, %1
br i1 %cmp33, label %if.else44, label %land.lhs.true34
land.lhs.true34: ; preds = %if.else32
%cmp35 = icmp eq i32 %0, %.pre
br i1 %cmp35, label %if.then36, label %land.lhs.true40
if.then36: ; preds = %land.lhs.true34
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %0, i32 noundef %0)
br label %if.end122
land.lhs.true40: ; preds = %land.lhs.true34
br i1 %cmp9, label %if.then42, label %if.else44
if.then42: ; preds = %land.lhs.true40
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %0, i32 noundef %.pre)
br label %if.end122
if.else44: ; preds = %if.else32, %land.lhs.true40
%cmp47 = icmp eq i32 %1, %.pre
%or.cond180 = and i1 %cmp, %cmp47
br i1 %or.cond180, label %if.then48, label %if.else50
if.then48: ; preds = %if.else44
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %1)
br label %if.end122
if.else50: ; preds = %if.else44
%cmp51 = icmp ne i32 %0, %.pre
%brmerge182 = or i1 %cmp51, %cmp27
br i1 %brmerge182, label %if.else56, label %if.then54
if.then54: ; preds = %if.else50
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %0, i32 noundef %1)
br label %if.end122
if.else56: ; preds = %if.else50
br i1 %cmp3, label %land.lhs.true58, label %if.else68
land.lhs.true58: ; preds = %if.else56
br i1 %cmp47, label %if.then60, label %if.else62
if.then60: ; preds = %land.lhs.true58
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %1)
br label %if.end122
if.else62: ; preds = %land.lhs.true58
br i1 %cmp33, label %if.else68, label %if.then66
if.then66: ; preds = %if.else62
%call67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %0, i32 noundef %.pre)
br label %if.end122
if.else68: ; preds = %if.else56, %if.else62
%brmerge185 = or i1 %cmp15, %cmp51
br i1 %brmerge185, label %if.else74, label %if.then72
if.then72: ; preds = %if.else68
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %0)
br label %if.end122
if.else74: ; preds = %if.else68
%cmp75 = icmp ne i32 %1, %.pre
%brmerge187 = or i1 %cmp75, %cmp21
br i1 %brmerge187, label %if.else80, label %if.then78
if.then78: ; preds = %if.else74
%call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %1, i32 noundef %0)
br label %if.end122
if.else80: ; preds = %if.else74
br i1 %cmp9, label %land.lhs.true82, label %if.else86
land.lhs.true82: ; preds = %if.else80
br i1 %cmp51, label %if.else92, label %if.then84
if.then84: ; preds = %land.lhs.true82
%call85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %0)
br label %if.end122
if.else86: ; preds = %if.else80
%brmerge190 = or i1 %cmp51, %cmp.not
br i1 %brmerge190, label %if.else92, label %if.then90
if.then90: ; preds = %if.else86
%call91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %0, i32 noundef %1)
br label %if.end122
if.else92: ; preds = %if.else86, %land.lhs.true82
%brmerge192 = or i1 %cmp33, %cmp21
br i1 %brmerge192, label %if.else98, label %if.then96
if.then96: ; preds = %if.else92
%call97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %0)
br label %if.end122
if.else98: ; preds = %if.else92
%brmerge195 = or i1 %cmp15, %cmp75
br i1 %brmerge195, label %if.else104, label %if.then102
if.then102: ; preds = %if.else98
%call103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %1, i32 noundef %0)
br label %if.end122
if.else104: ; preds = %if.else98
%call105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end122
if.end122: ; preds = %if.then6, %if.then18, %if.then30, %if.then42, %if.then54, %if.then66, %if.then78, %if.then90, %if.then102, %if.else104, %if.then96, %if.then84, %if.then72, %if.then60, %if.then48, %if.then36, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a<=b&&b<=c){
printf("%d %d %d\n",a,b,c);
}else if(a<=c&&c<=b){
printf("%d %d %d\n",a,c,b);
}else if(b<=a&&a<=c){
printf("%d %d %d\n",b,a,c);
}else if(b<=c&&c<=a){
printf("%d %d %d\n",b,c,a);
}else if(c<=a&&a<=b){
printf("%d %d %d\n",c,a,b);
}else{
printf("%d %d %d\n",c,b,a);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.pre = load i32, ptr %c, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %1, %.pre
%or.cond47 = select i1 %cmp.not, i1 true, i1 %cmp1.not
br i1 %or.cond47, label %if.else, label %if.then
if.then: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %1, i32 noundef %.pre)
br label %if.end31
if.else: ; preds = %entry
%cmp3.not = icmp sgt i32 %0, %.pre
br i1 %cmp3.not, label %if.else14, label %land.lhs.true4
land.lhs.true4: ; preds = %if.else
%cmp5.not = icmp sgt i32 %.pre, %1
br i1 %cmp5.not, label %if.else8.thread, label %if.then6
if.then6: ; preds = %land.lhs.true4
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0, i32 noundef %.pre, i32 noundef %1)
br label %if.end31
if.else8.thread: ; preds = %land.lhs.true4
%cmp9.not46 = icmp sgt i32 %1, %0
br i1 %cmp9.not46, label %if.else14, label %if.then12
if.then12: ; preds = %if.else8.thread
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %0, i32 noundef %.pre)
br label %if.end31
if.else14: ; preds = %if.else, %if.else8.thread
%cmp15.not = icmp sgt i32 %1, %.pre
%cmp17.not = icmp sgt i32 %.pre, %0
%or.cond = or i1 %cmp15.not, %cmp17.not
br i1 %or.cond, label %if.else20, label %if.then18
if.then18: ; preds = %if.else14
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1, i32 noundef %.pre, i32 noundef %0)
br label %if.end31
if.else20: ; preds = %if.else14
%brmerge = or i1 %cmp.not, %cmp17.not
br i1 %brmerge, label %if.else26, label %if.then24
if.then24: ; preds = %if.else20
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %0, i32 noundef %1)
br label %if.end31
if.else26: ; preds = %if.else20
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %1, i32 noundef %0)
br label %if.end31
if.end31: ; preds = %if.then6, %if.then18, %if.else26, %if.then24, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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%d",&n,&k);
long num;
long answer;
num = (long)n/k;
answer = num * num * num;
if(k % 2 == 0){
num = (long)(n + k/2) / k;
answer += num * num * num;
}
printf("%ld\n",answer);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170182/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170182/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%1 = load i32, ptr %k, align 4, !tbaa !5
%conv1 = sext i32 %1 to i64
%div = sdiv i64 %conv, %conv1
%mul = mul nsw i64 %div, %div
%mul2 = mul nsw i64 %mul, %div
%2 = and i32 %1, 1
%cmp = icmp eq i32 %2, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%div4 = sdiv i32 %1, 2
%add = add nsw i32 %div4, %0
%conv5 = sext i32 %add to i64
%div7 = sdiv i64 %conv5, %conv1
%mul8 = mul nsw i64 %div7, %div7
%mul9 = mul nsw i64 %mul8, %div7
%add10 = add nsw i64 %mul9, %mul2
br label %if.end
if.end: ; preds = %if.then, %entry
%answer.0 = phi i64 [ %add10, %if.then ], [ %mul2, %entry ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %answer.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
long long n,m;
scanf("%lld%lld", &n, &m);
if (2*n > m) printf("%lld", m/2);
else printf("%lld", n+(m-n*2)/4);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170232/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170232/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%mul = shl nsw i64 %0, 1
%1 = load i64, ptr %m, align 8, !tbaa !5
%cmp = icmp sgt i64 %mul, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i64 %1, 2
br label %if.end
if.else: ; preds = %entry
%sub = sub nsw i64 %1, %mul
%div3 = sdiv i64 %sub, 4
%add = add nsw i64 %div3, %0
br label %if.end
if.end: ; preds = %if.else, %if.then
%add.sink = phi i64 [ %add, %if.else ], [ %div, %if.then ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long long int n,m,s,i;
scanf("%ld %ld",&n,&m);
if(m<=2*n)
printf("%ld",m/2);
else printf("%ld",n+(m-2*n)/4);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170276/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170276/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %m, align 8, !tbaa !5
%1 = load i64, ptr %n, align 8, !tbaa !5
%mul = shl nsw i64 %1, 1
%cmp.not = icmp sgt i64 %0, %mul
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%div = sdiv i64 %0, 2
br label %if.end
if.else: ; preds = %entry
%sub = sub nsw i64 %0, %mul
%div3 = sdiv i64 %sub, 4
%add = add nsw i64 %div3, %1
br label %if.end
if.end: ; preds = %if.else, %if.then
%add.sink = phi i64 [ %add, %if.else ], [ %div, %if.then ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
long long int N , M , sum =0 ;
scanf("%lld %lld" , &N , &M);
if( N >= M / 2){
sum = M / 2;
}else{
sum += N;
M -= 2*N;
sum += M/4;
}
printf("%lld" , sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%M = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %M) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i64, ptr %N, align 8, !tbaa !5
%1 = load i64, ptr %M, align 8, !tbaa !5
%div = sdiv i64 %1, 2
%cmp.not = icmp slt i64 %0, %div
br i1 %cmp.not, label %if.else, label %if.end
if.else: ; preds = %entry
%mul = shl nsw i64 %0, 1
%sub = sub nsw i64 %1, %mul
store i64 %sub, ptr %M, align 8, !tbaa !5
%div2 = sdiv i64 %sub, 4
%add3 = add nsw i64 %div2, %0
br label %if.end
if.end: ; preds = %entry, %if.else
%sum.0 = phi i64 [ %add3, %if.else ], [ %div, %entry ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sum.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %M) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // int64_t
#define max(a,b) ((a) > (b) ? (a) : (b))
#define min(a,b) ((a) > (b) ? (b) : (a))
int get_int(void) {
int num;
scanf("%d", &num);
return num;
}
// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
int i;
for(i = 0; i < size; i++) {
scanf("%d", &arr[i]);
}
return 0;
}
#define NUM_MAX 100000
#define DIVISOR 1000000007
static int64_t factorial[NUM_MAX+1];
static int64_t inv_factorial[NUM_MAX+1];
struct pair {
int x;
int y;
};
struct pair gcdext(int a, int b) {
if(a==0) { return (struct pair){0, 1}; }
struct pair p = gcdext(b%a, a);
return (struct pair){p.y-(b/a)*p.x, p.x};
}
void init_combi(int ulimit) {
factorial[0] = factorial[1] = 1;
inv_factorial[0] = inv_factorial[1] = 1;
int i;
for(i = 2; i <= ulimit; i++) {
factorial[i] = (factorial[i-1] * i) % DIVISOR;
struct pair p = gcdext(i, DIVISOR);
int inv = (p.x + DIVISOR)%DIVISOR;
inv_factorial[i] = (inv_factorial[i-1] * inv) % DIVISOR;
}
return;
}
int64_t calc_combi(int n, int k) {
if(k > n) return 0;
int64_t ans = 1;
ans = (ans * factorial[n])%DIVISOR;
ans = (ans * inv_factorial[k])%DIVISOR;
ans = (ans * inv_factorial[n-k])%DIVISOR;
return ans;
}
int main(void) {
int num = get_int();
static int arr[NUM_MAX+1];
fget_array(arr, num+1);
static int idx_map[NUM_MAX+1];
memset(idx_map, 0xFF, sizeof(int)*(NUM_MAX+1));
int i;
int first = 0;
int second = 0;
for(i = 0; i < num+1; i++) {
int cur = arr[i];
if(idx_map[cur] == -1) {
idx_map[cur] = i;
} else {
first = idx_map[cur];
second = i;
break;
}
}
init_combi(num+1);
int k;
#ifdef DEBUG
printf("1st: %d 2nd: %d\n", first, second);
#endif
static int ans[NUM_MAX+2];
for(k = 1; k <= num+1; k++) {
if(k==1) {
ans[k] = num;
continue;
}
// k>=2
int64_t res = calc_combi(num+1, k);
#ifdef DEBUG
printf("%lld - %d\n", res, num-second+first);
#endif
res = (res + DIVISOR - calc_combi(num+1-1-second+first, k-1))%DIVISOR;
ans[k] = res;
}
for(k = 1; k <= num+1; k++) {
printf("%d\n", ans[k]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@factorial = internal unnamed_addr global [100001 x i64] zeroinitializer, align 16
@inv_factorial = internal unnamed_addr global [100001 x i64] zeroinitializer, align 16
@main.arr = internal global [100001 x i32] zeroinitializer, align 16
@main.idx_map = internal unnamed_addr global [100001 x i32] zeroinitializer, align 16
@main.ans = internal unnamed_addr global [100002 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_int() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #7
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fget_array(ptr noundef %arr, i32 noundef %size) local_unnamed_addr #0 {
entry:
%cmp3 = icmp sgt i32 %size, 0
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %size to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
ret i32 0
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @gcdext(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%cmp = icmp eq i32 %a, 0
br i1 %cmp, label %common.ret11, label %if.end
common.ret11: ; preds = %entry, %if.end
%common.ret11.op = phi i64 [ %2, %if.end ], [ 4294967296, %entry ]
ret i64 %common.ret11.op
if.end: ; preds = %entry
%rem = srem i32 %b, %a
%call = tail call i64 @gcdext(i32 noundef %rem, i32 noundef %a)
%p.sroa.0.0.extract.trunc = trunc i64 %call to i32
%p.sroa.5.0.extract.shift = lshr i64 %call, 32
%p.sroa.5.0.extract.trunc = trunc i64 %p.sroa.5.0.extract.shift to i32
%div = sdiv i32 %b, %a
%mul = mul nsw i32 %div, %p.sroa.0.0.extract.trunc
%sub = sub nsw i32 %p.sroa.5.0.extract.trunc, %mul
%0 = shl i64 %call, 32
%1 = zext i32 %sub to i64
%2 = or i64 %0, %1
br label %common.ret11
}
; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @init_combi(i32 noundef %ulimit) local_unnamed_addr #4 {
entry:
store i64 1, ptr getelementptr inbounds ([100001 x i64], ptr @factorial, i64 0, i64 1), align 8, !tbaa !11
store i64 1, ptr @factorial, align 16, !tbaa !11
store i64 1, ptr getelementptr inbounds ([100001 x i64], ptr @inv_factorial, i64 0, i64 1), align 8, !tbaa !11
store i64 1, ptr @inv_factorial, align 16, !tbaa !11
%cmp.not19 = icmp slt i32 %ulimit, 2
br i1 %cmp.not19, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = add nuw i32 %ulimit, 1
%wide.trip.count = zext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%1 = phi i64 [ 1, %for.body.preheader ], [ %rem9, %for.body ]
%2 = phi i64 [ 1, %for.body.preheader ], [ %rem, %for.body ]
%indvars.iv = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%mul = mul nsw i64 %2, %indvars.iv
%rem = srem i64 %mul, 1000000007
%arrayidx2 = getelementptr inbounds [100001 x i64], ptr @factorial, i64 0, i64 %indvars.iv
store i64 %rem, ptr %arrayidx2, align 8, !tbaa !11
%3 = trunc i64 %indvars.iv to i32
%call = tail call i64 @gcdext(i32 noundef %3, i32 noundef 1000000007)
%p.sroa.0.0.extract.trunc = trunc i64 %call to i32
%add = add nsw i32 %p.sroa.0.0.extract.trunc, 1000000007
%rem3 = srem i32 %add, 1000000007
%conv7 = sext i32 %rem3 to i64
%mul8 = mul nsw i64 %1, %conv7
%rem9 = srem i64 %mul8, 1000000007
%arrayidx11 = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %indvars.iv
store i64 %rem9, ptr %arrayidx11, align 8, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @calc_combi(i32 noundef %n, i32 noundef %k) local_unnamed_addr #5 {
entry:
%cmp = icmp sgt i32 %k, %n
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds [100001 x i64], ptr @factorial, i64 0, i64 %idxprom
%0 = load i64, ptr %arrayidx, align 8, !tbaa !11
%rem = srem i64 %0, 1000000007
%idxprom1 = sext i32 %k to i64
%arrayidx2 = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %idxprom1
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !11
%mul3 = mul nsw i64 %rem, %1
%rem4 = srem i64 %mul3, 1000000007
%sub = sub nsw i32 %n, %k
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %idxprom5
%2 = load i64, ptr %arrayidx6, align 8, !tbaa !11
%mul7 = mul nsw i64 %rem4, %2
%rem8 = srem i64 %mul7, 1000000007
br label %return
return: ; preds = %entry, %if.end
%retval.0 = phi i64 [ %rem8, %if.end ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num.i) #7
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num.i)
%0 = load i32, ptr %num.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num.i) #7
%add = add i32 %0, 1
%cmp3.i = icmp sgt i32 %0, -1
br i1 %cmp3.i, label %for.body.preheader.i, label %fget_array.exit.thread
fget_array.exit.thread: ; preds = %entry
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @main.idx_map, i8 -1, i64 400004, i1 false)
br label %init_combi.exit.thread
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %add to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr @main.arr, i64 %indvars.iv.i
%call.i73 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.i)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %fget_array.exit, label %for.body.i, !llvm.loop !9
fget_array.exit: ; preds = %for.body.i
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) @main.idx_map, i8 -1, i64 400004, i1 false)
%cmp.not106 = icmp slt i32 %0, 0
br i1 %cmp.not106, label %init_combi.exit.thread, label %for.body.preheader
for.body.preheader: ; preds = %fget_array.exit
%wide.trip.count = zext i32 %add to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr @main.arr, i64 0, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom3 = sext i32 %1 to i64
%arrayidx4 = getelementptr inbounds [100001 x i32], ptr @main.idx_map, i64 0, i64 %idxprom3
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %2, -1
%3 = trunc i64 %indvars.iv to i32
br i1 %cmp5, label %for.inc, label %for.end
for.inc: ; preds = %for.body
store i32 %3, ptr %arrayidx4, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
init_combi.exit.thread: ; preds = %fget_array.exit, %fget_array.exit.thread
store i64 1, ptr getelementptr inbounds ([100001 x i64], ptr @factorial, i64 0, i64 1), align 8, !tbaa !11
store i64 1, ptr @factorial, align 16, !tbaa !11
store i64 1, ptr getelementptr inbounds ([100001 x i64], ptr @inv_factorial, i64 0, i64 1), align 8, !tbaa !11
store i64 1, ptr @inv_factorial, align 16, !tbaa !11
br label %for.end44
for.end: ; preds = %for.inc, %for.body
%first.2 = phi i32 [ 0, %for.inc ], [ %2, %for.body ]
%second.2 = phi i32 [ 0, %for.inc ], [ %3, %for.body ]
store i64 1, ptr getelementptr inbounds ([100001 x i64], ptr @factorial, i64 0, i64 1), align 8, !tbaa !11
store i64 1, ptr @factorial, align 16, !tbaa !11
store i64 1, ptr getelementptr inbounds ([100001 x i64], ptr @inv_factorial, i64 0, i64 1), align 8, !tbaa !11
store i64 1, ptr @inv_factorial, align 16, !tbaa !11
%cmp.not19.i = icmp slt i32 %0, 1
br i1 %cmp.not19.i, label %init_combi.exit, label %for.body.preheader.i74
for.body.preheader.i74: ; preds = %for.end
%4 = add nuw i32 %0, 2
%wide.trip.count.i75 = zext i32 %4 to i64
br label %for.body.i76
for.body.i76: ; preds = %for.body.i76, %for.body.preheader.i74
%5 = phi i64 [ 1, %for.body.preheader.i74 ], [ %rem9.i, %for.body.i76 ]
%6 = phi i64 [ 1, %for.body.preheader.i74 ], [ %rem.i, %for.body.i76 ]
%indvars.iv.i77 = phi i64 [ 2, %for.body.preheader.i74 ], [ %indvars.iv.next.i79, %for.body.i76 ]
%mul.i = mul nsw i64 %indvars.iv.i77, %6
%rem.i = srem i64 %mul.i, 1000000007
%arrayidx2.i = getelementptr inbounds [100001 x i64], ptr @factorial, i64 0, i64 %indvars.iv.i77
store i64 %rem.i, ptr %arrayidx2.i, align 8, !tbaa !11
%7 = trunc i64 %indvars.iv.i77 to i32
%call.i78 = call i64 @gcdext(i32 noundef %7, i32 noundef 1000000007)
%p.sroa.0.0.extract.trunc.i = trunc i64 %call.i78 to i32
%add.i = add nsw i32 %p.sroa.0.0.extract.trunc.i, 1000000007
%rem3.i = srem i32 %add.i, 1000000007
%conv7.i = sext i32 %rem3.i to i64
%mul8.i = mul nsw i64 %5, %conv7.i
%rem9.i = srem i64 %mul8.i, 1000000007
%arrayidx11.i = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %indvars.iv.i77
store i64 %rem9.i, ptr %arrayidx11.i, align 8, !tbaa !11
%indvars.iv.next.i79 = add nuw nsw i64 %indvars.iv.i77, 1
%exitcond.not.i80 = icmp eq i64 %indvars.iv.next.i79, %wide.trip.count.i75
br i1 %exitcond.not.i80, label %init_combi.exit, label %for.body.i76, !llvm.loop !13
init_combi.exit: ; preds = %for.body.i76, %for.end
br i1 %cmp.not106, label %for.end44, label %for.inc31.peel
for.inc31.peel: ; preds = %init_combi.exit
%idxprom.i = sext i32 %add to i64
%sub24 = sub nsw i32 %0, %second.2
%add25 = add nsw i32 %sub24, %first.2
%idxprom.i86 = sext i32 %add25 to i64
%arrayidx.i87 = getelementptr inbounds [100001 x i64], ptr @factorial, i64 0, i64 %idxprom.i86
%8 = add nuw i32 %0, 2
%wide.trip.count122 = zext i32 %8 to i64
store i32 %0, ptr getelementptr inbounds ([100002 x i32], ptr @main.ans, i64 0, i64 1), align 4, !tbaa !5
%exitcond123.peel = icmp eq i32 %0, 0
br i1 %exitcond123.peel, label %for.body38.preheader, label %for.body14.peel.next
for.body14.peel.next: ; preds = %for.inc31.peel
%arrayidx.i81 = getelementptr inbounds [100001 x i64], ptr @factorial, i64 0, i64 %idxprom.i
%9 = load i64, ptr %arrayidx.i81, align 8, !tbaa !11
%rem.i82 = srem i64 %9, 1000000007
br label %calc_combi.exit
for.cond34.preheader: ; preds = %for.inc31
br i1 %cmp.not106, label %for.end44, label %for.body38.preheader
for.body38.preheader: ; preds = %for.inc31.peel, %for.cond34.preheader
%10 = add i32 %0, 2
%wide.trip.count128 = zext i32 %10 to i64
br label %for.body38
calc_combi.exit: ; preds = %for.inc31, %for.body14.peel.next
%indvars.iv116 = phi i64 [ 2, %for.body14.peel.next ], [ %indvars.iv.next117, %for.inc31 ]
%arrayidx2.i83 = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %indvars.iv116
%11 = load i64, ptr %arrayidx2.i83, align 8, !tbaa !11
%mul3.i = mul nsw i64 %rem.i82, %11
%rem4.i = srem i64 %mul3.i, 1000000007
%12 = sub nsw i64 %idxprom.i, %indvars.iv116
%arrayidx6.i = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %12
%13 = load i64, ptr %arrayidx6.i, align 8, !tbaa !11
%mul7.i = mul nsw i64 %rem4.i, %13
%rem8.i = srem i64 %mul7.i, 1000000007
%add22 = add nsw i64 %rem8.i, 1000000007
%14 = add nsw i64 %indvars.iv116, -1
%cmp.i84 = icmp sgt i64 %14, %idxprom.i86
br i1 %cmp.i84, label %for.inc31, label %if.end.i85
if.end.i85: ; preds = %calc_combi.exit
%15 = load i64, ptr %arrayidx.i87, align 8, !tbaa !11
%rem.i88 = srem i64 %15, 1000000007
%arrayidx2.i90 = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %14
%16 = load i64, ptr %arrayidx2.i90, align 8, !tbaa !11
%mul3.i91 = mul nsw i64 %rem.i88, %16
%rem4.i92 = srem i64 %mul3.i91, 1000000007
%17 = sub nsw i64 %idxprom.i86, %14
%arrayidx6.i95 = getelementptr inbounds [100001 x i64], ptr @inv_factorial, i64 0, i64 %17
%18 = load i64, ptr %arrayidx6.i95, align 8, !tbaa !11
%mul7.i96 = mul nsw i64 %rem4.i92, %18
%rem8.i97 = srem i64 %mul7.i96, 1000000007
br label %for.inc31
for.inc31: ; preds = %if.end.i85, %calc_combi.exit
%retval.0.i98 = phi i64 [ %rem8.i97, %if.end.i85 ], [ 0, %calc_combi.exit ]
%sub28 = sub nsw i64 %add22, %retval.0.i98
%rem = srem i64 %sub28, 1000000007
%conv = trunc i64 %rem to i32
%arrayidx30 = getelementptr inbounds [100002 x i32], ptr @main.ans, i64 0, i64 %indvars.iv116
store i32 %conv, ptr %arrayidx30, align 4, !tbaa !5
%indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
%exitcond123 = icmp eq i64 %indvars.iv.next117, %wide.trip.count122
br i1 %exitcond123, label %for.cond34.preheader, label %calc_combi.exit, !llvm.loop !15
for.body38: ; preds = %for.body38.preheader, %for.body38
%indvars.iv125 = phi i64 [ 1, %for.body38.preheader ], [ %indvars.iv.next126, %for.body38 ]
%arrayidx40 = getelementptr inbounds [100002 x i32], ptr @main.ans, i64 0, i64 %indvars.iv125
%19 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19)
%indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
%exitcond129 = icmp eq i64 %indvars.iv.next126, %wide.trip.count128
br i1 %exitcond129, label %for.end44, label %for.body38, !llvm.loop !17
for.end44: ; preds = %for.body38, %init_combi.exit, %init_combi.exit.thread, %for.cond34.preheader
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
; 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 nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main(){
int p, c, b, e, h, g, i, sc;
scanf("%d %d %d %d %d %d", &p, &c, &b, &e, &h, &g);
for(i=0;i<100;i++){
if(i == p){
sc = c + b + e;
break;
}else if(i == c){
sc = p + b + e;
break;
}else if(i == b){
sc = p + c + e;
break;
}else if(i == e){
sc = p + c + b;
break;
}
}
if(h > g)
printf("%d\n", sc + h);
else if(h <= g)
printf("%d\n", sc + g);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%p = alloca i32, align 4
%c = alloca i32, align 4
%b = alloca i32, align 4
%e = alloca i32, align 4
%h = alloca i32, align 4
%g = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %g) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p, ptr noundef nonnull %c, ptr noundef nonnull %b, ptr noundef nonnull %e, ptr noundef nonnull %h, ptr noundef nonnull %g)
%0 = load i32, ptr %p, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4
%2 = freeze i32 %1
%3 = load i32, ptr %b, align 4
%4 = freeze i32 %3
%5 = load i32, ptr %e, align 4
%.fr = freeze i32 %5
%umin = call i32 @llvm.umin.i32(i32 %.fr, i32 %4)
%umin50 = call i32 @llvm.umin.i32(i32 %umin, i32 %2)
%umin51 = call i32 @llvm.umin.i32(i32 %umin50, i32 %0)
%umin52 = call i32 @llvm.umin.i32(i32 %umin51, i32 99)
%6 = icmp eq i32 %0, %umin52
%7 = icmp eq i32 %2, %umin52
%8 = icmp eq i32 %4, %umin52
%9 = icmp eq i32 %.fr, %umin52
%.not = icmp ugt i32 %umin51, 98
br label %for.body
for.cond: ; preds = %if.else12
br i1 %.not, label %for.end, label %for.body, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
br i1 %6, label %if.then, label %if.else
if.then: ; preds = %for.body
%add = add nsw i32 %4, %2
%add2 = add nsw i32 %add, %.fr
br label %for.end
if.else: ; preds = %for.body
br i1 %7, label %if.then4, label %if.else7
if.then4: ; preds = %if.else
%add5 = add nsw i32 %4, %0
%add6 = add nsw i32 %add5, %.fr
br label %for.end
if.else7: ; preds = %if.else
br i1 %8, label %if.then9, label %if.else12
if.then9: ; preds = %if.else7
%add10 = add nsw i32 %2, %0
%add11 = add nsw i32 %add10, %.fr
br label %for.end
if.else12: ; preds = %if.else7
br i1 %9, label %if.then14, label %for.cond
if.then14: ; preds = %if.else12
%add15 = add nsw i32 %2, %0
%add16 = add nsw i32 %add15, %4
br label %for.end
for.end: ; preds = %for.cond, %if.then14, %if.then9, %if.then4, %if.then
%sc.0 = phi i32 [ %add2, %if.then ], [ %add6, %if.then4 ], [ %add11, %if.then9 ], [ %add16, %if.then14 ], [ undef, %for.cond ]
%10 = load i32, ptr %h, align 4, !tbaa !5
%11 = load i32, ptr %g, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %10, i32 %11)
%add27 = add nsw i32 %., %sc.0
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add27)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main(){
char s1[70],s2[70],s3[70],na[1000][70],s[71];
int st[1010],n,m,i,j,r,p[1010]={-1};
while(scanf("%d %d",&n,&m),n||m){
scanf("\n");
st[0]=-1;
for(j=0;j<n;j++){
fgets(s,71,stdin);
for(i=0;s[i]==' ';i++);
st[i+1]=j;
p[j]=st[i];//printf("%s\n",s+i);
for(r=0;s[i]-10;i++)na[j][r++]=s[i];
na[j][r]=0;
}//printf("a\n");
//for(i=0;i<n;i++)printf("%d\n",p[i]);
while(m--){
scanf("%s %*s %*s %s %*s %s",s1,s2,s3);//printf("%s\n",s3);
s3[strlen(s3)-1]=0;
for(i=0;strcmp(na[i],s1);i++);//printf("%d\n",i);
for(j=0;strcmp(na[j],s3);j++);//printf("%d\n",j);
if(s2[0]=='c'){
if(j==p[i])printf("True\n");
else printf("False\n");
}
if(s2[0]=='a'){
for(;j+1;j=p[j]){
if(i==j)break;
}
if(i==j)printf("True\n");
else printf("False\n");
}
if(s2[0]=='s'){
if(p[i]==p[j])printf("True\n");
else printf("False\n");
}
if(s2[0]=='p'){
if(i==p[j])printf("True\n");
else printf("False\n");
}
if(s2[0]=='d'){
for(;i+1;i=p[i]){
if(i==j)break;
}
if(i==j)printf("True\n");
else printf("False\n");
}
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170449/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170449/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [21 x i8] c"%s %*s %*s %s %*s %s\00", align 1
@str.12 = private unnamed_addr constant [6 x i8] c"False\00", align 1
@str.13 = private unnamed_addr constant [5 x i8] c"True\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [70 x i8], align 16
%s2 = alloca [70 x i8], align 16
%s3 = alloca [70 x i8], align 16
%na = alloca [1000 x [70 x i8]], align 16
%s = alloca [71 x i8], align 16
%st = alloca [1010 x i32], align 16
%n = alloca i32, align 4
%m = alloca i32, align 4
%p = alloca [1010 x i32], align 16
call void @llvm.lifetime.start.p0(i64 70, ptr nonnull %s1) #6
call void @llvm.lifetime.start.p0(i64 70, ptr nonnull %s2) #6
call void @llvm.lifetime.start.p0(i64 70, ptr nonnull %s3) #6
call void @llvm.lifetime.start.p0(i64 70000, ptr nonnull %na) #6
call void @llvm.lifetime.start.p0(i64 71, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %st) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4040, ptr nonnull %p) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4040) %p, i8 0, i64 4040, i1 false)
store i32 -1, ptr %p, align 16
%call228 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%tobool229 = icmp ne i32 %0, 0
%1 = load i32, ptr %m, align 4
%tobool1230 = icmp ne i32 %1, 0
%2 = select i1 %tobool229, i1 true, i1 %tobool1230
br i1 %2, label %while.body, label %while.end166
while.body: ; preds = %entry, %while.end
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1)
store i32 -1, ptr %st, align 16, !tbaa !5
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp217 = icmp sgt i32 %3, 0
br i1 %cmp217, label %for.body, label %while.cond38.preheader
while.cond38.preheader: ; preds = %for.end30, %while.body
%4 = load i32, ptr %m, align 4, !tbaa !5
%dec226 = add nsw i32 %4, -1
store i32 %dec226, ptr %m, align 4, !tbaa !5
%tobool39.not227 = icmp eq i32 %4, 0
br i1 %tobool39.not227, label %while.end, label %while.body40
for.body: ; preds = %while.body, %for.end30
%indvars.iv238 = phi i64 [ %indvars.iv.next239, %for.end30 ], [ 0, %while.body ]
%5 = load ptr, ptr @stdin, align 8, !tbaa !9
%call3 = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 71, ptr noundef %5)
br label %for.cond4
for.cond4: ; preds = %for.cond4, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond4 ], [ 0, %for.body ]
%arrayidx5 = getelementptr inbounds [71 x i8], ptr %s, i64 0, i64 %indvars.iv
%6 = load i8, ptr %arrayidx5, align 1, !tbaa !11
%cmp6 = icmp eq i8 %6, 32
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %cmp6, label %for.cond4, label %for.end, !llvm.loop !12
for.end: ; preds = %for.cond4
%add = add i64 %indvars.iv, 1
%idxprom9 = and i64 %add, 4294967295
%arrayidx10 = getelementptr inbounds [1010 x i32], ptr %st, i64 0, i64 %idxprom9
%7 = trunc i64 %indvars.iv238 to i32
store i32 %7, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx12 = getelementptr inbounds [1010 x i32], ptr %st, i64 0, i64 %indvars.iv
%8 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %indvars.iv238
store i32 %8, ptr %arrayidx14, align 4, !tbaa !5
%idxprom16212 = and i64 %indvars.iv, 4294967295
%arrayidx17213 = getelementptr inbounds [71 x i8], ptr %s, i64 0, i64 %idxprom16212
%9 = load i8, ptr %arrayidx17213, align 1, !tbaa !11
%tobool19.not214 = icmp eq i8 %9, 10
br i1 %tobool19.not214, label %for.end30, label %for.body20
for.body20: ; preds = %for.end, %for.body20
%indvars.iv236 = phi i64 [ %indvars.iv.next237, %for.body20 ], [ %indvars.iv, %for.end ]
%indvars.iv234 = phi i64 [ %indvars.iv.next235, %for.body20 ], [ 0, %for.end ]
%10 = phi i8 [ %11, %for.body20 ], [ %9, %for.end ]
%indvars.iv.next235 = add nuw i64 %indvars.iv234, 1
%arrayidx27 = getelementptr inbounds [1000 x [70 x i8]], ptr %na, i64 0, i64 %indvars.iv238, i64 %indvars.iv234
store i8 %10, ptr %arrayidx27, align 1, !tbaa !11
%indvars.iv.next237 = add nuw i64 %indvars.iv236, 1
%arrayidx17 = getelementptr inbounds [71 x i8], ptr %s, i64 0, i64 %indvars.iv.next237
%11 = load i8, ptr %arrayidx17, align 1, !tbaa !11
%tobool19.not = icmp eq i8 %11, 10
br i1 %tobool19.not, label %for.end30, label %for.body20, !llvm.loop !14
for.end30: ; preds = %for.body20, %for.end
%r.0.lcssa = phi i64 [ 0, %for.end ], [ %indvars.iv.next235, %for.body20 ]
%idxprom33 = and i64 %r.0.lcssa, 4294967295
%arrayidx34 = getelementptr inbounds [1000 x [70 x i8]], ptr %na, i64 0, i64 %indvars.iv238, i64 %idxprom33
store i8 0, ptr %arrayidx34, align 1, !tbaa !11
%indvars.iv.next239 = add nuw nsw i64 %indvars.iv238, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp = icmp slt i64 %indvars.iv.next239, %13
br i1 %cmp, label %for.body, label %while.cond38.preheader, !llvm.loop !15
while.body40: ; preds = %while.cond38.preheader, %if.end164
%call44 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s1, ptr noundef nonnull %s2, ptr noundef nonnull %s3)
%call46 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s3) #7
%sub47 = add i64 %call46, -1
%arrayidx48 = getelementptr inbounds [70 x i8], ptr %s3, i64 0, i64 %sub47
store i8 0, ptr %arrayidx48, align 1, !tbaa !11
br label %for.cond49
for.cond49: ; preds = %for.cond49, %while.body40
%indvars.iv241 = phi i64 [ %indvars.iv.next242, %for.cond49 ], [ 0, %while.body40 ]
%arrayidx51 = getelementptr inbounds [1000 x [70 x i8]], ptr %na, i64 0, i64 %indvars.iv241
%call54 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx51, ptr noundef nonnull dereferenceable(1) %s1) #7
%tobool55.not = icmp eq i32 %call54, 0
%indvars.iv.next242 = add nuw i64 %indvars.iv241, 1
br i1 %tobool55.not, label %for.cond60, label %for.cond49, !llvm.loop !16
for.cond60: ; preds = %for.cond49, %for.cond60
%indvars.iv244 = phi i64 [ %indvars.iv.next245, %for.cond60 ], [ 0, %for.cond49 ]
%arrayidx62 = getelementptr inbounds [1000 x [70 x i8]], ptr %na, i64 0, i64 %indvars.iv244
%call65 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %arrayidx62, ptr noundef nonnull dereferenceable(1) %s3) #7
%tobool66.not = icmp eq i32 %call65, 0
%indvars.iv.next245 = add nuw i64 %indvars.iv244, 1
br i1 %tobool66.not, label %for.end70, label %for.cond60, !llvm.loop !17
for.end70: ; preds = %for.cond60
%14 = trunc i64 %indvars.iv241 to i32
%15 = trunc i64 %indvars.iv244 to i32
%16 = load i8, ptr %s2, align 16, !tbaa !11
%cmp73 = icmp eq i8 %16, 99
br i1 %cmp73, label %if.then, label %if.end82
if.then: ; preds = %for.end70
%arrayidx76 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %indvars.iv241
%17 = load i32, ptr %arrayidx76, align 4, !tbaa !5
%cmp77 = icmp eq i32 %17, %15
%str.5.str = select i1 %cmp77, ptr @str.13, ptr @str.12
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.str)
%.pr = load i8, ptr %s2, align 16, !tbaa !11
br label %if.end82
if.end82: ; preds = %if.then, %for.end70
%18 = phi i8 [ %.pr, %if.then ], [ %16, %for.end70 ]
%cmp85 = icmp eq i8 %18, 97
br i1 %cmp85, label %for.cond88.preheader, label %if.end107
for.cond88.preheader: ; preds = %if.end82
%cmp92219 = icmp eq i32 %14, %15
br i1 %cmp92219, label %if.end107.sink.split, label %for.inc96
for.inc96: ; preds = %for.cond88.preheader, %for.inc96
%j.2220 = phi i32 [ %19, %for.inc96 ], [ %15, %for.cond88.preheader ]
%idxprom97 = sext i32 %j.2220 to i64
%arrayidx98 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %idxprom97
%19 = load i32, ptr %arrayidx98, align 4, !tbaa !5
%tobool90.not = icmp eq i32 %19, -1
%cmp92 = icmp eq i32 %19, %14
%or.cond = or i1 %tobool90.not, %cmp92
br i1 %or.cond, label %for.end99, label %for.inc96, !llvm.loop !18
for.end99: ; preds = %for.inc96
%spec.select = select i1 %cmp92, ptr @str.13, ptr @str.12
br label %if.end107.sink.split
if.end107.sink.split: ; preds = %for.end99, %for.cond88.preheader
%str.7.sink = phi ptr [ @str.13, %for.cond88.preheader ], [ %spec.select, %for.end99 ]
%j.3.ph = phi i32 [ %14, %for.cond88.preheader ], [ %19, %for.end99 ]
%puts203 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink)
br label %if.end107
if.end107: ; preds = %if.end107.sink.split, %if.end82
%j.3 = phi i32 [ %15, %if.end82 ], [ %j.3.ph, %if.end107.sink.split ]
%20 = load i8, ptr %s2, align 16, !tbaa !11
%cmp110 = icmp eq i8 %20, 115
br i1 %cmp110, label %if.then112, label %if.end124
if.then112: ; preds = %if.end107
%arrayidx114 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %indvars.iv241
%21 = load i32, ptr %arrayidx114, align 4, !tbaa !5
%idxprom115 = sext i32 %j.3 to i64
%arrayidx116 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %idxprom115
%22 = load i32, ptr %arrayidx116, align 4, !tbaa !5
%cmp117 = icmp eq i32 %21, %22
%str.9.str.8 = select i1 %cmp117, ptr @str.13, ptr @str.12
%puts204 = call i32 @puts(ptr nonnull dereferenceable(1) %str.9.str.8)
%.pr211 = load i8, ptr %s2, align 16, !tbaa !11
br label %if.end124
if.end124: ; preds = %if.then112, %if.end107
%23 = phi i8 [ %.pr211, %if.then112 ], [ %20, %if.end107 ]
%cmp127 = icmp eq i8 %23, 112
br i1 %cmp127, label %if.then129, label %if.end139
if.then129: ; preds = %if.end124
%idxprom130 = sext i32 %j.3 to i64
%arrayidx131 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %idxprom130
%24 = load i32, ptr %arrayidx131, align 4, !tbaa !5
%cmp132 = icmp eq i32 %24, %14
%str.11.str.10 = select i1 %cmp132, ptr @str.13, ptr @str.12
%puts207 = call i32 @puts(ptr nonnull dereferenceable(1) %str.11.str.10)
br label %if.end139
if.end139: ; preds = %if.then129, %if.end124
%25 = load i8, ptr %s2, align 16, !tbaa !11
%cmp142 = icmp eq i8 %25, 100
br i1 %cmp142, label %for.cond145.preheader, label %if.end164
for.cond145.preheader: ; preds = %if.end139
%cmp149223 = icmp eq i32 %j.3, %14
br i1 %cmp149223, label %if.end164.sink.split, label %for.inc153
for.inc153: ; preds = %for.cond145.preheader, %for.inc153
%i.3224 = phi i32 [ %26, %for.inc153 ], [ %14, %for.cond145.preheader ]
%idxprom154 = sext i32 %i.3224 to i64
%arrayidx155 = getelementptr inbounds [1010 x i32], ptr %p, i64 0, i64 %idxprom154
%26 = load i32, ptr %arrayidx155, align 4, !tbaa !5
%tobool147.not = icmp eq i32 %26, -1
%cmp149 = icmp eq i32 %26, %j.3
%or.cond210 = or i1 %tobool147.not, %cmp149
br i1 %or.cond210, label %for.end156, label %for.inc153, !llvm.loop !19
for.end156: ; preds = %for.inc153
%spec.select251 = select i1 %cmp149, ptr @str.13, ptr @str.12
br label %if.end164.sink.split
if.end164.sink.split: ; preds = %for.end156, %for.cond145.preheader
%str.13.sink = phi ptr [ @str.13, %for.cond145.preheader ], [ %spec.select251, %for.end156 ]
%puts209 = call i32 @puts(ptr nonnull dereferenceable(1) %str.13.sink)
br label %if.end164
if.end164: ; preds = %if.end164.sink.split, %if.end139
%27 = load i32, ptr %m, align 4, !tbaa !5
%dec = add nsw i32 %27, -1
store i32 %dec, ptr %m, align 4, !tbaa !5
%tobool39.not = icmp eq i32 %27, 0
br i1 %tobool39.not, label %while.end, label %while.body40, !llvm.loop !20
while.end: ; preds = %if.end164, %while.cond38.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%28 = load i32, ptr %n, align 4, !tbaa !5
%tobool = icmp ne i32 %28, 0
%29 = load i32, ptr %m, align 4
%tobool1 = icmp ne i32 %29, 0
%30 = select i1 %tobool, i1 true, i1 %tobool1
br i1 %30, label %while.body, label %while.end166, !llvm.loop !21
while.end166: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %p) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.end.p0(i64 4040, ptr nonnull %st) #6
call void @llvm.lifetime.end.p0(i64 71, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 70000, ptr nonnull %na) #6
call void @llvm.lifetime.end.p0(i64 70, ptr nonnull %s3) #6
call void @llvm.lifetime.end.p0(i64 70, ptr nonnull %s2) #6
call void @llvm.lifetime.end.p0(i64 70, ptr nonnull %s1) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
|
#include <stdio.h>
#define N 200000
int main() {
static char s[N + 1];
int n, k, i;
scanf("%d%d%s", &n, &k, s);
if (n == 1 && k > 0)
s[0] = '0', k--;
else if (n > 1)
for (i = 0; i < n; i++)
if (i == 0 && s[i] != '1' && k > 0)
s[i] = '1', k--;
else if (i > 0 && s[i] != '0' && k > 0)
s[i] = '0', k--;
printf("%s\n", s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1705/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1705/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@main.s = internal global [200001 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [7 x i8] c"%d%d%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull @main.s)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
%1 = load i32, ptr %k, align 4
%cmp1 = icmp sgt i32 %1, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %entry
store i8 48, ptr @main.s, align 16, !tbaa !9
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %k, align 4, !tbaa !5
br label %if.end34
if.else: ; preds = %entry
%cmp2 = icmp sgt i32 %0, 1
br i1 %cmp2, label %land.lhs.true6.peel, label %if.end34
land.lhs.true6.peel: ; preds = %if.else
%wide.trip.count = zext i32 %0 to i64
%main.s.promoted = load i8, ptr @main.s, align 16, !tbaa !9
%cmp7.peel = icmp ne i8 %main.s.promoted, 49
%or.cond36.peel = select i1 %cmp7.peel, i1 %cmp1, i1 false
br i1 %or.cond36.peel, label %if.then12.peel, label %land.lhs.true19.preheader
if.then12.peel: ; preds = %land.lhs.true6.peel
store i8 49, ptr @main.s, align 16, !tbaa !9
%dec15.peel = add nsw i32 %1, -1
store i32 %dec15.peel, ptr %k, align 4, !tbaa !5
br label %land.lhs.true19.preheader
land.lhs.true19.preheader: ; preds = %land.lhs.true6.peel, %if.then12.peel
%.ph = phi i32 [ %dec15.peel, %if.then12.peel ], [ %1, %land.lhs.true6.peel ]
%2 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %2, 1
%3 = icmp eq i32 %0, 2
br i1 %3, label %if.end34.loopexit.unr-lcssa, label %land.lhs.true19.preheader.new
land.lhs.true19.preheader.new: ; preds = %land.lhs.true19.preheader
%unroll_iter = and i64 %2, -2
br label %land.lhs.true19
land.lhs.true19: ; preds = %for.inc.1, %land.lhs.true19.preheader.new
%indvars.iv = phi i64 [ 1, %land.lhs.true19.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%4 = phi i32 [ %.ph, %land.lhs.true19.preheader.new ], [ %8, %for.inc.1 ]
%niter = phi i64 [ 0, %land.lhs.true19.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx21 = getelementptr inbounds [200001 x i8], ptr @main.s, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx21, align 1, !tbaa !9
%cmp23 = icmp ne i8 %5, 48
%cmp26 = icmp sgt i32 %4, 0
%or.cond37 = select i1 %cmp23, i1 %cmp26, i1 false
br i1 %or.cond37, label %if.then28, label %for.inc
if.then28: ; preds = %land.lhs.true19
store i8 48, ptr %arrayidx21, align 1, !tbaa !9
%dec31 = add nsw i32 %4, -1
store i32 %dec31, ptr %k, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then28, %land.lhs.true19
%6 = phi i32 [ %dec31, %if.then28 ], [ %4, %land.lhs.true19 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx21.1 = getelementptr inbounds [200001 x i8], ptr @main.s, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx21.1, align 1, !tbaa !9
%cmp23.1 = icmp ne i8 %7, 48
%cmp26.1 = icmp sgt i32 %6, 0
%or.cond37.1 = select i1 %cmp23.1, i1 %cmp26.1, i1 false
br i1 %or.cond37.1, label %if.then28.1, label %for.inc.1
if.then28.1: ; preds = %for.inc
store i8 48, ptr %arrayidx21.1, align 1, !tbaa !9
%dec31.1 = add nsw i32 %6, -1
store i32 %dec31.1, ptr %k, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then28.1, %for.inc
%8 = phi i32 [ %dec31.1, %if.then28.1 ], [ %6, %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 %if.end34.loopexit.unr-lcssa, label %land.lhs.true19, !llvm.loop !10
if.end34.loopexit.unr-lcssa: ; preds = %for.inc.1, %land.lhs.true19.preheader
%indvars.iv.unr = phi i64 [ 1, %land.lhs.true19.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%.unr = phi i32 [ %.ph, %land.lhs.true19.preheader ], [ %8, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end34, label %land.lhs.true19.epil
land.lhs.true19.epil: ; preds = %if.end34.loopexit.unr-lcssa
%arrayidx21.epil = getelementptr inbounds [200001 x i8], ptr @main.s, i64 0, i64 %indvars.iv.unr
%9 = load i8, ptr %arrayidx21.epil, align 1, !tbaa !9
%cmp23.epil = icmp ne i8 %9, 48
%cmp26.epil = icmp sgt i32 %.unr, 0
%or.cond37.epil = select i1 %cmp23.epil, i1 %cmp26.epil, i1 false
br i1 %or.cond37.epil, label %if.then28.epil, label %if.end34
if.then28.epil: ; preds = %land.lhs.true19.epil
store i8 48, ptr %arrayidx21.epil, align 1, !tbaa !9
%dec31.epil = add nsw i32 %.unr, -1
store i32 %dec31.epil, ptr %k, align 4, !tbaa !5
br label %if.end34
if.end34: ; preds = %if.end34.loopexit.unr-lcssa, %if.then28.epil, %land.lhs.true19.epil, %if.else, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @main.s)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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, !12}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#define Num 100000
int a[Num];
int search(int c){
if(c == a[c])
return c;
return a[c] = search(a[c]);
}
int main(){
int i,x,y,n,m,z;
for(i=0;i<Num;i++){
a[i] = i;
}
scanf("%d %d",&x,&y);
for(i=0;i<y;i++){
scanf("%d %d", &n,&m);
if(search(n) != search(m)){
a[search(m)] = search(n);
}
}
scanf("%d",&z);
for(i=0;i<z;i++){
scanf("%d %d",&n,&m);
if(search(n) == search(m))
printf("yes\n");
else
printf("no\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@a = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = 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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @search(i32 noundef %c) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %c to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %c
br i1 %cmp, label %common.ret9, label %if.end
common.ret9: ; preds = %entry, %if.end
%common.ret9.op = phi i32 [ %call, %if.end ], [ %c, %entry ]
ret i32 %common.ret9.op
if.end: ; preds = %entry
%call = tail call i32 @search(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
br label %common.ret9
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
%n = alloca i32, align 4
%m = alloca i32, align 4
%z = alloca i32, align 4
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 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #5
br label %vector.body
vector.body: ; preds = %vector.body, %entry
%index = phi i64 [ 0, %entry ], [ %index.next.1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %entry ], [ %vec.ind.next.1, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !5
%index.next = or i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%step.add.1 = add <4 x i32> %vec.ind, <i32 12, i32 12, i32 12, i32 12>
%2 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %index.next
store <4 x i32> %vec.ind.next, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
store <4 x i32> %step.add.1, ptr %3, align 16, !tbaa !5
%index.next.1 = add nuw nsw i64 %index, 16
%vec.ind.next.1 = add <4 x i32> %vec.ind, <i32 16, i32 16, i32 16, i32 16>
%4 = icmp eq i64 %index.next.1, 100000
br i1 %4, label %for.end, label %vector.body, !llvm.loop !9
for.end: ; preds = %vector.body
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%5 = load i32, ptr %y, align 4, !tbaa !5
%cmp239 = icmp sgt i32 %5, 0
br i1 %cmp239, label %for.body3, label %for.end14
for.body3: ; preds = %for.end, %for.inc12
%i.140 = phi i32 [ %inc13, %for.inc12 ], [ 0, %for.end ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%6 = load i32, ptr %n, align 4, !tbaa !5
%call5 = call i32 @search(i32 noundef %6)
%7 = load i32, ptr %m, align 4, !tbaa !5
%call6 = call i32 @search(i32 noundef %7)
%cmp7.not = icmp eq i32 %call5, %call6
br i1 %cmp7.not, label %for.inc12, label %if.then
if.then: ; preds = %for.body3
%8 = load i32, ptr %n, align 4, !tbaa !5
%call8 = call i32 @search(i32 noundef %8)
%9 = load i32, ptr %m, align 4, !tbaa !5
%call9 = call i32 @search(i32 noundef %9)
%idxprom10 = sext i32 %call9 to i64
%arrayidx11 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom10
store i32 %call8, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc12
for.inc12: ; preds = %for.body3, %if.then
%inc13 = add nuw nsw i32 %i.140, 1
%10 = load i32, ptr %y, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc13, %10
br i1 %cmp2, label %for.body3, label %for.end14, !llvm.loop !13
for.end14: ; preds = %for.inc12, %for.end
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %z)
%11 = load i32, ptr %z, align 4, !tbaa !5
%cmp1741 = icmp sgt i32 %11, 0
br i1 %cmp1741, label %for.body18, label %for.end29
for.body18: ; preds = %for.end14, %for.body18
%i.242 = phi i32 [ %inc28, %for.body18 ], [ 0, %for.end14 ]
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%12 = load i32, ptr %n, align 4, !tbaa !5
%call20 = call i32 @search(i32 noundef %12)
%13 = load i32, ptr %m, align 4, !tbaa !5
%call21 = call i32 @search(i32 noundef %13)
%cmp22 = icmp eq i32 %call20, %call21
%str.4.str = select i1 %cmp22, ptr @str.4, ptr @str
%puts37 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
%inc28 = add nuw nsw i32 %i.242, 1
%14 = load i32, ptr %z, align 4, !tbaa !5
%cmp17 = icmp slt i32 %inc28, %14
br i1 %cmp17, label %for.body18, label %for.end29, !llvm.loop !14
for.end29: ; preds = %for.body18, %for.end14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #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
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 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int unionfind[100000];
void unionfind_init(int n)
{
for(int i = 0; i < n; ++i) { unionfind[i] = i; }
}
int unionfind_root(int x)
{
if(x != unionfind[x])
{
unionfind[x] = unionfind_root(unionfind[x]);
}
return unionfind[x];
}
void unionfind_merge(int s, int t)
{
unionfind[unionfind_root(s)] = unionfind_root(t);
}
int unionfind_query(int s, int t)
{
return unionfind_root(s) == unionfind_root(t);
}
int main()
{
int n, m, q, s, t;
scanf("%d %d", &n, &m);
unionfind_init(n);
for(int i = 0; i < m; ++i)
{
scanf("%d %d", &s, &t);
unionfind_merge(s, t);
}
scanf("%d", &q);
for(int i = 0; i < q; ++i)
{
scanf("%d %d", &s, &t);
printf(unionfind_query(s, t) ? "yes\n" : "no\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170586/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170586/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@unionfind = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"yes\0A\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"no\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @unionfind_init(i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp4 = icmp sgt i32 %n, 0
br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader8, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !5
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader8
for.body.preheader8: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.preheader8, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader8 ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %indvars.iv
%3 = trunc i64 %indvars.iv to i32
store i32 %3, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @unionfind_root(i32 noundef %x) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %x
br i1 %cmp.not, label %common.ret, label %if.then
common.ret: ; preds = %entry, %if.then
%common.ret.op = phi i32 [ %call, %if.then ], [ %x, %entry ]
ret i32 %common.ret.op
if.then: ; preds = %entry
%call = tail call i32 @unionfind_root(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @unionfind_merge(i32 noundef %s, i32 noundef %t) local_unnamed_addr #3 {
entry:
%call = tail call i32 @unionfind_root(i32 noundef %t)
%call1 = tail call i32 @unionfind_root(i32 noundef %s)
%idxprom = sext i32 %call1 to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %idxprom
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @unionfind_query(i32 noundef %s, i32 noundef %t) local_unnamed_addr #3 {
entry:
%call = tail call i32 @unionfind_root(i32 noundef %s)
%call1 = tail call i32 @unionfind_root(i32 noundef %t)
%cmp = icmp eq i32 %call, %call1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%q = alloca i32, align 4
%s = alloca i32, align 4
%t = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
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 %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %0, 0
br i1 %cmp4.i, label %for.body.preheader.i, label %unionfind_init.exit
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph
vector.ph: ; preds = %for.body.preheader.i
%n.vec = and i64 %wide.trip.count.i, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%1 = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> %step.add, ptr %2, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i
br i1 %cmp.n, label %unionfind_init.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ]
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %indvars.iv.i
%4 = trunc i64 %indvars.iv.i to i32
store i32 %4, ptr %arrayidx.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %unionfind_init.exit, label %for.body.i, !llvm.loop !15
unionfind_init.exit: ; preds = %for.body.i, %middle.block, %entry
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %5, 0
br i1 %cmp19, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %unionfind_init.exit
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %q)
%6 = load i32, ptr %q, align 4, !tbaa !5
%cmp521 = icmp sgt i32 %6, 0
br i1 %cmp521, label %for.body7, label %for.cond.cleanup6
for.body: ; preds = %unionfind_init.exit, %for.body
%i.020 = phi i32 [ %inc, %for.body ], [ 0, %unionfind_init.exit ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%7 = load i32, ptr %s, align 4, !tbaa !5
%8 = load i32, ptr %t, align 4, !tbaa !5
%call.i = call i32 @unionfind_root(i32 noundef %8)
%call1.i = call i32 @unionfind_root(i32 noundef %7)
%idxprom.i = sext i32 %call1.i to i64
%arrayidx.i16 = getelementptr inbounds [100000 x i32], ptr @unionfind, i64 0, i64 %idxprom.i
store i32 %call.i, ptr %arrayidx.i16, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.020, 1
%9 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %9
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !16
for.cond.cleanup6: ; preds = %for.body7, %for.cond.cleanup
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.body7: ; preds = %for.cond.cleanup, %for.body7
%i3.022 = phi i32 [ %inc12, %for.body7 ], [ 0, %for.cond.cleanup ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%10 = load i32, ptr %s, align 4, !tbaa !5
%11 = load i32, ptr %t, align 4, !tbaa !5
%call.i17 = call i32 @unionfind_root(i32 noundef %10)
%call1.i18 = call i32 @unionfind_root(i32 noundef %11)
%cmp.i.not = icmp eq i32 %call.i17, %call1.i18
%cond = select i1 %cmp.i.not, ptr @.str.2, ptr @.str.3
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
%inc12 = add nuw nsw i32 %i3.022, 1
%12 = load i32, ptr %q, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc12, %12
br i1 %cmp5, label %for.body7, label %for.cond.cleanup6, !llvm.loop !17
}
; 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
attributes #0 = { nofree norecurse nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main(){
int unused __attribute__((unused));
int a, b, c, min = 100000000;
unused = scanf("%d %d %d", &a, &b, &c);
if(min > a+b) min = a+b;
if(min > a+c) min = a+c;
if(min > b+c) min = b+c;
printf("%d", min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%add2 = add nsw i32 %2, %0
%spec.select = call i32 @llvm.smin.i32(i32 %add, i32 %add2)
%add7 = add nsw i32 %2, %1
%min.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %add7)
%min.2 = call i32 @llvm.smin.i32(i32 %min.1, i32 100000000)
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
// Ver19.02
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF 1 << 29
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }
int main()
{
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
printf("%d\n", MIN(MIN(a + b, b + c), c + a));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170694/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170694/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #6
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #6
ret void
}
; 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
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #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 %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !9
%1 = load i32, ptr %b, align 4, !tbaa !9
%2 = load i32, ptr %c, align 4, !tbaa !9
%cond.v = call i32 @llvm.smin.i32(i32 %0, i32 %2)
%cond = add nsw i32 %1, %cond.v
%add4 = add nsw i32 %2, %0
%cond19 = call i32 @llvm.smin.i32(i32 %cond, i32 %add4)
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond19)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #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) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include<stdio.h>
int main(){
int a,b,c,d,e,f;
scanf("%d%d%d",&a,&b,&c);
d=a+b;
e=b+c;
f=a+c;
if(d<=e&&d<=f){
printf("%d\n",d);
}
else if(e<=d&&e<=f){
printf("%d\n",e);
}
else if(f<=d&&f<=e){
printf("%d\n",f);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170737/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170737/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%add2 = add nsw i32 %2, %0
%cmp.not = icmp sgt i32 %0, %2
%cmp3.not = icmp sgt i32 %1, %2
%or.cond = select i1 %cmp.not, i1 true, i1 %cmp3.not
br i1 %or.cond, label %if.else, label %if.then
if.then: ; preds = %entry
%add = add nsw i32 %1, %0
br label %if.end17.sink.split
if.else: ; preds = %entry
%add1 = add nsw i32 %2, %1
%cmp5.not = icmp sgt i32 %2, %0
%cmp7.not = icmp sgt i32 %1, %0
%or.cond30 = select i1 %cmp5.not, i1 true, i1 %cmp7.not
br i1 %or.cond30, label %if.else10, label %if.end17.sink.split
if.else10: ; preds = %if.else
%cmp11.not = icmp sgt i32 %2, %1
%cmp13.not = icmp sgt i32 %0, %1
%or.cond31 = or i1 %cmp13.not, %cmp11.not
br i1 %or.cond31, label %if.end17, label %if.end17.sink.split
if.end17.sink.split: ; preds = %if.else10, %if.else, %if.then
%add1.sink = phi i32 [ %add, %if.then ], [ %add1, %if.else ], [ %add2, %if.else10 ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add1.sink)
br label %if.end17
if.end17: ; preds = %if.end17.sink.split, %if.else10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int num[2];
int i,max;
scanf("%d %d %d",&num[0],&num[1],&num[2]);
max = num[0];
for(i = 1; i <= 2; i++){
if(max < num[i]){
max = num[i];
}
}
printf("%d",num[0] + num[1] + num[2] - max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca [2 x i32], align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %num) #4
%arrayidx1 = getelementptr inbounds [2 x i32], ptr %num, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [2 x i32], ptr %num, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %num, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%add = sub i32 %0, %spec.select.1
%add11 = add i32 %add, %1
%sub = add i32 %add11, %2
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
int min = a + b;
if(min > b + c) min = b + c;
if(min > a + c) min = a + c;
printf("%d\n", min);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%spec.select.v = call i32 @llvm.smin.i32(i32 %0, i32 %2)
%spec.select = add nsw i32 %spec.select.v, %1
%add3 = add nsw i32 %2, %0
%min.1 = call i32 @llvm.smin.i32(i32 %spec.select, i32 %add3)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int a, b, c;
int ans;
scanf("%d", &a);
scanf("%d", &b);
scanf("%d", &c);
int max;
max = a;
if (max < b) max = b;
if (max < c) max = c;
printf("%d", a+b+c-max);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%2 = load i32, ptr %c, align 4, !tbaa !5
%max.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %2)
%add = add nsw i32 %1, %0
%add6 = add nsw i32 %add, %2
%sub = sub i32 %add6, %max.1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,i,j,k,l,g,f,d,x,y;
scanf("%d",&n);
int a[10000];
if(n%2==0)
{
x = n/2;
printf("%d\n",x);
for(i=1;i<=x;i++)
{
printf("2 ");
}
printf("\n");
}
else
{
y = n-3;
x = y/2;
printf("%d\n",x+1);
for(i=1;i<=x;i++)
{
printf("2 ");
}
printf("3\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17091/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17091/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"2 \00", align 1
@str = private unnamed_addr constant [2 x i8] c"3\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %0, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%cmp2.not23 = icmp slt i32 %0, 2
br i1 %cmp2.not23, label %for.end, label %for.body
for.body: ; preds = %if.then, %for.body
%i.024 = phi i32 [ %inc, %for.body ], [ 1, %if.then ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%inc = add nuw nsw i32 %i.024, 1
%exitcond25.not = icmp eq i32 %i.024, %div
br i1 %exitcond25.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %if.then
%putchar = call i32 @putchar(i32 10)
br label %if.end
if.else: ; preds = %entry
%sub = add nsw i32 %0, -3
%div5 = sdiv i32 %sub, 2
%add = add nsw i32 %div5, 1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%cmp8.not21 = icmp slt i32 %0, 5
br i1 %cmp8.not21, label %for.end13, label %for.body9.preheader
for.body9.preheader: ; preds = %if.else
%smax = call i32 @llvm.smax.i32(i32 %div5, i32 1)
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.body9
%i.122 = phi i32 [ %inc12, %for.body9 ], [ 1, %for.body9.preheader ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%inc12 = add nuw nsw i32 %i.122, 1
%exitcond.not = icmp eq i32 %i.122, %smax
br i1 %exitcond.not, label %for.end13, label %for.body9, !llvm.loop !11
for.end13: ; preds = %for.body9, %if.else
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.end: ; preds = %for.end13, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
int n,b;
scanf("%d",&n);
b = n/100;
printf("ai1333");
for(int i =0; i<b; i++){
printf("3");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_170960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_170960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ai1333\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
%div = sdiv i32 %0, 100
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%cmp6 = icmp sgt i32 %0, 99
br i1 %cmp6, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%putchar5 = call i32 @putchar(i32 51)
%inc = add nuw nsw i32 %i.07, 1
%exitcond.not = icmp eq i32 %inc, %div
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int x[5],y[5], a,b,p,i;
scanf("%d %d %d %d %d %d", &x[1],&y[1],&x[2],&y[2],&x[3],&y[3]);
printf("3\n");
a = x[2] - x[1] +x[3];
b = y[2] - y[1] +y[3];
printf("%d %d\n", a,b);
a = x[2] + x[1] -x[3];
b = y[2] + y[1] -y[3];
printf("%d %d\n",a,b);
a = -x[2] + x[1] +x[3];
b = -y[2] + y[1] +y[3];
printf("%d %d\n",a,b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17101/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17101/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"3\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca [5 x i32], align 16
%y = alloca [5 x i32], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %y) #4
%arrayidx = getelementptr inbounds [5 x i32], ptr %x, i64 0, i64 1
%arrayidx1 = getelementptr inbounds [5 x i32], ptr %y, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [5 x i32], ptr %x, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [5 x i32], ptr %y, i64 0, i64 2
%arrayidx4 = getelementptr inbounds [5 x i32], ptr %x, i64 0, i64 3
%arrayidx5 = getelementptr inbounds [5 x i32], ptr %y, i64 0, i64 3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%0 = load i32, ptr %arrayidx2, align 8, !tbaa !5
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%sub = sub i32 %0, %1
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%add = add nsw i32 %sub, %2
%3 = load i32, ptr %arrayidx3, align 8, !tbaa !5
%4 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%sub12 = sub i32 %3, %4
%5 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add14 = add nsw i32 %sub12, %5
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %add14)
%6 = load i32, ptr %arrayidx2, align 8, !tbaa !5
%7 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add18 = add nsw i32 %7, %6
%8 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%sub20 = sub i32 %add18, %8
%9 = load i32, ptr %arrayidx3, align 8, !tbaa !5
%10 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%add23 = add nsw i32 %10, %9
%11 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%sub25 = sub i32 %add23, %11
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20, i32 noundef %sub25)
%12 = load i32, ptr %arrayidx2, align 8, !tbaa !5
%13 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add30 = sub i32 %13, %12
%14 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%add32 = add nsw i32 %add30, %14
%15 = load i32, ptr %arrayidx3, align 8, !tbaa !5
%16 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%add36 = sub i32 %16, %15
%17 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add38 = add nsw i32 %add36, %17
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add32, i32 noundef %add38)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind 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,day;
scanf("%d",&X);
day=X%7;
if(day==0)
puts("thu");
else if(day==1)
puts("fri");
else if(day==2)
puts("sat");
else if(day==3)
puts("sun");
else if(day==4)
puts("mon");
else if(day==5)
puts("tue");
else if(day==6)
puts("wed");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171053/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"thu\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"fri\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"sat\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"sun\00", align 1
@.str.5 = private unnamed_addr constant [4 x i8] c"mon\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c"tue\00", align 1
@.str.7 = private unnamed_addr constant [4 x i8] c"wed\00", align 1
@reltable.main = private unnamed_addr constant [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.5 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.6 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.7 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X)
%0 = load i32, ptr %X, align 4, !tbaa !5
%rem = srem i32 %0, 7
%1 = icmp ult i32 %rem, 7
br i1 %1, label %switch.lookup, label %if.end30
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %reltable.intrinsic)
br label %if.end30
if.end30: ; preds = %entry, %switch.lookup
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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int a;
scanf("%d",&a);
if(a<1200) printf("ABC");
else if(a<2800) printf("ARC");
else printf("AGC");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171097/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171097/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ABC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"AGC\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
%cmp = icmp slt i32 %0, 1200
%cmp2 = icmp ult i32 %0, 2800
%.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 n3=0;
int ans(int n){
if(n%2==0){
return n/2;
}
else{
n-=3;
n3=1;
if(n==0){
return 1;
}
else{
return 1+(n/2);
}
}
}
int main(){
int n;
scanf("%d",&n);
int k=ans(n),i;
printf("%d\n",k);
for(i=1;i<=k-n3;i++){
printf("2 ");
}
if(n3==1){
printf("3");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17114/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17114/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n3 = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"2 \00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @ans(i32 noundef %n) local_unnamed_addr #0 {
entry:
%0 = and i32 %n, 1
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %n, 2
br label %return
if.else: ; preds = %entry
%sub = add nsw i32 %n, -3
store i32 1, ptr @n3, align 4, !tbaa !5
%cmp1 = icmp eq i32 %sub, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%div4 = sdiv i32 %sub, 2
%add = add nsw i32 %div4, 1
br label %return
return: ; preds = %if.else, %if.else3, %if.then
%retval.0 = phi i32 [ %div, %if.then ], [ %add, %if.else3 ], [ 1, %if.else ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp.i = icmp eq i32 %1, 0
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %entry
%div.i = sdiv i32 %0, 2
br label %ans.exit
if.else.i: ; preds = %entry
%sub.i = add nsw i32 %0, -3
store i32 1, ptr @n3, align 4, !tbaa !5
%cmp1.i = icmp eq i32 %sub.i, 0
br i1 %cmp1.i, label %ans.exit, label %if.else3.i
if.else3.i: ; preds = %if.else.i
%div4.i = sdiv i32 %sub.i, 2
%add.i = add nsw i32 %div4.i, 1
br label %ans.exit
ans.exit: ; preds = %if.then.i, %if.else.i, %if.else3.i
%retval.0.i = phi i32 [ %div.i, %if.then.i ], [ %add.i, %if.else3.i ], [ 1, %if.else.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i)
%2 = load i32, ptr @n3, align 4, !tbaa !5
%cmp.not11.not = icmp sgt i32 %retval.0.i, %2
br i1 %cmp.not11.not, label %for.body, label %for.end
for.body: ; preds = %ans.exit, %for.body
%i.012 = phi i32 [ %inc, %for.body ], [ 1, %ans.exit ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%inc = add nuw nsw i32 %i.012, 1
%3 = load i32, ptr @n3, align 4, !tbaa !5
%sub = sub nsw i32 %retval.0.i, %3
%cmp.not.not = icmp slt i32 %i.012, %sub
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %ans.exit
%.lcssa = phi i32 [ %2, %ans.exit ], [ %3, %for.body ]
%cmp4 = icmp eq i32 %.lcssa, 1
br i1 %cmp4, label %if.then, label %if.end
if.then: ; preds = %for.end
%putchar = call i32 @putchar(i32 51)
br label %if.end
if.end: ; preds = %if.then, %for.end
%putchar9 = call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void) {
int r; scanf("%d", &r);
if( r < 1200 ) { printf("ABC\n"); }
else if( r < 2800) { printf("ARC\n"); }
else { printf("AGC\n"); }
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171183/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171183/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"AGC\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"ABC\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1200
%cmp2 = icmp ult i32 %0, 2800
%str.4.str = select i1 %cmp2, ptr @str.4, ptr @str
%str.4.sink = select i1 %cmp, ptr @str.5, ptr %str.4.str
%puts8 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #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 r;
scanf("%d",&r);
if(r<1200){
printf("ABC");
}
else if(r>=1200&&r<2800){
printf("ARC");
}
else{
printf("AGC");
}
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171226/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171226/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ABC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"AGC\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%0 = load i32, ptr %r, align 4
%cmp = icmp slt i32 %0, 1200
%cmp3 = icmp ult i32 %0, 2800
%.str.2..str.3 = select i1 %cmp3, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main()
{
int n,x,i,j;
scanf("%d",&n);
if(n%2==0)
{
printf("%d\n",n/2);
for(i=0; i<n/2; i++)
{
if(i>0) printf(" ");
printf("2");
}
}
else
{
n = n-3;
printf("%d\n",(n/2)+1);
for(i=0; i<n/2; i++)
{
if(i>0) printf(" ");
printf("2");
}
printf(" 3");
}
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17127/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17127/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c" 3\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = and i32 %0, 1
%cmp = icmp eq i32 %1, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%div = sdiv i32 %0, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp338 = icmp sgt i32 %2, 1
br i1 %cmp338, label %if.end.peel, label %if.end23
if.end.peel: ; preds = %if.then
%putchar33.peel = call i32 @putchar(i32 50)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %3, 3
br i1 %cmp3.peel, label %if.end, label %if.end23
if.end: ; preds = %if.end.peel, %if.end
%i.039 = phi i32 [ %inc, %if.end ], [ 1, %if.end.peel ]
%putchar32 = call i32 @putchar(i32 32)
%putchar33 = call i32 @putchar(i32 50)
%inc = add nuw nsw i32 %i.039, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%div2 = sdiv i32 %4, 2
%cmp3 = icmp slt i32 %inc, %div2
br i1 %cmp3, label %if.end, label %if.end23, !llvm.loop !9
if.else: ; preds = %entry
%sub = add nsw i32 %0, -3
store i32 %sub, ptr %n, align 4, !tbaa !5
%div8 = sdiv i32 %sub, 2
%add = add nsw i32 %div8, 1
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp1235 = icmp sgt i32 %5, 1
br i1 %cmp1235, label %if.end17.peel, label %for.end21
if.end17.peel: ; preds = %if.else
%putchar30.peel = call i32 @putchar(i32 50)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp12.peel = icmp sgt i32 %6, 3
br i1 %cmp12.peel, label %if.end17, label %for.end21
if.end17: ; preds = %if.end17.peel, %if.end17
%i.136 = phi i32 [ %inc20, %if.end17 ], [ 1, %if.end17.peel ]
%putchar = call i32 @putchar(i32 32)
%putchar30 = call i32 @putchar(i32 50)
%inc20 = add nuw nsw i32 %i.136, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%div11 = sdiv i32 %7, 2
%cmp12 = icmp slt i32 %inc20, %div11
br i1 %cmp12, label %if.end17, label %for.end21, !llvm.loop !12
for.end21: ; preds = %if.end17, %if.end17.peel, %if.else
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %if.end23
if.end23: ; preds = %if.end, %if.end.peel, %if.then, %for.end21
%putchar31 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10, !11}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int i,n,k,R;
scanf("%d",&R);
if(R<1200){
printf("ABC");
}else if (R<2800){
printf("ARC");
}else{
printf("AGC");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171363/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171363/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"ABC\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"ARC\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"AGC\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%R = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %R)
%0 = load i32, ptr %R, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1200
%cmp2 = icmp ult i32 %0, 2800
%.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3
%.str.2.sink = select i1 %cmp, ptr @.str.1, ptr %.str.2..str.3
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define N 5
/** Application main entry point. */
int main (
int argc,
char * argv[ ]
)
{
int i;
for ( ; ; )
{
unsigned int f = 0;
int d[ N ];
for ( i = 0; i < N; ++i )
{
scanf ( "%d", d + i );
if ( !d[ i ] ) goto BREAKK;
f |= 1 << ( d[ i ] - 1 );
}
for ( i = 0; i < 5; ++i )
{
if ( f == 0x01 || f == 0x02 || f == 0x04 || f == 0x07 )
{
puts ( "3" );
}
else
{
printf ( "%d\n", 2 - !!( f & ( 1 << ( d[ i ] % 3 ) ) ) );
}
}
}
BREAKK:
return ( 0 );
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171442/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171442/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"3\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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%d = alloca [5 x i32], align 16
%add.ptr.1 = getelementptr inbounds i32, ptr %d, i64 1
%add.ptr.2 = getelementptr inbounds i32, ptr %d, i64 2
%add.ptr.3 = getelementptr inbounds i32, ptr %d, i64 3
%add.ptr.4 = getelementptr inbounds i32, ptr %d, i64 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %d) #3
%call51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%0 = load i32, ptr %d, align 16, !tbaa !5
%tobool.not52 = icmp eq i32 %0, 0
br i1 %tobool.not52, label %cleanup27, label %if.end
for.body6.preheader: ; preds = %if.end.4
%1 = load i32, ptr %d, align 16, !tbaa !5
%rem = srem i32 %1, 3
%2 = lshr i32 %or.4, %rem
%lnot.ext = and i32 %2, 1
%sub20 = sub nuw nsw i32 2, %lnot.ext
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20)
%3 = load i32, ptr %add.ptr.1, align 4, !tbaa !5
%rem.1 = srem i32 %3, 3
%4 = lshr i32 %or.4, %rem.1
%lnot.ext.1 = and i32 %4, 1
%sub20.1 = sub nuw nsw i32 2, %lnot.ext.1
%call21.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20.1)
%5 = load i32, ptr %add.ptr.2, align 8, !tbaa !5
%rem.2 = srem i32 %5, 3
%6 = lshr i32 %or.4, %rem.2
%lnot.ext.2 = and i32 %6, 1
%sub20.2 = sub nuw nsw i32 2, %lnot.ext.2
%call21.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20.2)
%7 = load i32, ptr %add.ptr.3, align 4, !tbaa !5
%rem.3 = srem i32 %7, 3
%8 = lshr i32 %or.4, %rem.3
%lnot.ext.3 = and i32 %8, 1
%sub20.3 = sub nuw nsw i32 2, %lnot.ext.3
%call21.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20.3)
%9 = load i32, ptr %add.ptr.4, align 16, !tbaa !5
%rem.4 = srem i32 %9, 3
%10 = lshr i32 %or.4, %rem.4
%lnot.ext.4 = and i32 %10, 1
%sub20.4 = sub nuw nsw i32 2, %lnot.ext.4
%call21.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub20.4)
br label %cleanup
for.cond4.preheader.split.us: ; preds = %if.end.4, %if.end.4, %if.end.4, %if.end.4
%call14.us = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
%call14.us.1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
%call14.us.2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
%call14.us.3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
%call14.us.4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %cleanup
if.end: ; preds = %entry, %cleanup
%11 = phi i32 [ %16, %cleanup ], [ %0, %entry ]
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1)
%12 = load i32, ptr %add.ptr.1, align 4, !tbaa !5
%tobool.not.1 = icmp eq i32 %12, 0
br i1 %tobool.not.1, label %cleanup27, label %if.end.1
if.end.1: ; preds = %if.end
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2)
%13 = load i32, ptr %add.ptr.2, align 8, !tbaa !5
%tobool.not.2 = icmp eq i32 %13, 0
br i1 %tobool.not.2, label %cleanup27, label %if.end.2
if.end.2: ; preds = %if.end.1
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3)
%14 = load i32, ptr %add.ptr.3, align 4, !tbaa !5
%tobool.not.3 = icmp eq i32 %14, 0
br i1 %tobool.not.3, label %cleanup27, label %if.end.3
if.end.3: ; preds = %if.end.2
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.4)
%15 = load i32, ptr %add.ptr.4, align 16, !tbaa !5
%tobool.not.4 = icmp eq i32 %15, 0
br i1 %tobool.not.4, label %cleanup27, label %if.end.4
if.end.4: ; preds = %if.end.3
%sub.3 = add nsw i32 %14, -1
%shl.3 = shl nuw i32 1, %sub.3
%sub.2 = add nsw i32 %13, -1
%shl.2 = shl nuw i32 1, %sub.2
%sub.1 = add nsw i32 %12, -1
%shl.1 = shl nuw i32 1, %sub.1
%sub = add nsw i32 %11, -1
%shl = shl nuw i32 1, %sub
%or.1 = or i32 %shl.1, %shl
%or.2 = or i32 %shl.2, %or.1
%or.3 = or i32 %shl.3, %or.2
%sub.4 = add nsw i32 %15, -1
%shl.4 = shl nuw i32 1, %sub.4
%or.4 = or i32 %shl.4, %or.3
switch i32 %or.4, label %for.body6.preheader [
i32 7, label %for.cond4.preheader.split.us
i32 4, label %for.cond4.preheader.split.us
i32 2, label %for.cond4.preheader.split.us
i32 1, label %for.cond4.preheader.split.us
]
cleanup: ; preds = %for.cond4.preheader.split.us, %for.body6.preheader
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %d) #3
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%16 = load i32, ptr %d, align 16, !tbaa !5
%tobool.not = icmp eq i32 %16, 0
br i1 %tobool.not, label %cleanup27, label %if.end
cleanup27: ; preds = %cleanup, %if.end, %if.end.1, %if.end.2, %if.end.3, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %d) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void) {
long long int n,a,b,c,d,i;
scanf("%lld",&n);
d=n/2;
printf("%lld\n",d);
for(i=0;i<d-1;i++)
{
printf("2");
printf(" ");
}
if(n%2!=0)
{
printf("3");
}
else printf("2");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_17150/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_17150/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%div = sdiv i64 %0, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
%cmp12 = icmp sgt i64 %0, 3
br i1 %cmp12, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%1 = call i64 @llvm.smax.i64(i64 %div, i64 2)
%2 = add nsw i64 %1, -2
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%i.013 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
%putchar10 = call i32 @putchar(i32 50)
%putchar11 = call i32 @putchar(i32 32)
%inc = add nuw nsw i64 %i.013, 1
%exitcond.not = icmp eq i64 %i.013, %2
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%3 = load i64, ptr %n, align 8, !tbaa !5
%4 = and i64 %3, 1
%cmp4.not = icmp eq i64 %4, 0
%. = select i1 %cmp4.not, i32 50, i32 51
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
/* ex_4-2. nknm */
#include <stdio.h>
#include <math.h>
//関数を宣言
double length(double len_h, double len_m, double hour, double min);
int main(void){
double len_h, len_m, hour, min, ans;
scanf("%lf%lf%lf%lf", &len_h, &len_m, &hour, &min);
//関数の計算結果を出力
ans = length(len_h, len_m, hour, min);
printf("%.20f\n", ans);
return 0;
}
double length(double len_h, double len_m, double hour, double min){
//針が作る角度のコサインを求め余弦定理を計算
double result, ang;
ang = cos((2 * M_PI * min / 60) - ((2 * M_PI * hour / 12) + (2 * M_PI * min /12 / 60)));
result = sqrt(len_h * len_h + len_m * len_m - 2 * len_h * len_m * ang);
return result;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171543/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171543/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [13 x i8] c"%lf%lf%lf%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.20f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%len_h = alloca double, align 8
%len_m = alloca double, align 8
%hour = alloca double, align 8
%min = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %len_h) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %len_m) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %hour) #6
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %min) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len_h, ptr noundef nonnull %len_m, ptr noundef nonnull %hour, ptr noundef nonnull %min)
%0 = load double, ptr %len_h, align 8, !tbaa !5
%1 = load double, ptr %len_m, align 8, !tbaa !5
%2 = load double, ptr %hour, align 8, !tbaa !5
%3 = load double, ptr %min, align 8, !tbaa !5
%4 = insertelement <2 x double> poison, double %3, i64 0
%5 = insertelement <2 x double> %4, double %2, i64 1
%6 = fmul <2 x double> %5, <double 0x401921FB54442D18, double 0x401921FB54442D18>
%7 = fdiv <2 x double> %6, <double 6.000000e+01, double 1.200000e+01>
%8 = extractelement <2 x double> %6, i64 0
%div4.i = fdiv double %8, 1.200000e+01
%div5.i = fdiv double %div4.i, 6.000000e+01
%9 = extractelement <2 x double> %7, i64 1
%add.i = fadd double %9, %div5.i
%10 = extractelement <2 x double> %7, i64 0
%sub.i = fsub double %10, %add.i
%call.i = call double @cos(double noundef %sub.i) #6
%mul7.i = fmul double %1, %1
%11 = call double @llvm.fmuladd.f64(double %0, double %0, double %mul7.i)
%12 = fmul double %0, -2.000000e+00
%neg.i = fmul double %12, %1
%13 = call double @llvm.fmuladd.f64(double %neg.i, double %call.i, double %11)
%call11.i = call double @sqrt(double noundef %13) #6
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call11.i)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %min) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %hour) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %len_m) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %len_h) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write) uwtable
define dso_local double @length(double noundef %len_h, double noundef %len_m, double noundef %hour, double noundef %min) local_unnamed_addr #3 {
entry:
%0 = insertelement <2 x double> poison, double %min, i64 0
%1 = insertelement <2 x double> %0, double %hour, i64 1
%2 = fmul <2 x double> %1, <double 0x401921FB54442D18, double 0x401921FB54442D18>
%3 = fdiv <2 x double> %2, <double 6.000000e+01, double 1.200000e+01>
%4 = extractelement <2 x double> %2, i64 0
%div4 = fdiv double %4, 1.200000e+01
%div5 = fdiv double %div4, 6.000000e+01
%5 = extractelement <2 x double> %3, i64 1
%add = fadd double %5, %div5
%6 = extractelement <2 x double> %3, i64 0
%sub = fsub double %6, %add
%call = tail call double @cos(double noundef %sub) #6
%mul7 = fmul double %len_m, %len_m
%7 = tail call double @llvm.fmuladd.f64(double %len_h, double %len_h, double %mul7)
%8 = fmul double %len_h, -2.000000e+00
%neg = fmul double %8, %len_m
%9 = tail call double @llvm.fmuladd.f64(double %neg, double %call, double %7)
%call11 = tail call double @sqrt(double noundef %9) #6
ret double %call11
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex4_2
riverstone*/
#include<stdio.h>
#include<math.h>
int main(void){
//時針の長さlen_hourと分針の長さlen_minute、その瞬間での時hourと分minuteを受け取る
double len_hour, len_minute, hour, min;
scanf("%lf %lf %lf %lf", &len_hour, &len_minute, &hour, &min);
double theta_h = 2 * M_PI * (hour + min/60)/12; //時針と12の間のなす角度 [rad]
double theta_m = 2 * M_PI * min/60; //分針と12の間のなす角度[rad]
double theta = theta_h - theta_m; //時針と分針の間のなす角度[rad]
//余弦定理より距離を求める
double ans = sqrt(pow(len_hour, 2) + pow(len_minute, 2) - 2*len_hour*len_minute * cos(theta));
printf("%.10f\n", ans); //ansを出力
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_171587/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_171587/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%lf %lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%len_hour = alloca double, align 8
%len_minute = alloca double, align 8
%hour = alloca double, align 8
%min = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %len_hour) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %len_minute) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %hour) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %min) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len_hour, ptr noundef nonnull %len_minute, ptr noundef nonnull %hour, ptr noundef nonnull %min)
%0 = load double, ptr %hour, align 8, !tbaa !5
%1 = load double, ptr %min, align 8, !tbaa !5
%div = fdiv double %1, 6.000000e+01
%add = fadd double %0, %div
%2 = insertelement <2 x double> poison, double %add, i64 0
%3 = insertelement <2 x double> %2, double %1, i64 1
%4 = fmul <2 x double> %3, <double 0x401921FB54442D18, double 0x401921FB54442D18>
%5 = fdiv <2 x double> %4, <double 1.200000e+01, double 6.000000e+01>
%shift = shufflevector <2 x double> %5, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
%6 = fsub <2 x double> %5, %shift
%sub = extractelement <2 x double> %6, i64 0
%7 = load double, ptr %len_hour, align 8, !tbaa !5
%square = fmul double %7, %7
%8 = load double, ptr %len_minute, align 8, !tbaa !5
%square13 = fmul double %8, %8
%add6 = fadd double %square, %square13
%call9 = call double @cos(double noundef %sub) #5
%9 = fmul double %7, -2.000000e+00
%neg = fmul double %9, %8
%10 = call double @llvm.fmuladd.f64(double %neg, double %call9, double %add6)
%call11 = call double @sqrt(double noundef %10) #5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call11)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %min) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %hour) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %len_minute) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %len_hour) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.