Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
int main(void)
{
char x;
scanf("%c",&x);
if(x=='A'){
printf("T\n");
}
else if(x=='T'){
printf("A");
}
else if(x=='C'){
printf("G");
}
else if(x=='G'){
printf("C");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157194/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157194/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@str = private unnamed_addr constant [2 x i8] c"T\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i8, ptr %x, align 1, !tbaa !5
switch i8 %0, label %if.end22 [
i8 65, label %if.then
i8 84, label %if.then6
i8 67, label %if.then12
i8 71, label %if.then18
]
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end22
if.then6: ; preds = %entry
%putchar24 = call i32 @putchar(i32 65)
br label %if.end22
if.then12: ; preds = %entry
%putchar23 = call i32 @putchar(i32 71)
br label %if.end22
if.then18: ; preds = %entry
%putchar = call i32 @putchar(i32 67)
br label %if.end22
if.end22: ; preds = %entry, %if.then6, %if.then18, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
char a, b;
scanf("%c", &b);
if(b == 'A') {
a = 'T';
} else if(b == 'T') {
a = 'A';
} else if(b == 'C') {
a = 'G';
} else if(b == 'G') {
a = 'C';
}
printf("%c", a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157251/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157251/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1, !tbaa !5
switch i8 %0, label %if.end18.fold.split [
i8 65, label %if.end18
i8 84, label %if.then5
i8 67, label %if.then10
i8 71, label %if.then15
]
if.then5: ; preds = %entry
br label %if.end18
if.then10: ; preds = %entry
br label %if.end18
if.then15: ; preds = %entry
br label %if.end18
if.end18.fold.split: ; preds = %entry
br label %if.end18
if.end18: ; preds = %entry, %if.end18.fold.split, %if.then5, %if.then15, %if.then10
%a.0 = phi i32 [ 65, %if.then5 ], [ 71, %if.then10 ], [ 67, %if.then15 ], [ 84, %entry ], [ 0, %if.end18.fold.split ]
%putchar = call i32 @putchar(i32 %a.0)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char a;
scanf("%c",&a);
if(a == 'A')
printf("T");
if(a == 'T')
printf("A");
if(a == 'C')
printf("G");
if(a == 'G')
printf("C");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157301/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157301/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i8, ptr %a, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 65
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 84)
%.pr = load i8, ptr %a, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ]
%cmp4 = icmp eq i8 %1, 84
br i1 %cmp4, label %if.then6, label %if.end8
if.then6: ; preds = %if.end
%putchar21 = call i32 @putchar(i32 65)
%.pre = load i8, ptr %a, align 1, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then6, %if.end
%2 = phi i8 [ %.pre, %if.then6 ], [ %1, %if.end ]
%cmp10 = icmp eq i8 %2, 67
br i1 %cmp10, label %if.then12, label %if.end14
if.then12: ; preds = %if.end8
%putchar22 = call i32 @putchar(i32 71)
%.pr24 = load i8, ptr %a, align 1, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %if.end8
%3 = phi i8 [ %.pr24, %if.then12 ], [ %2, %if.end8 ]
%cmp16 = icmp eq i8 %3, 71
br i1 %cmp16, label %if.then18, label %if.end20
if.then18: ; preds = %if.end14
%putchar23 = call i32 @putchar(i32 67)
br label %if.end20
if.end20: ; preds = %if.then18, %if.end14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
char input_data, output_data[128];
output_data['A'] = 'T';
output_data['G'] = 'C';
output_data['C'] = 'G';
output_data['T'] = 'A';
scanf("%c", &input_data);
printf("%c\n", output_data[input_data]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157345/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157345/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input_data = alloca i8, align 1
%output_data = alloca [128 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %input_data) #3
call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %output_data) #3
%arrayidx = getelementptr inbounds [128 x i8], ptr %output_data, i64 0, i64 65
store i8 84, ptr %arrayidx, align 1, !tbaa !5
%arrayidx1 = getelementptr inbounds [128 x i8], ptr %output_data, i64 0, i64 71
store i8 67, ptr %arrayidx1, align 1, !tbaa !5
%arrayidx2 = getelementptr inbounds [128 x i8], ptr %output_data, i64 0, i64 67
store i8 71, ptr %arrayidx2, align 1, !tbaa !5
%arrayidx3 = getelementptr inbounds [128 x i8], ptr %output_data, i64 0, i64 84
store i8 65, ptr %arrayidx3, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input_data)
%0 = load i8, ptr %input_data, align 1, !tbaa !5
%idxprom = sext i8 %0 to i64
%arrayidx4 = getelementptr inbounds [128 x i8], ptr %output_data, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%conv = sext i8 %1 to i32
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv)
call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %output_data) #3
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %input_data) #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"}
|
#include "stdio.h"
int main(int argc, char const *argv[]) {
char B;
scanf("%c", &B);
if (B=='A') {printf("T");}
if (B=='T') {printf("A");}
if (B=='C') {printf("G");}
if (B=='G') {printf("C");}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157389/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157389/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\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:
%B = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %B) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%0 = load i8, ptr %B, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 65
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 84)
%.pr = load i8, ptr %B, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ]
%cmp4 = icmp eq i8 %1, 84
br i1 %cmp4, label %if.then6, label %if.end8
if.then6: ; preds = %if.end
%putchar21 = call i32 @putchar(i32 65)
%.pre = load i8, ptr %B, align 1, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then6, %if.end
%2 = phi i8 [ %.pre, %if.then6 ], [ %1, %if.end ]
%cmp10 = icmp eq i8 %2, 67
br i1 %cmp10, label %if.then12, label %if.end14
if.then12: ; preds = %if.end8
%putchar22 = call i32 @putchar(i32 71)
%.pr24 = load i8, ptr %B, align 1, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %if.end8
%3 = phi i8 [ %.pr24, %if.then12 ], [ %2, %if.end8 ]
%cmp16 = icmp eq i8 %3, 71
br i1 %cmp16, label %if.then18, label %if.end20
if.then18: ; preds = %if.end14
%putchar23 = call i32 @putchar(i32 67)
br label %if.end20
if.end20: ; preds = %if.then18, %if.end14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %B) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
char s;scanf("%s",&s);
if(s=='A'){
printf("%s","T");
}else if(s=='T'){
printf("%s","A");
}else if(s=='C'){
printf("%s","G");
}else if(s=='G'){
printf("%s","C");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157439/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157439/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
switch i8 %0, label %if.end22 [
i8 65, label %if.end22.sink.split
i8 84, label %if.then6
i8 67, label %if.then12
i8 71, label %if.then18
]
if.then6: ; preds = %entry
br label %if.end22.sink.split
if.then12: ; preds = %entry
br label %if.end22.sink.split
if.then18: ; preds = %entry
br label %if.end22.sink.split
if.end22.sink.split: ; preds = %entry, %if.then12, %if.then18, %if.then6
%.sink = phi i32 [ 65, %if.then6 ], [ 67, %if.then18 ], [ 71, %if.then12 ], [ 84, %entry ]
%putchar24 = call i32 @putchar(i32 %.sink)
br label %if.end22
if.end22: ; preds = %if.end22.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
char b;
scanf("%c",&b);
if(b=='A')
{
printf("T");
}
if(b=='T')
{
printf("A");
}
if(b=='C')
{
printf("G");
}
if(b=='G')
{
printf("C");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157482/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157482/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 65
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 84)
%.pr = load i8, ptr %b, align 1, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ]
%cmp4 = icmp eq i8 %1, 84
br i1 %cmp4, label %if.then6, label %if.end8
if.then6: ; preds = %if.end
%putchar21 = call i32 @putchar(i32 65)
%.pre = load i8, ptr %b, align 1, !tbaa !5
br label %if.end8
if.end8: ; preds = %if.then6, %if.end
%2 = phi i8 [ %.pre, %if.then6 ], [ %1, %if.end ]
%cmp10 = icmp eq i8 %2, 67
br i1 %cmp10, label %if.then12, label %if.end14
if.then12: ; preds = %if.end8
%putchar22 = call i32 @putchar(i32 71)
%.pr24 = load i8, ptr %b, align 1, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %if.end8
%3 = phi i8 [ %.pr24, %if.then12 ], [ %2, %if.end8 ]
%cmp16 = icmp eq i8 %3, 71
br i1 %cmp16, label %if.then18, label %if.end20
if.then18: ; preds = %if.end14
%putchar23 = call i32 @putchar(i32 67)
br label %if.end20
if.end20: ; preds = %if.then18, %if.end14
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
// Ver19.03
#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 ull unsigned 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()
{
char b;
scanf("%c", &b);
if (b == 'A')
puts("T");
else if (b == 'T')
puts("A");
else if (b == 'G')
puts("C");
else
puts("G");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157532/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157532/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1
@.str.1 = private unnamed_addr constant [2 x i8] c"T\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"A\00", align 1
@.str.3 = private unnamed_addr constant [2 x i8] c"C\00", align 1
@.str.4 = private unnamed_addr constant [2 x i8] c"G\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) #5
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) #5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%b = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i8, ptr %b, align 1, !tbaa !9
switch i8 %0, label %if.else14 [
i8 65, label %if.end17
i8 84, label %if.then6
i8 71, label %if.then12
]
if.then6: ; preds = %entry
br label %if.end17
if.then12: ; preds = %entry
br label %if.end17
if.else14: ; preds = %entry
br label %if.end17
if.end17: ; preds = %entry, %if.then6, %if.else14, %if.then12
%.str.2.sink = phi ptr [ @.str.2, %if.then6 ], [ @.str.4, %if.else14 ], [ @.str.3, %if.then12 ], [ @.str.1, %entry ]
%call7 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #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) #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 @puts(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
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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
#include<string.h>
#include<math.h>
#include <stdlib.h>
#include<ctype.h>
//qsort
int compare_int(const void *a, const void *b)
{
return *(int*)a - *(int*)b;
}
//比較
int max(int a, int b){
if (a>b) return a;
else return b;
}
int min(int a,int b) {
if(a>b) return b;
else return a;
}
//main関数
int main() {
long long N,K;
scanf("%lld %lld",&N,&K);
long long A[N];
for( int i=0; i<N; i++){
scanf("%lld",&A[i]);
}
qsort(A, N, sizeof(long long), compare_int);
if( K == 0){
printf("%lld", A[N-1]);
return 0;
}
long long left = 0; long long right = A[N-1]; long long mid;
long long sum = 0;
while(right > left+1){
mid = (right+left) / 2;
sum = 0;
for( long long i=0; i<N ; i++ ){
if(A[i] > mid){
sum += A[i] / mid;
}
}
if( sum > K ) {
left = mid;
}
else {
right = mid;
}
}
printf("%lld",right);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157576/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157576/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i64, align 8
%K = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %K) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i64, ptr %N, align 8, !tbaa !9
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %0, align 16
%2 = load i64, ptr %N, align 8, !tbaa !9
%cmp49 = icmp sgt i64 %2, 0
br i1 %cmp49, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %2, %entry ], [ %7, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @compare_int) #8
%3 = load i64, ptr %K, align 8, !tbaa !9
%.fr = freeze i64 %3
%cmp3 = icmp ne i64 %.fr, 0
%4 = load i64, ptr %N, align 8, !tbaa !9
%5 = getelementptr i64, ptr %vla, i64 %4
%arrayidx5 = getelementptr i64, ptr %5, i64 -1
%6 = load i64, ptr %arrayidx5, align 8, !tbaa !9
%cmp956 = icmp sgt i64 %6, 1
%or.cond = select i1 %cmp3, i1 %cmp956, i1 false
br i1 %or.cond, label %while.body.lr.ph, label %cleanup
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i64, ptr %N, align 8, !tbaa !9
%cmp = icmp sgt i64 %7, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
while.body.lr.ph: ; preds = %for.cond.cleanup
%cmp1452 = icmp sgt i64 %4, 0
br i1 %cmp1452, label %while.body.us.preheader, label %while.body.lr.ph.split
while.body.us.preheader: ; preds = %while.body.lr.ph
%xtraiter = and i64 %4, 1
%8 = icmp eq i64 %4, 1
%unroll_iter = and i64 %4, -2
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %while.body.us
while.body.us: ; preds = %while.body.us.preheader, %for.cond13.for.cond.cleanup16_crit_edge.us
%right.058.us = phi i64 [ %right.0.div.us, %for.cond13.for.cond.cleanup16_crit_edge.us ], [ %6, %while.body.us.preheader ]
%left.057.us = phi i64 [ %div.left.0.us, %for.cond13.for.cond.cleanup16_crit_edge.us ], [ 0, %while.body.us.preheader ]
%add11.us = add nsw i64 %right.058.us, %left.057.us
%div.us = sdiv i64 %add11.us, 2
br i1 %8, label %for.cond13.for.cond.cleanup16_crit_edge.us.unr-lcssa, label %for.body17.us
for.body17.us: ; preds = %while.body.us, %for.inc26.us.1
%i12.054.us = phi i64 [ %inc27.us.1, %for.inc26.us.1 ], [ 0, %while.body.us ]
%sum.053.us = phi i64 [ %sum.1.us.1, %for.inc26.us.1 ], [ 0, %while.body.us ]
%niter = phi i64 [ %niter.next.1, %for.inc26.us.1 ], [ 0, %while.body.us ]
%arrayidx18.us = getelementptr inbounds i64, ptr %vla, i64 %i12.054.us
%9 = load i64, ptr %arrayidx18.us, align 16, !tbaa !9
%cmp19.us = icmp sgt i64 %9, %div.us
br i1 %cmp19.us, label %if.then21.us, label %for.inc26.us
if.then21.us: ; preds = %for.body17.us
%div23.us = sdiv i64 %9, %div.us
%add24.us = add nsw i64 %div23.us, %sum.053.us
br label %for.inc26.us
for.inc26.us: ; preds = %if.then21.us, %for.body17.us
%sum.1.us = phi i64 [ %add24.us, %if.then21.us ], [ %sum.053.us, %for.body17.us ]
%inc27.us = or i64 %i12.054.us, 1
%arrayidx18.us.1 = getelementptr inbounds i64, ptr %vla, i64 %inc27.us
%10 = load i64, ptr %arrayidx18.us.1, align 8, !tbaa !9
%cmp19.us.1 = icmp sgt i64 %10, %div.us
br i1 %cmp19.us.1, label %if.then21.us.1, label %for.inc26.us.1
if.then21.us.1: ; preds = %for.inc26.us
%div23.us.1 = sdiv i64 %10, %div.us
%add24.us.1 = add nsw i64 %div23.us.1, %sum.1.us
br label %for.inc26.us.1
for.inc26.us.1: ; preds = %if.then21.us.1, %for.inc26.us
%sum.1.us.1 = phi i64 [ %add24.us.1, %if.then21.us.1 ], [ %sum.1.us, %for.inc26.us ]
%inc27.us.1 = add nuw nsw i64 %i12.054.us, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond13.for.cond.cleanup16_crit_edge.us.unr-lcssa, label %for.body17.us, !llvm.loop !13
for.cond13.for.cond.cleanup16_crit_edge.us.unr-lcssa: ; preds = %for.inc26.us.1, %while.body.us
%sum.1.us.lcssa.ph = phi i64 [ undef, %while.body.us ], [ %sum.1.us.1, %for.inc26.us.1 ]
%i12.054.us.unr = phi i64 [ 0, %while.body.us ], [ %inc27.us.1, %for.inc26.us.1 ]
%sum.053.us.unr = phi i64 [ 0, %while.body.us ], [ %sum.1.us.1, %for.inc26.us.1 ]
br i1 %lcmp.mod.not, label %for.cond13.for.cond.cleanup16_crit_edge.us, label %for.body17.us.epil
for.body17.us.epil: ; preds = %for.cond13.for.cond.cleanup16_crit_edge.us.unr-lcssa
%arrayidx18.us.epil = getelementptr inbounds i64, ptr %vla, i64 %i12.054.us.unr
%11 = load i64, ptr %arrayidx18.us.epil, align 8, !tbaa !9
%cmp19.us.epil = icmp sgt i64 %11, %div.us
br i1 %cmp19.us.epil, label %if.then21.us.epil, label %for.cond13.for.cond.cleanup16_crit_edge.us
if.then21.us.epil: ; preds = %for.body17.us.epil
%div23.us.epil = sdiv i64 %11, %div.us
%add24.us.epil = add nsw i64 %div23.us.epil, %sum.053.us.unr
br label %for.cond13.for.cond.cleanup16_crit_edge.us
for.cond13.for.cond.cleanup16_crit_edge.us: ; preds = %for.body17.us.epil, %if.then21.us.epil, %for.cond13.for.cond.cleanup16_crit_edge.us.unr-lcssa
%sum.1.us.lcssa = phi i64 [ %sum.1.us.lcssa.ph, %for.cond13.for.cond.cleanup16_crit_edge.us.unr-lcssa ], [ %add24.us.epil, %if.then21.us.epil ], [ %sum.053.us.unr, %for.body17.us.epil ]
%cmp29.us = icmp sgt i64 %sum.1.us.lcssa, %.fr
%div.left.0.us = select i1 %cmp29.us, i64 %div.us, i64 %left.057.us
%right.0.div.us = select i1 %cmp29.us, i64 %right.058.us, i64 %div.us
%add.us = add nsw i64 %div.left.0.us, 1
%cmp9.us = icmp sgt i64 %right.0.div.us, %add.us
br i1 %cmp9.us, label %while.body.us, label %cleanup, !llvm.loop !14
while.body.lr.ph.split: ; preds = %while.body.lr.ph
%cmp29 = icmp slt i64 %.fr, 0
br i1 %cmp29, label %cleanup, label %while.body
while.body: ; preds = %while.body.lr.ph.split, %while.body
%right.058 = phi i64 [ %div, %while.body ], [ %6, %while.body.lr.ph.split ]
%div = sdiv i64 %right.058, 2
%cmp9 = icmp sgt i64 %right.058, 3
br i1 %cmp9, label %while.body, label %cleanup, !llvm.loop !14
cleanup: ; preds = %while.body, %for.cond13.for.cond.cleanup16_crit_edge.us, %while.body.lr.ph.split, %for.cond.cleanup
%right.0.lcssa.sink = phi i64 [ %6, %for.cond.cleanup ], [ %6, %while.body.lr.ph.split ], [ %right.0.div.us, %for.cond13.for.cond.cleanup16_crit_edge.us ], [ %div, %while.body ]
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %right.0.lcssa.sink)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
#include <string.h>
void selection_s(char a[], int N);
void selection_l(char a[], int N);
int main(void)
{
char s[105];
char a[105];
fgets(s, sizeof(s), stdin);
fgets(a, sizeof(a), stdin);
//選択整列法を使用
//sを小さい順でソート
selection_s(s, strlen(s)-2);
selection_l(a, strlen(a)-2);
int str_siz = strcmp(s, a);
if (str_siz < 0) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
}
void selection_s(char a[], int N)
{
int min;
char t;
for (int i = 0; i < N; i++) {
min = i;
for (int j = i+1; j <= N; j++) {
if (a[j] < a[min]) {min = j;}
}
t = a[min];
a[min] = a[i];
a[i] = t;
}
}
void selection_l(char a[], int N)
{
int min;
char t;
for (int i = 0; i < N; i++) {
min = i;
for (int j = i+1; j <= N; j++) {
if (a[j] > a[min]) {min = j;}
}
t = a[min];
a[min] = a[i];
a[i] = t;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157633/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157633/source.c"
target datalayout = "e-m:e-p270: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"No\00", align 1
@str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [105 x i8], align 16
%a = alloca [105 x i8], align 16
call void @llvm.lifetime.start.p0(i64 105, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 105, ptr nonnull %a) #6
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 105, ptr noundef %0)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = call ptr @fgets(ptr noundef nonnull %a, i32 noundef 105, ptr noundef %1)
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%2 = trunc i64 %call5 to i32
%conv = add i32 %2, -2
%cmp40.i = icmp sgt i32 %conv, 0
br i1 %cmp40.i, label %for.body.preheader.i, label %selection_s.exit
for.body.preheader.i: ; preds = %entry
%3 = add i64 %call5, 4294967295
%wide.trip.count48.i = zext i32 %conv to i64
%wide.trip.count.i = and i64 %3, 4294967295
br label %for.body4.preheader.i
for.body4.preheader.i: ; preds = %for.cond.cleanup3.i, %for.body.preheader.i
%indvars.iv45.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next46.i, %for.cond.cleanup3.i ]
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.cond.cleanup3.i ]
%4 = trunc i64 %indvars.iv45.i to i32
br label %for.body4.i
for.cond.cleanup3.i: ; preds = %for.body4.i
%indvars.iv.next46.i = add nuw nsw i64 %indvars.iv45.i, 1
%idxprom10.i = sext i32 %spec.select.i to i64
%arrayidx11.i = getelementptr inbounds i8, ptr %s, i64 %idxprom10.i
%5 = load i8, ptr %arrayidx11.i, align 1, !tbaa !9
%arrayidx13.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv45.i
%6 = load i8, ptr %arrayidx13.i, align 1, !tbaa !9
store i8 %6, ptr %arrayidx11.i, align 1, !tbaa !9
store i8 %5, ptr %arrayidx13.i, align 1, !tbaa !9
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond49.not.i = icmp eq i64 %indvars.iv.next46.i, %wide.trip.count48.i
br i1 %exitcond49.not.i, label %selection_s.exit, label %for.body4.preheader.i, !llvm.loop !10
for.body4.i: ; preds = %for.body4.i, %for.body4.preheader.i
%indvars.iv42.i = phi i64 [ %indvars.iv.i, %for.body4.preheader.i ], [ %indvars.iv.next43.i, %for.body4.i ]
%min.038.i = phi i32 [ %4, %for.body4.preheader.i ], [ %spec.select.i, %for.body4.i ]
%arrayidx.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv42.i
%7 = load i8, ptr %arrayidx.i, align 1, !tbaa !9
%idxprom5.i = sext i32 %min.038.i to i64
%arrayidx6.i = getelementptr inbounds i8, ptr %s, i64 %idxprom5.i
%8 = load i8, ptr %arrayidx6.i, align 1, !tbaa !9
%cmp8.i = icmp slt i8 %7, %8
%9 = trunc i64 %indvars.iv42.i to i32
%spec.select.i = select i1 %cmp8.i, i32 %9, i32 %min.038.i
%indvars.iv.next43.i = add nuw nsw i64 %indvars.iv42.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next43.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond.cleanup3.i, label %for.body4.i, !llvm.loop !12
selection_s.exit: ; preds = %for.cond.cleanup3.i, %entry
%call8 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #7
%10 = trunc i64 %call8 to i32
%conv10 = add i32 %10, -2
%cmp40.i18 = icmp sgt i32 %conv10, 0
br i1 %cmp40.i18, label %for.body.preheader.i19, label %selection_l.exit
for.body.preheader.i19: ; preds = %selection_s.exit
%11 = add i64 %call8, 4294967295
%wide.trip.count48.i20 = zext i32 %conv10 to i64
%wide.trip.count.i21 = and i64 %11, 4294967295
br label %for.body4.preheader.i22
for.body4.preheader.i22: ; preds = %for.cond.cleanup3.i36, %for.body.preheader.i19
%indvars.iv45.i23 = phi i64 [ 0, %for.body.preheader.i19 ], [ %indvars.iv.next46.i25, %for.cond.cleanup3.i36 ]
%indvars.iv.i24 = phi i64 [ 1, %for.body.preheader.i19 ], [ %indvars.iv.next.i40, %for.cond.cleanup3.i36 ]
%12 = trunc i64 %indvars.iv45.i23 to i32
br label %for.body4.i26
for.cond.cleanup3.i36: ; preds = %for.body4.i26
%indvars.iv.next46.i25 = add nuw nsw i64 %indvars.iv45.i23, 1
%idxprom10.i37 = sext i32 %spec.select.i33 to i64
%arrayidx11.i38 = getelementptr inbounds i8, ptr %a, i64 %idxprom10.i37
%13 = load i8, ptr %arrayidx11.i38, align 1, !tbaa !9
%arrayidx13.i39 = getelementptr inbounds i8, ptr %a, i64 %indvars.iv45.i23
%14 = load i8, ptr %arrayidx13.i39, align 1, !tbaa !9
store i8 %14, ptr %arrayidx11.i38, align 1, !tbaa !9
store i8 %13, ptr %arrayidx13.i39, align 1, !tbaa !9
%indvars.iv.next.i40 = add nuw nsw i64 %indvars.iv.i24, 1
%exitcond49.not.i41 = icmp eq i64 %indvars.iv.next46.i25, %wide.trip.count48.i20
br i1 %exitcond49.not.i41, label %selection_l.exit, label %for.body4.preheader.i22, !llvm.loop !13
for.body4.i26: ; preds = %for.body4.i26, %for.body4.preheader.i22
%indvars.iv42.i27 = phi i64 [ %indvars.iv.i24, %for.body4.preheader.i22 ], [ %indvars.iv.next43.i34, %for.body4.i26 ]
%min.038.i28 = phi i32 [ %12, %for.body4.preheader.i22 ], [ %spec.select.i33, %for.body4.i26 ]
%arrayidx.i29 = getelementptr inbounds i8, ptr %a, i64 %indvars.iv42.i27
%15 = load i8, ptr %arrayidx.i29, align 1, !tbaa !9
%idxprom5.i30 = sext i32 %min.038.i28 to i64
%arrayidx6.i31 = getelementptr inbounds i8, ptr %a, i64 %idxprom5.i30
%16 = load i8, ptr %arrayidx6.i31, align 1, !tbaa !9
%cmp8.i32 = icmp sgt i8 %15, %16
%17 = trunc i64 %indvars.iv42.i27 to i32
%spec.select.i33 = select i1 %cmp8.i32, i32 %17, i32 %min.038.i28
%indvars.iv.next43.i34 = add nuw nsw i64 %indvars.iv42.i27, 1
%exitcond.not.i35 = icmp eq i64 %indvars.iv.next43.i34, %wide.trip.count.i21
br i1 %exitcond.not.i35, label %for.cond.cleanup3.i36, label %for.body4.i26, !llvm.loop !14
selection_l.exit: ; preds = %for.cond.cleanup3.i36, %selection_s.exit
%call13 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %a) #7
%cmp = icmp slt i32 %call13, 0
%str.2.str = select i1 %cmp, ptr @str.2, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.2.str)
call void @llvm.lifetime.end.p0(i64 105, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 105, ptr nonnull %s) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @selection_s(ptr nocapture noundef %a, i32 noundef %N) local_unnamed_addr #3 {
entry:
%cmp40 = icmp sgt i32 %N, 0
br i1 %cmp40, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = add nuw i32 %N, 1
%wide.trip.count48 = zext i32 %N to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.body4.preheader
for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry
ret void
for.body4.preheader: ; preds = %for.cond.cleanup3, %for.body.preheader
%indvars.iv45 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next46, %for.cond.cleanup3 ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.cond.cleanup3 ]
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%1 = trunc i64 %indvars.iv45 to i32
br label %for.body4
for.cond.cleanup3: ; preds = %for.body4
%idxprom10 = sext i32 %spec.select to i64
%arrayidx11 = getelementptr inbounds i8, ptr %a, i64 %idxprom10
%2 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%arrayidx13 = getelementptr inbounds i8, ptr %a, i64 %indvars.iv45
%3 = load i8, ptr %arrayidx13, align 1, !tbaa !9
store i8 %3, ptr %arrayidx11, align 1, !tbaa !9
store i8 %2, ptr %arrayidx13, align 1, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond49.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count48
br i1 %exitcond49.not, label %for.cond.cleanup, label %for.body4.preheader, !llvm.loop !10
for.body4: ; preds = %for.body4.preheader, %for.body4
%indvars.iv42 = phi i64 [ %indvars.iv, %for.body4.preheader ], [ %indvars.iv.next43, %for.body4 ]
%min.038 = phi i32 [ %1, %for.body4.preheader ], [ %spec.select, %for.body4 ]
%arrayidx = getelementptr inbounds i8, ptr %a, i64 %indvars.iv42
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%idxprom5 = sext i32 %min.038 to i64
%arrayidx6 = getelementptr inbounds i8, ptr %a, i64 %idxprom5
%5 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp slt i8 %4, %5
%6 = trunc i64 %indvars.iv42 to i32
%spec.select = select i1 %cmp8, i32 %6, i32 %min.038
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup3, label %for.body4, !llvm.loop !12
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @selection_l(ptr nocapture noundef %a, i32 noundef %N) local_unnamed_addr #3 {
entry:
%cmp40 = icmp sgt i32 %N, 0
br i1 %cmp40, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = add nuw i32 %N, 1
%wide.trip.count48 = zext i32 %N to i64
%wide.trip.count = zext i32 %0 to i64
br label %for.body4.preheader
for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry
ret void
for.body4.preheader: ; preds = %for.cond.cleanup3, %for.body.preheader
%indvars.iv45 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next46, %for.cond.cleanup3 ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.cond.cleanup3 ]
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%1 = trunc i64 %indvars.iv45 to i32
br label %for.body4
for.cond.cleanup3: ; preds = %for.body4
%idxprom10 = sext i32 %spec.select to i64
%arrayidx11 = getelementptr inbounds i8, ptr %a, i64 %idxprom10
%2 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%arrayidx13 = getelementptr inbounds i8, ptr %a, i64 %indvars.iv45
%3 = load i8, ptr %arrayidx13, align 1, !tbaa !9
store i8 %3, ptr %arrayidx11, align 1, !tbaa !9
store i8 %2, ptr %arrayidx13, align 1, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond49.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count48
br i1 %exitcond49.not, label %for.cond.cleanup, label %for.body4.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader, %for.body4
%indvars.iv42 = phi i64 [ %indvars.iv, %for.body4.preheader ], [ %indvars.iv.next43, %for.body4 ]
%min.038 = phi i32 [ %1, %for.body4.preheader ], [ %spec.select, %for.body4 ]
%arrayidx = getelementptr inbounds i8, ptr %a, i64 %indvars.iv42
%4 = load i8, ptr %arrayidx, align 1, !tbaa !9
%idxprom5 = sext i32 %min.038 to i64
%arrayidx6 = getelementptr inbounds i8, ptr %a, i64 %idxprom5
%5 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp8 = icmp sgt i8 %4, %5
%6 = trunc i64 %indvars.iv42 to i32
%spec.select = select i1 %cmp8, i32 %6, i32 %min.038
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup3, label %for.body4, !llvm.loop !14
}
; 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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
|
#include<stdio.h>
int main(){
int i,j;
char s[101],t[101];
scanf("%s %s",s,t);
for(i=0;s[i]!=0;i++){
for(j=0;j<i;j++){
if(s[i]<s[j]){
char tmp=s[i];
s[i]=s[j];
s[j]=tmp;
}
}
}
for(i=0;t[i]!=0;i++){
for(j=0;j<i;j++){
if(t[i]>t[j]){
char tmp=t[i];
t[i]=t[j];
t[j]=tmp;
}
}
}
i=0;
while(s[i]!=0&&t[i]!=0){
if(s[i]<t[i]){
puts("Yes");
return 0;
}
if(s[i]>t[i]){
puts("No");
return 0;
}i++;
}
for(i=0;s[i]!=0;i++);
for(j=0;t[j]!=0;j++);
if(i<j)puts("Yes");
else puts("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157684/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157684/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [101 x i8], align 16
%t = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not159 = icmp eq i8 %0, 0
br i1 %cmp.not159, label %for.cond26.preheader, label %for.cond3.preheader
for.cond3.preheader: ; preds = %entry, %for.inc23
%indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.inc23 ], [ 0, %entry ]
%arrayidx161 = phi ptr [ %arrayidx, %for.inc23 ], [ %s, %entry ]
%cmp4157.not = icmp eq i64 %indvars.iv171, 0
br i1 %cmp4157.not, label %for.inc23, label %for.body6.preheader
for.body6.preheader: ; preds = %for.cond3.preheader
%xtraiter = and i64 %indvars.iv171, 1
%1 = icmp eq i64 %indvars.iv171, 1
br i1 %1, label %for.inc23.loopexit.unr-lcssa, label %for.body6.preheader.new
for.body6.preheader.new: ; preds = %for.body6.preheader
%unroll_iter = and i64 %indvars.iv171, 9223372036854775806
br label %for.body6
for.cond26.preheader: ; preds = %for.inc23, %entry
%2 = load i8, ptr %t, align 16, !tbaa !5
%cmp30.not164 = icmp eq i8 %2, 0
br i1 %cmp30.not164, label %while.cond.preheader, label %for.cond33.preheader
for.body6: ; preds = %for.inc.1, %for.body6.preheader.new
%indvars.iv = phi i64 [ 0, %for.body6.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body6.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%3 = load i8, ptr %arrayidx161, align 1, !tbaa !5
%arrayidx11 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx11, align 2, !tbaa !5
%cmp13 = icmp slt i8 %3, %4
br i1 %cmp13, label %if.then, label %for.inc
if.then: ; preds = %for.body6
store i8 %4, ptr %arrayidx161, align 1, !tbaa !5
store i8 %3, ptr %arrayidx11, align 2, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body6, %if.then
%indvars.iv.next = or i64 %indvars.iv, 1
%5 = load i8, ptr %arrayidx161, align 1, !tbaa !5
%arrayidx11.1 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%6 = load i8, ptr %arrayidx11.1, align 1, !tbaa !5
%cmp13.1 = icmp slt i8 %5, %6
br i1 %cmp13.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i8 %6, ptr %arrayidx161, align 1, !tbaa !5
store i8 %5, ptr %arrayidx11.1, align 1, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.inc23.loopexit.unr-lcssa, label %for.body6, !llvm.loop !8
for.inc23.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body6.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc23, label %for.body6.epil
for.body6.epil: ; preds = %for.inc23.loopexit.unr-lcssa
%7 = load i8, ptr %arrayidx161, align 1, !tbaa !5
%arrayidx11.epil = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%8 = load i8, ptr %arrayidx11.epil, align 1, !tbaa !5
%cmp13.epil = icmp slt i8 %7, %8
br i1 %cmp13.epil, label %if.then.epil, label %for.inc23
if.then.epil: ; preds = %for.body6.epil
store i8 %8, ptr %arrayidx161, align 1, !tbaa !5
store i8 %7, ptr %arrayidx11.epil, align 1, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.inc23.loopexit.unr-lcssa, %if.then.epil, %for.body6.epil, %for.cond3.preheader
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next172
%9 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %9, 0
br i1 %cmp.not, label %for.cond26.preheader, label %for.cond3.preheader, !llvm.loop !10
for.cond33.preheader: ; preds = %for.cond26.preheader, %for.inc59
%indvars.iv178 = phi i64 [ %indvars.iv.next179, %for.inc59 ], [ 0, %for.cond26.preheader ]
%arrayidx28166 = phi ptr [ %arrayidx28, %for.inc59 ], [ %t, %for.cond26.preheader ]
%cmp34162.not = icmp eq i64 %indvars.iv178, 0
br i1 %cmp34162.not, label %for.inc59, label %for.body36.preheader
for.body36.preheader: ; preds = %for.cond33.preheader
%xtraiter189 = and i64 %indvars.iv178, 1
%10 = icmp eq i64 %indvars.iv178, 1
br i1 %10, label %for.inc59.loopexit.unr-lcssa, label %for.body36.preheader.new
for.body36.preheader.new: ; preds = %for.body36.preheader
%unroll_iter191 = and i64 %indvars.iv178, 9223372036854775806
br label %for.body36
while.cond.preheader: ; preds = %for.inc59, %for.cond26.preheader
%11 = load i8, ptr %s, align 16, !tbaa !5
%cmp65.not167 = icmp eq i8 %11, 0
br i1 %cmp65.not167, label %for.cond95.preheader, label %land.rhs
for.cond95.preheader: ; preds = %land.rhs, %while.cond, %while.cond.preheader
br label %for.cond95
for.body36: ; preds = %for.inc56.1, %for.body36.preheader.new
%indvars.iv174 = phi i64 [ 0, %for.body36.preheader.new ], [ %indvars.iv.next175.1, %for.inc56.1 ]
%niter192 = phi i64 [ 0, %for.body36.preheader.new ], [ %niter192.next.1, %for.inc56.1 ]
%12 = load i8, ptr %arrayidx28166, align 1, !tbaa !5
%arrayidx41 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv174
%13 = load i8, ptr %arrayidx41, align 2, !tbaa !5
%cmp43 = icmp sgt i8 %12, %13
br i1 %cmp43, label %if.then45, label %for.inc56
if.then45: ; preds = %for.body36
store i8 %13, ptr %arrayidx28166, align 1, !tbaa !5
store i8 %12, ptr %arrayidx41, align 2, !tbaa !5
br label %for.inc56
for.inc56: ; preds = %for.body36, %if.then45
%indvars.iv.next175 = or i64 %indvars.iv174, 1
%14 = load i8, ptr %arrayidx28166, align 1, !tbaa !5
%arrayidx41.1 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv.next175
%15 = load i8, ptr %arrayidx41.1, align 1, !tbaa !5
%cmp43.1 = icmp sgt i8 %14, %15
br i1 %cmp43.1, label %if.then45.1, label %for.inc56.1
if.then45.1: ; preds = %for.inc56
store i8 %15, ptr %arrayidx28166, align 1, !tbaa !5
store i8 %14, ptr %arrayidx41.1, align 1, !tbaa !5
br label %for.inc56.1
for.inc56.1: ; preds = %if.then45.1, %for.inc56
%indvars.iv.next175.1 = add nuw nsw i64 %indvars.iv174, 2
%niter192.next.1 = add i64 %niter192, 2
%niter192.ncmp.1 = icmp eq i64 %niter192.next.1, %unroll_iter191
br i1 %niter192.ncmp.1, label %for.inc59.loopexit.unr-lcssa, label %for.body36, !llvm.loop !11
for.inc59.loopexit.unr-lcssa: ; preds = %for.inc56.1, %for.body36.preheader
%indvars.iv174.unr = phi i64 [ 0, %for.body36.preheader ], [ %indvars.iv.next175.1, %for.inc56.1 ]
%lcmp.mod190.not = icmp eq i64 %xtraiter189, 0
br i1 %lcmp.mod190.not, label %for.inc59, label %for.body36.epil
for.body36.epil: ; preds = %for.inc59.loopexit.unr-lcssa
%16 = load i8, ptr %arrayidx28166, align 1, !tbaa !5
%arrayidx41.epil = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv174.unr
%17 = load i8, ptr %arrayidx41.epil, align 1, !tbaa !5
%cmp43.epil = icmp sgt i8 %16, %17
br i1 %cmp43.epil, label %if.then45.epil, label %for.inc59
if.then45.epil: ; preds = %for.body36.epil
store i8 %17, ptr %arrayidx28166, align 1, !tbaa !5
store i8 %16, ptr %arrayidx41.epil, align 1, !tbaa !5
br label %for.inc59
for.inc59: ; preds = %for.inc59.loopexit.unr-lcssa, %if.then45.epil, %for.body36.epil, %for.cond33.preheader
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%arrayidx28 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv.next179
%18 = load i8, ptr %arrayidx28, align 1, !tbaa !5
%cmp30.not = icmp eq i8 %18, 0
br i1 %cmp30.not, label %while.cond.preheader, label %for.cond33.preheader, !llvm.loop !12
while.cond: ; preds = %if.end82
%indvars.iv.next182 = add nuw i64 %indvars.iv181, 1
%arrayidx63 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next182
%19 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%cmp65.not = icmp eq i8 %19, 0
br i1 %cmp65.not, label %for.cond95.preheader, label %land.rhs, !llvm.loop !13
land.rhs: ; preds = %while.cond.preheader, %while.cond
%indvars.iv181 = phi i64 [ %indvars.iv.next182, %while.cond ], [ 0, %while.cond.preheader ]
%20 = phi i8 [ %19, %while.cond ], [ %11, %while.cond.preheader ]
%arrayidx68 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv181
%21 = load i8, ptr %arrayidx68, align 1, !tbaa !5
%cmp70.not = icmp eq i8 %21, 0
br i1 %cmp70.not, label %for.cond95.preheader, label %while.body
while.body: ; preds = %land.rhs
%cmp78 = icmp slt i8 %20, %21
br i1 %cmp78, label %cleanup, label %if.end82
if.end82: ; preds = %while.body
%cmp89 = icmp sgt i8 %20, %21
br i1 %cmp89, label %cleanup, label %while.cond
for.cond95: ; preds = %for.cond95.preheader, %for.cond95
%indvars.iv183 = phi i64 [ %indvars.iv.next184, %for.cond95 ], [ 0, %for.cond95.preheader ]
%arrayidx97 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv183
%22 = load i8, ptr %arrayidx97, align 1, !tbaa !5
%cmp99.not = icmp eq i8 %22, 0
%indvars.iv.next184 = add nuw i64 %indvars.iv183, 1
br i1 %cmp99.not, label %for.cond105, label %for.cond95, !llvm.loop !14
for.cond105: ; preds = %for.cond95, %for.cond105
%indvars.iv186 = phi i64 [ %indvars.iv.next187, %for.cond105 ], [ 0, %for.cond95 ]
%arrayidx107 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv186
%23 = load i8, ptr %arrayidx107, align 1, !tbaa !5
%cmp109.not = icmp eq i8 %23, 0
%indvars.iv.next187 = add nuw i64 %indvars.iv186, 1
br i1 %cmp109.not, label %for.end114, label %for.cond105, !llvm.loop !15
for.end114: ; preds = %for.cond105
%24 = trunc i64 %indvars.iv183 to i32
%25 = trunc i64 %indvars.iv186 to i32
%cmp115 = icmp ult i32 %24, %25
%.str.1..str.2 = select i1 %cmp115, ptr @.str.1, ptr @.str.2
br label %cleanup
cleanup: ; preds = %if.end82, %while.body, %for.end114
%.str.1.sink = phi ptr [ %.str.1..str.2, %for.end114 ], [ @.str.1, %while.body ], [ @.str.2, %if.end82 ]
%call118 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #3
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: 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
!14 = distinct !{!14, !9}
!15 = distinct !{!15, !9}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
void chin(char s[]){
scanf("%s",s);
}
void print(int a){
printf("%d\n",a);
}
void llprint(long long a){
printf("%lld\n",a);
}
void print2(int a,int b){
printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
return a>b?a:b;
}
long long min(long long a,long long b){
return a<b?a:b;
}
int get4(int a[],int d){
return a[d+3]*1000+a[d+2]*100+a[d+1]*10+a[d];
}
int main(void){
int m,n,a[72],i,j;
char *t[72];
for(i=0;i<72;i++){
t[i]=(char *)calloc(10,sizeof(char));
}
t[4]="Man";
t[8]="Oku";
t[12]="Cho";
t[16]="Kei";
t[20]="Gai";
t[24]="Jo";
t[28]="Jou";
t[32]="Ko";
t[36]="Kan";
t[40]="Sei";
t[44]="Sai";
t[48]="Gok";
t[52]="Ggs";
t[56]="Asg";
t[60]="Nyt";
t[64]="Fks";
t[68]="Mts";
while(1){
m=in();
n=in();
if(m==0){
break;
}
memset(a,0,sizeof(a));
a[0]=1;
for(i=0;i<n;i++){
for(j=0;j<72;j++){
a[j]*=m;
}
for(j=0;j<71;j++){
a[j+1]+=a[j]/10;
a[j]%=10;
}
}
for(i=68;i>=0;i-=4){
int tmp=get4(a,i);
if(tmp!=0){
printf("%d",tmp);
printf("%s",t[i]);
}
}
puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157749/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157749/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.5 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c"Man\00", align 1
@.str.7 = private unnamed_addr constant [4 x i8] c"Oku\00", align 1
@.str.8 = private unnamed_addr constant [4 x i8] c"Cho\00", align 1
@.str.9 = private unnamed_addr constant [4 x i8] c"Kei\00", align 1
@.str.10 = private unnamed_addr constant [4 x i8] c"Gai\00", align 1
@.str.11 = private unnamed_addr constant [3 x i8] c"Jo\00", align 1
@.str.12 = private unnamed_addr constant [4 x i8] c"Jou\00", align 1
@.str.13 = private unnamed_addr constant [3 x i8] c"Ko\00", align 1
@.str.14 = private unnamed_addr constant [4 x i8] c"Kan\00", align 1
@.str.15 = private unnamed_addr constant [4 x i8] c"Sei\00", align 1
@.str.16 = private unnamed_addr constant [4 x i8] c"Sai\00", align 1
@.str.17 = private unnamed_addr constant [4 x i8] c"Gok\00", align 1
@.str.18 = private unnamed_addr constant [4 x i8] c"Ggs\00", align 1
@.str.19 = private unnamed_addr constant [4 x i8] c"Asg\00", align 1
@.str.20 = private unnamed_addr constant [4 x i8] c"Nyt\00", align 1
@.str.21 = private unnamed_addr constant [4 x i8] c"Fks\00", align 1
@.str.22 = private unnamed_addr constant [4 x i8] c"Mts\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #9
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 i64 @llin() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #9
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %a)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %a, i32 noundef %b)
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @get4(ptr nocapture noundef readonly %a, i32 noundef %d) local_unnamed_addr #4 {
entry:
%add = add nsw i32 %d, 3
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%mul = mul nsw i32 %0, 1000
%add1 = add nsw i32 %d, 2
%idxprom2 = sext i32 %add1 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%mul4 = mul nsw i32 %1, 100
%add5 = add nsw i32 %mul4, %mul
%add6 = add nsw i32 %d, 1
%idxprom7 = sext i32 %add6 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7
%2 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%mul9 = mul nsw i32 %2, 10
%add10 = add nsw i32 %add5, %mul9
%idxprom11 = sext i32 %d to i64
%arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %idxprom11
%3 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add13 = add nsw i32 %add10, %3
ret i32 %add13
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i.i81 = alloca i32, align 4
%i.i = alloca i32, align 4
%a = alloca [72 x i32], align 16
%t = alloca [72 x ptr], align 16
call void @llvm.lifetime.start.p0(i64 288, ptr nonnull %a) #9
call void @llvm.lifetime.start.p0(i64 576, ptr nonnull %t) #9
br label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
%call = tail call noalias dereferenceable_or_null(10) ptr @calloc(i64 noundef 10, i64 noundef 1) #10
%arrayidx = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 %indvars.iv
store ptr %call, ptr %arrayidx, align 8, !tbaa !11
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 72
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body
%arrayidx1 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 4
store ptr @.str.6, ptr %arrayidx1, align 16, !tbaa !11
%arrayidx2 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 8
store ptr @.str.7, ptr %arrayidx2, align 16, !tbaa !11
%arrayidx3 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 12
store ptr @.str.8, ptr %arrayidx3, align 16, !tbaa !11
%arrayidx4 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 16
store ptr @.str.9, ptr %arrayidx4, align 16, !tbaa !11
%arrayidx5 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 20
store ptr @.str.10, ptr %arrayidx5, align 16, !tbaa !11
%arrayidx6 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 24
store ptr @.str.11, ptr %arrayidx6, align 16, !tbaa !11
%arrayidx7 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 28
store ptr @.str.12, ptr %arrayidx7, align 16, !tbaa !11
%arrayidx8 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 32
store ptr @.str.13, ptr %arrayidx8, align 16, !tbaa !11
%arrayidx9 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 36
store ptr @.str.14, ptr %arrayidx9, align 16, !tbaa !11
%arrayidx10 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 40
store ptr @.str.15, ptr %arrayidx10, align 16, !tbaa !11
%arrayidx11 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 44
store ptr @.str.16, ptr %arrayidx11, align 16, !tbaa !11
%arrayidx12 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 48
store ptr @.str.17, ptr %arrayidx12, align 16, !tbaa !11
%arrayidx13 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 52
store ptr @.str.18, ptr %arrayidx13, align 16, !tbaa !11
%arrayidx14 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 56
store ptr @.str.19, ptr %arrayidx14, align 16, !tbaa !11
%arrayidx15 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 60
store ptr @.str.20, ptr %arrayidx15, align 16, !tbaa !11
%arrayidx16 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 64
store ptr @.str.21, ptr %arrayidx16, align 16, !tbaa !11
%arrayidx17 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 68
store ptr @.str.22, ptr %arrayidx17, align 16, !tbaa !11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #9
%call.i89 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i81) #9
%call.i8290 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i81)
%1 = load i32, ptr %i.i81, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i81) #9
%cmp2091 = icmp eq i32 %0, 0
br i1 %cmp2091, label %while.end, label %if.end.preheader
if.end.preheader: ; preds = %for.end
%2 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 4
%3 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 8
%4 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 12
%5 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 16
%6 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 20
%7 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 24
%8 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 28
%9 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 32
%10 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 36
%11 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 40
%12 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 44
%13 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 48
%14 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 52
%15 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 56
%16 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 60
%17 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 64
%18 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 68
br label %if.end
if.end: ; preds = %if.end.preheader, %for.end62
%19 = phi i32 [ %50, %for.end62 ], [ %1, %if.end.preheader ]
%20 = phi i32 [ %49, %for.end62 ], [ %0, %if.end.preheader ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(288) %a, i8 0, i64 288, i1 false)
store i32 1, ptr %a, align 16, !tbaa !5
%cmp2386 = icmp sgt i32 %19, 0
br i1 %cmp2386, label %vector.ph.preheader, label %for.body51.preheader
vector.ph.preheader: ; preds = %if.end
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %20, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.ph
vector.ph: ; preds = %vector.ph.preheader, %for.inc46
%i.187 = phi i32 [ %inc47, %for.inc46 ], [ 0, %vector.ph.preheader ]
%wide.load = load <4 x i32>, ptr %a, align 16, !tbaa !5
%21 = mul nsw <4 x i32> %wide.load, %broadcast.splat
store <4 x i32> %21, ptr %a, align 16, !tbaa !5
%wide.load.1 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%22 = mul nsw <4 x i32> %wide.load.1, %broadcast.splat
store <4 x i32> %22, ptr %2, align 16, !tbaa !5
%wide.load.2 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%23 = mul nsw <4 x i32> %wide.load.2, %broadcast.splat
store <4 x i32> %23, ptr %3, align 16, !tbaa !5
%wide.load.3 = load <4 x i32>, ptr %4, align 16, !tbaa !5
%24 = mul nsw <4 x i32> %wide.load.3, %broadcast.splat
store <4 x i32> %24, ptr %4, align 16, !tbaa !5
%wide.load.4 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%25 = mul nsw <4 x i32> %wide.load.4, %broadcast.splat
store <4 x i32> %25, ptr %5, align 16, !tbaa !5
%wide.load.5 = load <4 x i32>, ptr %6, align 16, !tbaa !5
%26 = mul nsw <4 x i32> %wide.load.5, %broadcast.splat
store <4 x i32> %26, ptr %6, align 16, !tbaa !5
%wide.load.6 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%27 = mul nsw <4 x i32> %wide.load.6, %broadcast.splat
store <4 x i32> %27, ptr %7, align 16, !tbaa !5
%wide.load.7 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%28 = mul nsw <4 x i32> %wide.load.7, %broadcast.splat
store <4 x i32> %28, ptr %8, align 16, !tbaa !5
%wide.load.8 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%29 = mul nsw <4 x i32> %wide.load.8, %broadcast.splat
store <4 x i32> %29, ptr %9, align 16, !tbaa !5
%wide.load.9 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%30 = mul nsw <4 x i32> %wide.load.9, %broadcast.splat
store <4 x i32> %30, ptr %10, align 16, !tbaa !5
%wide.load.10 = load <4 x i32>, ptr %11, align 16, !tbaa !5
%31 = mul nsw <4 x i32> %wide.load.10, %broadcast.splat
store <4 x i32> %31, ptr %11, align 16, !tbaa !5
%wide.load.11 = load <4 x i32>, ptr %12, align 16, !tbaa !5
%32 = mul nsw <4 x i32> %wide.load.11, %broadcast.splat
store <4 x i32> %32, ptr %12, align 16, !tbaa !5
%wide.load.12 = load <4 x i32>, ptr %13, align 16, !tbaa !5
%33 = mul nsw <4 x i32> %wide.load.12, %broadcast.splat
store <4 x i32> %33, ptr %13, align 16, !tbaa !5
%wide.load.13 = load <4 x i32>, ptr %14, align 16, !tbaa !5
%34 = mul nsw <4 x i32> %wide.load.13, %broadcast.splat
store <4 x i32> %34, ptr %14, align 16, !tbaa !5
%wide.load.14 = load <4 x i32>, ptr %15, align 16, !tbaa !5
%35 = mul nsw <4 x i32> %wide.load.14, %broadcast.splat
store <4 x i32> %35, ptr %15, align 16, !tbaa !5
%wide.load.15 = load <4 x i32>, ptr %16, align 16, !tbaa !5
%36 = mul nsw <4 x i32> %wide.load.15, %broadcast.splat
store <4 x i32> %36, ptr %16, align 16, !tbaa !5
%wide.load.16 = load <4 x i32>, ptr %17, align 16, !tbaa !5
%37 = mul nsw <4 x i32> %wide.load.16, %broadcast.splat
store <4 x i32> %37, ptr %17, align 16, !tbaa !5
%wide.load.17 = load <4 x i32>, ptr %18, align 16, !tbaa !5
%38 = mul nsw <4 x i32> %wide.load.17, %broadcast.splat
store <4 x i32> %38, ptr %18, align 16, !tbaa !5
%.pre = load i32, ptr %a, align 16, !tbaa !5
br label %for.body35
for.body35: ; preds = %vector.ph, %for.body35
%39 = phi i32 [ %.pre, %vector.ph ], [ %add40, %for.body35 ]
%indvars.iv97 = phi i64 [ 0, %vector.ph ], [ %indvars.iv.next98, %for.body35 ]
%arrayidx37 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 %indvars.iv97
%div = sdiv i32 %39, 10
%indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
%arrayidx39 = getelementptr inbounds [72 x i32], ptr %a, i64 0, i64 %indvars.iv.next98
%40 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%add40 = add nsw i32 %40, %div
store i32 %add40, ptr %arrayidx39, align 4, !tbaa !5
%rem = srem i32 %39, 10
store i32 %rem, ptr %arrayidx37, align 4, !tbaa !5
%exitcond100.not = icmp eq i64 %indvars.iv.next98, 71
br i1 %exitcond100.not, label %for.inc46, label %for.body35, !llvm.loop !15
for.inc46: ; preds = %for.body35
%inc47 = add nuw nsw i32 %i.187, 1
%exitcond101.not = icmp eq i32 %inc47, %19
br i1 %exitcond101.not, label %for.body51.preheader, label %vector.ph, !llvm.loop !16
for.body51.preheader: ; preds = %for.inc46, %if.end
br label %for.body51
for.body51: ; preds = %for.body51.preheader, %if.end60
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %if.end60 ], [ 68, %for.body51.preheader ]
%41 = or i64 %indvars.iv102, 3
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %41
%42 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%mul.i = mul nsw i32 %42, 1000
%43 = or i64 %indvars.iv102, 2
%arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %43
%44 = load i32, ptr %arrayidx3.i, align 8, !tbaa !5
%mul4.i = mul nsw i32 %44, 100
%add5.i = add nsw i32 %mul4.i, %mul.i
%45 = or i64 %indvars.iv102, 1
%arrayidx8.i = getelementptr inbounds i32, ptr %a, i64 %45
%46 = load i32, ptr %arrayidx8.i, align 4, !tbaa !5
%mul9.i = mul nsw i32 %46, 10
%add10.i = add nsw i32 %add5.i, %mul9.i
%arrayidx12.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv102
%47 = load i32, ptr %arrayidx12.i, align 16, !tbaa !5
%add13.i = add nsw i32 %add10.i, %47
%cmp54.not = icmp eq i32 %add13.i, 0
br i1 %cmp54.not, label %if.end60, label %if.then55
if.then55: ; preds = %for.body51
%call56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add13.i)
%arrayidx58 = getelementptr inbounds [72 x ptr], ptr %t, i64 0, i64 %indvars.iv102
%48 = load ptr, ptr %arrayidx58, align 16, !tbaa !11
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %48)
br label %if.end60
if.end60: ; preds = %if.then55, %for.body51
%indvars.iv.next103 = add nsw i64 %indvars.iv102, -4
%cmp50.not = icmp eq i64 %indvars.iv102, 0
br i1 %cmp50.not, label %for.end62, label %for.body51, !llvm.loop !17
for.end62: ; preds = %if.end60
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #9
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
%49 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i81) #9
%call.i82 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i81)
%50 = load i32, ptr %i.i81, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i81) #9
%cmp20 = icmp eq i32 %49, 0
br i1 %cmp20, label %while.end, label %if.end
while.end: ; preds = %for.end62, %for.end
call void @llvm.lifetime.end.p0(i64 576, ptr nonnull %t) #9
call void @llvm.lifetime.end.p0(i64 288, ptr nonnull %a) #9
ret i32 0
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5
; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #8
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nofree nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0,1) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
|
#include<stdio.h>
#include<inttypes.h>
int main()
{
int q,i,j;
uint64_t s[3],sum;
uint64_t mid;
scanf("%d",&q);
for(i=0;i<q;i++)
{
sum=0;
for(j=0;j<3;j++)
{
scanf("%"PRId64"",&s[j]);
sum=sum+s[j];
}
mid=sum/2;
printf("%"PRId64"\n",mid);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1578/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1578/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i32, align 4
%s = alloca [3 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.cond1.preheader.preheader, label %for.end10
for.cond1.preheader.preheader: ; preds = %entry
%arrayidx.1 = getelementptr inbounds [3 x i64], ptr %s, i64 0, i64 1
%arrayidx.2 = getelementptr inbounds [3 x i64], ptr %s, i64 0, i64 2
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.cond1.preheader
%i.020 = phi i32 [ %inc9, %for.cond1.preheader ], [ 0, %for.cond1.preheader.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%1 = load i64, ptr %s, align 16, !tbaa !9
%call4.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.1)
%2 = load i64, ptr %arrayidx.1, align 8, !tbaa !9
%add.1 = add i64 %2, %1
%call4.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.2)
%3 = load i64, ptr %arrayidx.2, align 16, !tbaa !9
%add.2 = add i64 %3, %add.1
%div16 = lshr i64 %add.2, 1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div16)
%inc9 = add nuw nsw i32 %i.020, 1
%4 = load i32, ptr %q, align 4, !tbaa !5
%cmp = icmp slt i32 %inc9, %4
br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.cond1.preheader, %entry
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char s[200002];
int D[200001][2];
int (*d)[2]=D+1;
scanf("%s", s);
int i;
d[-1][0]=d[-1][1]=0;
d[0][0]=1; d[0][1]=INT_MIN;
d[1][0]=s[0]==s[1]?INT_MIN:2; d[1][1]=1;
i=2;{
int f, g;
f=d[i-1][1]+1;
g=d[i-1][0]+1;
if(s[i]!=s[i-1] && g>f) f=g;
d[i][0] = f;
d[i][1] = d[i-2][0]+1;
}
for(i=3; s[i]!=0; i++){
int f, g;
f=d[i-1][1]+1;
g=d[i-1][0]+1;
if(s[i]!=s[i-1] && g>f) f=g;
d[i][0] = f;
f=d[i-2][0]+1;
g=d[i-2][1]+1;
if((s[i]!=s[i-2] || s[i-1]!=s[i-3]) && g>f) f=g;
d[i][1] = f;
}
printf("%d\n", d[i-1][0]>d[i-1][1]?d[i-1][0]:d[i-1][1]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157842/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157842/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [200002 x i8], align 16
%D = alloca [200001 x [2 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 200002, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 1600008, ptr nonnull %D) #4
%add.ptr = getelementptr inbounds [2 x i32], ptr %D, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
store <4 x i32> <i32 0, i32 0, i32 1, i32 -2147483648>, ptr %D, align 16, !tbaa !5
%0 = load i8, ptr %s, align 16, !tbaa !9
%arrayidx10 = getelementptr inbounds [200002 x i8], ptr %s, i64 0, i64 1
%1 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%cmp = icmp eq i8 %0, %1
%cond = select i1 %cmp, i32 -2147483648, i32 2
%arrayidx13 = getelementptr inbounds [2 x i32], ptr %D, i64 2
store i32 %cond, ptr %arrayidx13, align 16, !tbaa !5
%arrayidx16 = getelementptr inbounds [2 x i32], ptr %D, i64 2, i64 1
store i32 1, ptr %arrayidx16, align 4, !tbaa !5
%add23 = or i32 %cond, 1
%arrayidx25 = getelementptr inbounds [200002 x i8], ptr %s, i64 0, i64 2
%2 = load i8, ptr %arrayidx25, align 2, !tbaa !9
%cmp31.not = icmp ne i8 %2, %1
%cmp33 = icmp eq i32 %add23, 3
%or.cond = select i1 %cmp31.not, i1 %cmp33, i1 false
%f.0 = select i1 %or.cond, i32 %add23, i32 2
%arrayidx36 = getelementptr inbounds [2 x i32], ptr %D, i64 3
store i32 %f.0, ptr %arrayidx36, align 8, !tbaa !5
%arrayidx45 = getelementptr inbounds [2 x i32], ptr %D, i64 3, i64 1
store i32 2, ptr %arrayidx45, align 4, !tbaa !5
%arrayidx47192 = getelementptr inbounds [200002 x i8], ptr %s, i64 0, i64 3
%3 = load i8, ptr %arrayidx47192, align 1, !tbaa !9
%cmp49.not193 = icmp eq i8 %3, 0
br i1 %cmp49.not193, label %for.end, label %for.body
for.body: ; preds = %entry, %if.end113
%4 = phi i8 [ %9, %if.end113 ], [ %1, %entry ]
%5 = phi i32 [ %f51.0, %if.end113 ], [ %f.0, %entry ]
%6 = phi i32 [ %f51.1, %if.end113 ], [ 2, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end113 ], [ 3, %entry ]
%7 = phi i8 [ %15, %if.end113 ], [ %3, %entry ]
%8 = add nsw i64 %indvars.iv, -1
%arrayidx68 = getelementptr inbounds [200002 x i8], ptr %s, i64 0, i64 %8
%9 = load i8, ptr %arrayidx68, align 1, !tbaa !9
%cmp70.not = icmp ne i8 %7, %9
%cmp73 = icmp sgt i32 %5, %6
%or.cond190 = select i1 %cmp70.not, i1 %cmp73, i1 false
%f51.0.in = select i1 %or.cond190, i32 %5, i32 %6
%f51.0 = add nsw i32 %f51.0.in, 1
%arrayidx78 = getelementptr inbounds [2 x i32], ptr %add.ptr, i64 %indvars.iv
store i32 %f51.0, ptr %arrayidx78, align 8, !tbaa !5
%10 = add nsw i64 %indvars.iv, -2
%arrayidx82 = getelementptr inbounds [2 x i32], ptr %add.ptr, i64 %10
%11 = load i32, ptr %arrayidx82, align 8, !tbaa !5
%arrayidx88 = getelementptr inbounds [2 x i32], ptr %add.ptr, i64 %10, i64 1
%12 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%cmp97.not = icmp eq i8 %7, %4
br i1 %cmp97.not, label %lor.lhs.false, label %land.lhs.true109
lor.lhs.false: ; preds = %for.body
%13 = add nsw i64 %indvars.iv, -3
%arrayidx105 = getelementptr inbounds [200002 x i8], ptr %s, i64 0, i64 %13
%14 = load i8, ptr %arrayidx105, align 1, !tbaa !9
%cmp107.not = icmp ne i8 %9, %14
%cmp110 = icmp sgt i32 %12, %11
%or.cond191 = select i1 %cmp107.not, i1 %cmp110, i1 false
br i1 %or.cond191, label %if.then112, label %if.end113
land.lhs.true109: ; preds = %for.body
%cmp110.old = icmp sgt i32 %12, %11
br i1 %cmp110.old, label %if.then112, label %if.end113
if.then112: ; preds = %lor.lhs.false, %land.lhs.true109
br label %if.end113
if.end113: ; preds = %if.then112, %land.lhs.true109, %lor.lhs.false
%f51.1.in = phi i32 [ %12, %if.then112 ], [ %11, %land.lhs.true109 ], [ %11, %lor.lhs.false ]
%f51.1 = add nsw i32 %f51.1.in, 1
%arrayidx116 = getelementptr inbounds [2 x i32], ptr %add.ptr, i64 %indvars.iv, i64 1
store i32 %f51.1, ptr %arrayidx116, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx47 = getelementptr inbounds [200002 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%15 = load i8, ptr %arrayidx47, align 1, !tbaa !9
%cmp49.not = icmp eq i8 %15, 0
br i1 %cmp49.not, label %for.end.loopexit, label %for.body, !llvm.loop !10
for.end.loopexit: ; preds = %if.end113
%16 = and i64 %indvars.iv, 4294967295
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i64 [ 2, %entry ], [ %16, %for.end.loopexit ]
%arrayidx119 = getelementptr inbounds [2 x i32], ptr %add.ptr, i64 %i.0.lcssa
%17 = load i32, ptr %arrayidx119, align 8, !tbaa !5
%arrayidx124 = getelementptr inbounds [2 x i32], ptr %add.ptr, i64 %i.0.lcssa, i64 1
%18 = load i32, ptr %arrayidx124, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %17, i32 %18)
%call136 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.)
call void @llvm.lifetime.end.p0(i64 1600008, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 200002, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define MAX 201
int main(void)
{
int i,j,k,D,N,T[MAX],A[MAX],B[MAX],C[MAX],dp[MAX][MAX],z,S;
scanf("%d%d",&D,&N);
for(i=0;i<=D-1;i++)
{
scanf("%d",&T[i]);
}
for(i=0;i<=N-1;i++)
{
scanf("%d%d%d",&A[i],&B[i],&C[i]);
}
for(i=0;i<=N-1;i++)
{
for(j=0;j<=D-1;j++)
{
dp[j][i]=0;
}
}
for(i=1;i<=D-1;i++)
{
for(j=0;j<=N-1;j++)
{
if(A[j]<=T[i] && T[i]<=B[j])
{
for(k=0;k<=N-1;k++)
{
if(A[k]<=T[i-1] && T[i-1]<=B[k])
{
if(C[j]>=C[k])
{
z=C[j]-C[k]+dp[i-1][k];
}
else
{
z=C[k]-C[j]+dp[i-1][k];
}
if(dp[i][j]<=z)
{
dp[i][j]=z;
}
}
}
}
}
}
S=0;
for(i=0;i<=N-1;i++)
{
if(S<=dp[D-1][i])
{
S=dp[D-1][i];
}
}
printf("%d\n",S);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157893/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157893/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%D = alloca i32, align 4
%N = alloca i32, align 4
%T = alloca [201 x i32], align 16
%A = alloca [201 x i32], align 16
%B = alloca [201 x i32], align 16
%C = alloca [201 x i32], align 16
%dp = alloca [201 x [201 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 804, ptr nonnull %T) #4
call void @llvm.lifetime.start.p0(i64 804, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 804, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 804, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 161604, ptr nonnull %dp) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %D, ptr noundef nonnull %N)
%0 = load i32, ptr %D, align 4, !tbaa !5
%cmp.not.not192 = icmp sgt i32 %0, 0
br i1 %cmp.not.not192, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%1 = load i32, ptr %N, align 4, !tbaa !5
%cmp4.not.not194 = icmp sgt i32 %1, 0
br i1 %cmp4.not.not194, label %for.body5, label %for.end138
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [201 x i32], ptr %T, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %D, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond16.preheader: ; preds = %for.body5
%.pre.pre = load i32, ptr %D, align 4, !tbaa !5
%cmp18.not.not198 = icmp sgt i32 %5, 0
br i1 %cmp18.not.not198, label %for.cond20.preheader.lr.ph, label %for.cond34.preheader
for.cond20.preheader.lr.ph: ; preds = %for.cond16.preheader
%cmp22.not.not196 = icmp sgt i32 %.pre.pre, 0
br i1 %cmp22.not.not196, label %for.cond20.preheader.us.preheader, label %for.body122.lr.ph
for.cond20.preheader.us.preheader: ; preds = %for.cond20.preheader.lr.ph
%wide.trip.count223 = zext i32 %5 to i64
%wide.trip.count = zext i32 %.pre.pre to i64
%xtraiter = and i64 %wide.trip.count, 3
%4 = icmp ult i32 %.pre.pre, 4
%unroll_iter = and i64 %wide.trip.count, 4294967292
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond20.preheader.us
for.cond20.preheader.us: ; preds = %for.cond20.preheader.us.preheader, %for.cond20.for.inc31_crit_edge.us
%indvars.iv220 = phi i64 [ 0, %for.cond20.preheader.us.preheader ], [ %indvars.iv.next221, %for.cond20.for.inc31_crit_edge.us ]
br i1 %4, label %for.cond20.for.inc31_crit_edge.us.unr-lcssa, label %for.body23.us
for.body23.us: ; preds = %for.cond20.preheader.us, %for.body23.us
%indvars.iv217 = phi i64 [ %indvars.iv.next218.3, %for.body23.us ], [ 0, %for.cond20.preheader.us ]
%niter = phi i64 [ %niter.next.3, %for.body23.us ], [ 0, %for.cond20.preheader.us ]
%arrayidx27.us = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %indvars.iv217, i64 %indvars.iv220
store i32 0, ptr %arrayidx27.us, align 4, !tbaa !5
%indvars.iv.next218 = or i64 %indvars.iv217, 1
%arrayidx27.us.1 = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %indvars.iv.next218, i64 %indvars.iv220
store i32 0, ptr %arrayidx27.us.1, align 4, !tbaa !5
%indvars.iv.next218.1 = or i64 %indvars.iv217, 2
%arrayidx27.us.2 = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %indvars.iv.next218.1, i64 %indvars.iv220
store i32 0, ptr %arrayidx27.us.2, align 4, !tbaa !5
%indvars.iv.next218.2 = or i64 %indvars.iv217, 3
%arrayidx27.us.3 = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %indvars.iv.next218.2, i64 %indvars.iv220
store i32 0, ptr %arrayidx27.us.3, align 4, !tbaa !5
%indvars.iv.next218.3 = add nuw nsw i64 %indvars.iv217, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond20.for.inc31_crit_edge.us.unr-lcssa, label %for.body23.us, !llvm.loop !11
for.cond20.for.inc31_crit_edge.us.unr-lcssa: ; preds = %for.body23.us, %for.cond20.preheader.us
%indvars.iv217.unr = phi i64 [ 0, %for.cond20.preheader.us ], [ %indvars.iv.next218.3, %for.body23.us ]
br i1 %lcmp.mod.not, label %for.cond20.for.inc31_crit_edge.us, label %for.body23.us.epil
for.body23.us.epil: ; preds = %for.cond20.for.inc31_crit_edge.us.unr-lcssa, %for.body23.us.epil
%indvars.iv217.epil = phi i64 [ %indvars.iv.next218.epil, %for.body23.us.epil ], [ %indvars.iv217.unr, %for.cond20.for.inc31_crit_edge.us.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body23.us.epil ], [ 0, %for.cond20.for.inc31_crit_edge.us.unr-lcssa ]
%arrayidx27.us.epil = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %indvars.iv217.epil, i64 %indvars.iv220
store i32 0, ptr %arrayidx27.us.epil, align 4, !tbaa !5
%indvars.iv.next218.epil = add nuw nsw i64 %indvars.iv217.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond20.for.inc31_crit_edge.us, label %for.body23.us.epil, !llvm.loop !12
for.cond20.for.inc31_crit_edge.us: ; preds = %for.body23.us.epil, %for.cond20.for.inc31_crit_edge.us.unr-lcssa
%indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1
%exitcond224.not = icmp eq i64 %indvars.iv.next221, %wide.trip.count223
br i1 %exitcond224.not, label %for.cond34.preheader, label %for.cond20.preheader.us, !llvm.loop !14
for.body5: ; preds = %for.cond2.preheader, %for.body5
%indvars.iv214 = phi i64 [ %indvars.iv.next215, %for.body5 ], [ 0, %for.cond2.preheader ]
%arrayidx7 = getelementptr inbounds [201 x i32], ptr %A, i64 0, i64 %indvars.iv214
%arrayidx9 = getelementptr inbounds [201 x i32], ptr %B, i64 0, i64 %indvars.iv214
%arrayidx11 = getelementptr inbounds [201 x i32], ptr %C, i64 0, i64 %indvars.iv214
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx9, ptr noundef nonnull %arrayidx11)
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4.not.not = icmp slt i64 %indvars.iv.next215, %6
br i1 %cmp4.not.not, label %for.body5, label %for.cond16.preheader, !llvm.loop !15
for.cond34.preheader: ; preds = %for.cond20.for.inc31_crit_edge.us, %for.cond16.preheader
%cmp36.not.not204 = icmp sgt i32 %.pre.pre, 1
br i1 %cmp36.not.not204, label %for.cond38.preheader.lr.ph, label %for.cond119.preheader
for.cond38.preheader.lr.ph: ; preds = %for.cond34.preheader
br i1 %cmp18.not.not198, label %for.cond38.preheader.us.preheader, label %for.end138
for.cond38.preheader.us.preheader: ; preds = %for.cond38.preheader.lr.ph
%wide.trip.count239 = zext i32 %.pre.pre to i64
%wide.trip.count233 = zext i32 %5 to i64
br label %for.cond38.preheader.us
for.cond38.preheader.us: ; preds = %for.cond38.preheader.us.preheader, %for.cond38.for.inc116_crit_edge.split.us.us
%indvars.iv235 = phi i64 [ 1, %for.cond38.preheader.us.preheader ], [ %indvars.iv.next236, %for.cond38.for.inc116_crit_edge.split.us.us ]
%arrayidx45.us = getelementptr inbounds [201 x i32], ptr %T, i64 0, i64 %indvars.iv235
%7 = load i32, ptr %arrayidx45.us, align 4, !tbaa !5
%8 = add nsw i64 %indvars.iv235, -1
%arrayidx60.us = getelementptr inbounds [201 x i32], ptr %T, i64 0, i64 %8
br label %for.body41.us.us
for.body41.us.us: ; preds = %for.inc113.us.us, %for.cond38.preheader.us
%indvars.iv230 = phi i64 [ %indvars.iv.next231, %for.inc113.us.us ], [ 0, %for.cond38.preheader.us ]
%arrayidx43.us.us = getelementptr inbounds [201 x i32], ptr %A, i64 0, i64 %indvars.iv230
%9 = load i32, ptr %arrayidx43.us.us, align 4, !tbaa !5
%cmp46.not.us.us = icmp sgt i32 %9, %7
br i1 %cmp46.not.us.us, label %for.inc113.us.us, label %land.lhs.true.us.us
land.lhs.true.us.us: ; preds = %for.body41.us.us
%arrayidx50.us.us = getelementptr inbounds [201 x i32], ptr %B, i64 0, i64 %indvars.iv230
%10 = load i32, ptr %arrayidx50.us.us, align 4, !tbaa !5
%cmp51.not.us.us = icmp sgt i32 %7, %10
br i1 %cmp51.not.us.us, label %for.inc113.us.us, label %for.cond52.preheader.us.us
for.body55.us.us: ; preds = %for.cond52.preheader.us.us, %for.inc109.us.us
%indvars.iv225 = phi i64 [ 0, %for.cond52.preheader.us.us ], [ %indvars.iv.next226, %for.inc109.us.us ]
%arrayidx57.us.us = getelementptr inbounds [201 x i32], ptr %A, i64 0, i64 %indvars.iv225
%11 = load i32, ptr %arrayidx57.us.us, align 4, !tbaa !5
%cmp61.not.us.us = icmp sgt i32 %11, %17
br i1 %cmp61.not.us.us, label %for.inc109.us.us, label %land.lhs.true62.us.us
land.lhs.true62.us.us: ; preds = %for.body55.us.us
%arrayidx67.us.us = getelementptr inbounds [201 x i32], ptr %B, i64 0, i64 %indvars.iv225
%12 = load i32, ptr %arrayidx67.us.us, align 4, !tbaa !5
%cmp68.not.us.us = icmp sgt i32 %17, %12
br i1 %cmp68.not.us.us, label %for.inc109.us.us, label %if.then69.us.us
if.then69.us.us: ; preds = %land.lhs.true62.us.us
%13 = load i32, ptr %arrayidx71.us.us, align 4, !tbaa !5
%arrayidx73.us.us = getelementptr inbounds [201 x i32], ptr %C, i64 0, i64 %indvars.iv225
%14 = load i32, ptr %arrayidx73.us.us, align 4, !tbaa !5
%cmp74.not.us.us = icmp slt i32 %13, %14
%arrayidx95.us.us = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %8, i64 %indvars.iv225
%15 = load i32, ptr %arrayidx95.us.us, align 4, !tbaa !5
%sub90.us.us = sub i32 %14, %13
%sub80.us.us = sub i32 %13, %14
%sub90.us.us.sink = select i1 %cmp74.not.us.us, i32 %sub90.us.us, i32 %sub80.us.us
%add96.us.us = add nsw i32 %sub90.us.us.sink, %15
%16 = load i32, ptr %arrayidx100.us.us, align 4, !tbaa !5
%spec.store.select.us.us = call i32 @llvm.smax.i32(i32 %16, i32 %add96.us.us)
store i32 %spec.store.select.us.us, ptr %arrayidx100.us.us, align 4
br label %for.inc109.us.us
for.inc109.us.us: ; preds = %if.then69.us.us, %land.lhs.true62.us.us, %for.body55.us.us
%indvars.iv.next226 = add nuw nsw i64 %indvars.iv225, 1
%exitcond229.not = icmp eq i64 %indvars.iv.next226, %wide.trip.count233
br i1 %exitcond229.not, label %for.inc113.us.us, label %for.body55.us.us, !llvm.loop !16
for.inc113.us.us: ; preds = %for.inc109.us.us, %land.lhs.true.us.us, %for.body41.us.us
%indvars.iv.next231 = add nuw nsw i64 %indvars.iv230, 1
%exitcond234.not = icmp eq i64 %indvars.iv.next231, %wide.trip.count233
br i1 %exitcond234.not, label %for.cond38.for.inc116_crit_edge.split.us.us, label %for.body41.us.us, !llvm.loop !17
for.cond52.preheader.us.us: ; preds = %land.lhs.true.us.us
%17 = load i32, ptr %arrayidx60.us, align 4, !tbaa !5
%arrayidx71.us.us = getelementptr inbounds [201 x i32], ptr %C, i64 0, i64 %indvars.iv230
%arrayidx100.us.us = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %indvars.iv235, i64 %indvars.iv230
br label %for.body55.us.us
for.cond38.for.inc116_crit_edge.split.us.us: ; preds = %for.inc113.us.us
%indvars.iv.next236 = add nuw nsw i64 %indvars.iv235, 1
%exitcond240.not = icmp eq i64 %indvars.iv.next236, %wide.trip.count239
br i1 %exitcond240.not, label %for.cond119.preheader, label %for.cond38.preheader.us, !llvm.loop !18
for.cond119.preheader: ; preds = %for.cond38.for.inc116_crit_edge.split.us.us, %for.cond34.preheader
br i1 %cmp18.not.not198, label %for.body122.lr.ph, label %for.end138
for.body122.lr.ph: ; preds = %for.cond20.preheader.lr.ph, %for.cond119.preheader
%sub123 = add nsw i32 %.pre.pre, -1
%idxprom124 = sext i32 %sub123 to i64
%wide.trip.count244 = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body122.preheader, label %vector.ph
vector.ph: ; preds = %for.body122.lr.ph
%n.vec = and i64 %wide.trip.count244, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ]
%vec.phi284 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%18 = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %idxprom124, i64 %index
%wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !5
%19 = getelementptr inbounds i32, ptr %18, i64 4
%wide.load285 = load <4 x i32>, ptr %19, align 4, !tbaa !5
%20 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load)
%21 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi284, <4 x i32> %wide.load285)
%index.next = add nuw i64 %index, 8
%22 = icmp eq i64 %index.next, %n.vec
br i1 %22, label %middle.block, label %vector.body, !llvm.loop !19
middle.block: ; preds = %vector.body
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %20, <4 x i32> %21)
%23 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count244
br i1 %cmp.n, label %for.end138, label %for.body122.preheader
for.body122.preheader: ; preds = %for.body122.lr.ph, %middle.block
%indvars.iv241.ph = phi i64 [ 0, %for.body122.lr.ph ], [ %n.vec, %middle.block ]
%S.0209.ph = phi i32 [ 0, %for.body122.lr.ph ], [ %23, %middle.block ]
br label %for.body122
for.body122: ; preds = %for.body122.preheader, %for.body122
%indvars.iv241 = phi i64 [ %indvars.iv.next242, %for.body122 ], [ %indvars.iv241.ph, %for.body122.preheader ]
%S.0209 = phi i32 [ %spec.select, %for.body122 ], [ %S.0209.ph, %for.body122.preheader ]
%arrayidx127 = getelementptr inbounds [201 x [201 x i32]], ptr %dp, i64 0, i64 %idxprom124, i64 %indvars.iv241
%24 = load i32, ptr %arrayidx127, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %S.0209, i32 %24)
%indvars.iv.next242 = add nuw nsw i64 %indvars.iv241, 1
%exitcond245.not = icmp eq i64 %indvars.iv.next242, %wide.trip.count244
br i1 %exitcond245.not, label %for.end138, label %for.body122, !llvm.loop !22
for.end138: ; preds = %for.body122, %middle.block, %for.cond2.preheader, %for.cond38.preheader.lr.ph, %for.cond119.preheader
%S.0.lcssa = phi i32 [ 0, %for.cond119.preheader ], [ 0, %for.cond38.preheader.lr.ph ], [ 0, %for.cond2.preheader ], [ %23, %middle.block ], [ %spec.select, %for.body122 ]
%call139 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %S.0.lcssa)
call void @llvm.lifetime.end.p0(i64 161604, ptr nonnull %dp) #4
call void @llvm.lifetime.end.p0(i64 804, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 804, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 804, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 804, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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 <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !10, !21, !20}
|
#include <stdio.h>
int main(){
int c[3][3], flag = 1;
for(int i = 0; i < 3; i++){
scanf("%d %d %d", &c[i][0], &c[i][1], &c[i][2]);
}
for(int i = 0; i < 3; i++){
if(c[1][0] - c[0][0] != c[1][i] - c[0][i]){
flag = 0;
break;
}
if(c[2][0] - c[1][0] != c[2][i] - c[1][i]){
flag = 0;
break;
}
if(c[0][1] - c[0][0] != c[i][1] - c[i][0]){
flag = 0;
break;
}
if(c[0][2] - c[0][1] != c[i][2] - c[i][1]){
flag = 0;
break;
}
}
printf((flag == 1) ? "Yes\n" : "No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157943/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157943/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"Yes\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"No\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
for.cond9:
%c = alloca [3 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #3
%arrayidx4 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 1
%arrayidx7 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx7)
%arrayidx.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1
%arrayidx4.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 1
%arrayidx7.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx4.1, ptr noundef nonnull %arrayidx7.1)
%arrayidx.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2
%arrayidx4.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 1
%arrayidx7.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx4.2, ptr noundef nonnull %arrayidx7.2)
%0 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%1 = load i32, ptr %c, align 16, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %arrayidx.2, align 8
%sub29 = sub nsw i32 %2, %0
%3 = load i32, ptr %arrayidx4, align 4
%sub44 = sub nsw i32 %3, %1
%4 = load i32, ptr %arrayidx7, align 8
%sub59 = sub nsw i32 %4, %3
%5 = load i32, ptr %arrayidx4.1, align 16, !tbaa !5
%sub23.1 = sub nsw i32 %5, %3
%cmp24.not.1 = icmp eq i32 %sub, %sub23.1
br i1 %cmp24.not.1, label %if.end.1, label %cleanup
if.end.1: ; preds = %for.cond9
%6 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5
%sub36.1 = sub nsw i32 %6, %5
%cmp37.not.1 = icmp eq i32 %sub29, %sub36.1
%sub51.1 = sub nsw i32 %5, %0
%cmp52.not.1 = icmp eq i32 %sub44, %sub51.1
%or.cond = select i1 %cmp37.not.1, i1 %cmp52.not.1, i1 false
br i1 %or.cond, label %if.end54.1, label %cleanup
if.end54.1: ; preds = %if.end.1
%7 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5
%sub66.1 = sub nsw i32 %7, %5
%cmp67.not.1 = icmp eq i32 %sub59, %sub66.1
%sub23.2 = sub nsw i32 %7, %4
%cmp24.not.2 = icmp eq i32 %sub, %sub23.2
%or.cond94 = select i1 %cmp67.not.1, i1 %cmp24.not.2, i1 false
br i1 %or.cond94, label %if.end.2, label %cleanup
if.end.2: ; preds = %if.end54.1
%8 = load i32, ptr %arrayidx7.2, align 16, !tbaa !5
%sub36.2 = sub nsw i32 %8, %7
%cmp37.not.2 = icmp eq i32 %sub29, %sub36.2
%sub51.2 = sub nsw i32 %6, %2
%cmp52.not.2 = icmp eq i32 %sub44, %sub51.2
%or.cond95 = select i1 %cmp37.not.2, i1 %cmp52.not.2, i1 false
%sub66.2 = sub nsw i32 %8, %6
%cmp67.not.2 = icmp eq i32 %sub59, %sub66.2
%or.cond96 = select i1 %or.cond95, i1 %cmp67.not.2, i1 false
%spec.select = select i1 %or.cond96, ptr @.str.1, ptr @.str.2
br label %cleanup
cleanup: ; preds = %if.end.2, %if.end54.1, %if.end.1, %for.cond9
%cond = phi ptr [ @.str.2, %for.cond9 ], [ @.str.2, %if.end.1 ], [ @.str.2, %if.end54.1 ], [ %spec.select, %if.end.2 ]
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_GRD_SIZE 3 // グリッドサイズ
// 内部変数
static int si2Grid[D_GRD_SIZE][D_GRD_SIZE]; // グリッド
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpT, *szpFpA;
#endif
// 値取得 - 対象行のb(列2)-b(列1)
int
fGetVal(
int piRow1 // <I> 行1 0~
, int piCol1 // <I> 列1 0~
, int piCol2 // <I> 列2 0~
)
{
// [a1 + b1 = v1] -> [a1 = v1 - b1] -> [v1 - b1 + b2 = v2] -> [b2 - b1 = v2 - v1]
return si2Grid[piRow1][piCol2] - si2Grid[piRow1][piCol1];
}
// 判定
int
fJudge(
)
{
int i, j;
// 列1を、列2・3と比較
for (i = 1; i < D_GRD_SIZE; i++) {
// 行1
int liVal = fGetVal(0, 0, i);
// 行2・3と比較
for (j = 1; j < D_GRD_SIZE; j++) {
int liVal2 = fGetVal(j, 0, i);
if (liVal != liVal2) {
return -1;
}
}
}
return 0;
}
// 実行メイン
int
fMain(
int piTNo // <I> テスト番号 1~
)
{
int i, liRet;
char lc1Buf[1024], lc1Out[1024];
// テストファイルオープン
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
szpFpT = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#endif
// グリッド取得
for (i = 0; i < D_GRD_SIZE; i++) {
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpT);
#else
fgets(lc1Buf, sizeof(lc1Buf), stdin);
#endif
sscanf(lc1Buf, "%d%d%d", &si2Grid[i][0], &si2Grid[i][1], &si2Grid[i][2]);
}
// 判定
liRet = fJudge();
// 結果セット
if (liRet == 0) {
sprintf(lc1Out, "Yes\n");
}
else {
sprintf(lc1Out, "No\n");
}
// 結果表示
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, lc1Out)) {
siRes = -1;
}
#else
printf("%s", lc1Out);
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpT);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", piTNo);
}
else {
printf("NG %d\n", piTNo);
}
#endif
return 0;
}
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
fMain(i);
}
#else
fMain(0);
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158007/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158007/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@si2Grid = internal global [3 x [3 x i32]] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"Yes\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fGetVal(i32 noundef %piRow1, i32 noundef %piCol1, i32 noundef %piCol2) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %piRow1 to i64
%idxprom1 = sext i32 %piCol2 to i64
%arrayidx2 = getelementptr inbounds [3 x [3 x i32]], ptr @si2Grid, i64 0, i64 %idxprom, i64 %idxprom1
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%idxprom5 = sext i32 %piCol1 to i64
%arrayidx6 = getelementptr inbounds [3 x [3 x i32]], ptr @si2Grid, i64 0, i64 %idxprom, i64 %idxprom5
%1 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @fJudge() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @si2Grid, align 16, !tbaa !5
%1 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 0, i64 1), align 4, !tbaa !5
%sub.i = sub nsw i32 %1, %0
%2 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 1), align 16, !tbaa !5
%3 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 0), align 4, !tbaa !5
%sub.i23 = sub nsw i32 %2, %3
%cmp5.not = icmp eq i32 %sub.i, %sub.i23
br i1 %cmp5.not, label %for.cond1, label %cleanup12.loopexit
for.cond1: ; preds = %entry
%4 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 1), align 4, !tbaa !5
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 0), align 8, !tbaa !5
%sub.i23.1 = sub nsw i32 %4, %5
%cmp5.not.1 = icmp eq i32 %sub.i, %sub.i23.1
br i1 %cmp5.not.1, label %for.cond1.1, label %cleanup12.loopexit
for.cond1.1: ; preds = %for.cond1
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 0, i64 2), align 8, !tbaa !5
%sub.i.1 = sub nsw i32 %6, %0
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 2), align 4, !tbaa !5
%sub.i23.131 = sub nsw i32 %7, %3
%cmp5.not.132 = icmp eq i32 %sub.i.1, %sub.i23.131
br i1 %cmp5.not.132, label %for.cond1.133, label %cleanup12.loopexit
for.cond1.133: ; preds = %for.cond1.1
%8 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 2), align 16, !tbaa !5
%sub.i23.1.1 = sub nsw i32 %8, %5
%cmp5.not.1.1 = icmp eq i32 %sub.i.1, %sub.i23.1.1
br i1 %cmp5.not.1.1, label %cleanup12, label %cleanup12.loopexit
cleanup12.loopexit: ; preds = %for.cond1.133, %for.cond1.1, %for.cond1, %entry
br label %cleanup12
cleanup12: ; preds = %for.cond1.133, %cleanup12.loopexit
%retval.4 = phi i32 [ -1, %cleanup12.loopexit ], [ 0, %for.cond1.133 ]
ret i32 %retval.4
}
; 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 @fMain(i32 %piTNo) local_unnamed_addr #2 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%lc1Out = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #5
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%call9 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull @si2Grid, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 0, i64 1), ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 0, i64 2)) #5
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.1 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %1)
%call9.1 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1), ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 1), ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 2)) #5
%2 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.2 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %2)
%call9.2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2), ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 1), ptr noundef nonnull getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 2)) #5
%3 = load i32, ptr @si2Grid, align 16, !tbaa !5
%4 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 0, i64 1), align 4, !tbaa !5
%sub.i.i = sub nsw i32 %4, %3
%5 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 1), align 16, !tbaa !5
%6 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 0), align 4, !tbaa !5
%sub.i23.i = sub nsw i32 %5, %6
%cmp5.not.i = icmp eq i32 %sub.i.i, %sub.i23.i
br i1 %cmp5.not.i, label %for.cond1.i, label %if.else
for.cond1.i: ; preds = %entry
%7 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 1), align 4, !tbaa !5
%8 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 0), align 8, !tbaa !5
%sub.i23.1.i = sub nsw i32 %7, %8
%cmp5.not.1.i = icmp eq i32 %sub.i.i, %sub.i23.1.i
br i1 %cmp5.not.1.i, label %for.cond1.1.i, label %if.else
for.cond1.1.i: ; preds = %for.cond1.i
%9 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 0, i64 2), align 8, !tbaa !5
%sub.i.1.i = sub nsw i32 %9, %3
%10 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 1, i64 2), align 4, !tbaa !5
%sub.i23.131.i = sub nsw i32 %10, %6
%cmp5.not.132.i = icmp eq i32 %sub.i.1.i, %sub.i23.131.i
br i1 %cmp5.not.132.i, label %for.cond1.133.i, label %if.else
for.cond1.133.i: ; preds = %for.cond1.1.i
%11 = load i32, ptr getelementptr inbounds ([3 x [3 x i32]], ptr @si2Grid, i64 0, i64 2, i64 2), align 16, !tbaa !5
%sub.i23.1.1.i = sub nsw i32 %11, %8
%cmp5.not.1.1.i = icmp eq i32 %sub.i.1.i, %sub.i23.1.1.i
br i1 %cmp5.not.1.1.i, label %if.then, label %if.else
if.then: ; preds = %for.cond1.133.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(5) %lc1Out, ptr noundef nonnull align 1 dereferenceable(5) @.str.1, i64 5, i1 false)
br label %if.end
if.else: ; preds = %for.cond1.133.i, %for.cond1.1.i, %for.cond1.i, %entry
store i32 683854, ptr %lc1Out, align 16
br label %if.end
if.end: ; preds = %if.else, %if.then
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %lc1Out)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #5
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%call = tail call i32 @fMain(i32 poison)
ret i32 0
}
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
|
//
// main.c
// Xtest
//
// Created by 山口修史 on 2018/02/21.
// Copyright © 2018年 山口修史. All rights reserved.
//
#include <stdio.h>
int main(void) {
int a[3], b[3];
int i, j;
int c[3][3];
int x;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
scanf("%d", &c[i][j]);
}
}
for(i=0; i<3; i++){
a[i]=0;
b[i]=0;
}
//a[0]=0
for(j=0;j<3;j++){
b[j]=c[0][j];
}
for(i=1;i<3;i++){
a[i]=c[i][1]-b[1];
}
x = 1;
for(i=0;i<3;i++){
for(j=0;j<3;j++){
if(a[i]+b[j] != c[i][j])
x=0;
}
}
if(x == 0){
printf("No");
}else{
printf("Yes");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158050/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158050/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%c = alloca [3 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%arrayidx5.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.1103 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 0
%call.1104 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1103)
%arrayidx5.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 1
%call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.1)
%arrayidx5.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 2
%call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.1)
%arrayidx5.2105 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 0
%call.2106 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2105)
%arrayidx5.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 1
%call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.2)
%arrayidx5.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 2
%call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.2)
%b.sroa.0.0.copyload = load i32, ptr %c, align 16, !tbaa !5
%b.sroa.7.0.copyload = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%b.sroa.11.0.copyload = load i32, ptr %arrayidx5.2, align 8, !tbaa !5
%0 = load i32, ptr %arrayidx5.1.1, align 16, !tbaa !5
%sub = sub nsw i32 %0, %b.sroa.7.0.copyload
%1 = load i32, ptr %arrayidx5.1.2, align 4, !tbaa !5
%sub.1 = sub nsw i32 %1, %b.sroa.7.0.copyload
%add.1112 = add nsw i32 %b.sroa.0.0.copyload, %sub
%2 = load i32, ptr %arrayidx5.1103, align 4, !tbaa !5
%cmp56.not.1114 = icmp ne i32 %add.1112, %2
%add.2.1 = add nsw i32 %b.sroa.11.0.copyload, %sub
%3 = load i32, ptr %arrayidx5.2.1, align 4, !tbaa !5
%cmp56.not.2.1 = icmp ne i32 %add.2.1, %3
%add.2116 = add nsw i32 %b.sroa.0.0.copyload, %sub.1
%4 = load i32, ptr %arrayidx5.2105, align 8, !tbaa !5
%cmp56.not.2118 = icmp ne i32 %add.2116, %4
%add.2.2 = add nsw i32 %b.sroa.11.0.copyload, %sub.1
%5 = load i32, ptr %arrayidx5.2.2, align 16, !tbaa !5
%cmp56.not.2.2 = icmp ne i32 %add.2.2, %5
%.not = select i1 %cmp56.not.2.2, i1 true, i1 %cmp56.not.2118
%6 = select i1 %.not, i1 true, i1 %cmp56.not.2.1
%narrow = select i1 %6, i1 true, i1 %cmp56.not.1114
%.str.1..str.2 = select i1 %narrow, ptr @.str.1, ptr @.str.2
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @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 deg(long long int n){
long long int k=1;
for(int i=0;;i++){
if(n>=k)k*=2;
else {
return i;
break;
}
}
}
long long int pow(int n){
if(n==0)return 1;
else return 2*pow(n-1);
}
int main(void){
long long int A,B;
scanf("%lld %lld",&A,&B);
long long int ans=0;
int Bdeg=deg(B);
int Adeg=deg(A);
int subBdeg;
while(1){
if(Adeg==Bdeg){
A-=pow(Adeg-1);
B-=pow(Bdeg-1);
}
else{
ans+=pow(Bdeg-1);
ans-=A;
subBdeg=deg(B-pow(Bdeg-1));
B=pow(Bdeg-1)+pow(subBdeg)-1;
if(B-pow(Bdeg-1)<A){
ans+=(B-A)+1;
}
else ans+=pow(Bdeg-1);
break;
}
if(A==B){
ans++;
break;
}
Adeg=deg(A);
Bdeg=deg(B);
}
printf("%lld",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158094/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158094/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @deg(i64 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not3 = icmp slt i64 %n, 1
br i1 %cmp.not3, label %if.else, label %if.then
if.then: ; preds = %entry, %if.then
%i.05 = phi i32 [ %inc, %if.then ], [ 0, %entry ]
%k.04 = phi i64 [ %mul, %if.then ], [ 1, %entry ]
%mul = shl nsw i64 %k.04, 1
%inc = add nuw nsw i32 %i.05, 1
%cmp.not = icmp sgt i64 %mul, %n
br i1 %cmp.not, label %if.else, label %if.then
if.else: ; preds = %if.then, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %if.then ]
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @pow(i32 noundef %n) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %n, 0
br i1 %cmp, label %common.ret2, label %if.else
common.ret2: ; preds = %entry, %if.else
%common.ret2.op = phi i64 [ %mul, %if.else ], [ 1, %entry ]
ret i64 %common.ret2.op
if.else: ; preds = %entry
%sub = add nsw i32 %n, -1
%call = tail call i64 @pow(i32 noundef %sub)
%mul = shl nsw i64 %call, 1
br label %common.ret2
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%0 = load i64, ptr %B, align 8, !tbaa !5
%cmp.not3.i = icmp slt i64 %0, 1
br i1 %cmp.not3.i, label %deg.exit, label %if.then.i
if.then.i: ; preds = %entry, %if.then.i
%i.05.i = phi i32 [ %inc.i, %if.then.i ], [ 0, %entry ]
%k.04.i = phi i64 [ %mul.i, %if.then.i ], [ 1, %entry ]
%mul.i = shl nsw i64 %k.04.i, 1
%inc.i = add nuw nsw i32 %i.05.i, 1
%cmp.not.i = icmp sgt i64 %mul.i, %0
br i1 %cmp.not.i, label %deg.exit, label %if.then.i
deg.exit: ; preds = %if.then.i, %entry
%i.0.lcssa.i = phi i32 [ 0, %entry ], [ %inc.i, %if.then.i ]
%1 = load i64, ptr %A, align 8, !tbaa !5
%cmp.not3.i52 = icmp slt i64 %1, 1
br i1 %cmp.not3.i52, label %deg.exit60, label %if.then.i53
if.then.i53: ; preds = %deg.exit, %if.then.i53
%i.05.i54 = phi i32 [ %inc.i57, %if.then.i53 ], [ 0, %deg.exit ]
%k.04.i55 = phi i64 [ %mul.i56, %if.then.i53 ], [ 1, %deg.exit ]
%mul.i56 = shl nsw i64 %k.04.i55, 1
%inc.i57 = add nuw nsw i32 %i.05.i54, 1
%cmp.not.i58 = icmp sgt i64 %mul.i56, %1
br i1 %cmp.not.i58, label %deg.exit60, label %if.then.i53
deg.exit60: ; preds = %if.then.i53, %deg.exit
%i.0.lcssa.i59 = phi i32 [ 0, %deg.exit ], [ %inc.i57, %if.then.i53 ]
%cmp91 = icmp eq i32 %i.0.lcssa.i59, %i.0.lcssa.i
br i1 %cmp91, label %if.then, label %if.else
if.then: ; preds = %deg.exit60, %deg.exit87
%Adeg.095 = phi i32 [ %i.0.lcssa.i77, %deg.exit87 ], [ %i.0.lcssa.i, %deg.exit60 ]
%sub48993 = phi i64 [ %sub4, %deg.exit87 ], [ %1, %deg.exit60 ]
%sub79092 = phi i64 [ %sub7, %deg.exit87 ], [ %0, %deg.exit60 ]
%sub = add nsw i32 %Adeg.095, -1
%call3 = call i64 @pow(i32 noundef %sub)
%sub4 = sub nsw i64 %sub48993, %call3
%sub7 = sub nsw i64 %sub79092, %call3
%cmp33 = icmp eq i64 %sub48993, %sub79092
br i1 %cmp33, label %while.end.loopexit, label %if.end35
while.cond.if.else_crit_edge: ; preds = %deg.exit87
store i64 %sub4, ptr %A, align 8, !tbaa !5
br label %if.else
if.else: ; preds = %while.cond.if.else_crit_edge, %deg.exit60
%2 = phi i64 [ %sub7, %while.cond.if.else_crit_edge ], [ %0, %deg.exit60 ]
%3 = phi i64 [ %sub4, %while.cond.if.else_crit_edge ], [ %1, %deg.exit60 ]
%Bdeg.0.lcssa = phi i32 [ %i.0.lcssa.i86, %while.cond.if.else_crit_edge ], [ %i.0.lcssa.i, %deg.exit60 ]
%sub8 = add nsw i32 %Bdeg.0.lcssa, -1
%call9 = call i64 @pow(i32 noundef %sub8)
%sub10 = sub nsw i64 %call9, %3
%sub13 = sub nsw i64 %2, %call9
%cmp.not3.i61 = icmp slt i64 %sub13, 1
br i1 %cmp.not3.i61, label %deg.exit69, label %if.then.i62
if.then.i62: ; preds = %if.else, %if.then.i62
%i.05.i63 = phi i32 [ %inc.i66, %if.then.i62 ], [ 0, %if.else ]
%k.04.i64 = phi i64 [ %mul.i65, %if.then.i62 ], [ 1, %if.else ]
%mul.i65 = shl nsw i64 %k.04.i64, 1
%inc.i66 = add nuw nsw i32 %i.05.i63, 1
%cmp.not.i67 = icmp sgt i64 %mul.i65, %sub13
br i1 %cmp.not.i67, label %deg.exit69, label %if.then.i62
deg.exit69: ; preds = %if.then.i62, %if.else
%i.0.lcssa.i68 = phi i32 [ 0, %if.else ], [ %inc.i66, %if.then.i62 ]
%call17 = call i64 @pow(i32 noundef %i.0.lcssa.i68)
%add18 = add i64 %call9, -1
%sub19 = add i64 %add18, %call17
store i64 %sub19, ptr %B, align 8, !tbaa !5
%sub22 = sub nsw i64 %sub19, %call9
%cmp23 = icmp slt i64 %sub22, %3
br i1 %cmp23, label %if.then24, label %if.else28
if.then24: ; preds = %deg.exit69
%reass.sub = sub i64 %sub10, %3
%add26 = add i64 %reass.sub, 1
%add27 = add i64 %add26, %sub19
br label %while.end
if.else28: ; preds = %deg.exit69
%add31 = add nsw i64 %sub10, %call9
br label %while.end
if.end35: ; preds = %if.then
%cmp.not3.i70 = icmp slt i64 %sub4, 1
br i1 %cmp.not3.i70, label %deg.exit78, label %if.then.i71
if.then.i71: ; preds = %if.end35, %if.then.i71
%i.05.i72 = phi i32 [ %inc.i75, %if.then.i71 ], [ 0, %if.end35 ]
%k.04.i73 = phi i64 [ %mul.i74, %if.then.i71 ], [ 1, %if.end35 ]
%mul.i74 = shl nsw i64 %k.04.i73, 1
%inc.i75 = add nuw nsw i32 %i.05.i72, 1
%cmp.not.i76 = icmp sgt i64 %mul.i74, %sub4
br i1 %cmp.not.i76, label %deg.exit78, label %if.then.i71
deg.exit78: ; preds = %if.then.i71, %if.end35
%i.0.lcssa.i77 = phi i32 [ 0, %if.end35 ], [ %inc.i75, %if.then.i71 ]
%cmp.not3.i79 = icmp slt i64 %sub7, 1
br i1 %cmp.not3.i79, label %deg.exit87, label %if.then.i80
if.then.i80: ; preds = %deg.exit78, %if.then.i80
%i.05.i81 = phi i32 [ %inc.i84, %if.then.i80 ], [ 0, %deg.exit78 ]
%k.04.i82 = phi i64 [ %mul.i83, %if.then.i80 ], [ 1, %deg.exit78 ]
%mul.i83 = shl nsw i64 %k.04.i82, 1
%inc.i84 = add nuw nsw i32 %i.05.i81, 1
%cmp.not.i85 = icmp sgt i64 %mul.i83, %sub7
br i1 %cmp.not.i85, label %deg.exit87, label %if.then.i80
deg.exit87: ; preds = %if.then.i80, %deg.exit78
%i.0.lcssa.i86 = phi i32 [ 0, %deg.exit78 ], [ %inc.i84, %if.then.i80 ]
%cmp = icmp eq i32 %i.0.lcssa.i77, %i.0.lcssa.i86
br i1 %cmp, label %if.then, label %while.cond.if.else_crit_edge
while.end.loopexit: ; preds = %if.then
store i64 %sub4, ptr %A, align 8, !tbaa !5
store i64 %sub4, ptr %B, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.end.loopexit, %if.then24, %if.else28
%ans.0 = phi i64 [ %add27, %if.then24 ], [ %add31, %if.else28 ], [ 1, %while.end.loopexit ]
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: 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
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 <stdlib.h>
char *
int2str(int n)
{
static char str[4];
str[0] = n/100+'0';
str[1] = n/10%10+'0';
str[2] = n%10+'0';
str[3] = '\0';
return str;
}
void
solver(int n, char *s)
{
int r=0;
int i, j, p;
char *t;
for (i=0; i<1000; i++) {
t = int2str(i);
p=0;
for (j=0; j<n; j++) {
if (t[p]==s[j]) {
if (p==2) {
r++;
break;
}
else {
p++;
}
}
}
}
printf("%d\n", r);
}
int
main(int argc, char *argv[])
{
int n;
char s[30001];
scanf("%d", &n);
scanf("%s", s);
solver(n, s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158137/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158137/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@int2str.str = internal global [4 x i8] zeroinitializer, align 4
@.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 [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local nonnull ptr @int2str(i32 noundef %n) local_unnamed_addr #0 {
entry:
%div = sdiv i32 %n, 100
%0 = trunc i32 %div to i8
%conv = add i8 %0, 48
store i8 %conv, ptr @int2str.str, align 1, !tbaa !5
%div1 = sdiv i32 %n, 10
%rem = srem i32 %div1, 10
%1 = trunc i32 %rem to i8
%conv3 = add nsw i8 %1, 48
store i8 %conv3, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 1), align 1, !tbaa !5
%rem4 = srem i32 %n, 10
%2 = trunc i32 %rem4 to i8
%conv6 = add nsw i8 %2, 48
store i8 %conv6, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 2), align 1, !tbaa !5
store i8 0, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 3), align 1, !tbaa !5
ret ptr @int2str.str
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @solver(i32 noundef %n, ptr nocapture noundef readonly %s) local_unnamed_addr #1 {
entry:
%cmp234 = icmp sgt i32 %n, 0
br i1 %cmp234, label %for.body.us.preheader, label %entry.split
for.body.us.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %for.inc15.us
%r.038.us = phi i32 [ %r.1.us, %for.inc15.us ], [ 0, %for.body.us.preheader ]
%i.037.us = phi i32 [ %inc16.us, %for.inc15.us ], [ 0, %for.body.us.preheader ]
%div.i26.lhs.trunc.us = trunc i32 %i.037.us to i16
%div.i2627.us = udiv i16 %div.i26.lhs.trunc.us, 100
%0 = trunc i16 %div.i2627.us to i8
%conv.i.us = add nuw nsw i8 %0, 48
store i8 %conv.i.us, ptr @int2str.str, align 4, !tbaa !5
%div1.i2829.us = udiv i16 %div.i26.lhs.trunc.us, 10
%rem.i30.lhs.trunc.us = trunc i16 %div1.i2829.us to i8
%rem.i3031.us = urem i8 %rem.i30.lhs.trunc.us, 10
%conv3.i.us = or i8 %rem.i3031.us, 48
store i8 %conv3.i.us, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 1), align 1, !tbaa !5
%rem4.i3233.us = urem i16 %div.i26.lhs.trunc.us, 10
%1 = trunc i16 %rem4.i3233.us to i8
%conv6.i.us = or i8 %1, 48
store i8 %conv6.i.us, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 2), align 2, !tbaa !5
store i8 0, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 3), align 1, !tbaa !5
br label %for.body3.us
for.body3.us: ; preds = %for.body.us, %for.inc.us
%indvars.iv = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next, %for.inc.us ]
%p.036.us = phi i32 [ 0, %for.body.us ], [ %p.1.us, %for.inc.us ]
%idxprom.us = sext i32 %p.036.us to i64
%arrayidx.us = getelementptr inbounds i8, ptr @int2str.str, i64 %idxprom.us
%2 = load i8, ptr %arrayidx.us, align 1, !tbaa !5
%arrayidx5.us = getelementptr inbounds i8, ptr %s, i64 %indvars.iv
%3 = load i8, ptr %arrayidx5.us, align 1, !tbaa !5
%cmp7.us = icmp eq i8 %2, %3
br i1 %cmp7.us, label %if.then.us, label %for.inc.us
if.then.us: ; preds = %for.body3.us
%cmp9.us = icmp eq i32 %p.036.us, 2
br i1 %cmp9.us, label %if.then11.us, label %if.else.us
if.else.us: ; preds = %if.then.us
%inc12.us = add nsw i32 %p.036.us, 1
br label %for.inc.us
for.inc.us: ; preds = %if.else.us, %for.body3.us
%p.1.us = phi i32 [ %inc12.us, %if.else.us ], [ %p.036.us, %for.body3.us ]
%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.inc15.us, label %for.body3.us, !llvm.loop !8
if.then11.us: ; preds = %if.then.us
%inc.us = add nsw i32 %r.038.us, 1
br label %for.inc15.us
for.inc15.us: ; preds = %for.inc.us, %if.then11.us
%r.1.us = phi i32 [ %inc.us, %if.then11.us ], [ %r.038.us, %for.inc.us ]
%inc16.us = add nuw nsw i32 %i.037.us, 1
%exitcond42.not = icmp eq i32 %inc16.us, 1000
br i1 %exitcond42.not, label %for.end17, label %for.body.us, !llvm.loop !10
entry.split: ; preds = %entry
store <4 x i8> <i8 57, i8 57, i8 57, i8 0>, ptr @int2str.str, align 4, !tbaa !5
br label %for.end17
for.end17: ; preds = %for.inc15.us, %entry.split
%.us-phi = phi i32 [ 0, %entry.split ], [ %r.1.us, %for.inc15.us ]
%call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.us-phi)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%s = alloca [30001 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 30001, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s)
%0 = load i32, ptr %n, align 4, !tbaa !11
%cmp234.i = icmp sgt i32 %0, 0
br i1 %cmp234.i, label %for.body.us.preheader.i, label %entry.split.i
for.body.us.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %0 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %for.inc15.us.i, %for.body.us.preheader.i
%r.038.us.i = phi i32 [ %r.1.us.i, %for.inc15.us.i ], [ 0, %for.body.us.preheader.i ]
%i.037.us.i = phi i32 [ %inc16.us.i, %for.inc15.us.i ], [ 0, %for.body.us.preheader.i ]
%div.i26.lhs.trunc.us.i = trunc i32 %i.037.us.i to i16
%div.i2627.us.i = udiv i16 %div.i26.lhs.trunc.us.i, 100
%1 = trunc i16 %div.i2627.us.i to i8
%conv.i.us.i = add nuw nsw i8 %1, 48
store i8 %conv.i.us.i, ptr @int2str.str, align 4, !tbaa !5
%div1.i2829.us.i = udiv i16 %div.i26.lhs.trunc.us.i, 10
%rem.i30.lhs.trunc.us.i = trunc i16 %div1.i2829.us.i to i8
%rem.i3031.us.i = urem i8 %rem.i30.lhs.trunc.us.i, 10
%conv3.i.us.i = or i8 %rem.i3031.us.i, 48
store i8 %conv3.i.us.i, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 1), align 1, !tbaa !5
%rem4.i3233.us.i = urem i16 %div.i26.lhs.trunc.us.i, 10
%2 = trunc i16 %rem4.i3233.us.i to i8
%conv6.i.us.i = or i8 %2, 48
store i8 %conv6.i.us.i, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 2), align 2, !tbaa !5
store i8 0, ptr getelementptr inbounds ([4 x i8], ptr @int2str.str, i64 0, i64 3), align 1, !tbaa !5
br label %for.body3.us.i
for.body3.us.i: ; preds = %for.inc.us.i, %for.body.us.i
%indvars.iv.i = phi i64 [ 0, %for.body.us.i ], [ %indvars.iv.next.i, %for.inc.us.i ]
%p.036.us.i = phi i32 [ 0, %for.body.us.i ], [ %p.1.us.i, %for.inc.us.i ]
%idxprom.us.i = sext i32 %p.036.us.i to i64
%arrayidx.us.i = getelementptr inbounds i8, ptr @int2str.str, i64 %idxprom.us.i
%3 = load i8, ptr %arrayidx.us.i, align 1, !tbaa !5
%arrayidx5.us.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.i
%4 = load i8, ptr %arrayidx5.us.i, align 1, !tbaa !5
%cmp7.us.i = icmp eq i8 %3, %4
br i1 %cmp7.us.i, label %if.then.us.i, label %for.inc.us.i
if.then.us.i: ; preds = %for.body3.us.i
%cmp9.us.i = icmp eq i32 %p.036.us.i, 2
br i1 %cmp9.us.i, label %if.then11.us.i, label %if.else.us.i
if.else.us.i: ; preds = %if.then.us.i
%inc12.us.i = add nsw i32 %p.036.us.i, 1
br label %for.inc.us.i
for.inc.us.i: ; preds = %if.else.us.i, %for.body3.us.i
%p.1.us.i = phi i32 [ %inc12.us.i, %if.else.us.i ], [ %p.036.us.i, %for.body3.us.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 %for.inc15.us.i, label %for.body3.us.i, !llvm.loop !8
if.then11.us.i: ; preds = %if.then.us.i
%inc.us.i = add nsw i32 %r.038.us.i, 1
br label %for.inc15.us.i
for.inc15.us.i: ; preds = %for.inc.us.i, %if.then11.us.i
%r.1.us.i = phi i32 [ %inc.us.i, %if.then11.us.i ], [ %r.038.us.i, %for.inc.us.i ]
%inc16.us.i = add nuw nsw i32 %i.037.us.i, 1
%exitcond42.not.i = icmp eq i32 %inc16.us.i, 1000
br i1 %exitcond42.not.i, label %solver.exit, label %for.body.us.i, !llvm.loop !10
entry.split.i: ; preds = %entry
store <4 x i8> <i8 57, i8 57, i8 57, i8 0>, ptr @int2str.str, align 4, !tbaa !5
br label %solver.exit
solver.exit: ; preds = %for.inc15.us.i, %entry.split.i
%.us-phi.i = phi i32 [ 0, %entry.split.i ], [ %r.1.us.i, %for.inc15.us.i ]
%call18.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.us-phi.i)
call void @llvm.lifetime.end.p0(i64 30001, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !6, i64 0}
|
#include <stdio.h>
int main()
{
long long N;
scanf("%lld", &N);
printf("%lld\n", N * (N - 1) / 2);
fflush(stdout);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158188/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158188/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i64, ptr %N, align 8, !tbaa !5
%sub = add nsw i64 %0, -1
%mul = mul nsw i64 %sub, %0
%div = sdiv i64 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
%1 = load ptr, ptr @stdout, align 8, !tbaa !9
%call2 = call i32 @fflush(ptr noundef %1)
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: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 = !{!"any pointer", !7, i64 0}
|
#include <stdio.h>
int main()
{
long long n;
scanf("%lld",&n);
n --;
printf("%lld",n * (n + 1) / 2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158230/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158230/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%dec = add nsw i64 %0, -1
store i64 %dec, ptr %n, align 8, !tbaa !5
%mul = mul nsw i64 %dec, %0
%div = sdiv i64 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div)
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 int n;
scanf("%ld",&n);
printf("%ld",n*(n-1)/2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158274/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158274/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\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) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%sub = add nsw i64 %0, -1
%mul = mul nsw i64 %sub, %0
%div = sdiv i64 %mul, 2
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div)
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", !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("%ld\n",(long)(N-1)*N/2);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158324/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158324/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%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
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
%sub = add nsw i32 %0, -1
%conv = sext i32 %sub to i64
%conv1 = sext i32 %0 to i64
%mul = mul nsw i64 %conv, %conv1
%div = sdiv i64 %mul, 2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
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>
#define ll long long
int main(){
int k,q;
scanf("%d%d",&k,&q);
ll d[5010];
for(int i=0;i<k;i++){
scanf("%lld",&d[i]);}
for(int i=0;i<q;i++){
ll n,x,m;
scanf("%lld %lld %lld",&n,&x,&m);
ll an=x%m,tmp;
ll zeros=0;
ll amari = (n-1)%k;
for(int j=0;j<k;j++){
tmp = d[j]%m;
if(amari>j){
if(tmp==0) zeros+=(n-1)/k+1;
an += ((n-1)/k+1)*tmp;}
else{
if(tmp==0) zeros+=(n-1)/k;
an+=((n-1)/k)*tmp;}}
//printf("%lld %lld %lld\n",zeros,an,n-1);
ll ans = n-1-zeros-an/m;
printf("%lld\n",ans);}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158368/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158368/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\00", align 1
@.str.2 = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.3 = 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:
%k = alloca i32, align 4
%q = alloca i32, align 4
%d = alloca [5010 x i64], align 16
%n = alloca i64, align 8
%x = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %q)
call void @llvm.lifetime.start.p0(i64 40080, ptr nonnull %d) #3
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp69 = icmp sgt i32 %0, 0
br i1 %cmp69, label %for.body, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.body, %entry
%1 = load i32, ptr %q, align 4, !tbaa !5
%cmp476 = icmp sgt i32 %1, 0
br i1 %cmp476, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [5010 x i64], ptr %d, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %k, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.cond.cleanup12, %for.cond3.preheader
call void @llvm.lifetime.end.p0(i64 40080, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
ret i32 0
for.body6: ; preds = %for.cond3.preheader, %for.cond.cleanup12
%i2.077 = phi i32 [ %inc54, %for.cond.cleanup12 ], [ 0, %for.cond3.preheader ]
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n, ptr noundef nonnull %x, ptr noundef nonnull %m)
%4 = load i64, ptr %x, align 8, !tbaa !11
%5 = load i64, ptr %m, align 8, !tbaa !11
%rem = srem i64 %4, %5
%6 = load i64, ptr %n, align 8, !tbaa !11
%sub = add nsw i64 %6, -1
%7 = load i32, ptr %k, align 4, !tbaa !5
%conv = sext i32 %7 to i64
%rem8 = srem i64 %sub, %conv
%div = sdiv i64 %sub, %conv
%cmp1071 = icmp sgt i32 %7, 0
br i1 %cmp1071, label %for.body13.preheader, label %for.cond.cleanup12
for.body13.preheader: ; preds = %for.body6
%wide.trip.count = zext i32 %7 to i64
%add29 = add nsw i64 %div, 1
br label %for.body13
for.cond.cleanup12: ; preds = %for.inc45, %for.body6
%an.0.lcssa = phi i64 [ %rem, %for.body6 ], [ %an.1, %for.inc45 ]
%zeros.0.lcssa = phi i64 [ 0, %for.body6 ], [ %zeros.3, %for.inc45 ]
%8 = xor i64 %zeros.0.lcssa, -1
%sub49 = add i64 %6, %8
%div50 = sdiv i64 %an.0.lcssa, %5
%sub51 = sub i64 %sub49, %div50
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %sub51)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
%inc54 = add nuw nsw i32 %i2.077, 1
%9 = load i32, ptr %q, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc54, %9
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !13
for.body13: ; preds = %for.body13.preheader, %for.inc45
%indvars.iv79 = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next80, %for.inc45 ]
%zeros.073 = phi i64 [ 0, %for.body13.preheader ], [ %zeros.3, %for.inc45 ]
%an.072 = phi i64 [ %rem, %for.body13.preheader ], [ %an.1, %for.inc45 ]
%arrayidx15 = getelementptr inbounds [5010 x i64], ptr %d, i64 0, i64 %indvars.iv79
%10 = load i64, ptr %arrayidx15, align 8, !tbaa !11
%rem16 = srem i64 %10, %5
%cmp18 = icmp sgt i64 %rem8, %indvars.iv79
%cmp20 = icmp eq i64 %rem16, 0
br i1 %cmp18, label %if.then, label %if.else
if.then: ; preds = %for.body13
%add = add i64 %zeros.073, 1
%add25 = add i64 %add, %div
%zeros.1 = select i1 %cmp20, i64 %add25, i64 %zeros.073
br label %for.inc45
if.else: ; preds = %for.body13
%add37 = select i1 %cmp20, i64 %div, i64 0
%spec.select = add nsw i64 %zeros.073, %add37
br label %for.inc45
for.inc45: ; preds = %if.else, %if.then
%add29.pn = phi i64 [ %add29, %if.then ], [ %div, %if.else ]
%zeros.3 = phi i64 [ %zeros.1, %if.then ], [ %spec.select, %if.else ]
%mul.pn = mul nsw i64 %add29.pn, %rem16
%an.1 = add nsw i64 %mul.pn, %an.072
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%exitcond.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup12, label %for.body13, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_DIGIT_MAX 35 // 最大桁数
// 内部変数
static FILE *szpFpI; // 入力
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
#endif
// 実行メイン
int
fMain(
int piTNo // <I> テスト番号 1~
)
{
int i;
char lc1Buf[1024], lc1Out[1024];
// 入力 - セット
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo);
szpFpI = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#else
szpFpI = stdin;
#endif
// 対象値 - 取得
long long llVal;
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%lld", &llVal);
// llVal = 17;
// 桁毎の値範囲セット
long long ll1RngS[D_DIGIT_MAX];
long long ll1RngE[D_DIGIT_MAX];
ll1RngS[0] = 1;
ll1RngE[0] = 1;
ll1RngS[1] = -2;
ll1RngE[1] = -1;
long long llTwo = 4;
for (i = 2; i < D_DIGIT_MAX; i++) {
if (llTwo > 0) {
ll1RngS[i] = ll1RngE[i - 2] + 1;
ll1RngE[i] = ll1RngE[i - 2] + llTwo;
}
else {
ll1RngS[i] = ll1RngS[i - 2] + llTwo;
ll1RngE[i] = ll1RngS[i - 2] - 1;
}
llTwo *= -2; // 次へ
}
// 開始桁取得
int liDNo = 0;
llTwo = 1;
if (llVal != 0) {
for (i = 0; i < D_DIGIT_MAX; i++) {
if (ll1RngS[i] <= llVal && llVal <= ll1RngE[i]) {
liDNo = i;
break;
}
else {
llTwo *= -2; // 次へ
}
}
}
// 算出
int liSNo = 0;
for (i = liDNo; i >= 0; i--) {
if (ll1RngS[i] <= llVal && llVal <= ll1RngE[i]) {
lc1Out[liSNo] = '1';
llVal -= llTwo; // 現在値更新
}
else {
lc1Out[liSNo] = '0';
}
liSNo++;
llTwo /= -2; // 次へ
}
// 改行
lc1Out[liSNo] = '\n';
lc1Out[liSNo + 1] = '\0';
// 結果 - 表示
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, lc1Out)) {
siRes = -1;
}
#else
printf("%s", lc1Out);
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpI);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", piTNo);
}
else {
printf("NG %d\n", piTNo);
}
#endif
return 0;
}
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
fMain(i);
}
#else
fMain(0);
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158425/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158425/source.c"
target datalayout = "e-m:e-p270: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
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fMain(i32 %piTNo) local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%lc1Out = alloca [1024 x i8], align 16
%llVal = alloca i64, align 8
%ll1RngS = alloca [35 x i64], align 16
%ll1RngE = alloca [35 x i64], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #3
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %llVal) #3
%call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull %llVal) #3
call void @llvm.lifetime.start.p0(i64 280, ptr nonnull %ll1RngS) #3
call void @llvm.lifetime.start.p0(i64 280, ptr nonnull %ll1RngE) #3
store i64 1, ptr %ll1RngS, align 16, !tbaa !9
store i64 1, ptr %ll1RngE, align 16, !tbaa !9
%arrayidx4 = getelementptr inbounds [35 x i64], ptr %ll1RngS, i64 0, i64 1
store i64 -2, ptr %arrayidx4, align 8, !tbaa !9
%arrayidx5 = getelementptr inbounds [35 x i64], ptr %ll1RngE, i64 0, i64 1
store i64 -1, ptr %arrayidx5, align 8, !tbaa !9
br label %for.body
for.body: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %if.end ]
%llTwo.0105 = phi i64 [ 4, %entry ], [ %mul, %if.end ]
%cmp6 = icmp sgt i64 %llTwo.0105, 0
%1 = add nsw i64 %indvars.iv, -2
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %for.body
%arrayidx7 = getelementptr inbounds [35 x i64], ptr %ll1RngE, i64 0, i64 %1
%2 = load i64, ptr %arrayidx7, align 8, !tbaa !9
%add = add nsw i64 %2, 1
%add13 = add nsw i64 %2, %llTwo.0105
br label %if.end
if.else: ; preds = %for.body
%arrayidx18 = getelementptr inbounds [35 x i64], ptr %ll1RngS, i64 0, i64 %1
%3 = load i64, ptr %arrayidx18, align 8, !tbaa !9
%add19 = add nsw i64 %3, %llTwo.0105
%sub25 = add nsw i64 %3, -1
br label %if.end
if.end: ; preds = %if.else, %if.then
%add19.sink = phi i64 [ %add, %if.then ], [ %add19, %if.else ]
%sub25.sink = phi i64 [ %add13, %if.then ], [ %sub25, %if.else ]
%4 = getelementptr inbounds [35 x i64], ptr %ll1RngS, i64 0, i64 %indvars.iv
store i64 %add19.sink, ptr %4, align 8
%5 = getelementptr inbounds [35 x i64], ptr %ll1RngE, i64 0, i64 %indvars.iv
store i64 %sub25.sink, ptr %5, align 8
%mul = mul nsw i64 %llTwo.0105, -2
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 35
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %if.end
%6 = load i64, ptr %llVal, align 8, !tbaa !9
%cmp28.not = icmp eq i64 %6, 0
br i1 %cmp28.not, label %for.body49.preheader, label %for.body32
for.body32: ; preds = %for.end, %if.else40.1
%indvars.iv118 = phi i64 [ %indvars.iv.next119.1, %if.else40.1 ], [ 0, %for.end ]
%llTwo.1107 = phi i64 [ %mul41.1, %if.else40.1 ], [ 1, %for.end ]
%arrayidx34 = getelementptr inbounds [35 x i64], ptr %ll1RngS, i64 0, i64 %indvars.iv118
%7 = load i64, ptr %arrayidx34, align 16, !tbaa !9
%cmp35.not = icmp sgt i64 %7, %6
br i1 %cmp35.not, label %if.else40, label %land.lhs.true
land.lhs.true: ; preds = %for.body32
%arrayidx37 = getelementptr inbounds [35 x i64], ptr %ll1RngE, i64 0, i64 %indvars.iv118
%8 = load i64, ptr %arrayidx37, align 16, !tbaa !9
%cmp38.not = icmp sgt i64 %6, %8
br i1 %cmp38.not, label %if.else40, label %for.body49.preheader.loopexit.split.loop.exit
if.else40: ; preds = %land.lhs.true, %for.body32
%indvars.iv.next119 = or i64 %indvars.iv118, 1
%exitcond121.not = icmp eq i64 %indvars.iv.next119, 35
br i1 %exitcond121.not, label %for.body49.preheader.loopexit, label %for.body32.1, !llvm.loop !13
for.body32.1: ; preds = %if.else40
%arrayidx34.1 = getelementptr inbounds [35 x i64], ptr %ll1RngS, i64 0, i64 %indvars.iv.next119
%9 = load i64, ptr %arrayidx34.1, align 8, !tbaa !9
%cmp35.not.1 = icmp sgt i64 %9, %6
br i1 %cmp35.not.1, label %if.else40.1, label %land.lhs.true.1
land.lhs.true.1: ; preds = %for.body32.1
%arrayidx37.1 = getelementptr inbounds [35 x i64], ptr %ll1RngE, i64 0, i64 %indvars.iv.next119
%10 = load i64, ptr %arrayidx37.1, align 8, !tbaa !9
%cmp38.not.1 = icmp sgt i64 %6, %10
br i1 %cmp38.not.1, label %if.else40.1, label %for.body49.preheader.loopexit.split.loop.exit.split.loop.exit
if.else40.1: ; preds = %land.lhs.true.1, %for.body32.1
%mul41.1 = shl i64 %llTwo.1107, 2
%indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2
br label %for.body32
for.body49.preheader.loopexit.split.loop.exit.split.loop.exit: ; preds = %land.lhs.true.1
%mul41.le = mul nsw i64 %llTwo.1107, -2
br label %for.body49.preheader.loopexit.split.loop.exit
for.body49.preheader.loopexit.split.loop.exit: ; preds = %land.lhs.true, %for.body49.preheader.loopexit.split.loop.exit.split.loop.exit
%indvars.iv118.lcssa = phi i64 [ %indvars.iv.next119, %for.body49.preheader.loopexit.split.loop.exit.split.loop.exit ], [ %indvars.iv118, %land.lhs.true ]
%llTwo.1107.lcssa = phi i64 [ %mul41.le, %for.body49.preheader.loopexit.split.loop.exit.split.loop.exit ], [ %llTwo.1107, %land.lhs.true ]
%11 = trunc i64 %indvars.iv118.lcssa to i32
br label %for.body49.preheader
for.body49.preheader.loopexit: ; preds = %if.else40
%mul41.le141 = mul nsw i64 %llTwo.1107, -2
br label %for.body49.preheader
for.body49.preheader: ; preds = %for.body49.preheader.loopexit, %for.body49.preheader.loopexit.split.loop.exit, %for.end
%llTwo.2 = phi i64 [ 1, %for.end ], [ %llTwo.1107.lcssa, %for.body49.preheader.loopexit.split.loop.exit ], [ %mul41.le141, %for.body49.preheader.loopexit ]
%liDNo.0 = phi i32 [ 0, %for.end ], [ %11, %for.body49.preheader.loopexit.split.loop.exit ], [ 0, %for.body49.preheader.loopexit ]
%12 = zext i32 %liDNo.0 to i64
%13 = add nuw nsw i32 %liDNo.0, 1
%wide.trip.count = zext i32 %13 to i64
br label %for.body49
for.body49: ; preds = %for.body49.preheader, %if.end64
%indvars.iv124 = phi i64 [ %12, %for.body49.preheader ], [ %indvars.iv.next125, %if.end64 ]
%indvars.iv122 = phi i64 [ 0, %for.body49.preheader ], [ %indvars.iv.next123, %if.end64 ]
%llTwo.3113 = phi i64 [ %llTwo.2, %for.body49.preheader ], [ %div, %if.end64 ]
%sub60109111 = phi i64 [ %6, %for.body49.preheader ], [ %sub60108, %if.end64 ]
%arrayidx51 = getelementptr inbounds [35 x i64], ptr %ll1RngS, i64 0, i64 %indvars.iv124
%14 = load i64, ptr %arrayidx51, align 8, !tbaa !9
%cmp52.not = icmp sgt i64 %14, %sub60109111
br i1 %cmp52.not, label %if.else61, label %land.lhs.true53
land.lhs.true53: ; preds = %for.body49
%arrayidx55 = getelementptr inbounds [35 x i64], ptr %ll1RngE, i64 0, i64 %indvars.iv124
%15 = load i64, ptr %arrayidx55, align 8, !tbaa !9
%cmp56.not = icmp sgt i64 %sub60109111, %15
br i1 %cmp56.not, label %if.else61, label %if.then57
if.then57: ; preds = %land.lhs.true53
%arrayidx59 = getelementptr inbounds [1024 x i8], ptr %lc1Out, i64 0, i64 %indvars.iv122
store i8 49, ptr %arrayidx59, align 1, !tbaa !14
%sub60 = sub nsw i64 %sub60109111, %llTwo.3113
store i64 %sub60, ptr %llVal, align 8, !tbaa !9
br label %if.end64
if.else61: ; preds = %land.lhs.true53, %for.body49
%arrayidx63 = getelementptr inbounds [1024 x i8], ptr %lc1Out, i64 0, i64 %indvars.iv122
store i8 48, ptr %arrayidx63, align 1, !tbaa !14
br label %if.end64
if.end64: ; preds = %if.else61, %if.then57
%sub60108 = phi i64 [ %sub60109111, %if.else61 ], [ %sub60, %if.then57 ]
%indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
%div = sdiv i64 %llTwo.3113, -2
%indvars.iv.next125 = add nsw i64 %indvars.iv124, -1
%exitcond129.not = icmp eq i64 %indvars.iv.next123, %wide.trip.count
br i1 %exitcond129.not, label %for.end67, label %for.body49, !llvm.loop !15
for.end67: ; preds = %if.end64
%idxprom68 = zext i32 %13 to i64
%arrayidx69 = getelementptr inbounds [1024 x i8], ptr %lc1Out, i64 0, i64 %idxprom68
store i8 10, ptr %arrayidx69, align 1, !tbaa !14
%add70 = add nuw nsw i32 %liDNo.0, 2
%idxprom71 = zext i32 %add70 to i64
%arrayidx72 = getelementptr inbounds [1024 x i8], ptr %lc1Out, i64 0, i64 %idxprom71
store i8 0, ptr %arrayidx72, align 1, !tbaa !14
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %lc1Out)
call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %ll1RngE) #3
call void @llvm.lifetime.end.p0(i64 280, ptr nonnull %ll1RngS) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %llVal) #3
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #3
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 @fMain(i32 poison)
ret i32 0
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_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;
}
int get_int2(int *a1, int *a2) {
scanf("%d %d", a1, a2);
return 0;
}
struct sushi {
int neta;
int point;
};
#define NUM_MAX 100000
#define TYPES_MAX (NUM_MAX)
int desc_by_point(const void *a1, const void *a2) {
struct sushi *s1 = (struct sushi*)a1;
struct sushi *s2 = (struct sushi*)a2;
return s2->point - s1->point;
}
#define HEAP_MAX (NUM_MAX+100)
#define ROOT_NODE 1
static struct sushi* heap[HEAP_MAX];
static int hidx = ROOT_NODE;
int comp(struct sushi *a1, struct sushi *a2) {
return a1->point > a2->point;
}
void swap(struct sushi **a1, struct sushi **a2) {
struct sushi *tmp = *a1;
*a1 = *a2;
*a2 = tmp;
}
// max heap
void enqueue(struct sushi *s) {
int node = hidx;
heap[hidx++] = s;
int parent;
while((parent = node/2)) {
if(comp(heap[parent], heap[node])) break;
swap(&heap[parent], &heap[node]);
node = parent;
}
return;
}
struct sushi *delete_max(void) {
struct sushi *ans = heap[ROOT_NODE];
heap[ROOT_NODE] = heap[--hidx];
int node = ROOT_NODE;
while(1) {
int largest = node;
int left = node * 2;
int right = node * 2 + 1;
if(left < hidx && !comp(heap[largest], heap[left])) {
largest = left;
}
if(right < hidx && !comp(heap[largest], heap[right])) {
largest = right;
}
if(node == largest) break;
swap(&heap[node], &heap[largest]);
node = largest;
}
return ans;
}
static struct sushi* stack[NUM_MAX+50];
static int sidx = 0;
int is_empty(void) { return !sidx; }
void push(struct sushi *s) { stack[sidx++] = s; }
struct sushi *pop(void) { return stack[--sidx]; }
int main(void) {
int num, k;
get_int2(&num, &k);
int i;
static struct sushi sushis[NUM_MAX];
for(i = 0; i < num; i++) {
get_int2(&sushis[i].neta, &sushis[i].point);
}
qsort(sushis, num, sizeof(struct sushi), desc_by_point);
static char checked[TYPES_MAX+1];
int64_t base = 0;
for(i = 0; i < num; i++) {
struct sushi s = sushis[i];
if(sidx >= k || checked[s.neta]) {
enqueue(&sushis[i]);
continue;
}
checked[s.neta]++;
base += s.point;
push(&sushis[i]);
}
// if (# of types) < K
for(i = sidx; i < k; i++) {
struct sushi *s = delete_max();
base += s->point;
}
#ifdef DEBUG
printf("[stack: %d heap: %d] %lld\n", sidx, hidx, base);
#endif
int64_t ans = base + (int64_t)sidx*sidx; // when x=max
while(!is_empty() && hidx>1) {
struct sushi *trash = pop();
struct sushi *s = delete_max();
base = base - trash->point + s->point;
#ifdef DEBUG
printf("[stack: %d heap: %d] %lld\n", sidx, hidx, base);
#endif
ans = max(ans, base + (int64_t)sidx*sidx);
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158469/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158469/source.c"
target datalayout = "e-m:e-p270: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.sushi = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@hidx = internal unnamed_addr global i32 1, align 4
@heap = internal unnamed_addr global [100100 x ptr] zeroinitializer, align 16
@sidx = internal unnamed_addr global i32 0, align 4
@stack = internal unnamed_addr global [100050 x ptr] zeroinitializer, align 16
@main.sushis = internal global [100000 x %struct.sushi] zeroinitializer, align 16
@main.checked = internal unnamed_addr global [100001 x i8] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @get_int() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #10
%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) #10
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 @get_int2(ptr noundef %a1, ptr noundef %a2) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %a1, ptr noundef %a2)
ret i32 0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @desc_by_point(ptr nocapture noundef readonly %a1, ptr nocapture noundef readonly %a2) #3 {
entry:
%point = getelementptr inbounds %struct.sushi, ptr %a2, i64 0, i32 1
%0 = load i32, ptr %point, align 4, !tbaa !9
%point1 = getelementptr inbounds %struct.sushi, ptr %a1, i64 0, i32 1
%1 = load i32, ptr %point1, align 4, !tbaa !9
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @comp(ptr nocapture noundef readonly %a1, ptr nocapture noundef readonly %a2) local_unnamed_addr #3 {
entry:
%point = getelementptr inbounds %struct.sushi, ptr %a1, i64 0, i32 1
%0 = load i32, ptr %point, align 4, !tbaa !9
%point1 = getelementptr inbounds %struct.sushi, ptr %a2, i64 0, i32 1
%1 = load i32, ptr %point1, align 4, !tbaa !9
%cmp = icmp sgt i32 %0, %1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a1, ptr nocapture noundef %a2) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %a1, align 8, !tbaa !11
%1 = load ptr, ptr %a2, align 8, !tbaa !11
store ptr %1, ptr %a1, align 8, !tbaa !11
store ptr %0, ptr %a2, align 8, !tbaa !11
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local void @enqueue(ptr noundef %s) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr @hidx, align 4, !tbaa !5
%inc = add i32 %0, 1
store i32 %inc, ptr @hidx, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom
store ptr %s, ptr %arrayidx, align 8, !tbaa !11
%tobool.not16 = icmp ult i32 %inc, 3
br i1 %tobool.not16, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%node.017 = phi i32 [ %div18, %if.end ], [ %0, %entry ]
%div18 = sdiv i32 %node.017, 2
%idxprom1 = sext i32 %div18 to i64
%arrayidx2 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom1
%1 = load ptr, ptr %arrayidx2, align 8, !tbaa !11
%idxprom3 = sext i32 %node.017 to i64
%arrayidx4 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom3
%2 = load ptr, ptr %arrayidx4, align 8, !tbaa !11
%point.i = getelementptr inbounds %struct.sushi, ptr %1, i64 0, i32 1
%3 = load i32, ptr %point.i, align 4, !tbaa !9
%point1.i = getelementptr inbounds %struct.sushi, ptr %2, i64 0, i32 1
%4 = load i32, ptr %point1.i, align 4, !tbaa !9
%cmp.i.not = icmp sgt i32 %3, %4
br i1 %cmp.i.not, label %while.end, label %if.end
if.end: ; preds = %while.body
store ptr %2, ptr %arrayidx2, align 8, !tbaa !11
store ptr %1, ptr %arrayidx4, align 8, !tbaa !11
%node.0.off = add nsw i32 %div18, 1
%tobool.not = icmp ult i32 %node.0.off, 3
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %if.end, %while.body, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local ptr @delete_max() local_unnamed_addr #5 {
entry:
%0 = load ptr, ptr getelementptr inbounds ([100100 x ptr], ptr @heap, i64 0, i64 1), align 8, !tbaa !11
%1 = load i32, ptr @hidx, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr @hidx, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom
%2 = load ptr, ptr %arrayidx, align 8, !tbaa !11
store ptr %2, ptr getelementptr inbounds ([100100 x ptr], ptr @heap, i64 0, i64 1), align 8, !tbaa !11
%point.i = getelementptr inbounds %struct.sushi, ptr %2, i64 0, i32 1
br label %while.cond
while.cond: ; preds = %cleanup, %entry
%node.0 = phi i32 [ 1, %entry ], [ %largest.1, %cleanup ]
%mul = shl nsw i32 %node.0, 1
%add = or i32 %mul, 1
%cmp = icmp slt i32 %mul, %dec
br i1 %cmp, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %while.cond
%idxprom4 = sext i32 %mul to i64
%arrayidx5 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom4
%3 = load ptr, ptr %arrayidx5, align 16, !tbaa !11
%4 = load i32, ptr %point.i, align 4, !tbaa !9
%point1.i = getelementptr inbounds %struct.sushi, ptr %3, i64 0, i32 1
%5 = load i32, ptr %point1.i, align 4, !tbaa !9
%cmp.i.not = icmp sgt i32 %4, %5
%spec.select = select i1 %cmp.i.not, i32 %node.0, i32 %mul
br label %if.end
if.end: ; preds = %land.lhs.true, %while.cond
%largest.0 = phi i32 [ %node.0, %while.cond ], [ %spec.select, %land.lhs.true ]
%cmp6 = icmp slt i32 %add, %dec
br i1 %cmp6, label %land.lhs.true7, label %if.end15
land.lhs.true7: ; preds = %if.end
%idxprom8 = sext i32 %largest.0 to i64
%arrayidx9 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom8
%6 = load ptr, ptr %arrayidx9, align 8, !tbaa !11
%idxprom10 = sext i32 %add to i64
%arrayidx11 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom10
%7 = load ptr, ptr %arrayidx11, align 8, !tbaa !11
%point.i40 = getelementptr inbounds %struct.sushi, ptr %6, i64 0, i32 1
%8 = load i32, ptr %point.i40, align 4, !tbaa !9
%point1.i41 = getelementptr inbounds %struct.sushi, ptr %7, i64 0, i32 1
%9 = load i32, ptr %point1.i41, align 4, !tbaa !9
%cmp.i42.not = icmp sgt i32 %8, %9
%spec.select39 = select i1 %cmp.i42.not, i32 %largest.0, i32 %add
br label %if.end15
if.end15: ; preds = %land.lhs.true7, %if.end
%largest.1 = phi i32 [ %largest.0, %if.end ], [ %spec.select39, %land.lhs.true7 ]
%cmp16 = icmp eq i32 %node.0, %largest.1
br i1 %cmp16, label %while.end, label %cleanup
cleanup: ; preds = %if.end15
%idxprom19 = sext i32 %node.0 to i64
%arrayidx20 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom19
%idxprom21 = sext i32 %largest.1 to i64
%arrayidx22 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom21
%10 = load ptr, ptr %arrayidx22, align 8, !tbaa !11
store ptr %10, ptr %arrayidx20, align 8, !tbaa !11
store ptr %2, ptr %arrayidx22, align 8, !tbaa !11
br label %while.cond
while.end: ; preds = %if.end15
ret ptr %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @is_empty() local_unnamed_addr #6 {
entry:
%0 = load i32, ptr @sidx, align 4, !tbaa !5
%tobool.not = icmp eq i32 %0, 0
%lnot.ext = zext i1 %tobool.not to i32
ret i32 %lnot.ext
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @push(ptr noundef %s) local_unnamed_addr #7 {
entry:
%0 = load i32, ptr @sidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @sidx, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100050 x ptr], ptr @stack, i64 0, i64 %idxprom
store ptr %s, ptr %arrayidx, align 8, !tbaa !11
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local ptr @pop() local_unnamed_addr #7 {
entry:
%0 = load i32, ptr @sidx, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr @sidx, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [100050 x ptr], ptr @stack, i64 0, i64 %idxprom
%1 = load ptr, ptr %arrayidx, align 8, !tbaa !11
ret ptr %1
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #10
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %num, ptr noundef nonnull %k)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp140 = icmp sgt i32 %0, 0
br i1 %cmp140, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre189 = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x %struct.sushi], ptr @main.sushis, i64 0, i64 %indvars.iv
%point = getelementptr inbounds [100000 x %struct.sushi], ptr @main.sushis, i64 0, i64 %indvars.iv, i32 1
%call.i90 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %point)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %num, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !15
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre189, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull @main.sushis, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @desc_by_point) #10
%3 = load i32, ptr %num, align 4, !tbaa !5
%cmp5146 = icmp sgt i32 %3, 0
br i1 %cmp5146, label %for.body7.lr.ph, label %for.end.for.end28_crit_edge
for.end.for.end28_crit_edge: ; preds = %for.end
%.pre = load i32, ptr @sidx, align 4, !tbaa !5
%.pre186 = load i32, ptr %k, align 4, !tbaa !5
%hidx.promoted152.pre = load i32, ptr @hidx, align 4
br label %for.end28
for.body7.lr.ph: ; preds = %for.end
%hidx.promoted = load i32, ptr @hidx, align 4
%sidx.promoted = load i32, ptr @sidx, align 4, !tbaa !5
%4 = load i32, ptr %k, align 4, !tbaa !5
%wide.trip.count = zext i32 %3 to i64
br label %for.body7
for.body7: ; preds = %for.body7.lr.ph, %cleanup
%indvars.iv172 = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next173, %cleanup ]
%base.0149 = phi i64 [ 0, %for.body7.lr.ph ], [ %base.1, %cleanup ]
%inc.i91143148 = phi i32 [ %sidx.promoted, %for.body7.lr.ph ], [ %inc.i91142, %cleanup ]
%inc.i145147 = phi i32 [ %hidx.promoted, %for.body7.lr.ph ], [ %inc.i144, %cleanup ]
%arrayidx9 = getelementptr inbounds [100000 x %struct.sushi], ptr @main.sushis, i64 0, i64 %indvars.iv172
%s.sroa.5.0.arrayidx9.sroa_idx = getelementptr inbounds i8, ptr %arrayidx9, i64 4
%s.sroa.5.0.copyload = load i32, ptr %s.sroa.5.0.arrayidx9.sroa_idx, align 4, !tbaa.struct !16
%cmp10.not = icmp slt i32 %inc.i91143148, %4
br i1 %cmp10.not, label %lor.lhs.false, label %if.then
lor.lhs.false: ; preds = %for.body7
%s.sroa.0.0.copyload = load i32, ptr %arrayidx9, align 8, !tbaa.struct !17
%idxprom13 = sext i32 %s.sroa.0.0.copyload to i64
%arrayidx14 = getelementptr inbounds [100001 x i8], ptr @main.checked, i64 0, i64 %idxprom13
%5 = load i8, ptr %arrayidx14, align 1, !tbaa !18
%tobool.not = icmp eq i8 %5, 0
br i1 %tobool.not, label %if.end, label %if.then
if.then: ; preds = %lor.lhs.false, %for.body7
%inc.i = add i32 %inc.i145147, 1
store i32 %inc.i, ptr @hidx, align 4, !tbaa !5
%idxprom.i = sext i32 %inc.i145147 to i64
%arrayidx.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom.i
store ptr %arrayidx9, ptr %arrayidx.i, align 8, !tbaa !11
%tobool.not16.i = icmp ult i32 %inc.i, 3
br i1 %tobool.not16.i, label %cleanup, label %while.body.i
while.body.i: ; preds = %if.then, %if.end.i
%node.017.i = phi i32 [ %div18.i, %if.end.i ], [ %inc.i145147, %if.then ]
%div18.i = sdiv i32 %node.017.i, 2
%idxprom1.i = sext i32 %div18.i to i64
%arrayidx2.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom1.i
%6 = load ptr, ptr %arrayidx2.i, align 8, !tbaa !11
%idxprom3.i = sext i32 %node.017.i to i64
%arrayidx4.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom3.i
%7 = load ptr, ptr %arrayidx4.i, align 8, !tbaa !11
%point.i.i = getelementptr inbounds %struct.sushi, ptr %6, i64 0, i32 1
%8 = load i32, ptr %point.i.i, align 4, !tbaa !9
%point1.i.i = getelementptr inbounds %struct.sushi, ptr %7, i64 0, i32 1
%9 = load i32, ptr %point1.i.i, align 4, !tbaa !9
%cmp.i.not.i = icmp sgt i32 %8, %9
br i1 %cmp.i.not.i, label %cleanup, label %if.end.i
if.end.i: ; preds = %while.body.i
store ptr %7, ptr %arrayidx2.i, align 8, !tbaa !11
store ptr %6, ptr %arrayidx4.i, align 8, !tbaa !11
%node.0.off.i = add nsw i32 %div18.i, 1
%tobool.not.i = icmp ult i32 %node.0.off.i, 3
br i1 %tobool.not.i, label %cleanup, label %while.body.i, !llvm.loop !13
if.end: ; preds = %lor.lhs.false
store i8 1, ptr %arrayidx14, align 1, !tbaa !18
%conv23 = sext i32 %s.sroa.5.0.copyload to i64
%add = add nsw i64 %base.0149, %conv23
%inc.i91 = add nsw i32 %inc.i91143148, 1
store i32 %inc.i91, ptr @sidx, align 4, !tbaa !5
%idxprom.i92 = sext i32 %inc.i91143148 to i64
%arrayidx.i93 = getelementptr inbounds [100050 x ptr], ptr @stack, i64 0, i64 %idxprom.i92
store ptr %arrayidx9, ptr %arrayidx.i93, align 8, !tbaa !11
br label %cleanup
cleanup: ; preds = %if.end.i, %while.body.i, %if.then, %if.end
%inc.i144 = phi i32 [ %inc.i145147, %if.end ], [ %inc.i, %if.then ], [ %inc.i, %while.body.i ], [ %inc.i, %if.end.i ]
%inc.i91142 = phi i32 [ %inc.i91, %if.end ], [ %inc.i91143148, %if.then ], [ %inc.i91143148, %while.body.i ], [ %inc.i91143148, %if.end.i ]
%base.1 = phi i64 [ %add, %if.end ], [ %base.0149, %if.then ], [ %base.0149, %while.body.i ], [ %base.0149, %if.end.i ]
%indvars.iv.next173 = add nuw nsw i64 %indvars.iv172, 1
%exitcond.not = icmp eq i64 %indvars.iv.next173, %wide.trip.count
br i1 %exitcond.not, label %for.end28, label %for.body7, !llvm.loop !19
for.end28: ; preds = %cleanup, %for.end.for.end28_crit_edge
%hidx.promoted152 = phi i32 [ %hidx.promoted152.pre, %for.end.for.end28_crit_edge ], [ %inc.i144, %cleanup ]
%10 = phi i32 [ %.pre186, %for.end.for.end28_crit_edge ], [ %4, %cleanup ]
%sidx.promoted159 = phi i32 [ %.pre, %for.end.for.end28_crit_edge ], [ %inc.i91142, %cleanup ]
%base.0.lcssa = phi i64 [ 0, %for.end.for.end28_crit_edge ], [ %base.1, %cleanup ]
%cmp30154 = icmp slt i32 %sidx.promoted159, %10
br i1 %cmp30154, label %for.body32.preheader, label %for.end40
for.body32.preheader: ; preds = %for.end28
%11 = sext i32 %hidx.promoted152 to i64
br label %for.body32
for.body32: ; preds = %for.body32.preheader, %delete_max.exit
%indvars.iv175 = phi i64 [ %11, %for.body32.preheader ], [ %indvars.iv.next176, %delete_max.exit ]
%i.2157 = phi i32 [ %sidx.promoted159, %for.body32.preheader ], [ %inc39, %delete_max.exit ]
%base.2156 = phi i64 [ %base.0.lcssa, %for.body32.preheader ], [ %add37, %delete_max.exit ]
%12 = load ptr, ptr getelementptr inbounds ([100100 x ptr], ptr @heap, i64 0, i64 1), align 8, !tbaa !11
%indvars.iv.next176 = add nsw i64 %indvars.iv175, -1
%arrayidx.i95 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %indvars.iv.next176
%13 = load ptr, ptr %arrayidx.i95, align 8, !tbaa !11
store ptr %13, ptr getelementptr inbounds ([100100 x ptr], ptr @heap, i64 0, i64 1), align 8, !tbaa !11
%point.i.i96 = getelementptr inbounds %struct.sushi, ptr %13, i64 0, i32 1
br label %while.cond.i
while.cond.i: ; preds = %cleanup.i, %for.body32
%node.0.i = phi i32 [ 1, %for.body32 ], [ %largest.1.i, %cleanup.i ]
%mul.i = shl nsw i32 %node.0.i, 1
%add.i = or i32 %mul.i, 1
%14 = sext i32 %mul.i to i64
%cmp.i = icmp sgt i64 %indvars.iv.next176, %14
br i1 %cmp.i, label %land.lhs.true.i, label %if.end.i97
land.lhs.true.i: ; preds = %while.cond.i
%arrayidx5.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %14
%15 = load ptr, ptr %arrayidx5.i, align 16, !tbaa !11
%16 = load i32, ptr %point.i.i96, align 4, !tbaa !9
%point1.i.i98 = getelementptr inbounds %struct.sushi, ptr %15, i64 0, i32 1
%17 = load i32, ptr %point1.i.i98, align 4, !tbaa !9
%cmp.i.not.i99 = icmp sgt i32 %16, %17
%spec.select.i = select i1 %cmp.i.not.i99, i32 %node.0.i, i32 %mul.i
br label %if.end.i97
if.end.i97: ; preds = %land.lhs.true.i, %while.cond.i
%largest.0.i = phi i32 [ %node.0.i, %while.cond.i ], [ %spec.select.i, %land.lhs.true.i ]
%18 = sext i32 %add.i to i64
%cmp6.i = icmp sgt i64 %indvars.iv.next176, %18
br i1 %cmp6.i, label %land.lhs.true7.i, label %if.end15.i
land.lhs.true7.i: ; preds = %if.end.i97
%idxprom8.i = sext i32 %largest.0.i to i64
%arrayidx9.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom8.i
%19 = load ptr, ptr %arrayidx9.i, align 8, !tbaa !11
%arrayidx11.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %18
%20 = load ptr, ptr %arrayidx11.i, align 8, !tbaa !11
%point.i40.i = getelementptr inbounds %struct.sushi, ptr %19, i64 0, i32 1
%21 = load i32, ptr %point.i40.i, align 4, !tbaa !9
%point1.i41.i = getelementptr inbounds %struct.sushi, ptr %20, i64 0, i32 1
%22 = load i32, ptr %point1.i41.i, align 4, !tbaa !9
%cmp.i42.not.i = icmp sgt i32 %21, %22
%spec.select39.i = select i1 %cmp.i42.not.i, i32 %largest.0.i, i32 %add.i
br label %if.end15.i
if.end15.i: ; preds = %land.lhs.true7.i, %if.end.i97
%largest.1.i = phi i32 [ %largest.0.i, %if.end.i97 ], [ %spec.select39.i, %land.lhs.true7.i ]
%cmp16.i = icmp eq i32 %node.0.i, %largest.1.i
br i1 %cmp16.i, label %delete_max.exit, label %cleanup.i
cleanup.i: ; preds = %if.end15.i
%idxprom19.i = sext i32 %node.0.i to i64
%arrayidx20.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom19.i
%idxprom21.i = sext i32 %largest.1.i to i64
%arrayidx22.i = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom21.i
%23 = load ptr, ptr %arrayidx22.i, align 8, !tbaa !11
store ptr %23, ptr %arrayidx20.i, align 8, !tbaa !11
store ptr %13, ptr %arrayidx22.i, align 8, !tbaa !11
br label %while.cond.i
delete_max.exit: ; preds = %if.end15.i
%point35 = getelementptr inbounds %struct.sushi, ptr %12, i64 0, i32 1
%24 = load i32, ptr %point35, align 4, !tbaa !9
%conv36 = sext i32 %24 to i64
%add37 = add nsw i64 %base.2156, %conv36
%inc39 = add nsw i32 %i.2157, 1
%exitcond178.not = icmp eq i32 %inc39, %10
br i1 %exitcond178.not, label %for.cond29.for.end40_crit_edge, label %for.body32, !llvm.loop !20
for.cond29.for.end40_crit_edge: ; preds = %delete_max.exit
%25 = trunc i64 %indvars.iv.next176 to i32
store i32 %25, ptr @hidx, align 4, !tbaa !5
br label %for.end40
for.end40: ; preds = %for.cond29.for.end40_crit_edge, %for.end28
%hidx.promoted161 = phi i32 [ %25, %for.cond29.for.end40_crit_edge ], [ %hidx.promoted152, %for.end28 ]
%base.2.lcssa = phi i64 [ %add37, %for.cond29.for.end40_crit_edge ], [ %base.0.lcssa, %for.end28 ]
%conv41 = sext i32 %sidx.promoted159 to i64
%mul = mul nsw i64 %conv41, %conv41
%add43 = add nsw i64 %base.2.lcssa, %mul
%tobool.not.i100163 = icmp ne i32 %sidx.promoted159, 0
%cmp46164 = icmp sgt i32 %hidx.promoted161, 1
%26 = select i1 %tobool.not.i100163, i1 %cmp46164, i1 false
br i1 %26, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %for.end40
%27 = zext i32 %hidx.promoted161 to i64
br label %while.body
while.body: ; preds = %while.body.preheader, %delete_max.exit139
%indvars.iv181 = phi i64 [ %27, %while.body.preheader ], [ %indvars.iv.next182, %delete_max.exit139 ]
%indvars.iv179 = phi i64 [ %conv41, %while.body.preheader ], [ %indvars.iv.next180, %delete_max.exit139 ]
%ans.0168 = phi i64 [ %add43, %while.body.preheader ], [ %ans.0.add59, %delete_max.exit139 ]
%base.3167 = phi i64 [ %base.2.lcssa, %while.body.preheader ], [ %add55, %delete_max.exit139 ]
%indvars.iv.next180 = add nsw i64 %indvars.iv179, -1
%arrayidx.i103 = getelementptr inbounds [100050 x ptr], ptr @stack, i64 0, i64 %indvars.iv.next180
%28 = load ptr, ptr %arrayidx.i103, align 8, !tbaa !11
%29 = load ptr, ptr getelementptr inbounds ([100100 x ptr], ptr @heap, i64 0, i64 1), align 8, !tbaa !11
%indvars.iv.next182 = add nsw i64 %indvars.iv181, -1
%indvars184 = trunc i64 %indvars.iv.next182 to i32
%idxprom.i105 = and i64 %indvars.iv.next182, 4294967295
%arrayidx.i106 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom.i105
%30 = load ptr, ptr %arrayidx.i106, align 8, !tbaa !11
store ptr %30, ptr getelementptr inbounds ([100100 x ptr], ptr @heap, i64 0, i64 1), align 8, !tbaa !11
%point.i.i107 = getelementptr inbounds %struct.sushi, ptr %30, i64 0, i32 1
br label %while.cond.i108
while.cond.i108: ; preds = %cleanup.i119, %while.body
%node.0.i109 = phi i32 [ 1, %while.body ], [ %largest.1.i117, %cleanup.i119 ]
%mul.i110 = shl nsw i32 %node.0.i109, 1
%add.i111 = or i32 %mul.i110, 1
%cmp.i112 = icmp slt i32 %mul.i110, %indvars184
br i1 %cmp.i112, label %land.lhs.true.i133, label %if.end.i113
land.lhs.true.i133: ; preds = %while.cond.i108
%idxprom4.i134 = sext i32 %mul.i110 to i64
%arrayidx5.i135 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom4.i134
%31 = load ptr, ptr %arrayidx5.i135, align 16, !tbaa !11
%32 = load i32, ptr %point.i.i107, align 4, !tbaa !9
%point1.i.i136 = getelementptr inbounds %struct.sushi, ptr %31, i64 0, i32 1
%33 = load i32, ptr %point1.i.i136, align 4, !tbaa !9
%cmp.i.not.i137 = icmp sgt i32 %32, %33
%spec.select.i138 = select i1 %cmp.i.not.i137, i32 %node.0.i109, i32 %mul.i110
br label %if.end.i113
if.end.i113: ; preds = %land.lhs.true.i133, %while.cond.i108
%largest.0.i114 = phi i32 [ %node.0.i109, %while.cond.i108 ], [ %spec.select.i138, %land.lhs.true.i133 ]
%cmp6.i115 = icmp slt i32 %add.i111, %indvars184
br i1 %cmp6.i115, label %land.lhs.true7.i124, label %if.end15.i116
land.lhs.true7.i124: ; preds = %if.end.i113
%idxprom8.i125 = sext i32 %largest.0.i114 to i64
%arrayidx9.i126 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom8.i125
%34 = load ptr, ptr %arrayidx9.i126, align 8, !tbaa !11
%idxprom10.i127 = sext i32 %add.i111 to i64
%arrayidx11.i128 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom10.i127
%35 = load ptr, ptr %arrayidx11.i128, align 8, !tbaa !11
%point.i40.i129 = getelementptr inbounds %struct.sushi, ptr %34, i64 0, i32 1
%36 = load i32, ptr %point.i40.i129, align 4, !tbaa !9
%point1.i41.i130 = getelementptr inbounds %struct.sushi, ptr %35, i64 0, i32 1
%37 = load i32, ptr %point1.i41.i130, align 4, !tbaa !9
%cmp.i42.not.i131 = icmp sgt i32 %36, %37
%spec.select39.i132 = select i1 %cmp.i42.not.i131, i32 %largest.0.i114, i32 %add.i111
br label %if.end15.i116
if.end15.i116: ; preds = %land.lhs.true7.i124, %if.end.i113
%largest.1.i117 = phi i32 [ %largest.0.i114, %if.end.i113 ], [ %spec.select39.i132, %land.lhs.true7.i124 ]
%cmp16.i118 = icmp eq i32 %node.0.i109, %largest.1.i117
br i1 %cmp16.i118, label %delete_max.exit139, label %cleanup.i119
cleanup.i119: ; preds = %if.end15.i116
%idxprom19.i120 = sext i32 %node.0.i109 to i64
%arrayidx20.i121 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom19.i120
%idxprom21.i122 = sext i32 %largest.1.i117 to i64
%arrayidx22.i123 = getelementptr inbounds [100100 x ptr], ptr @heap, i64 0, i64 %idxprom21.i122
%38 = load ptr, ptr %arrayidx22.i123, align 8, !tbaa !11
store ptr %38, ptr %arrayidx20.i121, align 8, !tbaa !11
store ptr %30, ptr %arrayidx22.i123, align 8, !tbaa !11
br label %while.cond.i108
delete_max.exit139: ; preds = %if.end15.i116
%point51 = getelementptr inbounds %struct.sushi, ptr %28, i64 0, i32 1
%39 = load i32, ptr %point51, align 4, !tbaa !9
%conv52 = sext i32 %39 to i64
%sub = sub nsw i64 %base.3167, %conv52
%point53 = getelementptr inbounds %struct.sushi, ptr %29, i64 0, i32 1
%40 = load i32, ptr %point53, align 4, !tbaa !9
%conv54 = sext i32 %40 to i64
%add55 = add nsw i64 %sub, %conv54
%mul58 = mul nsw i64 %indvars.iv.next180, %indvars.iv.next180
%add59 = add nsw i64 %add55, %mul58
%ans.0.add59 = call i64 @llvm.smax.i64(i64 %ans.0168, i64 %add59)
%41 = trunc i64 %indvars.iv.next180 to i32
%tobool.not.i100 = icmp ne i32 %41, 0
%cmp46 = icmp sgt i64 %indvars.iv181, 2
%42 = and i1 %tobool.not.i100, %cmp46
br i1 %42, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !21
while.cond.while.end_crit_edge: ; preds = %delete_max.exit139
store i32 %41, ptr @sidx, align 4, !tbaa !5
store i32 %indvars184, ptr @hidx, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %for.end40
%ans.0.lcssa = phi i64 [ %ans.0.add59, %while.cond.while.end_crit_edge ], [ %add43, %for.end40 ]
%call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #10
ret i32 0
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #9
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree 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 #5 = { nofree norecurse nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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, !6, i64 4}
!10 = !{!"sushi", !6, i64 0, !6, i64 4}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{i64 0, i64 4, !5}
!17 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!18 = !{!7, !7, i64 0}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
|
#include<stdio.h>
#include<math.h>
int main(){
long int a, b, c, x;
scanf("%ld %ld %ld",&a, &b, &c);
x = c-a-b;
if(x<0)
printf("No");
else if(4*a*b < x*x)
printf("Yes");
else
printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158519/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158519/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%ld %ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %c, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%3 = add i64 %1, %2
%sub1 = sub i64 %0, %3
%cmp = icmp slt i64 %sub1, 0
br i1 %cmp, label %if.end10, label %if.else
if.else: ; preds = %entry
%mul = shl nsw i64 %1, 2
%mul3 = mul nsw i64 %mul, %2
%mul4 = mul nsw i64 %sub1, %sub1
%cmp5 = icmp slt i64 %mul3, %mul4
%.str.2..str.1 = select i1 %cmp5, ptr @.str.2, ptr @.str.1
br label %if.end10
if.end10: ; preds = %if.else, %entry
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ %.str.2..str.1, %if.else ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{long long int a,b,c;
scanf("%lld%lld%lld",&a,&b,&c);
long long int y=a*b;
long long int x=c-a-b;
if(x<=0)
{
printf("No");
return 0;
}
else
{
if(x%2==1)
{
if((x/2)*(x/2)+x/2>=y)
printf("Yes");
else
printf("No");
}
else
{
if((x/2)*(x/2)>y)
printf("Yes");
else
printf("No");
}
return 0;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158562/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158562/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%2 = load i64, ptr %c, align 8, !tbaa !5
%3 = add i64 %1, %0
%sub1 = sub i64 %2, %3
%cmp = icmp slt i64 %sub1, 1
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%rem = and i64 %sub1, 1
%cmp3.not = icmp eq i64 %rem, 0
%div1435 = lshr i64 %sub1, 1
br i1 %cmp3.not, label %if.else13, label %if.then4
if.then4: ; preds = %if.else
%div3637 = add nuw nsw i64 %div1435, 1
%add = mul i64 %div3637, %div1435
%cmp8.not = icmp slt i64 %add, %mul
%.str.1..str.2 = select i1 %cmp8.not, ptr @.str.1, ptr @.str.2
br label %cleanup
if.else13: ; preds = %if.else
%mul16 = mul nsw i64 %div1435, %div1435
%cmp17 = icmp sgt i64 %mul16, %mul
%.str.2..str.1 = select i1 %cmp17, ptr @.str.2, ptr @.str.1
br label %cleanup
cleanup: ; preds = %if.else13, %if.then4, %entry
%.str.1.sink = phi ptr [ @.str.1, %entry ], [ %.str.1..str.2, %if.then4 ], [ %.str.2..str.1, %if.else13 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include<stdlib.h>
#include<math.h>
int main() {
long long int a,b,c;
scanf("%lld %lld %lld\n",&a,&b,&c);
if(4*a*b<(c-a-b)*(c-a-b)&&(c-a-b)>0){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158605/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158605/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld %lld %lld\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, 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 i64, ptr %a, align 8, !tbaa !5
%mul = shl nsw i64 %0, 2
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul1 = mul nsw i64 %mul, %1
%2 = load i64, ptr %c, align 8, !tbaa !5
%3 = add i64 %1, %0
%sub2 = sub i64 %2, %3
%mul5 = mul nsw i64 %sub2, %sub2
%cmp = icmp slt i64 %mul1, %mul5
%cmp8 = icmp sgt i64 %sub2, 0
%or.cond = and i1 %cmp8, %cmp
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
//#include <stdlib.h>
//#include <string.h>
#include <stdbool.h>
#include <limits.h>
//#include <math.h>
#define Min(a, b) ((a < b) ? a : b)
int main() {
int h, w, k;
scanf("%d%d%d", &h, &w, &k);
char s[h][w+5];
for (int i=0; i<h; i++)
scanf("%s", s[i]);
int cnt[h+1][w+1], ans = INT_MAX;
for (int i=0; i<w+1; i++)
cnt[0][i] = 0;
for (int i=0; i<h+1; i++)
cnt[i][0] = 0;
for (int i=0; i<h; i++)
for (int j=0; j<w; j++)
cnt[i+1][j+1] = cnt[i][j+1]+cnt[i+1][j]-cnt[i][j]+(s[i][j]=='1');
for (int i=(1<<(h-1)); i<(1<<h); i++) {
int c, d = 0, a = 0, tmpi = i;
bool check = true;
while (tmpi != 1) {
a += tmpi%2;
tmpi /= 2;
}
for (int j=0; j<w; j++) {
c = 0;
for (int l=0; l<h; l++) {
if (i & (1<<l)) {
if (cnt[l+1][j+1] - cnt[c][j+1] - cnt[l+1][d]+cnt[c][d] > k) {
if (cnt[l+1][j+1]-cnt[l+1][j]-cnt[c][j]+cnt[c][j] > k) {
check = false;
break;
}
a++;
d = j;
}
c = l+1;
}
}
if (!check)
break;
}
if (!check)
continue;
ans = Min(ans, a);
}
if (ans == INT_MAX)
ans = 0;
printf("%d\n", ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158649/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158649/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w, ptr noundef nonnull %k)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = load i32, ptr %w, align 4, !tbaa !5
%add = add nsw i32 %2, 5
%3 = zext i32 %add to i64
%4 = call ptr @llvm.stacksave.p0()
%5 = mul nuw i64 %3, %1
%vla = alloca i8, i64 %5, align 16
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp244 = icmp sgt i32 %6, 0
br i1 %cmp244, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %6, %entry ], [ %13, %for.body ]
%add2 = add i32 %.lcssa, 1
%7 = zext i32 %add2 to i64
%8 = load i32, ptr %w, align 4, !tbaa !5
%add3 = add i32 %8, 1
%9 = zext i32 %add3 to i64
%10 = mul nuw i64 %9, %7
%vla4 = alloca i32, i64 %10, align 16
%cmp8.not246 = icmp slt i32 %8, 0
br i1 %cmp8.not246, label %for.cond18.preheader, label %for.body10.preheader
for.body10.preheader: ; preds = %for.cond.cleanup
%11 = shl nuw nsw i64 %9, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla4, i8 0, i64 %11, i1 false), !tbaa !5
br label %for.cond18.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%12 = mul nuw nsw i64 %indvars.iv, %3
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %12
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr %h, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond18.preheader: ; preds = %for.body10.preheader, %for.cond.cleanup
%cmp20.not248 = icmp slt i32 %.lcssa, 0
br i1 %cmp20.not248, label %for.cond.cleanup32, label %for.body22.preheader
for.body22.preheader: ; preds = %for.cond18.preheader
%15 = add nsw i64 %7, -1
%xtraiter = and i64 %7, 3
%16 = icmp ult i64 %15, 3
br i1 %16, label %for.cond30.preheader.unr-lcssa, label %for.body22.preheader.new
for.body22.preheader.new: ; preds = %for.body22.preheader
%unroll_iter = and i64 %7, 4294967292
br label %for.body22
for.cond30.preheader.unr-lcssa: ; preds = %for.body22, %for.body22.preheader
%indvars.iv286.unr = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next287.3, %for.body22 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond30.preheader, label %for.body22.epil
for.body22.epil: ; preds = %for.cond30.preheader.unr-lcssa, %for.body22.epil
%indvars.iv286.epil = phi i64 [ %indvars.iv.next287.epil, %for.body22.epil ], [ %indvars.iv286.unr, %for.cond30.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond30.preheader.unr-lcssa ]
%17 = mul nuw nsw i64 %indvars.iv286.epil, %9
%arrayidx24.epil = getelementptr inbounds i32, ptr %vla4, i64 %17
store i32 0, ptr %arrayidx24.epil, align 4, !tbaa !5
%indvars.iv.next287.epil = add nuw nsw i64 %indvars.iv286.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond30.preheader, label %for.body22.epil, !llvm.loop !11
for.cond30.preheader: ; preds = %for.body22.epil, %for.cond30.preheader.unr-lcssa
%cmp31252 = icmp sgt i32 %.lcssa, 0
br i1 %cmp31252, label %for.cond34.preheader.lr.ph, label %for.cond.cleanup32
for.cond34.preheader.lr.ph: ; preds = %for.cond30.preheader
%cmp35250 = icmp sgt i32 %8, 0
br i1 %cmp35250, label %for.cond34.preheader.us.preheader, label %for.cond.cleanup32
for.cond34.preheader.us.preheader: ; preds = %for.cond34.preheader.lr.ph
%wide.trip.count297 = zext i32 %.lcssa to i64
%wide.trip.count292 = zext i32 %8 to i64
%xtraiter324 = and i64 %wide.trip.count292, 1
%18 = icmp eq i32 %8, 1
%unroll_iter327 = and i64 %wide.trip.count292, 4294967294
%lcmp.mod326.not = icmp eq i64 %xtraiter324, 0
br label %for.cond34.preheader.us
for.cond34.preheader.us: ; preds = %for.cond34.preheader.us.preheader, %for.cond34.for.cond.cleanup36_crit_edge.us
%indvars.iv294 = phi i64 [ 0, %for.cond34.preheader.us.preheader ], [ %indvars.iv.next295, %for.cond34.for.cond.cleanup36_crit_edge.us ]
%19 = mul nuw nsw i64 %indvars.iv294, %9
%arrayidx39.us = getelementptr inbounds i32, ptr %vla4, i64 %19
%indvars.iv.next295 = add nuw nsw i64 %indvars.iv294, 1
%20 = mul nuw nsw i64 %indvars.iv.next295, %9
%arrayidx45.us = getelementptr inbounds i32, ptr %vla4, i64 %20
%21 = mul nuw nsw i64 %indvars.iv294, %3
%arrayidx54.us = getelementptr inbounds i8, ptr %vla, i64 %21
%.pre = load i32, ptr %arrayidx45.us, align 4, !tbaa !5
br i1 %18, label %for.cond34.for.cond.cleanup36_crit_edge.us.unr-lcssa, label %for.body37.us
for.body37.us: ; preds = %for.cond34.preheader.us, %for.body37.us
%22 = phi i32 [ %add59.us.1, %for.body37.us ], [ %.pre, %for.cond34.preheader.us ]
%indvars.iv289 = phi i64 [ %indvars.iv.next290.1, %for.body37.us ], [ 0, %for.cond34.preheader.us ]
%niter328 = phi i64 [ %niter328.next.1, %for.body37.us ], [ 0, %for.cond34.preheader.us ]
%indvars.iv.next290 = or i64 %indvars.iv289, 1
%arrayidx42.us = getelementptr inbounds i32, ptr %arrayidx39.us, i64 %indvars.iv.next290
%23 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5
%add48.us = add nsw i32 %22, %23
%arrayidx52.us = getelementptr inbounds i32, ptr %arrayidx39.us, i64 %indvars.iv289
%24 = load i32, ptr %arrayidx52.us, align 4, !tbaa !5
%sub.us = sub i32 %add48.us, %24
%arrayidx56.us = getelementptr inbounds i8, ptr %arrayidx54.us, i64 %indvars.iv289
%25 = load i8, ptr %arrayidx56.us, align 1, !tbaa !13
%cmp57.us = icmp eq i8 %25, 49
%conv58.us = zext i1 %cmp57.us to i32
%add59.us = add nsw i32 %sub.us, %conv58.us
%arrayidx65.us = getelementptr inbounds i32, ptr %arrayidx45.us, i64 %indvars.iv.next290
store i32 %add59.us, ptr %arrayidx65.us, align 4, !tbaa !5
%indvars.iv.next290.1 = add nuw nsw i64 %indvars.iv289, 2
%arrayidx42.us.1 = getelementptr inbounds i32, ptr %arrayidx39.us, i64 %indvars.iv.next290.1
%26 = load i32, ptr %arrayidx42.us.1, align 4, !tbaa !5
%add48.us.1 = add nsw i32 %add59.us, %26
%arrayidx52.us.1 = getelementptr inbounds i32, ptr %arrayidx39.us, i64 %indvars.iv.next290
%27 = load i32, ptr %arrayidx52.us.1, align 4, !tbaa !5
%sub.us.1 = sub i32 %add48.us.1, %27
%arrayidx56.us.1 = getelementptr inbounds i8, ptr %arrayidx54.us, i64 %indvars.iv.next290
%28 = load i8, ptr %arrayidx56.us.1, align 1, !tbaa !13
%cmp57.us.1 = icmp eq i8 %28, 49
%conv58.us.1 = zext i1 %cmp57.us.1 to i32
%add59.us.1 = add nsw i32 %sub.us.1, %conv58.us.1
%arrayidx65.us.1 = getelementptr inbounds i32, ptr %arrayidx45.us, i64 %indvars.iv.next290.1
store i32 %add59.us.1, ptr %arrayidx65.us.1, align 4, !tbaa !5
%niter328.next.1 = add i64 %niter328, 2
%niter328.ncmp.1 = icmp eq i64 %niter328.next.1, %unroll_iter327
br i1 %niter328.ncmp.1, label %for.cond34.for.cond.cleanup36_crit_edge.us.unr-lcssa, label %for.body37.us, !llvm.loop !14
for.cond34.for.cond.cleanup36_crit_edge.us.unr-lcssa: ; preds = %for.body37.us, %for.cond34.preheader.us
%.unr = phi i32 [ %.pre, %for.cond34.preheader.us ], [ %add59.us.1, %for.body37.us ]
%indvars.iv289.unr = phi i64 [ 0, %for.cond34.preheader.us ], [ %indvars.iv.next290.1, %for.body37.us ]
br i1 %lcmp.mod326.not, label %for.cond34.for.cond.cleanup36_crit_edge.us, label %for.body37.us.epil
for.body37.us.epil: ; preds = %for.cond34.for.cond.cleanup36_crit_edge.us.unr-lcssa
%indvars.iv.next290.epil = add nuw nsw i64 %indvars.iv289.unr, 1
%arrayidx42.us.epil = getelementptr inbounds i32, ptr %arrayidx39.us, i64 %indvars.iv.next290.epil
%29 = load i32, ptr %arrayidx42.us.epil, align 4, !tbaa !5
%add48.us.epil = add nsw i32 %.unr, %29
%arrayidx52.us.epil = getelementptr inbounds i32, ptr %arrayidx39.us, i64 %indvars.iv289.unr
%30 = load i32, ptr %arrayidx52.us.epil, align 4, !tbaa !5
%sub.us.epil = sub i32 %add48.us.epil, %30
%arrayidx56.us.epil = getelementptr inbounds i8, ptr %arrayidx54.us, i64 %indvars.iv289.unr
%31 = load i8, ptr %arrayidx56.us.epil, align 1, !tbaa !13
%cmp57.us.epil = icmp eq i8 %31, 49
%conv58.us.epil = zext i1 %cmp57.us.epil to i32
%add59.us.epil = add nsw i32 %sub.us.epil, %conv58.us.epil
%arrayidx65.us.epil = getelementptr inbounds i32, ptr %arrayidx45.us, i64 %indvars.iv.next290.epil
store i32 %add59.us.epil, ptr %arrayidx65.us.epil, align 4, !tbaa !5
br label %for.cond34.for.cond.cleanup36_crit_edge.us
for.cond34.for.cond.cleanup36_crit_edge.us: ; preds = %for.cond34.for.cond.cleanup36_crit_edge.us.unr-lcssa, %for.body37.us.epil
%exitcond298.not = icmp eq i64 %indvars.iv.next295, %wide.trip.count297
br i1 %exitcond298.not, label %for.cond.cleanup32, label %for.cond34.preheader.us, !llvm.loop !15
for.body22: ; preds = %for.body22, %for.body22.preheader.new
%indvars.iv286 = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next287.3, %for.body22 ]
%niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.3, %for.body22 ]
%32 = mul nuw nsw i64 %indvars.iv286, %9
%arrayidx24 = getelementptr inbounds i32, ptr %vla4, i64 %32
store i32 0, ptr %arrayidx24, align 16, !tbaa !5
%indvars.iv.next287 = or i64 %indvars.iv286, 1
%33 = mul nuw nsw i64 %indvars.iv.next287, %9
%arrayidx24.1 = getelementptr inbounds i32, ptr %vla4, i64 %33
store i32 0, ptr %arrayidx24.1, align 4, !tbaa !5
%indvars.iv.next287.1 = or i64 %indvars.iv286, 2
%34 = mul nuw nsw i64 %indvars.iv.next287.1, %9
%arrayidx24.2 = getelementptr inbounds i32, ptr %vla4, i64 %34
store i32 0, ptr %arrayidx24.2, align 8, !tbaa !5
%indvars.iv.next287.2 = or i64 %indvars.iv286, 3
%35 = mul nuw nsw i64 %indvars.iv.next287.2, %9
%arrayidx24.3 = getelementptr inbounds i32, ptr %vla4, i64 %35
store i32 0, ptr %arrayidx24.3, align 4, !tbaa !5
%indvars.iv.next287.3 = add nuw nsw i64 %indvars.iv286, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.cond30.preheader.unr-lcssa, label %for.body22, !llvm.loop !16
for.cond.cleanup32: ; preds = %for.cond34.for.cond.cleanup36_crit_edge.us, %for.cond18.preheader, %for.cond34.preheader.lr.ph, %for.cond30.preheader
%cmp31252313 = phi i1 [ false, %for.cond30.preheader ], [ true, %for.cond34.preheader.lr.ph ], [ false, %for.cond18.preheader ], [ %cmp31252, %for.cond34.for.cond.cleanup36_crit_edge.us ]
%sub73 = add nsw i32 %.lcssa, -1
%shl = shl nuw i32 1, %sub73
%shl75 = shl nuw i32 1, %.lcssa
%cmp76271 = icmp slt i32 %shl, %shl75
br i1 %cmp76271, label %while.cond.preheader.lr.ph, label %for.cond.cleanup78.thread
while.cond.preheader.lr.ph: ; preds = %for.cond.cleanup32
%cmp85265 = icmp sgt i32 %8, 0
%36 = load i32, ptr %k, align 4
%wide.trip.count308 = zext i32 %8 to i64
%wide.trip.count303 = zext i32 %.lcssa to i64
%brmerge.not = and i1 %cmp85265, %cmp31252313
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %.loopexit
%i72.0273 = phi i32 [ %shl, %while.cond.preheader.lr.ph ], [ %inc171, %.loopexit ]
%ans.0272 = phi i32 [ 2147483647, %while.cond.preheader.lr.ph ], [ %.fr, %.loopexit ]
%cmp80.not254 = icmp eq i32 %i72.0273, 1
br i1 %cmp80.not254, label %for.cond84.preheader, label %while.body
for.cond.cleanup78: ; preds = %.loopexit
%cmp174 = icmp eq i32 %.fr, 2147483647
br i1 %cmp174, label %for.cond.cleanup78.thread, label %37
for.cond.cleanup78.thread: ; preds = %for.cond.cleanup32, %for.cond.cleanup78
br label %37
37: ; preds = %for.cond.cleanup78, %for.cond.cleanup78.thread
%38 = phi i32 [ 0, %for.cond.cleanup78.thread ], [ %.fr, %for.cond.cleanup78 ]
%call178 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %38)
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #6
ret i32 0
for.cond84.preheader: ; preds = %while.body, %while.cond.preheader
%a.0.lcssa = phi i32 [ 0, %while.cond.preheader ], [ %add82, %while.body ]
br i1 %brmerge.not, label %for.cond89.preheader.us, label %cleanup158.thread
for.cond89.preheader.us: ; preds = %for.cond84.preheader, %for.cond89.for.inc156_crit_edge.us
%indvars.iv305 = phi i64 [ %indvars.iv.next306, %for.cond89.for.inc156_crit_edge.us ], [ 0, %for.cond84.preheader ]
%a.1267.us = phi i32 [ %a.4.us, %for.cond89.for.inc156_crit_edge.us ], [ %a.0.lcssa, %for.cond84.preheader ]
%d.0266.us = phi i32 [ %d.3.us, %for.cond89.for.inc156_crit_edge.us ], [ 0, %for.cond84.preheader ]
%indvars.iv.next306 = add nuw nsw i64 %indvars.iv305, 1
%39 = trunc i64 %indvars.iv305 to i32
br label %for.body93.us
for.body93.us: ; preds = %for.cond89.preheader.us, %for.inc150.us
%indvars.iv299 = phi i64 [ 0, %for.cond89.preheader.us ], [ %.pre311, %for.inc150.us ]
%a.2261.us = phi i32 [ %a.1267.us, %for.cond89.preheader.us ], [ %a.4.us, %for.inc150.us ]
%d.1260.us = phi i32 [ %d.0266.us, %for.cond89.preheader.us ], [ %d.3.us, %for.inc150.us ]
%c.0259.us = phi i32 [ 0, %for.cond89.preheader.us ], [ %c.1.us, %for.inc150.us ]
%40 = trunc i64 %indvars.iv299 to i32
%shl94.us = shl nuw i32 1, %40
%and.us = and i32 %shl94.us, %i72.0273
%tobool.not.us = icmp eq i32 %and.us, 0
%.pre311 = add nuw nsw i64 %indvars.iv299, 1
br i1 %tobool.not.us, label %for.inc150.us, label %if.then.us
if.then.us: ; preds = %for.body93.us
%41 = mul nuw nsw i64 %.pre311, %9
%arrayidx97.us = getelementptr inbounds i32, ptr %vla4, i64 %41
%arrayidx100.us = getelementptr inbounds i32, ptr %arrayidx97.us, i64 %indvars.iv.next306
%42 = load i32, ptr %arrayidx100.us, align 4, !tbaa !5
%idxprom101.us = sext i32 %c.0259.us to i64
%43 = mul nsw i64 %idxprom101.us, %9
%arrayidx102.us = getelementptr inbounds i32, ptr %vla4, i64 %43
%arrayidx105.us = getelementptr inbounds i32, ptr %arrayidx102.us, i64 %indvars.iv.next306
%44 = load i32, ptr %arrayidx105.us, align 4, !tbaa !5
%idxprom110.us = sext i32 %d.1260.us to i64
%arrayidx111.us = getelementptr inbounds i32, ptr %arrayidx97.us, i64 %idxprom110.us
%45 = load i32, ptr %arrayidx111.us, align 4, !tbaa !5
%arrayidx116.us = getelementptr inbounds i32, ptr %arrayidx102.us, i64 %idxprom110.us
%46 = load i32, ptr %arrayidx116.us, align 4, !tbaa !5
%47 = add i32 %44, %45
%sub112.us = sub i32 %42, %47
%add117.us = add nsw i32 %sub112.us, %46
%cmp118.us = icmp sgt i32 %add117.us, %36
%48 = trunc i64 %.pre311 to i32
br i1 %cmp118.us, label %if.then120.us, label %for.inc150.us
if.then120.us: ; preds = %if.then.us
%arrayidx131.us = getelementptr inbounds i32, ptr %arrayidx97.us, i64 %indvars.iv305
%49 = load i32, ptr %arrayidx131.us, align 4, !tbaa !5
%sub132.us = sub nsw i32 %42, %49
%cmp143.us = icmp sgt i32 %sub132.us, %36
br i1 %cmp143.us, label %.loopexit, label %if.end.us
if.end.us: ; preds = %if.then120.us
%inc146.us = add nsw i32 %a.2261.us, 1
br label %for.inc150.us
for.inc150.us: ; preds = %for.body93.us, %if.end.us, %if.then.us
%c.1.us = phi i32 [ %48, %if.end.us ], [ %48, %if.then.us ], [ %c.0259.us, %for.body93.us ]
%d.3.us = phi i32 [ %39, %if.end.us ], [ %d.1260.us, %if.then.us ], [ %d.1260.us, %for.body93.us ]
%a.4.us = phi i32 [ %inc146.us, %if.end.us ], [ %a.2261.us, %if.then.us ], [ %a.2261.us, %for.body93.us ]
%exitcond304.not = icmp eq i64 %.pre311, %wide.trip.count303
br i1 %exitcond304.not, label %for.cond89.for.inc156_crit_edge.us, label %for.body93.us, !llvm.loop !17
for.cond89.for.inc156_crit_edge.us: ; preds = %for.inc150.us
%exitcond309.not = icmp eq i64 %indvars.iv.next306, %wide.trip.count308
br i1 %exitcond309.not, label %cleanup158.thread, label %for.cond89.preheader.us, !llvm.loop !18
while.body: ; preds = %while.cond.preheader, %while.body
%tmpi.0256 = phi i32 [ %div, %while.body ], [ %i72.0273, %while.cond.preheader ]
%a.0255 = phi i32 [ %add82, %while.body ], [ 0, %while.cond.preheader ]
%rem = srem i32 %tmpi.0256, 2
%add82 = add nsw i32 %rem, %a.0255
%div = sdiv i32 %tmpi.0256, 2
%50 = and i32 %tmpi.0256, -2
%cmp80.not = icmp eq i32 %50, 2
br i1 %cmp80.not, label %for.cond84.preheader, label %while.body, !llvm.loop !19
cleanup158.thread: ; preds = %for.cond89.for.inc156_crit_edge.us, %for.cond84.preheader
%a.5.ph = phi i32 [ %a.0.lcssa, %for.cond84.preheader ], [ %a.4.us, %for.cond89.for.inc156_crit_edge.us ]
%cond319 = call i32 @llvm.smin.i32(i32 %ans.0272, i32 %a.5.ph)
br label %.loopexit
.loopexit: ; preds = %if.then120.us, %cleanup158.thread
%51 = phi i32 [ %cond319, %cleanup158.thread ], [ %ans.0272, %if.then120.us ]
%.fr = freeze i32 %51
%inc171 = add nsw i32 %i72.0273, 1
%exitcond310.not = icmp eq i32 %inc171, %shl75
br i1 %exitcond310.not, label %for.cond.cleanup78, label %while.cond.preheader, !llvm.loop !20
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
#include <limits.h>
#include <string.h>
int main(void)
{
char s1[102];
char s2[102];
scanf("%s%s", s1,s2);
if (strlen(s1) > strlen(s2))
{
printf("GREATER\n");
return 0;
}
else if (strlen(s1) < strlen(s2))
{
printf("LESS\n");
return 0;
}
else if (strcmp(s1, s2) == 0)
{
printf("EQUAL\n");
return 0;
}
int i = 0;
while (i < strlen(s1))
{
if (s1[i] > s2[i])
{
printf("GREATER\n");
return 0;
}
else if (s1[i] < s2[i])
{
printf("LESS\n");
return 0;
}
i++;
}
printf("EQUAL");
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158692/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158692/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@str.6 = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@str.7 = private unnamed_addr constant [5 x i8] c"LESS\00", align 1
@str.8 = private unnamed_addr constant [8 x i8] c"GREATER\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s1 = alloca [102 x i8], align 16
%s2 = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %s1) #5
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %s2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s1, ptr noundef nonnull %s2)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s1) #6
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s2) #6
%cmp = icmp ugt i64 %call3, %call5
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts59 = call i32 @puts(ptr nonnull dereferenceable(1) @str.8)
br label %cleanup49
if.else: ; preds = %entry
%cmp11 = icmp ult i64 %call3, %call5
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else
%puts58 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
br label %cleanup49
if.else14: ; preds = %if.else
%call17 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s1, ptr noundef nonnull dereferenceable(1) %s2) #6
%cmp18 = icmp eq i32 %call17, 0
br i1 %cmp18, label %if.then19, label %while.cond.preheader
while.cond.preheader: ; preds = %if.else14
%cmp2560.not = icmp eq i64 %call3, 0
br i1 %cmp2560.not, label %while.end, label %while.body
if.then19: ; preds = %if.else14
%puts57 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %cleanup49
while.cond: ; preds = %if.else35
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call3
br i1 %exitcond.not, label %while.end, label %while.body, !llvm.loop !5
while.body: ; preds = %while.cond.preheader, %while.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %while.cond.preheader ]
%arrayidx = getelementptr inbounds [102 x i8], ptr %s1, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%arrayidx29 = getelementptr inbounds [102 x i8], ptr %s2, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx29, align 1, !tbaa !7
%cmp31 = icmp sgt i8 %0, %1
br i1 %cmp31, label %if.then33, label %if.else35
if.then33: ; preds = %while.body
%puts56 = call i32 @puts(ptr nonnull dereferenceable(1) @str.8)
br label %cleanup49
if.else35: ; preds = %while.body
%cmp42 = icmp slt i8 %0, %1
br i1 %cmp42, label %if.then44, label %while.cond
if.then44: ; preds = %if.else35
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
br label %cleanup49
while.end: ; preds = %while.cond, %while.cond.preheader
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @str.6)
br label %cleanup49
cleanup49: ; preds = %if.then33, %if.then44, %while.end, %if.then19, %if.then12, %if.then
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %s2) #5
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %s1) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main()
{
char a[102]; scanf("%s", a);
char b[102]; scanf("%s", b);
int na;
int nb;
int i;
for(i = 0; a[i]; i++){
;
}
na = i;
for(i = 0; b[i]; i++){
;
}
nb = i;
if(na > nb){
printf("GREATER\n");
}
else{
if(na < nb){
printf("LESS\n");
}
else{
if(strcmp(a, b) > 0){
printf("GREATER\n");
}
else{
if(strcmp(a, b) < 0){
printf("LESS\n");
}
else{
printf("EQUAL\n");
}
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158735/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158735/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@str.6 = private unnamed_addr constant [5 x i8] c"LESS\00", align 1
@str.7 = private unnamed_addr constant [8 x i8] c"GREATER\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [102 x i8], align 16
%b = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %b) #5
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
br label %for.cond
for.cond: ; preds = %for.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [102 x i8], ptr %a, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %0, 0
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br i1 %tobool.not, label %for.cond3, label %for.cond, !llvm.loop !8
for.cond3: ; preds = %for.cond, %for.cond3
%indvars.iv46 = phi i64 [ %indvars.iv.next47, %for.cond3 ], [ 0, %for.cond ]
%arrayidx5 = getelementptr inbounds [102 x i8], ptr %b, i64 0, i64 %indvars.iv46
%1 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%tobool6.not = icmp eq i8 %1, 0
%indvars.iv.next47 = add nuw i64 %indvars.iv46, 1
br i1 %tobool6.not, label %for.end10, label %for.cond3, !llvm.loop !10
for.end10: ; preds = %for.cond3
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv46 to i32
%cmp = icmp ugt i32 %2, %3
br i1 %cmp, label %if.end33, label %if.else
if.else: ; preds = %for.end10
%cmp12 = icmp ult i32 %2, %3
br i1 %cmp12, label %if.end33, label %if.else15
if.else15: ; preds = %if.else
%call18 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #6
%cmp19 = icmp sgt i32 %call18, 0
br i1 %cmp19, label %if.end33, label %if.else22
if.else22: ; preds = %if.else15
%cmp26.not = icmp eq i32 %call18, 0
%str.4.str = select i1 %cmp26.not, ptr @str, ptr @str.6
br label %if.end33
if.end33: ; preds = %if.else22, %if.else15, %if.else, %for.end10
%str.6.sink = phi ptr [ @str.7, %for.end10 ], [ @str.6, %if.else ], [ @str.7, %if.else15 ], [ %str.4.str, %if.else22 ]
%puts43 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink)
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
#include<stdio.h>
#include<string.h>
char a[105], b[105];
int main(void) {
int i;
int lena, lenb;
scanf("%s", a);
scanf("%s", b);
lena = strlen(a);
lenb = strlen(b);
if (lena > lenb) {
printf("GREATER\n");
return 0;
}
else if (lena < lenb) {
printf("LESS\n");
return 0;
}
else
{
for (i = 0; i <=lena-1; i++) {
if (a[i] > b[i]) {
printf("GREATER\n");
return 0;
}
else if (a[i] < b[i]) {
printf("LESS\n");
return 0;
}
}
}
printf("EQUAL\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158793/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158793/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@a = dso_local global [105 x i8] zeroinitializer, align 16
@b = dso_local global [105 x i8] zeroinitializer, align 16
@str = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@str.6 = private unnamed_addr constant [5 x i8] c"LESS\00", align 1
@str.7 = private unnamed_addr constant [8 x i8] c"GREATER\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)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @b)
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @a) #4
%conv = trunc i64 %call2 to i32
%call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @b) #4
%conv4 = trunc i64 %call3 to i32
%cmp = icmp sgt i32 %conv, %conv4
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp7 = icmp slt i32 %conv, %conv4
br i1 %cmp7, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %if.else
%cmp12.not.not51 = icmp sgt i32 %conv, 0
br i1 %cmp12.not.not51, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %for.cond.preheader
%wide.trip.count = and i64 %call2, 4294967295
br label %for.body
for.cond: ; preds = %if.else22
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !5
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds [105 x i8], ptr @a, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%arrayidx16 = getelementptr inbounds [105 x i8], ptr @b, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx16, align 1, !tbaa !7
%cmp18 = icmp sgt i8 %0, %1
br i1 %cmp18, label %cleanup, label %if.else22
if.else22: ; preds = %for.body
%cmp29 = icmp slt i8 %0, %1
br i1 %cmp29, label %cleanup, label %for.cond
cleanup: ; preds = %for.cond, %if.else22, %for.body, %for.cond.preheader, %if.else, %entry
%str.sink = phi ptr [ @str.7, %entry ], [ @str.6, %if.else ], [ @str, %for.cond.preheader ], [ @str.7, %for.body ], [ @str.6, %if.else22 ], [ @str, %for.cond ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
int main(){
char A[100],B[100];
int ans = 0;
scanf("%s %s",A,B);
if(strlen(A) > strlen(B)) ans = 1;
if(strlen(A) < strlen(B)) ans = -1;
if(strlen(A) == strlen(B)){
FOR(i,0,strlen(A)){
if(A[i] > B[i]){ ans = 1; break; }
if(A[i] < B[i]){ ans = -1; break; }
}
}
if(ans == 1) printf("GREATER\n");
if(ans == -1) printf("LESS\n");
if(ans == 0) printf("EQUAL\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158836/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158836/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s %s\00", align 1
@str = private unnamed_addr constant [8 x i8] c"GREATER\00", align 1
@str.4 = private unnamed_addr constant [5 x i8] c"LESS\00", align 1
@str.5 = private unnamed_addr constant [6 x i8] c"EQUAL\00", align 1
@reltable.main = private unnamed_addr constant [3 x 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 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:
%A = alloca [100 x i8], align 16
%B = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %A) #6
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %B) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %A) #7
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %B) #7
%cmp = icmp ugt i64 %call3, %call5
%cmp10 = icmp ult i64 %call3, %call5
%cmp17 = icmp eq i64 %call3, %call5
%cmp2169 = icmp ne i64 %call3, 0
%or.cond = and i1 %cmp17, %cmp2169
br i1 %or.cond, label %for.body, label %switch.lookup
for.cond: ; preds = %if.end30
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call3
br i1 %exitcond.not, label %switch.lookup, label %for.body, !llvm.loop !5
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%arrayidx25 = getelementptr inbounds [100 x i8], ptr %B, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx25, align 1, !tbaa !7
%cmp27 = icmp sgt i8 %0, %1
br i1 %cmp27, label %if.end56.sink.split, label %if.end30
if.end30: ; preds = %for.body
%cmp37 = icmp slt i8 %0, %1
br i1 %cmp37, label %if.end56.sink.split, label %for.cond
switch.lookup: ; preds = %entry, %for.cond
%2 = select i1 %cmp, i64 2, i64 1
%3 = select i1 %cmp10, i64 0, i64 %2
%reltable.shift = shl i64 %3, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end56.sink.split
if.end56.sink.split: ; preds = %for.body, %if.end30, %switch.lookup
%str.4.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str, %for.body ], [ @str.4, %if.end30 ]
%puts64 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %B) #6
call void @llvm.lifetime.end.p0(i64 100, 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) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(void){
int a, b;
double N = 0, E = 0;
double theta = 0;
while(1){
scanf("%d,%d", &a, &b);
N += a * cos(theta);
E += a * sin(theta);
theta += b * (2 * M_PI / 360);
if(a == 0 && b == 0) break;
}
printf("%d\n%d\n", (int)E, (int)N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158900/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158900/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d\0A%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) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%theta.0 = phi double [ 0.000000e+00, %entry ], [ %10, %while.cond ]
%0 = phi <2 x double> [ zeroinitializer, %entry ], [ %8, %while.cond ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%call1 = call double @cos(double noundef %theta.0) #6
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = insertelement <2 x i32> poison, i32 %1, i64 0
%4 = insertelement <2 x i32> %3, i32 %2, i64 1
%5 = sitofp <2 x i32> %4 to <2 x double>
%call3 = call double @sin(double noundef %theta.0) #6
%6 = insertelement <2 x double> poison, double %call1, i64 0
%7 = insertelement <2 x double> %6, double %call3, i64 1
%8 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %5, <2 x double> %7, <2 x double> %0)
%9 = load i32, ptr %b, align 4
%conv4 = sitofp i32 %9 to double
%10 = call double @llvm.fmuladd.f64(double %conv4, double 0x3F91DF46A2529D39, double %theta.0)
%11 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
%cmp6 = icmp eq i32 %9, 0
%or.cond = select i1 %cmp, i1 %cmp6, i1 false
br i1 %or.cond, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%12 = extractelement <2 x double> %8, i64 1
%conv8 = fptosi double %12 to i32
%13 = extractelement <2 x double> %8, i64 0
%conv9 = fptosi double %13 to i32
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv8, i32 noundef %conv9)
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) #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 @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: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; 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>) #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) "no-trapping-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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void) {
int a, b, x, y, rad=90;
double xx = 0, yy = 0, pi;
while (1) {
scanf("%d,%d",&a,&b);
if (a == 0 && b == 0)break;
pi = acos(-1);
xx += a*cos(pi*rad / 180);
yy += a*sin(pi*rad / 180);
rad -= b;
}
x = xx;
y = yy;
printf("%d\n%d\n",x,y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158951/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158951/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d\0A%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) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp21 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp122 = icmp eq i32 %1, 0
%or.cond23 = select i1 %cmp21, i1 %cmp122, i1 false
br i1 %or.cond23, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%2 = phi i32 [ %12, %if.end ], [ %0, %entry ]
%rad.026 = phi i32 [ %sub, %if.end ], [ 90, %entry ]
%3 = phi <2 x double> [ %10, %if.end ], [ zeroinitializer, %entry ]
%conv3 = sitofp i32 %rad.026 to double
%mul = fmul double %conv3, 0x400921FB54442D18
%div = fdiv double %mul, 1.800000e+02
%call4 = call double @cos(double noundef %div) #5
%4 = load i32, ptr %a, align 4, !tbaa !5
%5 = insertelement <2 x i32> poison, i32 %2, i64 0
%6 = insertelement <2 x i32> %5, i32 %4, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%call10 = call double @sin(double noundef %div) #5
%8 = insertelement <2 x double> poison, double %call4, i64 0
%9 = insertelement <2 x double> %8, double %call10, i64 1
%10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %3)
%11 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %rad.026, %11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%12 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %12, 0
%13 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end.loopexit, label %if.end
while.end.loopexit: ; preds = %if.end
%14 = fptosi <2 x double> %10 to <2 x i32>
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%15 = phi <2 x i32> [ zeroinitializer, %entry ], [ %14, %while.end.loopexit ]
%16 = extractelement <2 x i32> %15, i64 0
%17 = extractelement <2 x i32> %15, i64 1
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16, i32 noundef %17)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; 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>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#define LINE_MAX 30
double cos(double);
double sin(double);
double floor(double);
struct Data{
int length;
int angle;
};
struct Position{
double x;
double y;
int angle;
};
double degToRad(int degree){
return degree * 3.1415926536 / 180;
}
void walk(struct Data buf, struct Position *position){
position->x += (buf.length * cos(degToRad(position->angle)));
position->y += (buf.length * sin(degToRad(position->angle)));
position->angle += buf.angle;
if(position->angle > 180){position->angle -= 360;}
else if(position->angle < -180){position->angle += 360;}
}
int main(void){
char c;
int length;
int argnum = 0;
int minus_flag = 0;
struct Data buf;
struct Position position;
position.x = 0;
position.y = 0;
position.angle = 0;
buf.length = 0;
buf.angle = 0;
while(1){
c = getchar();
if(c == EOF){
break;
}else if(c =='\n'){
if(minus_flag){buf.angle = -buf.angle;}
if(buf.length == 0 && buf.angle == 0){
break;
}
walk(buf,&position);
argnum = 0;
buf.length = 0;
buf.angle = 0;
minus_flag = 0;
}else if('0' <= c && c <= '9'){
switch(argnum){
case 0:
buf.length = buf.length * 10 + (c - '0');
break;
case 1:
buf.angle = buf.angle * 10 + (c - '0');
break;
}
}else if(c == ','){
if(minus_flag){buf.length = -buf.length;}
argnum++;
minus_flag = 0;
}else if(c == '-'){
minus_flag = 1;
}
}
printf("%d\n%d\n",(int)position.y,(int)position.x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159022/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159022/source.c"
target datalayout = "e-m:e-p270: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.Position = type { double, double, i32 }
@.str = private unnamed_addr constant [7 x i8] c"%d\0A%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @degToRad(i32 noundef %degree) local_unnamed_addr #0 {
entry:
%conv = sitofp i32 %degree to double
%mul = fmul double %conv, 0x400921FB544486E0
%div = fdiv double %mul, 1.800000e+02
ret double %div
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local void @walk(i64 %buf.coerce, ptr nocapture noundef %position) local_unnamed_addr #1 {
entry:
%buf.sroa.0.0.extract.trunc = trunc i64 %buf.coerce to i32
%buf.sroa.3.0.extract.shift = lshr i64 %buf.coerce, 32
%buf.sroa.3.0.extract.trunc = trunc i64 %buf.sroa.3.0.extract.shift to i32
%conv = sitofp i32 %buf.sroa.0.0.extract.trunc to double
%angle = getelementptr inbounds %struct.Position, ptr %position, i64 0, i32 2
%0 = load i32, ptr %angle, align 8, !tbaa !5
%conv.i = sitofp i32 %0 to double
%mul.i = fmul double %conv.i, 0x400921FB544486E0
%div.i = fdiv double %mul.i, 1.800000e+02
%call1 = tail call double @cos(double noundef %div.i) #7
%1 = load double, ptr %position, align 8, !tbaa !11
%2 = tail call double @llvm.fmuladd.f64(double %conv, double %call1, double %1)
store double %2, ptr %position, align 8, !tbaa !11
%3 = load i32, ptr %angle, align 8, !tbaa !5
%conv.i28 = sitofp i32 %3 to double
%mul.i29 = fmul double %conv.i28, 0x400921FB544486E0
%div.i30 = fdiv double %mul.i29, 1.800000e+02
%call6 = tail call double @sin(double noundef %div.i30) #7
%y = getelementptr inbounds %struct.Position, ptr %position, i64 0, i32 1
%4 = load double, ptr %y, align 8, !tbaa !12
%5 = tail call double @llvm.fmuladd.f64(double %conv, double %call6, double %4)
store double %5, ptr %y, align 8, !tbaa !12
%6 = load i32, ptr %angle, align 8, !tbaa !5
%add = add nsw i32 %6, %buf.sroa.3.0.extract.trunc
store i32 %add, ptr %angle, align 8, !tbaa !5
%cmp = icmp sgt i32 %add, 180
br i1 %cmp, label %if.end18.sink.split, label %if.else
if.else: ; preds = %entry
%cmp13 = icmp slt i32 %add, -180
br i1 %cmp13, label %if.end18.sink.split, label %if.end18
if.end18.sink.split: ; preds = %if.else, %entry
%.sink = phi i32 [ -360, %entry ], [ 360, %if.else ]
%add17 = add nsw i32 %add, %.sink
store i32 %add17, ptr %angle, align 8, !tbaa !5
br label %if.end18
if.end18: ; preds = %if.end18.sink.split, %if.else
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%position.sroa.10.0 = phi i32 [ 0, %entry ], [ %position.sroa.10.0.be, %while.cond.backedge ]
%argnum.0 = phi i32 [ 0, %entry ], [ %argnum.0.be, %while.cond.backedge ]
%minus_flag.0 = phi i32 [ 0, %entry ], [ %minus_flag.0.be, %while.cond.backedge ]
%buf.sroa.10.0 = phi i32 [ 0, %entry ], [ %buf.sroa.10.0.be, %while.cond.backedge ]
%buf.sroa.0.0 = phi i32 [ 0, %entry ], [ %buf.sroa.0.0.be, %while.cond.backedge ]
%0 = phi <2 x double> [ zeroinitializer, %entry ], [ %.be, %while.cond.backedge ]
%1 = load ptr, ptr @stdin, align 8, !tbaa !13
%call.i = tail call i32 @getc(ptr noundef %1)
%sext = shl i32 %call.i, 24
%conv3 = ashr exact i32 %sext, 24
switch i32 %sext, label %if.else22 [
i32 -16777216, label %while.end
i32 167772160, label %if.then8
]
if.then8: ; preds = %while.cond
%tobool.not = icmp eq i32 %minus_flag.0, 0
%sub = sub nsw i32 0, %buf.sroa.10.0
%spec.select = select i1 %tobool.not, i32 %buf.sroa.10.0, i32 %sub
%cmp13 = icmp eq i32 %buf.sroa.0.0, 0
%cmp16 = icmp eq i32 %spec.select, 0
%or.cond = select i1 %cmp13, i1 %cmp16, i1 false
br i1 %or.cond, label %while.end, label %if.end19
if.end19: ; preds = %if.then8
%conv.i = sitofp i32 %buf.sroa.0.0 to double
%conv.i.i = sitofp i32 %position.sroa.10.0 to double
%mul.i.i = fmul double %conv.i.i, 0x400921FB544486E0
%div.i.i = fdiv double %mul.i.i, 1.800000e+02
%call1.i = tail call double @cos(double noundef %div.i.i) #7
%call6.i = tail call double @sin(double noundef %div.i.i) #7
%2 = insertelement <2 x double> poison, double %conv.i, i64 0
%3 = shufflevector <2 x double> %2, <2 x double> poison, <2 x i32> zeroinitializer
%4 = insertelement <2 x double> poison, double %call6.i, i64 0
%5 = insertelement <2 x double> %4, double %call1.i, i64 1
%6 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %3, <2 x double> %5, <2 x double> %0)
%add.i = add nsw i32 %spec.select, %position.sroa.10.0
%cmp.i = icmp sgt i32 %add.i, 180
br i1 %cmp.i, label %if.end18.sink.split.i, label %if.else.i
if.else.i: ; preds = %if.end19
%cmp13.i = icmp slt i32 %add.i, -180
br i1 %cmp13.i, label %if.end18.sink.split.i, label %while.cond.backedge
if.end18.sink.split.i: ; preds = %if.else.i, %if.end19
%.sink.i = phi i32 [ -360, %if.end19 ], [ 360, %if.else.i ]
%add17.i = add nsw i32 %.sink.i, %add.i
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.end18.sink.split.i, %if.else.i, %if.else42, %if.then46, %if.then57, %sw.bb, %sw.bb35, %if.then30
%position.sroa.10.0.be = phi i32 [ %position.sroa.10.0, %if.then30 ], [ %position.sroa.10.0, %sw.bb35 ], [ %position.sroa.10.0, %sw.bb ], [ %position.sroa.10.0, %if.else42 ], [ %position.sroa.10.0, %if.then57 ], [ %position.sroa.10.0, %if.then46 ], [ %add17.i, %if.end18.sink.split.i ], [ %add.i, %if.else.i ]
%argnum.0.be = phi i32 [ %argnum.0, %if.then30 ], [ 1, %sw.bb35 ], [ 0, %sw.bb ], [ %argnum.0, %if.else42 ], [ %argnum.0, %if.then57 ], [ %inc, %if.then46 ], [ 0, %if.end18.sink.split.i ], [ 0, %if.else.i ]
%minus_flag.0.be = phi i32 [ %minus_flag.0, %if.then30 ], [ %minus_flag.0, %sw.bb35 ], [ %minus_flag.0, %sw.bb ], [ %minus_flag.0, %if.else42 ], [ 1, %if.then57 ], [ 0, %if.then46 ], [ 0, %if.end18.sink.split.i ], [ 0, %if.else.i ]
%buf.sroa.10.0.be = phi i32 [ %buf.sroa.10.0, %if.then30 ], [ %add40, %sw.bb35 ], [ %buf.sroa.10.0, %sw.bb ], [ %buf.sroa.10.0, %if.else42 ], [ %buf.sroa.10.0, %if.then57 ], [ %buf.sroa.10.0, %if.then46 ], [ 0, %if.end18.sink.split.i ], [ 0, %if.else.i ]
%buf.sroa.0.0.be = phi i32 [ %buf.sroa.0.0, %if.then30 ], [ %buf.sroa.0.0, %sw.bb35 ], [ %add, %sw.bb ], [ %buf.sroa.0.0, %if.else42 ], [ %buf.sroa.0.0, %if.then57 ], [ %spec.select83, %if.then46 ], [ 0, %if.end18.sink.split.i ], [ 0, %if.else.i ]
%.be = phi <2 x double> [ %0, %if.then30 ], [ %0, %sw.bb35 ], [ %0, %sw.bb ], [ %0, %if.else42 ], [ %0, %if.then57 ], [ %0, %if.then46 ], [ %6, %if.end18.sink.split.i ], [ %6, %if.else.i ]
br label %while.cond
if.else22: ; preds = %while.cond
%7 = add i32 %sext, -788529153
%or.cond68 = icmp ult i32 %7, 184549375
br i1 %or.cond68, label %if.then30, label %if.else42
if.then30: ; preds = %if.else22
switch i32 %argnum.0, label %while.cond.backedge [
i32 0, label %sw.bb
i32 1, label %sw.bb35
]
sw.bb: ; preds = %if.then30
%mul = mul nsw i32 %buf.sroa.0.0, 10
%sub33 = add i32 %mul, -48
%add = add i32 %sub33, %conv3
br label %while.cond.backedge
sw.bb35: ; preds = %if.then30
%mul37 = mul nsw i32 %buf.sroa.10.0, 10
%sub39 = add i32 %mul37, -48
%add40 = add i32 %sub39, %conv3
br label %while.cond.backedge
if.else42: ; preds = %if.else22
switch i32 %sext, label %while.cond.backedge [
i32 738197504, label %if.then46
i32 754974720, label %if.then57
]
if.then46: ; preds = %if.else42
%tobool47.not = icmp eq i32 %minus_flag.0, 0
%sub50 = sub nsw i32 0, %buf.sroa.0.0
%spec.select83 = select i1 %tobool47.not, i32 %buf.sroa.0.0, i32 %sub50
%inc = add nsw i32 %argnum.0, 1
br label %while.cond.backedge
if.then57: ; preds = %if.else42
br label %while.cond.backedge
while.end: ; preds = %while.cond, %if.then8
%8 = extractelement <2 x double> %0, i64 0
%conv64 = fptosi double %8 to i32
%9 = extractelement <2 x double> %0, i64 1
%conv66 = fptosi double %9 to i32
%call67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %conv64, i32 noundef %conv66)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #6
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 nounwind willreturn memory(write, argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !10, i64 16}
!6 = !{!"Position", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !8, i64 0}
|
#include<stdio.h>
#include<math.h>
int main(void){
int m,de,nde=0;
double PI=3.14159265,x=0,y=0;
while(1){
scanf("%d,%d",&m,&de);
if(m==0&&de==0) break;
x=x+m*sin((double)nde*PI/180);
y=y+m*cos((double)nde*PI/180);
nde=nde+de;
}
printf("%d\n%d\n",(int)x,(int)y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159088/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159088/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d,%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca i32, align 4
%de = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %de) #5
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %de)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp20 = icmp eq i32 %0, 0
%1 = load i32, ptr %de, align 4
%cmp121 = icmp eq i32 %1, 0
%or.cond22 = select i1 %cmp20, i1 %cmp121, i1 false
br i1 %or.cond22, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%2 = phi i32 [ %12, %if.end ], [ %0, %entry ]
%nde.023 = phi i32 [ %add, %if.end ], [ 0, %entry ]
%3 = phi <2 x double> [ %10, %if.end ], [ zeroinitializer, %entry ]
%conv2 = sitofp i32 %nde.023 to double
%mul = fmul double %conv2, 0x400921FB53C8D4F1
%div = fdiv double %mul, 1.800000e+02
%call3 = call double @sin(double noundef %div) #5
%4 = load i32, ptr %m, align 4, !tbaa !5
%5 = insertelement <2 x i32> poison, i32 %2, i64 0
%6 = insertelement <2 x i32> %5, i32 %4, i64 1
%7 = sitofp <2 x i32> %6 to <2 x double>
%call9 = call double @cos(double noundef %div) #5
%8 = insertelement <2 x double> poison, double %call3, i64 0
%9 = insertelement <2 x double> %8, double %call9, i64 1
%10 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %7, <2 x double> %9, <2 x double> %3)
%11 = load i32, ptr %de, align 4, !tbaa !5
%add = add nsw i32 %11, %nde.023
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %de)
%12 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp eq i32 %12, 0
%13 = load i32, ptr %de, align 4
%cmp1 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end.loopexit, label %if.end
while.end.loopexit: ; preds = %if.end
%14 = fptosi <2 x double> %10 to <2 x i32>
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%15 = phi <2 x i32> [ zeroinitializer, %entry ], [ %14, %while.end.loopexit ]
%16 = extractelement <2 x i32> %15, i64 0
%17 = extractelement <2 x i32> %15, i64 1
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16, i32 noundef %17)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %de) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(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: 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 <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int gcd(int x,int y){return (y==0?x:gcd(y,x%y));}
int main(){
int x,y;
scanf("%d%d",&x,&y);
printf("%d\n",gcd(x,y));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159130/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159130/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %y, 0
br i1 %cmp4, label %cond.end, label %cond.false
cond.false: ; preds = %entry, %cond.false
%y.tr6 = phi i32 [ %rem, %cond.false ], [ %y, %entry ]
%x.tr5 = phi i32 [ %y.tr6, %cond.false ], [ %x, %entry ]
%rem = srem i32 %x.tr5, %y.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %cond.end, label %cond.false
cond.end: ; preds = %cond.false, %entry
%x.tr.lcssa = phi i32 [ %x, %entry ], [ %y.tr6, %cond.false ]
ret i32 %x.tr.lcssa
}
; 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp4.i = icmp eq i32 %1, 0
br i1 %cmp4.i, label %gcd.exit, label %cond.false.i
cond.false.i: ; preds = %entry, %cond.false.i
%y.tr6.i = phi i32 [ %rem.i, %cond.false.i ], [ %1, %entry ]
%x.tr5.i = phi i32 [ %y.tr6.i, %cond.false.i ], [ %0, %entry ]
%rem.i = srem i32 %x.tr5.i, %y.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %cond.false.i
gcd.exit: ; preds = %cond.false.i, %entry
%x.tr.lcssa.i = phi i32 [ %0, %entry ], [ %y.tr6.i, %cond.false.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.tr.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
int temp;
if(a<b){
temp=b;
b=a;
a=temp;
}
while(1){
temp=a%b;
if(temp==0){
printf("%d\n",b);
return 0;
}
a=b;
b=temp;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159174/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159174/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt 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
%b.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem9 = srem i32 %a.promoted, %b.promoted
%cmp110 = icmp eq i32 %rem9, 0
br i1 %cmp110, label %if.then2, label %if.end4
while.cond.if.then2_crit_edge: ; preds = %if.end4
store i32 %rem811, ptr %a, align 4, !tbaa !5
store i32 %rem12, ptr %b, align 4, !tbaa !5
br label %if.then2
if.then2: ; preds = %while.cond.if.then2_crit_edge, %if.end
%.lcssa = phi i32 [ %rem12, %while.cond.if.then2_crit_edge ], [ %b.promoted, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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
if.end4: ; preds = %if.end, %if.end4
%rem12 = phi i32 [ %rem, %if.end4 ], [ %rem9, %if.end ]
%rem811 = phi i32 [ %rem12, %if.end4 ], [ %b.promoted, %if.end ]
%rem = srem i32 %rem811, %rem12
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.if.then2_crit_edge, label %if.end4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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 get_gcd(int x, int y);
int main(void)
{
int x, y, gcd, lcm;
while(scanf("%d %d", &x, &y)==2)
{
gcd = get_gcd(x, y);
lcm = x / gcd * y;
//printf("%d %d", gcd, lcm);
printf("%d\n", gcd);
}
return 0;
}
int get_gcd(int x, int y)
{
if(x<y)
{
y = y % x;
}
while(x >= 1 && y >= 1)
{
x = x % y;
if(x == 0)
break;
y = y % x;
}
return (x + y);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159246/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159246/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%cmp5 = icmp eq i32 %call4, 2
br i1 %cmp5, label %while.body, label %while.end
while.body: ; preds = %entry, %get_gcd.exit
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp.i = icmp slt i32 %0, %1
br i1 %cmp.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %while.body
%rem.i = srem i32 %1, %0
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body
%y.addr.0.i = phi i32 [ %rem.i, %if.then.i ], [ %1, %while.body ]
%cmp119.i = icmp sgt i32 %0, 0
%cmp220.i = icmp sgt i32 %y.addr.0.i, 0
%2 = and i1 %cmp119.i, %cmp220.i
br i1 %2, label %while.body.i, label %get_gcd.exit
while.body.i: ; preds = %if.end.i, %if.end6.i
%y.addr.122.i = phi i32 [ %rem7.i, %if.end6.i ], [ %y.addr.0.i, %if.end.i ]
%x.addr.021.i = phi i32 [ %rem3.i, %if.end6.i ], [ %0, %if.end.i ]
%rem3.i = urem i32 %x.addr.021.i, %y.addr.122.i
%cmp4.i = icmp eq i32 %rem3.i, 0
br i1 %cmp4.i, label %get_gcd.exit, label %if.end6.i
if.end6.i: ; preds = %while.body.i
%rem7.i = urem i32 %y.addr.122.i, %rem3.i
%cmp2.i.not = icmp eq i32 %rem7.i, 0
br i1 %cmp2.i.not, label %get_gcd.exit, label %while.body.i, !llvm.loop !9
get_gcd.exit: ; preds = %while.body.i, %if.end6.i, %if.end.i
%y.addr.1.lcssa.i = phi i32 [ %y.addr.0.i, %if.end.i ], [ 0, %if.end6.i ], [ %y.addr.122.i, %while.body.i ]
%x.addr.1.i = phi i32 [ %0, %if.end.i ], [ %rem3.i, %if.end6.i ], [ 0, %while.body.i ]
%add.i = add nsw i32 %x.addr.1.i, %y.addr.1.lcssa.i
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add.i)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%cmp = icmp eq i32 %call, 2
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11
while.end: ; preds = %get_gcd.exit, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @get_gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%cmp = icmp slt i32 %x, %y
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%rem = srem i32 %y, %x
br label %if.end
if.end: ; preds = %if.then, %entry
%y.addr.0 = phi i32 [ %rem, %if.then ], [ %y, %entry ]
%cmp119 = icmp sgt i32 %x, 0
%cmp220 = icmp sgt i32 %y.addr.0, 0
%0 = and i1 %cmp119, %cmp220
br i1 %0, label %while.body, label %while.end
while.body: ; preds = %if.end, %if.end6
%y.addr.122 = phi i32 [ %rem7, %if.end6 ], [ %y.addr.0, %if.end ]
%x.addr.021 = phi i32 [ %rem3, %if.end6 ], [ %x, %if.end ]
%rem3 = urem i32 %x.addr.021, %y.addr.122
%cmp4 = icmp eq i32 %rem3, 0
br i1 %cmp4, label %while.end, label %if.end6
if.end6: ; preds = %while.body
%rem7 = urem i32 %y.addr.122, %rem3
%cmp2 = icmp sgt i32 %rem7, 0
br i1 %cmp2, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end6, %while.body, %if.end
%y.addr.1.lcssa = phi i32 [ %y.addr.0, %if.end ], [ %y.addr.122, %while.body ], [ %rem7, %if.end6 ]
%x.addr.1 = phi i32 [ %x, %if.end ], [ 0, %while.body ], [ %rem3, %if.end6 ]
%add = add nsw i32 %x.addr.1, %y.addr.1.lcssa
ret i32 %add
}
; 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 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(void){
long x,y,tmp;
scanf("%ld %ld",&x,&y);
if (x<y)
{
tmp = x;
x = y;
y = tmp;
};
while( y > 0)
{
tmp = y;
y = x%y;
x = tmp;
}
printf("%ld\n",x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159297/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159297/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i64, ptr %x, align 8, !tbaa !5
%1 = load i64, ptr %y, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i64 %1, ptr %x, align 8, !tbaa !5
store i64 %0, ptr %y, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i64 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i64 [ %0, %if.then ], [ %1, %entry ]
%cmp16 = icmp sgt i64 %.pr, 0
br i1 %cmp16, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i64 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i64 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i64 %3, %2
%cmp1 = icmp sgt i64 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %rem, ptr %y, align 8, !tbaa !5
store i64 %2, ptr %x, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i64 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int x = 0, y = 0, z = 0;
scanf("%d%d", &x, &y);
while(1){
if(x % y == 0){
break;
}
if(x >= y){
z = x % y;
x = y;
y = z;
continue;
}
if(x < y){
z = x;
x = y;
y = z;
continue;
}
}
printf("%d\n", y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159383/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159383/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%x.promoted = load i32, ptr %x, align 4, !tbaa !5
%y.promoted = load i32, ptr %y, align 4, !tbaa !5
%rem11 = srem i32 %x.promoted, %y.promoted
%cmp12 = icmp eq i32 %rem11, 0
br i1 %cmp12, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%rem13 = phi i32 [ %rem, %if.end ], [ %rem11, %entry ]
%0 = phi i32 [ %1, %if.end ], [ %x.promoted, %entry ]
%1 = phi i32 [ %spec.select, %if.end ], [ %y.promoted, %entry ]
%cmp1.not = icmp slt i32 %0, %1
%spec.select = select i1 %cmp1.not, i32 %0, i32 %rem13
%rem = srem i32 %1, %spec.select
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %while.end.loopexit, label %if.end
while.end.loopexit: ; preds = %if.end
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %spec.select, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%.lcssa = phi i32 [ %y.promoted, %entry ], [ %spec.select, %while.end.loopexit ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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() {
int a,b,c,m;
while(1) {
scanf("%d%d",&a,&b);
if(a<1 || a>1000000001) {
printf("error\n");
continue;
}
if(b<1 || b>1000000001) {
printf("error\n");
continue;
}
else break;
}
if(a<b) {
c = a;
a = b;
b = c;
}
while(1) {
c = a%b;
if(c==0) {
m = b;
break;
}
a = b;
b = c;
}
printf("%d\n",m);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159433/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159433/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str.3 = private unnamed_addr constant [6 x i8] c"error\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4
%1 = add i32 %0, -1000000002
%or.cond = icmp ult i32 %1, -1000000001
br i1 %or.cond, label %while.cond.backedge, label %if.end
while.cond.backedge: ; preds = %while.cond, %if.end
%str.3.sink = phi ptr [ @str.3, %if.end ], [ @str.3, %while.cond ]
%puts22 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
br label %while.cond
if.end: ; preds = %while.cond
%2 = load i32, ptr %b, align 4
%3 = add i32 %2, -1000000002
%or.cond18 = icmp ult i32 %3, -1000000001
br i1 %or.cond18, label %while.cond.backedge, label %while.end
while.end: ; preds = %if.end
%cmp8 = icmp ult i32 %0, %2
br i1 %cmp8, label %if.then9, label %if.end10
if.then9: ; preds = %while.end
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
br label %if.end10
if.end10: ; preds = %if.then9, %while.end
%b.promoted = phi i32 [ %0, %if.then9 ], [ %2, %while.end ]
%a.promoted = phi i32 [ %2, %if.then9 ], [ %0, %while.end ]
%rem2634 = urem i32 %a.promoted, %b.promoted
%cmp1327 = icmp eq i32 %rem2634, 0
br i1 %cmp1327, label %if.then14, label %if.end15
while.cond11.if.then14_crit_edge: ; preds = %if.end15
store i32 %rem2528, ptr %a, align 4, !tbaa !5
store i32 %rem29, ptr %b, align 4, !tbaa !5
br label %if.then14
if.then14: ; preds = %while.cond11.if.then14_crit_edge, %if.end10
%.lcssa = phi i32 [ %rem29, %while.cond11.if.then14_crit_edge ], [ %b.promoted, %if.end10 ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.lcssa)
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
if.end15: ; preds = %if.end10, %if.end15
%rem29 = phi i32 [ %rem, %if.end15 ], [ %rem2634, %if.end10 ]
%rem2528 = phi i32 [ %rem29, %if.end15 ], [ %b.promoted, %if.end10 ]
%rem = srem i32 %rem2528, %rem29
%cmp13 = icmp eq i32 %rem, 0
br i1 %cmp13, label %while.cond11.if.then14_crit_edge, label %if.end15
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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>
/*---x??¨y?????\????????????---*/
void swap(int *x, int *y)
{
int temp;
temp = *x;
*x = *y;
*y = temp;
}
int main(void) {
int x[2];
scanf("%d %d", &x[0], &x[1]); //2???????????¶??°???????????????
if(x[0]<x[1])
swap(&x[0], &x[1]); //??????????????????
while (x[1]) { //?????????
x[0] = x[0] % x[1];
swap(&x[0], &x[1]);
}
printf("%d\n", x[0]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159477/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159477/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %x, ptr nocapture noundef %y) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, 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:
%x = alloca [2 x i32], align 4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%arrayidx1 = getelementptr inbounds [2 x i32], ptr %x, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %arrayidx1)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%tobool.not14 = icmp eq i32 %.pr, 0
br i1 %tobool.not14, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 0, ptr %arrayidx1, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
long long a[200000];
int main(void) {
int t, i, n, j;
long long s, sm, f;
scanf("%d", &t);
for (i = 0; i < t; i++) {
scanf("%d", &n);
scanf("%lld", &a[0]);
f = 1 - 2 * (a[0] < 0);
s = 0;
sm = a[0];
for (j = 1; j < n; j++) {
scanf("%lld", &a[j]);
if (f * a[j] < 0) {
f = -f;
s += sm;
sm = a[j];
} else if (a[j] > sm)
sm = a[j];
}
printf("%lld\n", s + sm);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15952/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15952/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@a = dso_local global [200000 x i64] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #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 %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp48 = icmp sgt i32 %0, 0
br i1 %cmp48, label %for.body, label %for.end30
for.body: ; preds = %entry, %for.end
%i.049 = phi i32 [ %inc29, %for.end ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @a)
%1 = load i64, ptr @a, align 16, !tbaa !9
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp642 = icmp sgt i32 %2, 1
br i1 %cmp642, label %for.body8.preheader, label %for.end
for.body8.preheader: ; preds = %for.body
%sh.diff = lshr i64 %1, 62
%mul = and i64 %sh.diff, 2
%sub = sub nsw i64 1, %mul
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next, %for.body8 ]
%f.046 = phi i64 [ %sub, %for.body8.preheader ], [ %f.1, %for.body8 ]
%sm.045 = phi i64 [ %1, %for.body8.preheader ], [ %sm.1, %for.body8 ]
%s.044 = phi i64 [ 0, %for.body8.preheader ], [ %s.1, %for.body8 ]
%arrayidx = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %indvars.iv
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%3 = load i64, ptr %arrayidx, align 8, !tbaa !9
%mul12 = mul nsw i64 %3, %f.046
%cmp13 = icmp slt i64 %mul12, 0
%sub15 = sub nsw i64 0, %f.046
%spec.select = call i64 @llvm.smax.i64(i64 %3, i64 %sm.045)
%add = select i1 %cmp13, i64 %sm.045, i64 0
%s.1 = add nsw i64 %add, %s.044
%sm.1 = select i1 %cmp13, i64 %3, i64 %spec.select
%f.1 = select i1 %cmp13, i64 %sub15, i64 %f.046
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp6 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp6, label %for.body8, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body8, %for.body
%s.0.lcssa = phi i64 [ 0, %for.body ], [ %s.1, %for.body8 ]
%sm.0.lcssa = phi i64 [ %1, %for.body ], [ %sm.1, %for.body8 ]
%add26 = add nsw i64 %sm.0.lcssa, %s.0.lcssa
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add26)
%inc29 = add nuw nsw i32 %i.049, 1
%6 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc29, %6
br i1 %cmp, label %for.body, label %for.end30, !llvm.loop !13
for.end30: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
int main(){
int a,b,c;
scanf("%d%d",&a,&b);
if(a < b){
c = a;
a = b;
b = c;
}
while(b != 0){
c = a % b;
a = b;
b = c;
}
printf("%d\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
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
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp1.not6 = icmp eq i32 %.pr, 0
br i1 %cmp1.not6, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %a.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %a, align 4, !tbaa !5
store i32 0, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %a.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x, y, a, r;
scanf("%d%d", &x, &y);
if(x > y){
a = x;
x = y;
y = a;
}
r = y % x;
while(r != 0){
y = x;
x = r;
r = y % x;
}
printf("%d\n", x);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159606/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159606/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, 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 ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%r.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%r.068 = phi i32 [ %r.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %r.068, %r.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %r.068, ptr %y, align 4, !tbaa !5
store i32 %r.09, ptr %x, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %r.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int T,i,n;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
if(n%4)
printf("NO\n");
else
{
printf("YES\n");
for(i=1;i<=n/2;i++)
printf("%d ",2*i);
for(i=1;i<n/2;i++)
printf("%d ",2*i-1);
printf("%d\n",3*i-1);
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15965/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15965/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local 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) #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 %T)
%0 = load i32, ptr %T, align 4, !tbaa !5
%dec31 = add nsw i32 %0, -1
store i32 %dec31, ptr %T, align 4, !tbaa !5
%tobool.not32 = icmp eq i32 %0, 0
br i1 %tobool.not32, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = and i32 %1, 3
%tobool2.not = icmp eq i32 %2, 0
br i1 %tobool2.not, label %if.else, label %if.then
if.then: ; preds = %while.body
%puts24 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %if.end
if.else: ; preds = %while.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not26 = icmp slt i32 %3, 2
br i1 %cmp.not26, label %for.end14, label %for.body
for.cond6.preheader: ; preds = %for.body
%cmp829 = icmp sgt i32 %4, 3
br i1 %cmp829, label %for.body9, label %for.end14
for.body: ; preds = %if.else, %for.body
%i.027 = phi i32 [ %inc, %for.body ], [ 1, %if.else ]
%mul = shl nuw nsw i32 %i.027, 1
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %mul)
%inc = add nuw nsw i32 %i.027, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %4, 2
%cmp.not.not = icmp slt i32 %i.027, %div
br i1 %cmp.not.not, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.body9: ; preds = %for.cond6.preheader, %for.body9
%i.130 = phi i32 [ %inc13, %for.body9 ], [ 1, %for.cond6.preheader ]
%mul10 = shl nuw nsw i32 %i.130, 1
%sub = add nsw i32 %mul10, -1
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub)
%inc13 = add nuw nsw i32 %i.130, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%div7 = sdiv i32 %5, 2
%cmp8 = icmp slt i32 %inc13, %div7
br i1 %cmp8, label %for.body9, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.body9, %if.else, %for.cond6.preheader
%i.1.lcssa = phi i32 [ 1, %for.cond6.preheader ], [ 1, %if.else ], [ %inc13, %for.body9 ]
%mul15 = mul nsw i32 %i.1.lcssa, 3
%sub16 = add nsw i32 %mul15, -1
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %sub16)
br label %if.end
if.end: ; preds = %for.end14, %if.then
%6 = load i32, ptr %T, align 4, !tbaa !5
%dec = add nsw i32 %6, -1
store i32 %dec, ptr %T, align 4, !tbaa !5
%tobool.not = icmp eq i32 %6, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#include<stdlib.h>
int main()
{
int t;
int n,k;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);k=4;
while(n%(k-1)!=0)
{
k*=2;
}
printf("%d\n",(n/(k-1)));
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15970/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15970/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec9 = add nsw i32 %0, -1
store i32 %dec9, ptr %t, align 4, !tbaa !5
%tobool.not10 = icmp eq i32 %0, 0
br i1 %tobool.not10, label %while.end6, label %while.body
while.body: ; preds = %entry, %while.end
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
br label %while.cond2
while.cond2: ; preds = %while.cond2, %while.body
%k.0 = phi i32 [ 4, %while.body ], [ %mul, %while.cond2 ]
%sub = add nsw i32 %k.0, -1
%rem = srem i32 %1, %sub
%div = sdiv i32 %1, %sub
%cmp.not = icmp eq i32 %rem, 0
%mul = shl nsw i32 %k.0, 1
br i1 %cmp.not, label %while.end, label %while.cond2, !llvm.loop !9
while.end: ; preds = %while.cond2
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end6, label %while.body, !llvm.loop !11
while.end6: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
//ALDS1_1_B: Greatest Common Divisor
#include <stdio.h>
int gcd(int a,int b){//要求a>=b
if(a%b==0)
return b;
return gcd(b,a%b);//此?写成 gcd(b,a%b); 有失水准
}
int main(){
int x,y,z;
scanf("%d%d",&x,&y);
if(x>y)z=gcd(x,y);
else z=gcd(y,x);
printf("%d\n",z);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159743/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159743/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%a.tr = phi i32 [ %a, %entry ], [ %b.tr, %tailrecurse ]
%b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ]
%rem = srem i32 %a.tr, %b.tr
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %tailrecurse
return: ; preds = %tailrecurse
ret i32 %b.tr
}
; 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %tailrecurse.i, label %tailrecurse.i6
tailrecurse.i: ; preds = %entry, %tailrecurse.i
%a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %0, %entry ]
%b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %1, %entry ]
%rem.i = srem i32 %a.tr.i, %b.tr.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.end, label %tailrecurse.i
tailrecurse.i6: ; preds = %entry, %tailrecurse.i6
%a.tr.i7 = phi i32 [ %b.tr.i8, %tailrecurse.i6 ], [ %1, %entry ]
%b.tr.i8 = phi i32 [ %rem.i9, %tailrecurse.i6 ], [ %0, %entry ]
%rem.i9 = srem i32 %a.tr.i7, %b.tr.i8
%cmp.i10 = icmp eq i32 %rem.i9, 0
br i1 %cmp.i10, label %if.end, label %tailrecurse.i6
if.end: ; preds = %tailrecurse.i6, %tailrecurse.i
%z.0 = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %b.tr.i8, %tailrecurse.i6 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %z.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int gcd(int,int);
int main(){
int x,y,r,ans;
scanf("%d%d",&x,&y);
if(x<y)ans = gcd(y,x);
else ans = gcd(y,x);
printf("%d\n",ans);
return 0;
}
int gcd(int a, int b)
{
int r;
while(b>0){
r = a%b;
a = b;
b = r;
}
return a;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159787/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159787/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp4.i = icmp sgt i32 %0, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
br i1 %cmp4.i, label %while.body.i, label %if.end
while.body.i: ; preds = %if.then, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %1, %if.then ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %0, %if.then ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.i = icmp sgt i32 %rem.i, 0
br i1 %cmp.i, label %while.body.i, label %if.end, !llvm.loop !9
if.else: ; preds = %entry
br i1 %cmp4.i, label %while.body.i8, label %if.end
while.body.i8: ; preds = %if.else, %while.body.i8
%a.addr.06.i9 = phi i32 [ %b.addr.05.i10, %while.body.i8 ], [ %1, %if.else ]
%b.addr.05.i10 = phi i32 [ %rem.i11, %while.body.i8 ], [ %0, %if.else ]
%rem.i11 = srem i32 %a.addr.06.i9, %b.addr.05.i10
%cmp.i12 = icmp sgt i32 %rem.i11, 0
br i1 %cmp.i12, label %while.body.i8, label %if.end, !llvm.loop !9
if.end: ; preds = %while.body.i8, %while.body.i, %if.else, %if.then
%ans.0 = phi i32 [ %1, %if.then ], [ %1, %if.else ], [ %b.addr.05.i, %while.body.i ], [ %b.addr.05.i10, %while.body.i8 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%cmp4 = icmp sgt i32 %b, 0
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%cmp = icmp sgt i32 %rem, 0
br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; 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 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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<math.h>
int main(void) {
// your code goes here
int t;
scanf("%d",&t);
for(int i=0;i<t;i++){
int n,x;
scanf("%d",&n);
int k=2;
while(1){
int h=pow(2,k)-1;
if(n%h==0){
x=n/h;
break;
}
k++;
}
printf("%d\n",x);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15983/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15983/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body: ; preds = %entry, %while.end
%i.019 = phi i32 [ %inc7, %while.end ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
br label %while.cond
while.cond: ; preds = %while.cond, %for.body
%k.0 = phi i32 [ 2, %for.body ], [ %inc, %while.cond ]
%ldexp = call double @ldexp(double 1.000000e+00, i32 %k.0) #4
%sub = fadd double %ldexp, -1.000000e+00
%conv3 = fptosi double %sub to i32
%1 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %1, %conv3
%div = sdiv i32 %1, %conv3
%cmp4 = icmp eq i32 %rem, 0
%inc = add nuw nsw i32 %k.0, 1
br i1 %cmp4, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%call6 = 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) #4
%inc7 = add nuw nsw i32 %i.019, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc7, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree willreturn
declare double @ldexp(double, i32) 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 willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int x,y;
scanf("%d %d",&x,&y);
int tmp;
if(x<y){
tmp=x;
x=y;
y=tmp;
}
while(x%y!=0){
tmp=y;
y=x%y;
x=tmp;
}
printf("%d\n",y);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159873/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159873/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%y.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem7 = srem i32 %x.promoted, %y.promoted
%cmp1.not8 = icmp eq i32 %rem7, 0
br i1 %cmp1.not8, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%rem10 = phi i32 [ %rem, %while.body ], [ %rem7, %if.end ]
%rem69 = phi i32 [ %rem10, %while.body ], [ %y.promoted, %if.end ]
%rem = srem i32 %rem69, %rem10
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem10, ptr %y, align 4, !tbaa !5
store i32 %rem69, ptr %x, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%.lcssa = phi i32 [ %rem10, %while.cond.while.end_crit_edge ], [ %y.promoted, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x,y,i,n;
scanf("%d %d",&x,&y);
if(x<y){n=y;
y=x;
x=n;
}
while(1){
n=y;
y=x%y;
if(y==0){
printf("%d\n",n);
break;
}
x=n;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_159916/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_159916/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%y.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%rem10 = srem i32 %x.promoted, %y.promoted
%cmp111 = icmp eq i32 %rem10, 0
br i1 %cmp111, label %if.then2, label %if.end4
while.cond.if.then2_crit_edge: ; preds = %if.end4
store i32 %rem812, ptr %x, align 4, !tbaa !5
br label %if.then2
if.then2: ; preds = %while.cond.if.then2_crit_edge, %if.end
%.lcssa = phi i32 [ %rem13, %while.cond.if.then2_crit_edge ], [ %y.promoted, %if.end ]
store i32 0, ptr %y, align 4, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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
if.end4: ; preds = %if.end, %if.end4
%rem13 = phi i32 [ %rem, %if.end4 ], [ %rem10, %if.end ]
%rem812 = phi i32 [ %rem13, %if.end4 ], [ %y.promoted, %if.end ]
%rem = srem i32 %rem812, %rem13
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.if.then2_crit_edge, label %if.end4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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(void) {
long int t;
scanf("%ld", &t);
while(t--){
long long int n;
scanf("%lld", &n);
int k=3, a=3;
while(n%k!=0){
k=pow(2,a)-1;
a++;
}
printf("%lld\n", n/k);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15996/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15996/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec17 = add nsw i64 %0, -1
store i64 %dec17, ptr %t, align 8, !tbaa !5
%tobool.not18 = icmp eq i64 %0, 0
br i1 %tobool.not18, label %while.end10, label %while.body
while.body: ; preds = %entry, %while.end
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
%rem13 = srem i64 %1, 3
%cmp.not14 = icmp eq i64 %rem13, 0
br i1 %cmp.not14, label %while.end, label %while.body4
while.body4: ; preds = %while.body, %while.body4
%a.015 = phi i32 [ %inc, %while.body4 ], [ 3, %while.body ]
%ldexp = call double @ldexp(double 1.000000e+00, i32 %a.015) #4
%sub = fadd double %ldexp, -1.000000e+00
%conv7 = fptosi double %sub to i32
%inc = add nuw nsw i32 %a.015, 1
%2 = load i64, ptr %n, align 8, !tbaa !9
%conv = sext i32 %conv7 to i64
%rem = srem i64 %2, %conv
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body4, !llvm.loop !11
while.end: ; preds = %while.body4, %while.body
%.lcssa = phi i64 [ %1, %while.body ], [ %2, %while.body4 ]
%conv.lcssa = phi i64 [ 3, %while.body ], [ %conv, %while.body4 ]
%div = sdiv i64 %.lcssa, %conv.lcssa
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
%3 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %3, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %3, 0
br i1 %tobool.not, label %while.end10, label %while.body, !llvm.loop !13
while.end10: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree willreturn
declare double @ldexp(double, i32) 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 willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main(){
int x, y, i, v, a;
scanf("%d%d", &x, &y);
if(x < y){
v = x;
x = y;
y = v;
}
while(1){
a = x % y;
if(a == 0){
printf("%d\n", y) ;
break;
}
x = y;
y = a;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160000/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160000/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%y.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem8 = srem i32 %x.promoted, %y.promoted
%cmp19 = icmp eq i32 %rem8, 0
br i1 %cmp19, label %if.then2, label %if.end4
while.cond.if.then2_crit_edge: ; preds = %if.end4
store i32 %rem710, ptr %x, align 4, !tbaa !5
store i32 %rem11, ptr %y, align 4, !tbaa !5
br label %if.then2
if.then2: ; preds = %while.cond.if.then2_crit_edge, %if.end
%.lcssa = phi i32 [ %rem11, %while.cond.if.then2_crit_edge ], [ %y.promoted, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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
if.end4: ; preds = %if.end, %if.end4
%rem11 = phi i32 [ %rem, %if.end4 ], [ %rem8, %if.end ]
%rem710 = phi i32 [ %rem11, %if.end4 ], [ %y.promoted, %if.end ]
%rem = srem i32 %rem710, %rem11
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.if.then2_crit_edge, label %if.end4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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, r, tmp;
scanf("%d%d", &x, &y);
if(x < y)
{
tmp = x;
x = y;
y = tmp;
}
r = x % y;
while(r != 0)
{
x = y;
y = r;
r = x % y;
}
printf("%d\n", y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160051/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160051/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, 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 ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%r.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%r.068 = phi i32 [ %r.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %r.068, %r.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %r.068, ptr %x, align 4, !tbaa !5
store i32 %r.09, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %r.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x,y,d,tmp;
scanf("%d %d",&x,&y);
if(x<y){
tmp=x;
x=y;
y=tmp;
}
while(y>0){
d=x%y;
x=y;
y=d;
}
printf("%d\n",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160095/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160095/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp15 = icmp sgt i32 %.pr, 0
br i1 %cmp15, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int x, y, z;
scanf("%d%d", &x, &y);
while(z!=0){
z = x % y;
if(z==0){
printf("%d\n", y);
break;
}
x = y;
y = z;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160138/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160138/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%x.promoted = load i32, ptr %x, align 4, !tbaa !5
%y.promoted = load i32, ptr %y, align 4, !tbaa !5
%rem6 = srem i32 %x.promoted, %y.promoted
%cmp17 = icmp eq i32 %rem6, 0
br i1 %cmp17, label %if.then, label %if.end
while.cond.if.then_crit_edge: ; preds = %if.end
store i32 %rem58, ptr %x, align 4, !tbaa !5
store i32 %rem9, ptr %y, align 4, !tbaa !5
br label %if.then
if.then: ; preds = %while.cond.if.then_crit_edge, %entry
%.lcssa = phi i32 [ %rem9, %while.cond.if.then_crit_edge ], [ %y.promoted, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
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
if.end: ; preds = %entry, %if.end
%rem9 = phi i32 [ %rem, %if.end ], [ %rem6, %entry ]
%rem58 = phi i32 [ %rem9, %if.end ], [ %y.promoted, %entry ]
%rem = srem i32 %rem58, %rem9
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.cond.if.then_crit_edge, label %if.end, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
void gcd(double []);//最大公約数
int main(void)
{
double number[3];
scanf("%lf %lf",&number[0],&number[1]);
gcd(number);
return 0;
}
void gcd(double number[])
{
double i,gcd,a;
if(number[0]<number[1]){/*「大÷小」にするため入れ替える*/
number[2]=number[0];
number[0]=number[1];
number[1]=number[2];
}
while(fmod(number[0],number[1])!=0){
number[0]=fmod(number[0],number[1]);
number[2]=number[0];//並び替え//
number[0]=number[1];
number[1]=number[2];
}
printf("%.0f\n",number[1]);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%.0f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%number = alloca [3 x double], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %number) #4
%arrayidx1 = getelementptr inbounds [3 x double], ptr %number, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %number, ptr noundef nonnull %arrayidx1)
%0 = load double, ptr %number, align 16, !tbaa !5
%1 = load double, ptr %arrayidx1, align 8, !tbaa !5
%cmp.i = fcmp olt double %0, %1
br i1 %cmp.i, label %if.then.i, label %if.end.i
if.then.i: ; preds = %entry
%arrayidx3.i = getelementptr inbounds double, ptr %number, i64 2
store double %0, ptr %arrayidx3.i, align 16, !tbaa !5
store double %1, ptr %number, align 16, !tbaa !5
store double %0, ptr %arrayidx1, align 8, !tbaa !5
br label %if.end.i
if.end.i: ; preds = %if.then.i, %entry
%2 = phi double [ %0, %if.then.i ], [ %1, %entry ]
%3 = phi double [ %1, %if.then.i ], [ %0, %entry ]
%call42.i = call double @fmod(double noundef %3, double noundef %2) #4
%cmp1043.i = fcmp une double %call42.i, 0.000000e+00
br i1 %cmp1043.i, label %while.body.lr.ph.i, label %gcd.exit
while.body.lr.ph.i: ; preds = %if.end.i
%arrayidx16.i = getelementptr inbounds double, ptr %number, i64 2
br label %while.body.i
while.body.i: ; preds = %while.body.i, %while.body.lr.ph.i
%4 = load double, ptr %number, align 16, !tbaa !5
%5 = load double, ptr %arrayidx1, align 8, !tbaa !5
%call13.i = call double @fmod(double noundef %4, double noundef %5) #4
store double %call13.i, ptr %arrayidx16.i, align 16, !tbaa !5
%6 = load double, ptr %arrayidx1, align 8, !tbaa !5
store double %6, ptr %number, align 16, !tbaa !5
store double %call13.i, ptr %arrayidx1, align 8, !tbaa !5
%call.i = call double @fmod(double noundef %6, double noundef %call13.i) #4
%cmp10.i = fcmp une double %call.i, 0.000000e+00
br i1 %cmp10.i, label %while.body.i, label %gcd.exit, !llvm.loop !9
gcd.exit: ; preds = %while.body.i, %if.end.i
%7 = load double, ptr %arrayidx1, align 8, !tbaa !5
%call22.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %7)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %number) #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 uwtable
define dso_local void @gcd(ptr nocapture noundef %number) local_unnamed_addr #0 {
entry:
%0 = load double, ptr %number, align 8, !tbaa !5
%arrayidx1 = getelementptr inbounds double, ptr %number, i64 1
%1 = load double, ptr %arrayidx1, align 8, !tbaa !5
%cmp = fcmp olt double %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%arrayidx3 = getelementptr inbounds double, ptr %number, i64 2
store double %0, ptr %arrayidx3, align 8, !tbaa !5
store double %1, ptr %number, align 8, !tbaa !5
store double %0, ptr %arrayidx1, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%2 = phi double [ %0, %if.then ], [ %1, %entry ]
%3 = phi double [ %1, %if.then ], [ %0, %entry ]
%call42 = tail call double @fmod(double noundef %3, double noundef %2) #4
%cmp1043 = fcmp une double %call42, 0.000000e+00
br i1 %cmp1043, label %while.body.lr.ph, label %while.end
while.body.lr.ph: ; preds = %if.end
%arrayidx16 = getelementptr inbounds double, ptr %number, i64 2
br label %while.body
while.body: ; preds = %while.body.lr.ph, %while.body
%4 = load double, ptr %number, align 8, !tbaa !5
%5 = load double, ptr %arrayidx1, align 8, !tbaa !5
%call13 = tail call double @fmod(double noundef %4, double noundef %5) #4
store double %call13, ptr %arrayidx16, align 8, !tbaa !5
%6 = load double, ptr %arrayidx1, align 8, !tbaa !5
store double %6, ptr %number, align 8, !tbaa !5
store double %call13, ptr %arrayidx1, align 8, !tbaa !5
%call = tail call double @fmod(double noundef %6, double noundef %call13) #4
%cmp10 = fcmp une double %call, 0.000000e+00
br i1 %cmp10, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %if.end
%7 = load double, ptr %arrayidx1, align 8, !tbaa !5
%call22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %7)
ret void
}
; 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 @fmod(double noundef, double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int a,b,i,min,max,temp;
scanf("%d %d",&a,&b);
if(a > b){
min = b;
max = a;
}else{
min = a;
max = b;
}
while(1){
if(max%min == 0)break;
temp = min;
min = max%min;
max = temp;
}
printf("%d\n",min);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160253/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160253/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%.12 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%max.1 = phi i32 [ %., %entry ], [ %min.1, %while.cond ]
%min.1 = phi i32 [ %.12, %entry ], [ %rem, %while.cond ]
%rem = srem i32 %max.1, %min.1
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%call5 = 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 %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 ggd(int, int);
int main(void){
int x, y;
scanf("%d %d", &x, &y);
printf("%d\n", ggd(x, y));
return 0;
}
int ggd(int x, int y){
int t, u, v;
if(y > x){
t = x; x = y; y = t;
}
if(x%y == 0){
return y;
}
t = x % y;
while(1){
u = t;
t = y % u;
//printf("%d %d %d\n", y, t, u);
if(t == 0){
return u;
}else if(t == 1){
return 1;
}
y = u;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160303/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160303/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smin.i32(i32 %1, i32 %0)
%spec.select27.i = call i32 @llvm.smax.i32(i32 %1, i32 %0)
%rem.i = srem i32 %spec.select27.i, %spec.select.i
%cmp1.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.i, label %ggd.exit, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%y.addr.1.i = phi i32 [ %t.0.i, %while.cond.i ], [ %spec.select.i, %entry ]
%t.0.i = phi i32 [ %rem5.i, %while.cond.i ], [ %rem.i, %entry ]
%rem5.i = srem i32 %y.addr.1.i, %t.0.i
switch i32 %rem5.i, label %while.cond.i [
i32 0, label %ggd.exit
i32 1, label %ggd.exit.loopexit
]
ggd.exit.loopexit: ; preds = %while.cond.i
br label %ggd.exit
ggd.exit: ; preds = %while.cond.i, %ggd.exit.loopexit, %entry
%retval.0.i = phi i32 [ %spec.select.i, %entry ], [ %rem5.i, %ggd.exit.loopexit ], [ %t.0.i, %while.cond.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i)
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) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @ggd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %y, i32 %x)
%spec.select27 = tail call i32 @llvm.smax.i32(i32 %y, i32 %x)
%rem = srem i32 %spec.select27, %spec.select
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %cleanup, label %while.cond
while.cond: ; preds = %entry, %while.cond
%y.addr.1 = phi i32 [ %t.0, %while.cond ], [ %spec.select, %entry ]
%t.0 = phi i32 [ %rem5, %while.cond ], [ %rem, %entry ]
%rem5 = srem i32 %y.addr.1, %t.0
switch i32 %rem5, label %while.cond [
i32 0, label %cleanup.loopexit
i32 1, label %cleanup
]
cleanup.loopexit: ; preds = %while.cond
br label %cleanup
cleanup: ; preds = %while.cond, %cleanup.loopexit, %entry
%retval.0 = phi i32 [ %spec.select, %entry ], [ %t.0, %cleanup.loopexit ], [ 1, %while.cond ]
ret i32 %retval.0
}
; 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) #4
; 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int x,y,r,a;
scanf("%d%d",&x,&y);
if(((1<=x)&&(x<=1000000000))&&((1<=y)&&(y<=1000000000))){
if(y>x){
a=y;
y=x;
x=a;
}
while(y>0){
r = x % y;
x = y;
y = r;
}
printf("%d\n",x);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160347/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160347/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 1000000000
%2 = load i32, ptr %y, align 4
%cmp3 = icmp sgt i32 %2, 0
%or.cond11 = select i1 %or.cond, i1 %cmp3, i1 false
%cmp5 = icmp slt i32 %2, 1000000001
%or.cond12 = select i1 %or.cond11, i1 %cmp5, i1 false
br i1 %or.cond12, label %if.then, label %if.end10
if.then: ; preds = %entry
%spec.select = call i32 @llvm.umax.i32(i32 %2, i32 %0)
%spec.select19 = call i32 @llvm.umin.i32(i32 %2, i32 %0)
br label %while.body
while.body: ; preds = %if.then, %while.body
%3 = phi i32 [ %rem18, %while.body ], [ %spec.select19, %if.then ]
%4 = phi i32 [ %3, %while.body ], [ %spec.select, %if.then ]
%rem18 = urem i32 %4, %3
%cmp8.not = icmp eq i32 %rem18, 0
br i1 %cmp8.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body
store i32 %3, ptr %x, align 4, !tbaa !7
store i32 %rem18, ptr %y, align 4, !tbaa !7
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
br label %if.end10
if.end10: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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.umax.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int x,y,d,amari;
scanf("%d%d",&x,&y);
if(x<y)
{
d=x;
x=y;
y=d;
}
amari=x%y;
while(amari!=0)
{
x=y;
y=amari;
amari=x%y;
}
printf("%d\n",y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160398/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160398/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, 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 ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%amari.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%amari.068 = phi i32 [ %amari.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %amari.068, %amari.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %amari.068, ptr %x, align 4, !tbaa !5
store i32 %amari.09, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %amari.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int syumid(int,int);
int main()
{
int x,y,d;
scanf("%d%d",&x,&y);
if(x >= y)
d = syumid(x,y);
else
d = syumid(y,x);
printf("%d\n",d);
return 0;
}
int syumid(int a,int b)
{
int c;
while(1){
c = a%b;
if(c == 0) break;
else ;
a = b;
b = c;
}
return b;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160440/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160440/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %while.cond.i6, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%b.addr.0.i = phi i32 [ %rem.i, %while.cond.i ], [ %1, %entry ]
%a.addr.0.i = phi i32 [ %b.addr.0.i, %while.cond.i ], [ %0, %entry ]
%rem.i = srem i32 %a.addr.0.i, %b.addr.0.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.end, label %while.cond.i
while.cond.i6: ; preds = %entry, %while.cond.i6
%b.addr.0.i7 = phi i32 [ %rem.i9, %while.cond.i6 ], [ %0, %entry ]
%a.addr.0.i8 = phi i32 [ %b.addr.0.i7, %while.cond.i6 ], [ %1, %entry ]
%rem.i9 = srem i32 %a.addr.0.i8, %b.addr.0.i7
%cmp.i10 = icmp eq i32 %rem.i9, 0
br i1 %cmp.i10, label %if.end, label %while.cond.i6
if.end: ; preds = %while.cond.i, %while.cond.i6
%d.0 = phi i32 [ %b.addr.0.i7, %while.cond.i6 ], [ %b.addr.0.i, %while.cond.i ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %d.0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @syumid(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%b.addr.0 = phi i32 [ %b, %entry ], [ %rem, %while.cond ]
%a.addr.0 = phi i32 [ %a, %entry ], [ %b.addr.0, %while.cond ]
%rem = srem i32 %a.addr.0, %b.addr.0
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %while.end, label %while.cond
while.end: ; preds = %while.cond
ret i32 %b.addr.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int x,y,r,tmp;
scanf("%d %d",&x,&y);
if(x<y){
tmp=x;
x=y;
y=tmp;
}
r=x%y;
while(r!=0){
x=y;
y=r;
r=x%y;
}
printf("%d\n",y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160484/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160484/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, 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 ]
%rem = srem i32 %3, %2
%cmp1.not7 = icmp eq i32 %rem, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%r.09 = phi i32 [ %rem2, %while.body ], [ %rem, %if.end ]
%r.068 = phi i32 [ %r.09, %while.body ], [ %2, %if.end ]
%rem2 = srem i32 %r.068, %r.09
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %r.068, ptr %x, align 4, !tbaa !5
store i32 %r.09, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %r.09, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
void GCD(int,int);
int main()
{
int x,y;
scanf("%d%d",&x,&y);
GCD(x,y);
return 0;
}
/*最大公約数を求める*/
void GCD(int x,int y)
{
int a,n;
if(x<y)
{
a=x;
x=y;
y=a;
}
n=x%y;
while(n!=0)
{
x=y;
y=n;
n=x%y;
}
printf("%d\n",y);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160527/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160527/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%spec.select.i = call i32 @llvm.smin.i32(i32 %0, i32 %1)
%spec.select12.i = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%rem.i = srem i32 %spec.select12.i, %spec.select.i
%cmp1.not13.i = icmp eq i32 %rem.i, 0
br i1 %cmp1.not13.i, label %GCD.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%n.015.i = phi i32 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ]
%y.addr.114.i = phi i32 [ %n.015.i, %while.body.i ], [ %spec.select.i, %entry ]
%rem2.i = srem i32 %y.addr.114.i, %n.015.i
%cmp1.not.i = icmp eq i32 %rem2.i, 0
br i1 %cmp1.not.i, label %GCD.exit, label %while.body.i, !llvm.loop !9
GCD.exit: ; preds = %while.body.i, %entry
%y.addr.1.lcssa.i = phi i32 [ %spec.select.i, %entry ], [ %n.015.i, %while.body.i ]
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.addr.1.lcssa.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @GCD(i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
%spec.select12 = tail call i32 @llvm.smax.i32(i32 %x, i32 %y)
%rem = srem i32 %spec.select12, %spec.select
%cmp1.not13 = icmp eq i32 %rem, 0
br i1 %cmp1.not13, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%n.015 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ]
%y.addr.114 = phi i32 [ %n.015, %while.body ], [ %spec.select, %entry ]
%rem2 = srem i32 %y.addr.114, %n.015
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%y.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %n.015, %while.body ]
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.addr.1.lcssa)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (){
int x,y,r,tmp;
scanf("%d %d",&x,&y);
if(y>x) {
tmp = y;
y = x;
x = tmp;
}
while (y > 0){
r = x % y;
x = y;
y = r;
}
printf("%d\n",x);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160585/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160585/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %y, align 4, !tbaa !5
%1 = load i32, ptr %x, 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 %y, align 4, !tbaa !5
store i32 %0, ptr %x, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%.pr = phi i32 [ %1, %if.then ], [ %0, %entry ]
%cmp15 = icmp sgt i32 %.pr, 0
br i1 %cmp15, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int gcd(int x, int y){
if( y == 0 ) return x;
if( x >= y ) gcd(y, x%y);
else gcd(y,x);
}
int main(void){
int x,y;
scanf("%d %d", &x, &y);
printf("%d\n", gcd(x,y));
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160628/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160628/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef returned %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%cmp14.not = icmp eq i32 %y, 0
br i1 %cmp14.not, label %if.end4, label %if.end
if.end: ; preds = %entry, %tailrecurse.backedge
%y.tr16 = phi i32 [ %y.tr.be, %tailrecurse.backedge ], [ %y, %entry ]
%x.tr15 = phi i32 [ %y.tr16, %tailrecurse.backedge ], [ %x, %entry ]
%cmp1.not = icmp slt i32 %x.tr15, %y.tr16
br i1 %cmp1.not, label %tailrecurse.backedge, label %if.then2
if.then2: ; preds = %if.end
%rem = srem i32 %x.tr15, %y.tr16
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.end, %if.then2
%y.tr.be = phi i32 [ %rem, %if.then2 ], [ %x.tr15, %if.end ]
%cmp = icmp eq i32 %y.tr.be, 0
br i1 %cmp, label %if.end4, label %if.end
if.end4: ; preds = %tailrecurse.backedge, %entry
ret i32 %x
}
; 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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp14.not.i = icmp eq i32 %1, 0
br i1 %cmp14.not.i, label %gcd.exit, label %if.end.i
if.end.i: ; preds = %entry, %tailrecurse.backedge.i
%y.tr16.i = phi i32 [ %y.tr.be.i, %tailrecurse.backedge.i ], [ %1, %entry ]
%x.tr15.i = phi i32 [ %y.tr16.i, %tailrecurse.backedge.i ], [ %0, %entry ]
%cmp1.not.i = icmp slt i32 %x.tr15.i, %y.tr16.i
br i1 %cmp1.not.i, label %tailrecurse.backedge.i, label %if.then2.i
if.then2.i: ; preds = %if.end.i
%rem.i = srem i32 %x.tr15.i, %y.tr16.i
br label %tailrecurse.backedge.i
tailrecurse.backedge.i: ; preds = %if.then2.i, %if.end.i
%y.tr.be.i = phi i32 [ %rem.i, %if.then2.i ], [ %x.tr15.i, %if.end.i ]
%cmp.i = icmp eq i32 %y.tr.be.i, 0
br i1 %cmp.i, label %gcd.exit, label %if.end.i
gcd.exit: ; preds = %tailrecurse.backedge.i, %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/*
AOJ - ALDS1_1_B
Date: 20190309
Author: Mikoron * ♡mikoiwate_351♡
*/
#include<stdio.h>
int gcd(int a, int b);
int main(void) {
int a, b;
scanf("%d %d", &a, &b);
printf("%d\n", gcd(a,b));
return 0;
}
int gcd(int a, int b) {
int buf, div_num;
if(a == b) return a;
else if(b > a) {
b = b % a;
} else if(a > b) {
buf = a;
a = b;
b = buf % a;
}
div_num = 1;
while(b >= div_num) {
if(b % div_num == 0) {
if(a % (b / div_num) == 0) {
return b / div_num;
}
}
div_num++;
}
return 1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160671/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160671/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\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) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.i = icmp eq i32 %0, %1
br i1 %cmp.i, label %gcd.exit, label %if.else.i
if.else.i: ; preds = %entry
%cmp1.i = icmp sgt i32 %1, %0
br i1 %cmp1.i, label %if.then2.i, label %if.else3.i
if.then2.i: ; preds = %if.else.i
%rem.i = srem i32 %1, %0
br label %if.end8.i
if.else3.i: ; preds = %if.else.i
%cmp4.i = icmp sgt i32 %0, %1
br i1 %cmp4.i, label %if.then5.i, label %if.end8.i
if.then5.i: ; preds = %if.else3.i
%rem6.i = srem i32 %0, %1
br label %if.end8.i
if.end8.i: ; preds = %if.then5.i, %if.else3.i, %if.then2.i
%a.addr.0.i = phi i32 [ %0, %if.then2.i ], [ %1, %if.then5.i ], [ %0, %if.else3.i ]
%b.addr.0.i = phi i32 [ %rem.i, %if.then2.i ], [ %rem6.i, %if.then5.i ], [ %1, %if.else3.i ]
%cmp9.not39.i = icmp slt i32 %b.addr.0.i, 1
br i1 %cmp9.not39.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %if.end8.i, %if.end18.i
%div_num.040.i = phi i32 [ %inc.i, %if.end18.i ], [ 1, %if.end8.i ]
%rem10.i = srem i32 %b.addr.0.i, %div_num.040.i
%div.i = sdiv i32 %b.addr.0.i, %div_num.040.i
%cmp11.i = icmp eq i32 %rem10.i, 0
br i1 %cmp11.i, label %if.then12.i, label %if.end18.i
if.then12.i: ; preds = %while.body.i
%rem13.i = srem i32 %a.addr.0.i, %div.i
%cmp14.i = icmp eq i32 %rem13.i, 0
br i1 %cmp14.i, label %gcd.exit, label %if.end18.i
if.end18.i: ; preds = %if.then12.i, %while.body.i
%inc.i = add nuw i32 %div_num.040.i, 1
%exitcond.not.i = icmp eq i32 %div_num.040.i, %b.addr.0.i
br i1 %exitcond.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !9
gcd.exit: ; preds = %if.then12.i, %if.end18.i, %entry, %if.end8.i
%retval.0.i = phi i32 [ %0, %entry ], [ 1, %if.end8.i ], [ 1, %if.end18.i ], [ %div.i, %if.then12.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i)
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: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%cmp = icmp eq i32 %a, %b
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp1 = icmp sgt i32 %b, %a
br i1 %cmp1, label %if.then2, label %if.else3
if.then2: ; preds = %if.else
%rem = srem i32 %b, %a
br label %if.end8
if.else3: ; preds = %if.else
%cmp4 = icmp sgt i32 %a, %b
br i1 %cmp4, label %if.then5, label %if.end8
if.then5: ; preds = %if.else3
%rem6 = srem i32 %a, %b
br label %if.end8
if.end8: ; preds = %if.then2, %if.then5, %if.else3
%a.addr.0 = phi i32 [ %a, %if.then2 ], [ %b, %if.then5 ], [ %a, %if.else3 ]
%b.addr.0 = phi i32 [ %rem, %if.then2 ], [ %rem6, %if.then5 ], [ %b, %if.else3 ]
%cmp9.not39 = icmp slt i32 %b.addr.0, 1
br i1 %cmp9.not39, label %cleanup, label %while.body
while.body: ; preds = %if.end8, %if.end18
%div_num.040 = phi i32 [ %inc, %if.end18 ], [ 1, %if.end8 ]
%rem10 = srem i32 %b.addr.0, %div_num.040
%div = sdiv i32 %b.addr.0, %div_num.040
%cmp11 = icmp eq i32 %rem10, 0
br i1 %cmp11, label %if.then12, label %if.end18
if.then12: ; preds = %while.body
%rem13 = srem i32 %a.addr.0, %div
%cmp14 = icmp eq i32 %rem13, 0
br i1 %cmp14, label %cleanup, label %if.end18
if.end18: ; preds = %if.then12, %while.body
%inc = add nuw i32 %div_num.040, 1
%exitcond.not = icmp eq i32 %div_num.040, %b.addr.0
br i1 %exitcond.not, label %cleanup, label %while.body, !llvm.loop !9
cleanup: ; preds = %if.then12, %if.end18, %if.end8, %entry
%retval.0 = phi i32 [ %a, %entry ], [ 1, %if.end8 ], [ %div, %if.then12 ], [ 1, %if.end18 ]
ret i32 %retval.0
}
; 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 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 x,y,n,r;
scanf("%d %d",&x,&y);
if(x<y){
n=x;
x=y;
y=n;
}
while(y>0){
r=x%y;
x=y;
y=r;
}
printf("%d",x);
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160714/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160714/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
store i32 %1, ptr %x, align 4, !tbaa !5
store i32 %0, ptr %y, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%x.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%.pr = phi i32 [ %0, %if.then ], [ %1, %entry ]
%cmp16 = icmp sgt i32 %.pr, 0
br i1 %cmp16, label %while.body, label %while.end
while.body: ; preds = %if.end, %while.body
%2 = phi i32 [ %rem, %while.body ], [ %.pr, %if.end ]
%3 = phi i32 [ %2, %while.body ], [ %x.promoted, %if.end ]
%rem = srem i32 %3, %2
%cmp1 = icmp sgt i32 %rem, 0
br i1 %cmp1, label %while.body, label %while.cond.while.end_crit_edge, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %2, ptr %x, align 4, !tbaa !5
store i32 %rem, ptr %y, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %2, %while.cond.while.end_crit_edge ], [ %x.promoted, %if.end ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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<stdlib.h>
int main(){
int x,y,d,a1,a2;
scanf("%d%d",&x,&y);
if(x>y){
a1=x;
a2=y;
}else{
a1=y;
a2=x;
}
while(1){
if(a1%a2==0){
break;
}else{
d=a1%a2;
a1=a2;
a2=d;
}
}
printf("%d\n",a2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160758/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160758/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%x = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %y, align 4, !tbaa !5
%. = call i32 @llvm.smax.i32(i32 %0, i32 %1)
%.13 = call i32 @llvm.smin.i32(i32 %0, i32 %1)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%a1.1 = phi i32 [ %., %entry ], [ %a2.1, %while.cond ]
%a2.1 = phi i32 [ %.13, %entry ], [ %rem, %while.cond ]
%rem = srem i32 %a1.1, %a2.1
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %while.end, label %while.cond
while.end: ; preds = %while.cond
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a2.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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,tmp,n;
scanf("%d%d",&a,&b);
if(a<b){
tmp=a;
a=b;
b=tmp;
}
while((n=a%b)!=0){
a=b;
b=n;
n=a%b;
}
printf("%d\n",b);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160800/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160800/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
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
%b.promoted = phi i32 [ %0, %if.then ], [ %1, %entry ]
%a.promoted = phi i32 [ %1, %if.then ], [ %0, %entry ]
%rem6 = srem i32 %a.promoted, %b.promoted
%cmp1.not7 = icmp eq i32 %rem6, 0
br i1 %cmp1.not7, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%rem9 = phi i32 [ %rem, %while.body ], [ %rem6, %if.end ]
%rem58 = phi i32 [ %rem9, %while.body ], [ %b.promoted, %if.end ]
%rem = srem i32 %rem58, %rem9
%cmp1.not = icmp eq i32 %rem, 0
br i1 %cmp1.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %rem58, ptr %a, align 4, !tbaa !5
store i32 %rem9, ptr %b, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%.lcssa = phi i32 [ %rem9, %while.cond.while.end_crit_edge ], [ %b.promoted, %if.end ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int GCD(int, int);
int main () {
int a = 0, b = 0, div = 0;
scanf("%d%d",&a,&b);
if(a > b) div = GCD(a,b);
else div = GCD(b,a);
printf("%d\n",div);
return 0;
}
int GCD(int a, int b) {
int sum = 0;
sum = a % b;
if(sum == 0) return b;
else sum = GCD(b,a%b);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160844/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160844/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #4
store i32 0, ptr %a, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
store i32 0, ptr %b, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%rem7.i = srem i32 %0, %1
%cmp8.not.i = icmp eq i32 %rem7.i, 0
br i1 %cmp8.not.i, label %if.end, label %if.else.i
if.else.i: ; preds = %if.then, %if.else.i
%rem12.i = phi i32 [ %rem.i, %if.else.i ], [ %rem7.i, %if.then ]
%b.tr9.i = phi i32 [ %rem12.i, %if.else.i ], [ %1, %if.then ]
%rem.i = srem i32 %b.tr9.i, %rem12.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %if.end, label %if.else.i
if.else: ; preds = %entry
%rem7.i6 = srem i32 %1, %0
%cmp8.not.i7 = icmp eq i32 %rem7.i6, 0
br i1 %cmp8.not.i7, label %if.end, label %if.else.i8
if.else.i8: ; preds = %if.else, %if.else.i8
%rem12.i9 = phi i32 [ %rem.i11, %if.else.i8 ], [ %rem7.i6, %if.else ]
%b.tr9.i10 = phi i32 [ %rem12.i9, %if.else.i8 ], [ %0, %if.else ]
%rem.i11 = srem i32 %b.tr9.i10, %rem12.i9
%cmp.i12 = icmp eq i32 %rem.i11, 0
br i1 %cmp.i12, label %if.end, label %if.else.i8
if.end: ; preds = %if.else.i8, %if.else.i, %if.else, %if.then
%div.0 = phi i32 [ %1, %if.then ], [ %0, %if.else ], [ %1, %if.else.i ], [ %0, %if.else.i8 ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.0)
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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @GCD(i32 noundef %a, i32 noundef returned %b) local_unnamed_addr #3 {
entry:
%rem7 = srem i32 %a, %b
%cmp8.not = icmp eq i32 %rem7, 0
br i1 %cmp8.not, label %cleanup, label %if.else
if.else: ; preds = %entry, %if.else
%rem12 = phi i32 [ %rem, %if.else ], [ %rem7, %entry ]
%b.tr9 = phi i32 [ %rem12, %if.else ], [ %b, %entry ]
%rem = srem i32 %b.tr9, %rem12
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %cleanup, label %if.else
cleanup: ; preds = %if.else, %entry
ret i32 %b
}
; 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 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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,k,n,ans;
scanf("%d",&a); scanf("%d",&b);
if(a>b){
k=a; a=b; b=k;}
n=b%a;
while(n!=0){
b=a; a=n; n=b%a;
}
printf("%d\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160895/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160895/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.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 ]
%rem = srem i32 %3, %2
%cmp2.not8 = icmp eq i32 %rem, 0
br i1 %cmp2.not8, label %while.end, label %while.body
while.body: ; preds = %if.end, %while.body
%n.010 = phi i32 [ %rem3, %while.body ], [ %rem, %if.end ]
%n.079 = phi i32 [ %n.010, %while.body ], [ %2, %if.end ]
%rem3 = srem i32 %n.079, %n.010
%cmp2.not = icmp eq i32 %rem3, 0
br i1 %cmp2.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i32 %n.079, ptr %b, align 4, !tbaa !5
store i32 %n.010, ptr %a, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %if.end
%4 = phi i32 [ %n.010, %while.cond.while.end_crit_edge ], [ %2, %if.end ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n, a, v, wa, wv;
int i;
scanf("%d", &n);
scanf("%d%d", &wa, &wv);
for (i = 1; i < n; i++) {
scanf("%d%d", &a, &v);
if (v > wv) {
wv = v; wa = a;
} else if (v == wv && a < wa) {
wv = v; wa = a;
}
}
printf("%d %d\n", wa, wv);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160938/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160938/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%v = alloca i32, align 4
%wa = alloca i32, align 4
%wv = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %wa) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %wv) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %wa, ptr noundef nonnull %wv)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 1
br i1 %cmp11, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr %wv, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.inc
%i.012 = phi i32 [ %inc, %for.inc ], [ 1, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %v)
%1 = load i32, ptr %v, align 4, !tbaa !5
%2 = load i32, ptr %wv, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %1, %2
br i1 %cmp3, label %if.then, label %if.else
if.then: ; preds = %for.body
store i32 %1, ptr %wv, align 4, !tbaa !5
%3 = load i32, ptr %a, align 4, !tbaa !5
store i32 %3, ptr %wa, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%cmp4 = icmp eq i32 %1, %2
br i1 %cmp4, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %if.else
%4 = load i32, ptr %a, align 4, !tbaa !5
%5 = load i32, ptr %wa, align 4, !tbaa !5
%cmp5 = icmp slt i32 %4, %5
br i1 %cmp5, label %if.then6, label %for.inc
if.then6: ; preds = %land.lhs.true
store i32 %1, ptr %wv, align 4, !tbaa !5
store i32 %4, ptr %wa, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.then6, %land.lhs.true, %if.else
%6 = phi i32 [ %1, %if.then ], [ %1, %if.then6 ], [ %1, %land.lhs.true ], [ %2, %if.else ]
%inc = add nuw nsw i32 %i.012, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %7
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry.for.end_crit_edge
%8 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %6, %for.inc ]
%9 = load i32, ptr %wa, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9, i32 noundef %8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %wv) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %wa) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int i,n,ans=0,num,j;
scanf("%d",&n);
int a,v;
for(i=0;i<n;i++){
scanf("%d %d",&a,&v);
if(ans<v){
ans=v;
num=a;
}else if(ans==v&&num>a)num=a;
}
printf("%d %d\n",num,ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_160989/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_160989/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%v = 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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp13)
br label %for.body
for.body: ; preds = %entry, %for.inc
%i.016 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%num.015 = phi i32 [ %num.1, %for.inc ], [ undef, %entry ]
%ans.014 = phi i32 [ %ans.1, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %v)
%1 = load i32, ptr %v, align 4, !tbaa !5
%cmp2 = icmp slt i32 %ans.014, %1
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
%2 = load i32, ptr %a, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%cmp3 = icmp eq i32 %ans.014, %1
br i1 %cmp3, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %if.else
%3 = load i32, ptr %a, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %num.015, i32 %3)
br label %for.inc
for.inc: ; preds = %land.lhs.true, %if.then, %if.else
%ans.1 = phi i32 [ %1, %if.then ], [ %ans.014, %if.else ], [ %ans.014, %land.lhs.true ]
%num.1 = phi i32 [ %2, %if.then ], [ %num.015, %if.else ], [ %spec.select, %land.lhs.true ]
%inc = add nuw nsw i32 %i.016, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %num.1, i32 noundef %ans.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
char a[11];
scanf("%s",a);
if((a[5]=='0') && (a[6]<'5')){
printf("Heisei\n");
}else{
printf("TBD\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%arrayidx = getelementptr inbounds [11 x i8], ptr %a, i64 0, i64 5
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 48
%arrayidx2 = getelementptr inbounds [11 x i8], ptr %a, i64 0, i64 6
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp slt i8 %1, 53
%or.cond = select i1 %cmp, i1 %cmp4, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main(void){
int Y=0, M=0;
char S[15];
scanf("%s", S);
Y += 1000*(S[0]-'0');
Y += 100*(S[1]-'0');
Y += 10*(S[2]-'0');
Y += S[3]-'0';
M += 10*(S[5]-'0');
M += S[6]-'0';
//printf("%d %d\n", Y, M);
if(Y>2019) printf("TBD\n");
else if(Y==2019){
if(M>4) printf("TBD\n");
else printf("Heisei\n");
}
else printf("Heisei\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%0 = load i8, ptr %S, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%1 = mul nsw i32 %conv, 1000
%arrayidx1 = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 1
%2 = load i8, ptr %arrayidx1, align 1, !tbaa !5
%conv2 = sext i8 %2 to i32
%3 = mul nsw i32 %conv2, 100
%mul4 = add nsw i32 %3, %1
%arrayidx6 = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 2
%4 = load i8, ptr %arrayidx6, align 1, !tbaa !5
%conv7 = sext i8 %4 to i32
%5 = mul nsw i32 %conv7, 10
%mul9 = add nsw i32 %mul4, %5
%arrayidx11 = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 3
%6 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%conv12 = sext i8 %6 to i32
%sub13 = add nsw i32 %mul9, %conv12
%arrayidx15 = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 5
%7 = load i8, ptr %arrayidx15, align 1, !tbaa !5
%conv16 = sext i8 %7 to i32
%8 = mul nsw i32 %conv16, 10
%arrayidx20 = getelementptr inbounds [15 x i8], ptr %S, i64 0, i64 6
%9 = load i8, ptr %arrayidx20, align 1, !tbaa !5
%conv21 = sext i8 %9 to i32
%sub22 = add nsw i32 %8, %conv21
%cmp = icmp sgt i32 %sub13, 55347
br i1 %cmp, label %if.end38, label %if.else
if.else: ; preds = %entry
%cmp26 = icmp eq i32 %sub13, 55347
br i1 %cmp26, label %if.then28, label %if.end38
if.then28: ; preds = %if.else
%cmp29 = icmp sgt i32 %sub22, 532
%str.4.str.3 = select i1 %cmp29, ptr @str.5, ptr @str.3
br label %if.end38
if.end38: ; preds = %if.else, %if.then28, %entry
%str.sink = phi ptr [ @str.5, %entry ], [ %str.4.str.3, %if.then28 ], [ @str.3, %if.else ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int a, b, c;
scanf("%d/%d/%d",&a,&b,&c);
if(a<2019){ printf("Heisei\n");
return 0; }
else if(a>2019) {printf("TBD\n");
return 0; }
if(b<04) {printf("Heisei\n");
return 0; }
else if(b>04) {printf("TBD\n");
return 0; }
if(c<=30) {printf("Heisei\n");
return 0;;}
else if(c>30) {printf("TBD\n");
return 0; }
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161139/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161139/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.6 = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
@str.7 = private unnamed_addr constant [7 x i8] c"Heisei\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
%cmp = icmp slt i32 %0, 2019
br i1 %cmp, label %cleanup, label %if.else
if.else: ; preds = %entry
%cmp2.not = icmp eq i32 %0, 2019
br i1 %cmp2.not, label %if.end5, label %cleanup
if.end5: ; preds = %if.else
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp6 = icmp slt i32 %1, 4
br i1 %cmp6, label %cleanup, label %if.else9
if.else9: ; preds = %if.end5
%cmp10.not = icmp eq i32 %1, 4
br i1 %cmp10.not, label %if.end14, label %cleanup
if.end14: ; preds = %if.else9
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp15 = icmp slt i32 %2, 31
%str.3.str = select i1 %cmp15, ptr @str.7, ptr @str.6
br label %cleanup
cleanup: ; preds = %if.end14, %if.else9, %if.end5, %if.else, %entry
%str.sink = phi ptr [ @str.7, %entry ], [ @str.6, %if.else ], [ @str.7, %if.end5 ], [ @str.6, %if.else9 ], [ %str.3.str, %if.end14 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c;
scanf("%d/%d/%d",&a,&b,&c);
if(2019<a || (a<=2019 && 5<=b)){
printf("TBD\n");
}
else{
printf("Heisei\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161182/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161182/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d/%d/%d\00", align 1
@str = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"TBD\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
%cmp = icmp sgt i32 %0, 2019
%1 = load i32, ptr %b, align 4
%cmp2 = icmp sgt i32 %1, 4
%or.cond = select i1 %cmp, i1 true, i1 %cmp2
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int a,b,c;
char d,e;
scanf("%d%c%d%c%d",&a,&d,&b,&e,&c);
if(a<=2019 && b<=04){
printf("Heisei\n");
}else{
printf("TBD\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161225/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161225/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%c%d%c%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"Heisei\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i8, align 1
%e = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %e) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %b, ptr noundef nonnull %e, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 2020
%1 = load i32, ptr %b, align 4
%cmp1 = icmp slt i32 %1, 5
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%str.3.str = select i1 %or.cond, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %e) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
char S[10];
scanf("%s",S);
if(S[5]=='0'&&S[6]<='4'){
printf("Heisei");
return 0;
}
printf("TBD");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161276/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161276/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Heisei\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"TBD\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%arrayidx = getelementptr inbounds [10 x i8], ptr %S, i64 0, i64 5
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp = icmp eq i8 %0, 48
%arrayidx2 = getelementptr inbounds [10 x i8], ptr %S, i64 0, i64 6
%1 = load i8, ptr %arrayidx2, align 1
%cmp4 = icmp slt i8 %1, 53
%or.cond = select i1 %cmp, i1 %cmp4, i1 false
%.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 10, 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"}
|
#include <stdio.h>
#include <math.h>
int main(void){
long long x,i,j;
scanf("%lld",&x);
int s = sqrt(x);
for(i=s;i>0;i--){
if(x%i==0){
j = x/i;
printf("%lld",i+j-2);
return 0;
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161319/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161319/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i64, ptr %x, align 8, !tbaa !5
%conv = sitofp i64 %0 to double
%call1 = call double @sqrt(double noundef %conv) #4
%conv2 = fptosi double %call1 to i32
%cmp16 = icmp sgt i32 %conv2, 0
br i1 %cmp16, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %entry
%conv3 = zext i32 %conv2 to i64
%1 = load i64, ptr %x, align 8, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%i.017 = phi i64 [ %conv3, %for.body.lr.ph ], [ %dec, %for.inc ]
%rem = srem i64 %1, %i.017
%div = sdiv i64 %1, %i.017
%cmp5 = icmp eq i64 %rem, 0
br i1 %cmp5, label %if.then, label %for.inc
if.then: ; preds = %for.body
%add = add nsw i64 %i.017, -2
%sub = add i64 %add, %div
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sub)
br label %cleanup
for.inc: ; preds = %for.body
%dec = add nsw i64 %i.017, -1
%cmp = icmp sgt i64 %i.017, 1
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9
cleanup: ; preds = %for.inc, %entry, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
int main()
{
long long int n,i,j,k,ans;
scanf("%lld", &n);
k=sqrt(n);
//printf("k=%lld\n", k);
ans=n;
for(i=1;i<=k;i++){
if(n%i==0){
j=n/i;
ans=(ans<=i+j-2)?ans:i+j-2;
//printf("%lld\n", i);
//printf("%lld\n", j);
//printf("%lld\n", ans);
}
}
printf("%lld", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161362/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161362/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
%conv = sitofp i64 %0 to double
%call1 = call double @sqrt(double noundef %conv) #5
%conv2 = fptosi double %call1 to i64
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not19 = icmp slt i64 %conv2, 1
br i1 %cmp.not19, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%ans.021 = phi i64 [ %ans.1, %for.inc ], [ %1, %entry ]
%i.020 = phi i64 [ %inc, %for.inc ], [ 1, %entry ]
%rem = srem i64 %1, %i.020
%div = sdiv i64 %1, %i.020
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %for.body
%add = add nsw i64 %i.020, -2
%sub = add i64 %add, %div
%sub.ans.0 = call i64 @llvm.smin.i64(i64 %ans.021, i64 %sub)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%ans.1 = phi i64 [ %sub.ans.0, %if.then ], [ %ans.021, %for.body ]
%inc = add nuw i64 %i.020, 1
%exitcond.not = icmp eq i64 %i.020, %conv2
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i64 [ %1, %entry ], [ %ans.1, %for.inc ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.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 = { 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 = { 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"}
|
#include <stdio.h>
typedef long long ll;
ll min(ll x, ll y) {
return x < y ? x : y;
}
int main() {
ll n;
scanf("%lld", &n);
ll ans = n;
for (ll i = 1; i*i <= n; i++) {
if (n % i == 0) {
ans = min(ans, i + n/i - 2);
}
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161405/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161405/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
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
%cmp.not10 = icmp slt i64 %0, 1
br i1 %cmp.not10, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i64 [ %0, %entry ], [ %ans.1, %for.inc ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.012 = phi i64 [ %inc, %for.inc ], [ 1, %entry ]
%ans.011 = phi i64 [ %ans.1, %for.inc ], [ %0, %entry ]
%rem = srem i64 %0, %i.012
%div = sdiv i64 %0, %i.012
%cmp1 = icmp eq i64 %rem, 0
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%add = add nsw i64 %i.012, -2
%sub = add i64 %add, %div
%cond.i = call i64 @llvm.smin.i64(i64 %ans.011, i64 %sub)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%ans.1 = phi i64 [ %cond.i, %if.then ], [ %ans.011, %for.body ]
%inc = add nuw nsw i64 %i.012, 1
%mul = mul nsw i64 %inc, %inc
%cmp.not = icmp sgt i64 %mul, %0
br i1 %cmp.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) #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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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"}
|
#include<stdio.h>
#include<math.h>
int main(){
long n,k;
scanf("%ld",&n);
k=sqrt(n);
for(long i=k;i>=1;i--){
if(n%i==0){
k=i;
break;
}
}
printf("%ld\n",k+n/k-2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161456/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\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 i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%conv = sitofp i64 %0 to double
%call1 = call double @sqrt(double noundef %conv) #4
%conv2 = fptosi double %call1 to i64
%cmp14 = icmp sgt i64 %conv2, 0
%.pre = load i64, ptr %n, align 8, !tbaa !5
br i1 %cmp14, label %for.body, label %cleanup
for.body: ; preds = %entry, %for.inc
%i.015 = phi i64 [ %dec, %for.inc ], [ %conv2, %entry ]
%rem = srem i64 %.pre, %i.015
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %cleanup, label %for.inc
for.inc: ; preds = %for.body
%dec = add nsw i64 %i.015, -1
%cmp = icmp sgt i64 %i.015, 1
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9
cleanup: ; preds = %for.inc, %for.body, %entry
%k.0 = phi i64 [ %conv2, %entry ], [ %i.015, %for.body ], [ %conv2, %for.inc ]
%div = sdiv i64 %.pre, %k.0
%add = add i64 %k.0, -2
%sub = add i64 %add, %div
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int t,i,a,j;
scanf("%d",&t);
for(i=1;i<=t;i++)
{scanf("%d",&a);
for(j=0;a>0;j++){
a-=2*j+1;
}
printf("%d\n",j);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1615/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1615/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not14 = icmp slt i32 %0, 1
br i1 %cmp.not14, label %for.end8, label %for.body
for.body: ; preds = %entry, %for.end
%i.015 = phi i32 [ %inc7, %for.end ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%.pr = load i32, ptr %a, align 4, !tbaa !5
%cmp312 = icmp sgt i32 %.pr, 0
br i1 %cmp312, label %for.body4, label %for.end
for.body4: ; preds = %for.body, %for.body4
%j.013 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ]
%1 = phi i32 [ %sub, %for.body4 ], [ %.pr, %for.body ]
%mul = shl nuw nsw i32 %j.013, 1
%add.neg = xor i32 %mul, -1
%sub = add i32 %1, %add.neg
%inc = add nuw nsw i32 %j.013, 1
%cmp3 = icmp sgt i32 %sub, 0
br i1 %cmp3, label %for.body4, label %for.cond2.for.end_crit_edge, !llvm.loop !9
for.cond2.for.end_crit_edge: ; preds = %for.body4
store i32 %sub, ptr %a, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.cond2.for.end_crit_edge, %for.body
%j.0.lcssa = phi i32 [ %inc, %for.cond2.for.end_crit_edge ], [ 0, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.0.lcssa)
%inc7 = add nuw nsw i32 %i.015, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %i.015, %2
br i1 %cmp.not.not, label %for.body, label %for.end8, !llvm.loop !11
for.end8: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <math.h>
long long int Min(long long int a,long long int b){
if(a>b)
return b;
else
return a;
}
int main(){
long long int n,ans=0,i,f=0;
scanf("%lld",&n);
for(i=2;i<=sqrt(n);i++){
if(n%i == 0){
if(f==0){
ans = i+n/i-2;
f=1;
continue;
}
ans = Min(ans,(i+n/i-2));
}
}
if(ans == 0)
printf("%lld",n-1);
else
printf("%lld",ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @Min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%b.a = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %b.a
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%conv129 = sitofp i64 %0 to double
%call230 = call double @sqrt(double noundef %conv129) #6
%cmp31 = fcmp ult double %call230, 2.000000e+00
br i1 %cmp31, label %if.then16, label %for.body
for.body: ; preds = %entry, %for.inc
%f.034 = phi i64 [ %f.1, %for.inc ], [ 0, %entry ]
%i.033 = phi i64 [ %inc, %for.inc ], [ 2, %entry ]
%ans.032 = phi i64 [ %ans.1, %for.inc ], [ 0, %entry ]
%1 = load i64, ptr %n, align 8, !tbaa !5
%rem = srem i64 %1, %i.033
%div = sdiv i64 %1, %i.033
%cmp4 = icmp eq i64 %rem, 0
br i1 %cmp4, label %if.then, label %for.inc
if.then: ; preds = %for.body
%cmp6 = icmp eq i64 %f.034, 0
%add = add nsw i64 %i.033, -2
%sub = add i64 %add, %div
br i1 %cmp6, label %for.inc, label %if.end
if.end: ; preds = %if.then
%b.a.i = call i64 @llvm.smin.i64(i64 %ans.032, i64 %sub)
br label %for.inc
for.inc: ; preds = %if.then, %for.body, %if.end
%ans.1 = phi i64 [ %b.a.i, %if.end ], [ %ans.032, %for.body ], [ %sub, %if.then ]
%f.1 = phi i64 [ 1, %if.end ], [ %f.034, %for.body ], [ 1, %if.then ]
%inc = add nuw nsw i64 %i.033, 1
%conv = sitofp i64 %inc to double
%conv1 = sitofp i64 %1 to double
%call2 = call double @sqrt(double noundef %conv1) #6
%cmp = fcmp ult double %call2, %conv
br i1 %cmp, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc
%cmp14 = icmp eq i64 %ans.1, 0
br i1 %cmp14, label %if.then16, label %if.end20
if.then16: ; preds = %entry, %for.end
%2 = load i64, ptr %n, align 8, !tbaa !5
%sub17 = add nsw i64 %2, -1
br label %if.end20
if.end20: ; preds = %for.end, %if.then16
%ans.1.lcssa.sink = phi i64 [ %sub17, %if.then16 ], [ %ans.1, %for.end ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.1.lcssa.sink)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <math.h>
#define MAX 1000
int main(){
int n;
int i, j=0, sum;
int score[MAX];
double ave, tmp;
double dev[MAX];
while(1){
scanf("%d", &n);
if(n==0)break;
sum=0;
for(i=0;i<n;i++){
scanf("%d", &score[i]);
sum+=score[i];
}
ave=(double)sum/(double)n;
tmp=0.0;
for(i=0;i<n;i++){
tmp+=pow(score[i]-ave, 2);
}
dev[j++]=sqrt(tmp/(double)n);
}
for(i=0;i<j;i++){
printf("%f\n", dev[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161586/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161586/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%score = alloca [1000 x i32], align 16
%dev = alloca [1000 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %score) #4
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %dev) #4
%call55 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp56 = icmp eq i32 %0, 0
br i1 %cmp56, label %for.end33, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end17
%1 = phi i32 [ %12, %for.end17 ], [ %0, %entry ]
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.end17 ], [ 0, %entry ]
%cmp147 = icmp sgt i32 %1, 0
br i1 %cmp147, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond.preheader
%conv579 = sitofp i32 %1 to double
br label %for.end17
for.cond24.preheader: ; preds = %for.end17
%2 = and i64 %indvars.iv.next67, 4294967295
%cmp2559.not = icmp eq i64 %2, 0
br i1 %cmp2559.not, label %for.end33, label %for.body27.preheader
for.body27.preheader: ; preds = %for.cond24.preheader
%wide.trip.count72 = and i64 %indvars.iv.next67, 4294967295
br label %for.body27
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%sum.048 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %score, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %3, %sum.048
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%conv = sitofp i32 %add to double
%conv5 = sitofp i32 %4 to double
%div = fdiv double %conv, %conv5
%cmp751 = icmp sgt i32 %4, 0
br i1 %cmp751, label %for.body9.preheader, label %for.end17
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count, 3
%6 = icmp ult i32 %4, 4
br i1 %6, label %for.end17.loopexit.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body9
for.body9: ; preds = %for.body9, %for.body9.preheader.new
%indvars.iv63 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next64.3, %for.body9 ]
%tmp.053 = phi double [ 0.000000e+00, %for.body9.preheader.new ], [ %add14.3, %for.body9 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.body9 ]
%arrayidx11 = getelementptr inbounds [1000 x i32], ptr %score, i64 0, i64 %indvars.iv63
%7 = load i32, ptr %arrayidx11, align 16, !tbaa !5
%conv12 = sitofp i32 %7 to double
%sub = fsub double %conv12, %div
%square = fmul double %sub, %sub
%add14 = fadd double %tmp.053, %square
%indvars.iv.next64 = or i64 %indvars.iv63, 1
%arrayidx11.1 = getelementptr inbounds [1000 x i32], ptr %score, i64 0, i64 %indvars.iv.next64
%8 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%conv12.1 = sitofp i32 %8 to double
%sub.1 = fsub double %conv12.1, %div
%square.1 = fmul double %sub.1, %sub.1
%add14.1 = fadd double %add14, %square.1
%indvars.iv.next64.1 = or i64 %indvars.iv63, 2
%arrayidx11.2 = getelementptr inbounds [1000 x i32], ptr %score, i64 0, i64 %indvars.iv.next64.1
%9 = load i32, ptr %arrayidx11.2, align 8, !tbaa !5
%conv12.2 = sitofp i32 %9 to double
%sub.2 = fsub double %conv12.2, %div
%square.2 = fmul double %sub.2, %sub.2
%add14.2 = fadd double %add14.1, %square.2
%indvars.iv.next64.2 = or i64 %indvars.iv63, 3
%arrayidx11.3 = getelementptr inbounds [1000 x i32], ptr %score, i64 0, i64 %indvars.iv.next64.2
%10 = load i32, ptr %arrayidx11.3, align 4, !tbaa !5
%conv12.3 = sitofp i32 %10 to double
%sub.3 = fsub double %conv12.3, %div
%square.3 = fmul double %sub.3, %sub.3
%add14.3 = fadd double %add14.2, %square.3
%indvars.iv.next64.3 = add nuw nsw i64 %indvars.iv63, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end17.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11
for.end17.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader
%add14.lcssa.ph = phi double [ undef, %for.body9.preheader ], [ %add14.3, %for.body9 ]
%indvars.iv63.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next64.3, %for.body9 ]
%tmp.053.unr = phi double [ 0.000000e+00, %for.body9.preheader ], [ %add14.3, %for.body9 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end17, label %for.body9.epil
for.body9.epil: ; preds = %for.end17.loopexit.unr-lcssa, %for.body9.epil
%indvars.iv63.epil = phi i64 [ %indvars.iv.next64.epil, %for.body9.epil ], [ %indvars.iv63.unr, %for.end17.loopexit.unr-lcssa ]
%tmp.053.epil = phi double [ %add14.epil, %for.body9.epil ], [ %tmp.053.unr, %for.end17.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body9.epil ], [ 0, %for.end17.loopexit.unr-lcssa ]
%arrayidx11.epil = getelementptr inbounds [1000 x i32], ptr %score, i64 0, i64 %indvars.iv63.epil
%11 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%conv12.epil = sitofp i32 %11 to double
%sub.epil = fsub double %conv12.epil, %div
%square.epil = fmul double %sub.epil, %sub.epil
%add14.epil = fadd double %tmp.053.epil, %square.epil
%indvars.iv.next64.epil = add nuw nsw i64 %indvars.iv63.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end17, label %for.body9.epil, !llvm.loop !12
for.end17: ; preds = %for.end17.loopexit.unr-lcssa, %for.body9.epil, %for.end.thread, %for.end
%conv582 = phi double [ %conv5, %for.end ], [ %conv579, %for.end.thread ], [ %conv5, %for.body9.epil ], [ %conv5, %for.end17.loopexit.unr-lcssa ]
%tmp.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ 0.000000e+00, %for.end.thread ], [ %add14.lcssa.ph, %for.end17.loopexit.unr-lcssa ], [ %add14.epil, %for.body9.epil ]
%div19 = fdiv double %tmp.0.lcssa, %conv582
%call20 = call double @sqrt(double noundef %div19) #4
%indvars.iv.next67 = add nuw i64 %indvars.iv66, 1
%arrayidx23 = getelementptr inbounds [1000 x double], ptr %dev, i64 0, i64 %indvars.iv66
store double %call20, ptr %arrayidx23, align 8, !tbaa !14
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%12 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %12, 0
br i1 %cmp, label %for.cond24.preheader, label %for.cond.preheader
for.body27: ; preds = %for.body27.preheader, %for.body27
%indvars.iv69 = phi i64 [ 0, %for.body27.preheader ], [ %indvars.iv.next70, %for.body27 ]
%arrayidx29 = getelementptr inbounds [1000 x double], ptr %dev, i64 0, i64 %indvars.iv69
%13 = load double, ptr %arrayidx29, align 8, !tbaa !14
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %13)
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
br i1 %exitcond73.not, label %for.end33, label %for.body27, !llvm.loop !16
for.end33: ; preds = %for.body27, %entry, %for.cond24.preheader
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %dev) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %score) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <math.h>
#define MAX_DATA 1000
int main()
{
int num, data[MAX_DATA], i;
double avg, var;
for (;;) {
scanf("%d", &num);
if (num == 0)
return 0;
avg = 0;
var = 0;
for (i = 0; i < num; i++) {
scanf("%d", &data[i]);
avg += data[i];
}
avg = 1.0 * avg / num;
for (i = 0; i < num; i++)
var += pow(data[i] - avg, 2);
var /= num;
printf("%f\n", sqrt(var));
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%data = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %data) #4
%call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp43 = icmp eq i32 %0, 0
br i1 %cmp43, label %if.then, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.end18
%1 = phi i32 [ %11, %for.end18 ], [ %0, %entry ]
%cmp234 = icmp sgt i32 %1, 0
br i1 %cmp234, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond1.preheader
%conv651 = sitofp i32 %1 to double
br label %for.end18
if.then: ; preds = %for.end18, %entry
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %data) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
ret i32 0
for.body: ; preds = %for.cond1.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond1.preheader ]
%avg.036 = phi double [ %add, %for.body ], [ 0.000000e+00, %for.cond1.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %2 to double
%add = fadd double %avg.036, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %num, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%conv6 = sitofp i32 %3 to double
%div = fdiv double %add, %conv6
%cmp838 = icmp sgt i32 %3, 0
br i1 %cmp838, label %for.body10.preheader, label %for.end18
for.body10.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 3
%5 = icmp ult i32 %3, 4
br i1 %5, label %for.end18.loopexit.unr-lcssa, label %for.body10.preheader.new
for.body10.preheader.new: ; preds = %for.body10.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967292
br label %for.body10
for.body10: ; preds = %for.body10, %for.body10.preheader.new
%indvars.iv46 = phi i64 [ 0, %for.body10.preheader.new ], [ %indvars.iv.next47.3, %for.body10 ]
%var.040 = phi double [ 0.000000e+00, %for.body10.preheader.new ], [ %add15.3, %for.body10 ]
%niter = phi i64 [ 0, %for.body10.preheader.new ], [ %niter.next.3, %for.body10 ]
%arrayidx12 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv46
%6 = load i32, ptr %arrayidx12, align 16, !tbaa !5
%conv13 = sitofp i32 %6 to double
%sub = fsub double %conv13, %div
%square = fmul double %sub, %sub
%add15 = fadd double %var.040, %square
%indvars.iv.next47 = or i64 %indvars.iv46, 1
%arrayidx12.1 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next47
%7 = load i32, ptr %arrayidx12.1, align 4, !tbaa !5
%conv13.1 = sitofp i32 %7 to double
%sub.1 = fsub double %conv13.1, %div
%square.1 = fmul double %sub.1, %sub.1
%add15.1 = fadd double %add15, %square.1
%indvars.iv.next47.1 = or i64 %indvars.iv46, 2
%arrayidx12.2 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next47.1
%8 = load i32, ptr %arrayidx12.2, align 8, !tbaa !5
%conv13.2 = sitofp i32 %8 to double
%sub.2 = fsub double %conv13.2, %div
%square.2 = fmul double %sub.2, %sub.2
%add15.2 = fadd double %add15.1, %square.2
%indvars.iv.next47.2 = or i64 %indvars.iv46, 3
%arrayidx12.3 = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv.next47.2
%9 = load i32, ptr %arrayidx12.3, align 4, !tbaa !5
%conv13.3 = sitofp i32 %9 to double
%sub.3 = fsub double %conv13.3, %div
%square.3 = fmul double %sub.3, %sub.3
%add15.3 = fadd double %add15.2, %square.3
%indvars.iv.next47.3 = add nuw nsw i64 %indvars.iv46, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end18.loopexit.unr-lcssa, label %for.body10, !llvm.loop !11
for.end18.loopexit.unr-lcssa: ; preds = %for.body10, %for.body10.preheader
%add15.lcssa.ph = phi double [ undef, %for.body10.preheader ], [ %add15.3, %for.body10 ]
%indvars.iv46.unr = phi i64 [ 0, %for.body10.preheader ], [ %indvars.iv.next47.3, %for.body10 ]
%var.040.unr = phi double [ 0.000000e+00, %for.body10.preheader ], [ %add15.3, %for.body10 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end18, label %for.body10.epil
for.body10.epil: ; preds = %for.end18.loopexit.unr-lcssa, %for.body10.epil
%indvars.iv46.epil = phi i64 [ %indvars.iv.next47.epil, %for.body10.epil ], [ %indvars.iv46.unr, %for.end18.loopexit.unr-lcssa ]
%var.040.epil = phi double [ %add15.epil, %for.body10.epil ], [ %var.040.unr, %for.end18.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body10.epil ], [ 0, %for.end18.loopexit.unr-lcssa ]
%arrayidx12.epil = getelementptr inbounds [1000 x i32], ptr %data, i64 0, i64 %indvars.iv46.epil
%10 = load i32, ptr %arrayidx12.epil, align 4, !tbaa !5
%conv13.epil = sitofp i32 %10 to double
%sub.epil = fsub double %conv13.epil, %div
%square.epil = fmul double %sub.epil, %sub.epil
%add15.epil = fadd double %var.040.epil, %square.epil
%indvars.iv.next47.epil = add nuw nsw i64 %indvars.iv46.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end18, label %for.body10.epil, !llvm.loop !12
for.end18: ; preds = %for.end18.loopexit.unr-lcssa, %for.body10.epil, %for.end.thread, %for.end
%conv654 = phi double [ %conv6, %for.end ], [ %conv651, %for.end.thread ], [ %conv6, %for.body10.epil ], [ %conv6, %for.end18.loopexit.unr-lcssa ]
%var.0.lcssa = phi double [ 0.000000e+00, %for.end ], [ 0.000000e+00, %for.end.thread ], [ %add15.lcssa.ph, %for.end18.loopexit.unr-lcssa ], [ %add15.epil, %for.body10.epil ]
%div20 = fdiv double %var.0.lcssa, %conv654
%call21 = call double @sqrt(double noundef %div20) #4
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %call21)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%11 = load i32, ptr %num, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
br i1 %cmp, label %if.then, label %for.cond1.preheader
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !13}
!13 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
int main()
{
int a;
scanf("%d", &a);
int B[a];
int c;
for( int i = 0, r; i < a; i++){scanf("%d", &r); B[i] = r;}
for(int i = 0; i < a; i++){
c = B[i]%3;
if(c == 0){printf("%d %d\n",B[i]/3 , B[i]/3);}
if(c == 1){printf("%d %d\n",B[i]/3 + 1 , B[i]/3);}
if(c == 2){printf("%d %d\n",B[i]/3 , B[i]/3 + 1);}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_16168/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_16168/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%r = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #4
%3 = load i32, ptr %a, align 4, !tbaa !5
%cmp52 = icmp sgt i32 %3, 0
br i1 %cmp52, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
br label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.body
%4 = icmp sgt i32 %6, 0
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #4
br i1 %4, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %r)
%5 = load i32, ptr %r, align 4, !tbaa !5
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %a, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.inc37, %for.cond.cleanup.thread, %for.cond.cleanup
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
for.body6: ; preds = %for.cond.cleanup, %for.inc37
%indvars.iv57 = phi i64 [ %indvars.iv.next58, %for.inc37 ], [ 0, %for.cond.cleanup ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv57
%8 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%rem = srem i32 %8, 3
%div30 = sdiv i32 %8, 3
switch i32 %rem, label %for.inc37 [
i32 0, label %if.then
i32 1, label %if.then17
i32 2, label %if.then27
]
if.then: ; preds = %for.body6
%div = sdiv i32 %8, 3
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %div)
br label %for.inc37
if.then17: ; preds = %for.body6
%div20 = sdiv i32 %8, 3
%add = add nsw i32 %div20, 1
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add, i32 noundef %div20)
br label %for.inc37
if.then27: ; preds = %for.body6
%add34 = add nsw i32 %div30, 1
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div30, i32 noundef %add34)
br label %for.inc37
for.inc37: ; preds = %if.then17, %if.then, %for.body6, %if.then27
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%9 = load i32, ptr %a, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp4 = icmp slt i64 %indvars.iv.next58, %10
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 a,b,n,ans;
scanf("%d",&n);
if(n==1){
printf("Hello World\n");
return 0;
}else{
scanf("%d %d",&a,&b);
ans=a+b;
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%d %d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [12 x i8] c"Hello World\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
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.else: ; preds = %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %add)
br label %cleanup
cleanup: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main() {
int n, a, b;
scanf("%d", &n);
if (n == 1) {
printf("Hello World\n");
}
else {
scanf("%d", &a);
scanf("%d", &b);
printf("%d\n", a + b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1
@str = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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;
scanf("%d", &n);
if (n == 1)
printf("Hello World");
else
{
int a, b;
scanf("%d", &a);
scanf("%d", &b);
printf("%d", a + b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161867/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
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
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
br label %if.end
if.end: ; preds = %if.else, %if.then
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 a,b,c;
scanf("%d",&a);
if(a==1){
printf("Hello World");
}
else if(a==2){
scanf("%d",&b);
scanf("%d",&c);
printf("%d",b+c);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161917/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161917/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\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)
%0 = load i32, ptr %a, align 4, !tbaa !5
switch i32 %0, label %if.end7 [
i32 1, label %if.then
i32 2, label %if.then3
]
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end7
if.then3: ; preds = %entry
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%add = add nsw i32 %2, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
br label %if.end7
if.end7: ; preds = %entry, %if.then3, %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 i;
scanf("%d",&i);
if(i==1)
printf("Hello World");
else if(i==2){
int sum;
scanf("%d",&i);
scanf("%d",&sum);
printf("%d",sum+=i);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_161960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_161960/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
%sum = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
switch i32 %0, label %if.end7 [
i32 1, label %if.then
i32 2, label %if.then3
]
if.then: ; preds = %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end7
if.then3: ; preds = %entry
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sum) #3
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sum)
%1 = load i32, ptr %i, align 4, !tbaa !5
%2 = load i32, ptr %sum, align 4, !tbaa !5
%add = add nsw i32 %2, %1
store i32 %add, ptr %sum, align 4, !tbaa !5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sum) #3
br label %if.end7
if.end7: ; preds = %entry, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int n,a,b;
scanf("%d",&n);
if(n==1)
{
printf("Hello World\n");
}
if(n==2)
{
scanf("%d", &a);
scanf("%d", &b);
printf("%d\n",a+b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_162002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_162002/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%d\0A\00", align 1
@str = private unnamed_addr constant [12 x i8] c"Hello World\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%.pr = load i32, ptr %n, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i32 [ %.pr, %if.then ], [ %0, %entry ]
%cmp2 = icmp eq i32 %1, 2
br i1 %cmp2, label %if.then3, label %if.end7
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%2 = load i32, ptr %a, align 4, !tbaa !5
%3 = load i32, ptr %b, align 4, !tbaa !5
%add = add nsw i32 %3, %2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end7
if.end7: ; preds = %if.then3, %if.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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"}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.