Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int main(void){
int input[3];
int i;
scanf("%d",&input[0]);
scanf("%d",&input[1]);
scanf("%d",&input[2]);
if(input[1]-input[0]+1<=2*input[2]){
for(i=input[0];i<=input[1];i++){
printf("%d\n",i);
}
}
else{
for(i=input[0];i<=input[0]+input[2]-1;i++){
printf("%d\n",i);
}
for(i=input[1]-input[2]+1;i<=input[1];i++){
printf("%d\n",i);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215579/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215579/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%input = alloca [3 x i32], align 4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %input) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%arrayidx1 = getelementptr inbounds [3 x i32], ptr %input, i64 0, i64 1
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1)
%arrayidx3 = getelementptr inbounds [3 x i32], ptr %input, i64 0, i64 2
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx3)
%0 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%1 = load i32, ptr %input, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%mul = shl nsw i32 %2, 1
%cmp.not.not = icmp slt i32 %sub, %mul
br i1 %cmp.not.not, label %for.cond.preheader, label %for.cond13.preheader
for.cond13.preheader: ; preds = %entry
%cmp18.not.not46 = icmp sgt i32 %2, 0
br i1 %cmp18.not.not46, label %for.body19, label %if.end
for.cond.preheader: ; preds = %entry
%cmp10.not50 = icmp sgt i32 %1, %0
br i1 %cmp10.not50, label %if.end, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%i.051 = phi i32 [ %inc, %for.body ], [ %1, %for.cond.preheader ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.051)
%inc = add nsw i32 %i.051, 1
%3 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp10.not.not = icmp slt i32 %i.051, %3
br i1 %cmp10.not.not, label %for.body, label %if.end, !llvm.loop !9
for.body19: ; preds = %for.cond13.preheader, %for.body19
%i.147 = phi i32 [ %inc22, %for.body19 ], [ %1, %for.cond13.preheader ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.147)
%inc22 = add nsw i32 %i.147, 1
%4 = load i32, ptr %input, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%add16 = add nsw i32 %5, %4
%cmp18.not.not = icmp slt i32 %inc22, %add16
br i1 %cmp18.not.not, label %for.body19, label %for.end23, !llvm.loop !11
for.end23: ; preds = %for.body19
%cmp30.not.not48 = icmp sgt i32 %5, 0
br i1 %cmp30.not.not48, label %for.body31.preheader, label %if.end
for.body31.preheader: ; preds = %for.end23
%.pre = load i32, ptr %arrayidx1, align 4, !tbaa !5
%sub26 = sub nsw i32 %.pre, %5
br label %for.body31
for.body31: ; preds = %for.body31.preheader, %for.body31
%i.2.in49 = phi i32 [ %i.2, %for.body31 ], [ %sub26, %for.body31.preheader ]
%i.2 = add nsw i32 %i.2.in49, 1
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.2)
%6 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp30.not.not = icmp slt i32 %i.2, %6
br i1 %cmp30.not.not, label %for.body31, label %if.end, !llvm.loop !12
if.end: ; preds = %for.body31, %for.body, %for.cond13.preheader, %for.end23, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %input) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define SOBA_MAX 51 /* ?????°?????\???????????§(????????????????????§50(?????§?????\???)?????§??¨?????????????´???°???51) */
#define PATTERN_MAX 6 /* ????????????????????°????????????????????¨?????¨???????????????????????????????????????????????? */
#define MAX_VAL 10000000 /* ??£?????????????????????????????§???????????§????????????DP????????????????????¨??? */
/* ?????\????????¨???????????????????????? */
const int pattern[PATTERN_MAX][2] = {
{ 200 /100, 380 }
,{ 200*5/100, 380*5*80/100 }
,{ 300 /100, 550 }
,{ 300*4/100, 550*4*85/100 }
,{ 500 /100, 850 }
,{ 500*3/100, 850*3*88/100 }
};
int memo[SOBA_MAX];
int dfs(int soba){
int pat;
int min;
int val;
if(memo[soba]<MAX_VAL) return memo[soba];
min = MAX_VAL;
/* ????????\??????????????\?????????????????????????????????????¨????????????????????¨????????°???????????????? */
for(pat=0;pat<PATTERN_MAX;pat++){
if( soba-pattern[pat][0] >= 0 ){
val = pattern[pat][1] + dfs(soba-pattern[pat][0]);
if( min > val ){
min = val;
}
}
}
return memo[soba]=min;
}
int main(){
int input;
int i;
for(i=0;i<SOBA_MAX;i++){
memo[i] = MAX_VAL;
}
memo[0] = 0; /* 0g?????\????????????0??????????????? */
while((scanf("%d",&input)>0) && (input>0)){
printf("%d\n",dfs(input/100));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215621/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215621/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@pattern = dso_local local_unnamed_addr constant [6 x [2 x i32]] [[2 x i32] [i32 2, i32 380], [2 x i32] [i32 10, i32 1520], [2 x i32] [i32 3, i32 550], [2 x i32] [i32 12, i32 1870], [2 x i32] [i32 5, i32 850], [2 x i32] [i32 15, i32 2244]], align 16
@memo = dso_local local_unnamed_addr global [51 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @dfs(i32 noundef %soba) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %soba to i64
%arrayidx = getelementptr inbounds [51 x i32], ptr @memo, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 10000000
br i1 %cmp, label %cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%cmp7 = icmp sgt i32 %soba, 1
br i1 %cmp7, label %for.inc, label %for.inc.5
for.inc: ; preds = %for.body.preheader
%sub = add nsw i32 %soba, -2
%call = tail call i32 @dfs(i32 noundef %sub), !range !9
%1 = tail call i32 @llvm.smin.i32(i32 %call, i32 9999620)
%spec.select = add nsw i32 %1, 380
%cmp7.1 = icmp ugt i32 %soba, 9
br i1 %cmp7.1, label %for.inc.1.thread, label %for.inc.1
for.inc.1.thread: ; preds = %for.inc
%sub.1 = add nsw i32 %soba, -10
%call.1 = tail call i32 @dfs(i32 noundef %sub.1), !range !9
%add.1 = add nsw i32 %call.1, 1520
%spec.select.1 = tail call i32 @llvm.smin.i32(i32 %spec.select, i32 %add.1)
br label %for.inc.2
for.inc.1: ; preds = %for.inc
%cmp7.2 = icmp ugt i32 %soba, 2
br i1 %cmp7.2, label %for.inc.2, label %for.inc.5
for.inc.2: ; preds = %for.inc.1, %for.inc.1.thread
%min.1.141 = phi i32 [ %spec.select.1, %for.inc.1.thread ], [ %spec.select, %for.inc.1 ]
%sub.2 = add nsw i32 %soba, -3
%call.2 = tail call i32 @dfs(i32 noundef %sub.2), !range !9
%add.2 = add nsw i32 %call.2, 550
%spec.select.2 = tail call i32 @llvm.smin.i32(i32 %min.1.141, i32 %add.2)
%cmp7.3 = icmp ugt i32 %soba, 11
br i1 %cmp7.3, label %for.inc.3.thread, label %for.inc.3
for.inc.3.thread: ; preds = %for.inc.2
%sub.3 = add nsw i32 %soba, -12
%call.3 = tail call i32 @dfs(i32 noundef %sub.3), !range !9
%add.3 = add nsw i32 %call.3, 1870
%spec.select.3 = tail call i32 @llvm.smin.i32(i32 %spec.select.2, i32 %add.3)
br label %for.inc.4
for.inc.3: ; preds = %for.inc.2
%cmp7.4 = icmp ugt i32 %soba, 4
br i1 %cmp7.4, label %for.inc.4, label %for.inc.5
for.inc.4: ; preds = %for.inc.3, %for.inc.3.thread
%min.1.349 = phi i32 [ %spec.select.3, %for.inc.3.thread ], [ %spec.select.2, %for.inc.3 ]
%sub.4 = add nsw i32 %soba, -5
%call.4 = tail call i32 @dfs(i32 noundef %sub.4), !range !9
%add.4 = add nsw i32 %call.4, 850
%spec.select.4 = tail call i32 @llvm.smin.i32(i32 %min.1.349, i32 %add.4)
%cmp7.5 = icmp ugt i32 %soba, 14
br i1 %cmp7.5, label %if.then8.5, label %for.inc.5
if.then8.5: ; preds = %for.inc.4
%sub.5 = add nsw i32 %soba, -15
%call.5 = tail call i32 @dfs(i32 noundef %sub.5), !range !9
%add.5 = add nsw i32 %call.5, 2244
%spec.select.5 = tail call i32 @llvm.smin.i32(i32 %spec.select.4, i32 %add.5)
br label %for.inc.5
for.inc.5: ; preds = %for.inc.1, %for.body.preheader, %for.inc.3, %if.then8.5, %for.inc.4
%min.1.5 = phi i32 [ %spec.select.4, %for.inc.4 ], [ %spec.select.5, %if.then8.5 ], [ %spec.select.2, %for.inc.3 ], [ %spec.select, %for.inc.1 ], [ 10000000, %for.body.preheader ]
store i32 %min.1.5, ptr %arrayidx, align 4, !tbaa !5
br label %cleanup
cleanup: ; preds = %entry, %for.inc.5
%retval.0 = phi i32 [ %min.1.5, %for.inc.5 ], [ %0, %entry ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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:
%input = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input) #5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 4), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 8), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 12), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 16), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 20), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 24), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 28), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 32), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 36), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 40), align 16, !tbaa !5
store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 44), align 16, !tbaa !5
store i32 10000000, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 48), align 16, !tbaa !5
store i32 10000000, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 49), align 4, !tbaa !5
store i32 10000000, ptr getelementptr inbounds ([51 x i32], ptr @memo, i64 0, i64 50), align 8, !tbaa !5
store <4 x i32> <i32 0, i32 10000000, i32 10000000, i32 10000000>, ptr @memo, align 16, !tbaa !5
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%cmp19 = icmp sgt i32 %call8, 0
%0 = load i32, ptr %input, align 4
%cmp210 = icmp sgt i32 %0, 0
%1 = select i1 %cmp19, i1 %cmp210, i1 false
br i1 %1, label %while.body, label %while.end
while.body: ; preds = %entry, %while.body
%2 = phi i32 [ %3, %while.body ], [ %0, %entry ]
%div = udiv i32 %2, 100
%call3 = call i32 @dfs(i32 noundef %div), !range !9
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call3)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input)
%cmp1 = icmp sgt i32 %call, 0
%3 = load i32, ptr %input, align 4
%cmp2 = icmp sgt i32 %3, 0
%4 = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %4, label %while.body, label %while.end, !llvm.loop !10
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i32 -2147483648, i32 10000001}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
char C[5] = { '\0' };
scanf("%s", C);
if (C[2] != '\0') {
printf("%c%c%c", C[2],C[1],C[0]);
}
else {
printf("%s", C);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215687/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215687/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%c%c%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%C = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %C) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %C, i8 0, i64 5, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C)
%arrayidx = getelementptr inbounds [5 x i8], ptr %C, i64 0, i64 2
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%conv = sext i8 %0 to i32
%arrayidx4 = getelementptr inbounds [5 x i8], ptr %C, i64 0, i64 1
%1 = load i8, ptr %arrayidx4, align 1, !tbaa !5
%conv5 = sext i8 %1 to i32
%2 = load i8, ptr %C, align 1, !tbaa !5
%conv7 = sext i8 %2 to i32
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv, i32 noundef %conv5, i32 noundef %conv7)
br label %if.end
if.else: ; preds = %entry
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %C)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %C) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,i,temp1,temp2,a[100010];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
printf("%d ",a[1] - a[0]);
printf("%d\n",a[n-1] - a[0]);
for(i=1;i<n-1;i++){
temp1 = a[i] - a[i-1];
temp2 = a[i+1] - a[i];
if(temp1 < temp2)
printf("%d ",temp1);
else
printf("%d ",temp2);
temp1 = a[i] - a[0];
temp2 = a[n-1] - a[i];
if(temp1 > temp2)
printf("%d\n",temp1);
else
printf("%d\n",temp2);
}
printf("%d ",a[n-1] - a[n-2]);
printf("%d\n",a[n-1] - a[0]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21573/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21573/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100010 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp78 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp78)
br label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%arrayidx2.phi.trans.insert = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 1
%.pre = load i32, ptr %arrayidx2.phi.trans.insert, align 4, !tbaa !5
%.pre91 = load i32, ptr %a, align 16, !tbaa !5
%3 = sub nsw i32 %.pre, %.pre91
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%4 = load i32, ptr %n, align 4, !tbaa !5
%sub5 = add nsw i32 %4, -1
%idxprom6 = sext i32 %sub5 to i64
%arrayidx7 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %idxprom6
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%6 = load i32, ptr %a, align 16, !tbaa !5
%sub9 = sub nsw i32 %5, %6
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub9)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp1381 = icmp sgt i32 %7, 2
br i1 %cmp1381, label %for.body14, label %for.end.for.end47_crit_edge
for.end.for.end47_crit_edge: ; preds = %for.end.loopexit
%sub1280 = add nsw i32 %7, -1
%.pre92 = sext i32 %sub1280 to i64
br label %for.end47
for.body14: ; preds = %for.end.loopexit, %for.body14
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.body14 ], [ 1, %for.end.loopexit ]
%arrayidx16 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv87
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%9 = add nsw i64 %indvars.iv87, -1
%arrayidx19 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %9
%10 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%sub20 = sub nsw i32 %8, %10
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%arrayidx22 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv.next88
%11 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%sub25 = sub nsw i32 %11, %8
%sub20.sub25 = call i32 @llvm.smin.i32(i32 %sub20, i32 %sub25)
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub20.sub25)
%12 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%13 = load i32, ptr %a, align 16, !tbaa !5
%sub32 = sub nsw i32 %12, %13
%14 = load i32, ptr %n, align 4, !tbaa !5
%sub33 = add nsw i32 %14, -1
%idxprom34 = sext i32 %sub33 to i64
%arrayidx35 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %idxprom34
%15 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%sub38 = sub nsw i32 %15, %12
%sub32.sink = call i32 @llvm.smax.i32(i32 %sub32, i32 %sub38)
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub32.sink)
%16 = load i32, ptr %n, align 4, !tbaa !5
%sub12 = add nsw i32 %16, -1
%17 = sext i32 %sub12 to i64
%cmp13 = icmp slt i64 %indvars.iv.next88, %17
br i1 %cmp13, label %for.body14, label %for.end47, !llvm.loop !11
for.end47: ; preds = %for.body14, %for.end.for.end47_crit_edge
%idxprom49.pre-phi = phi i64 [ %.pre92, %for.end.for.end47_crit_edge ], [ %17, %for.body14 ]
%.lcssa = phi i32 [ %7, %for.end.for.end47_crit_edge ], [ %16, %for.body14 ]
%arrayidx50 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %idxprom49.pre-phi
%18 = load i32, ptr %arrayidx50, align 4, !tbaa !5
%sub51 = add nsw i32 %.lcssa, -2
%idxprom52 = sext i32 %sub51 to i64
%arrayidx53 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %idxprom52
%19 = load i32, ptr %arrayidx53, align 4, !tbaa !5
%sub54 = sub nsw i32 %18, %19
%call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub54)
%20 = load i32, ptr %n, align 4, !tbaa !5
%sub56 = add nsw i32 %20, -1
%idxprom57 = sext i32 %sub56 to i64
%arrayidx58 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %idxprom57
%21 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%22 = load i32, ptr %a, align 16, !tbaa !5
%sub60 = sub nsw i32 %21, %22
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub60)
call void @llvm.lifetime.end.p0(i64 400040, 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 willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #3
; 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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include<string.h>
int main()
{
char str[4];
scanf("%s",str);
if(strlen(str)==2)
printf("%s",str);
else
{
for(int i=2;i>=0;i--)
printf("%c",str[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215780/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215780/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%str = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %str) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6
%cmp = icmp eq i64 %call2, 2
br i1 %cmp, label %if.then, label %for.body.preheader
for.body.preheader: ; preds = %entry
%arrayidx = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 2
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%putchar = call i32 @putchar(i32 %conv)
%arrayidx.1 = getelementptr inbounds [4 x i8], ptr %str, i64 0, i64 1
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %1 to i32
%putchar.1 = call i32 @putchar(i32 %conv.1)
%2 = load i8, ptr %str, align 1, !tbaa !5
%conv.2 = sext i8 %2 to i32
%putchar.2 = call i32 @putchar(i32 %conv.2)
br label %if.end
if.then: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %str)
br label %if.end
if.end: ; preds = %for.body.preheader, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %str) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int N,n;
scanf("%d",&N);
n = N%10;
if(n == 3)
printf("bon");
else if (n == 0 || n == 1 || n == 6 || n == 8)
printf("pon");
else
printf("hon");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215838/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215838/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"bon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@reltable.main = private unnamed_addr constant [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 9
br i1 %1, label %switch.lookup, label %if.end12
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end12
if.end12: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
void solve(int a) {
a%=10;
if (a==3) printf("bon");
else if (a==0||a==1||a==6||a==8) printf("pon");
else printf("hon");
}
int main () {
int a;
scanf("%d",&a);
solve(a);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215889/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215889/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"bon\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@switch.table.main = private unnamed_addr constant [9 x ptr] [ptr @.str.1, ptr @.str.1, ptr @.str.2, ptr @.str, ptr @.str.2, ptr @.str.2, ptr @.str.1, ptr @.str.2, ptr @.str.1], align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @solve(i32 noundef %a) local_unnamed_addr #0 {
entry:
%rem = srem i32 %a, 10
%0 = icmp ult i32 %rem, 9
br i1 %0, label %switch.lookup, label %if.end11
switch.lookup: ; preds = %entry
%1 = sext i32 %rem to i64
%switch.gep = getelementptr inbounds [9 x ptr], ptr @switch.table.main, i64 0, i64 %1
%switch.load = load ptr, ptr %switch.gep, align 8
br label %if.end11
if.end11: ; preds = %entry, %switch.lookup
%.str.1.sink = phi ptr [ %switch.load, %switch.lookup ], [ @.str.2, %entry ]
%call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem.i = srem i32 %0, 10
%1 = icmp ult i32 %rem.i, 9
br i1 %1, label %switch.lookup, label %solve.exit
switch.lookup: ; preds = %entry
%2 = sext i32 %rem.i to i64
%switch.gep = getelementptr inbounds [9 x ptr], ptr @switch.table.main, i64 0, i64 %2
%switch.load = load ptr, ptr %switch.gep, align 8
br label %solve.exit
solve.exit: ; preds = %entry, %switch.lookup
%.str.1.sink.i = phi ptr [ %switch.load, %switch.lookup ], [ @.str.2, %entry ]
%call8.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink.i)
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int n;
scanf("%d",&n);
int f = n % 10;
if(f == 2 || f == 4 || f == 5 || f == 7 || f == 9){
printf("hon");
}else if(f == 0 || f == 1 || f == 6 || f == 8){
printf("pon");
}else printf("bon");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215931/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215931/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"hon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@reltable.main = private unnamed_addr constant [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 10
br i1 %1, label %switch.lookup, label %if.end20
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end20
if.end20: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
char S[11][5]={
"pon",
"pon",
"hon",
"bon",
"hon",
"hon",
"pon",
"hon",
"pon",
"hon"
};
int N;
scanf("%d",&N);
printf("%s\n",S[N%10]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_215975/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_215975/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@__const.main.S = private unnamed_addr constant [11 x [5 x i8]] [[5 x i8] c"pon\00\00", [5 x i8] c"pon\00\00", [5 x i8] c"hon\00\00", [5 x i8] c"bon\00\00", [5 x i8] c"hon\00\00", [5 x i8] c"hon\00\00", [5 x i8] c"pon\00\00", [5 x i8] c"hon\00\00", [5 x i8] c"pon\00\00", [5 x i8] c"hon\00\00", [5 x i8] zeroinitializer], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 10
%idxprom = sext i32 %rem to i64
%arrayidx = getelementptr inbounds [11 x [5 x i8]], ptr @__const.main.S, i64 0, i64 %idxprom
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %arrayidx)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex3_2 melo */
#include <stdio.h>
int main(void){
int Number,onesplace;//整数の箱を二つ用意する
scanf("%d",&Number);//本数を代入する
onesplace = Number%10;//一の位の数を出す
switch(onesplace){//連続したif文なのでswitch関数を使う
case 2:case 4:case 5:case 7:case 9://onesplaceが2または4または5または7または9であった場合
printf("hon\n");//honとよむ
break;//swich{}から抜ける
case 0:case 1:case 6:case 8://onesplaceが0,1,6,8のいずれかであった場合
printf("pon\n");//ponとよむ
break;//swich{}から抜ける
case 3://onesplaceが3であった場合
printf("bon\n");//bonとよむ
break;//swich{}から抜ける
default:fprintf(stderr, "unexpected Number value:%d¥n", Number);return 1;//他の場合errorを出す
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216017/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216017/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = private unnamed_addr constant [30 x i8] c"unexpected Number value:%d\C2\A5n\00", align 1
@str = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%Number = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %Number) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %Number)
%0 = load i32, ptr %Number, align 4, !tbaa !5
%rem = srem i32 %0, 10
switch i32 %rem, label %sw.default [
i32 2, label %sw.bb
i32 4, label %sw.bb
i32 5, label %sw.bb
i32 7, label %sw.bb
i32 9, label %sw.bb
i32 0, label %sw.bb2
i32 1, label %sw.bb2
i32 6, label %sw.bb2
i32 8, label %sw.bb2
i32 3, label %sw.bb4
]
sw.bb: ; preds = %entry, %entry, %entry, %entry, %entry
%puts9 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %cleanup
sw.bb2: ; preds = %entry, %entry, %entry, %entry
%puts8 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup
sw.bb4: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
sw.default: ; preds = %entry
%1 = load ptr, ptr @stderr, align 8, !tbaa !9
%call6 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.4, i32 noundef %0) #5
br label %cleanup
cleanup: ; preds = %sw.bb, %sw.bb2, %sw.bb4, %sw.default
%retval.0 = phi i32 [ 1, %sw.default ], [ 0, %sw.bb4 ], [ 0, %sw.bb2 ], [ 0, %sw.bb ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %Number) #4
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_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 }
attributes #5 = { cold }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
|
#include<stdio.h>
int main(void){
int a;
scanf("%d", &a);
a = a % 10;
if(a == 3){
printf("bon");
return 0;
}
else if(a == 0 || a == 1 || a == 6 || a == 8){
printf("pon");
return 0;
}
else{
printf("hon");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216060/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216060/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"bon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@reltable.main = private unnamed_addr constant [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 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 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
%rem = srem i32 %0, 10
store i32 %rem, ptr %a, align 4, !tbaa !5
%1 = icmp ult i32 %rem, 9
br i1 %1, label %switch.lookup, label %cleanup
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %cleanup
cleanup: ; preds = %entry, %switch.lookup
%.str.3.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
/* ex3-2
Sagzar1993 */
#include <stdio.h>
int main(void) {
//鉛筆の本数と、その数の一の位を定義
int pencilNum, onesplace;
//入力を受け取る
scanf("%d", &pencilNum);
//一の位は10で割った余りに等しい
onesplace = pencilNum % 10;
//一の位に応じた読み方を表示
switch (onesplace)
{
case 0:
printf("pon\n");
break;
case 1:
printf("pon\n");
break;
case 2:
printf("hon\n");
break;
case 3:
printf("bon\n");
break;
case 4:
printf("hon\n");
break;
case 5:
printf("hon\n");
break;
case 6:
printf("pon\n");
break;
case 7:
printf("hon\n");
break;
case 8:
printf("pon\n");
break;
case 9:
printf("hon\n");
break;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216103/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216103/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.9 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@str.10 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@str.12 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@reltable.main = private unnamed_addr constant [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 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:
%pencilNum = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pencilNum) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pencilNum)
%0 = load i32, ptr %pencilNum, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 10
br i1 %1, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %entry, %switch.lookup
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pencilNum) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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"}
|
/* kadai3_2
Saikyo_Kazune
*/
#include <stdio.h>
#include <string.h>
int main(void){
//本の数を要れる変数num_booksを宣言
int num_books;
scanf("%d",&num_books);
//1の位の数で場合分け
switch(num_books%10){
case 2:case 4:case 5:case 7: case 9:printf("hon\n");break;
case 0:case 1:case 6:case 8:printf("pon\n");break;
case 3:printf("bon\n");break;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216154/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216154/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@reltable.main = private unnamed_addr constant [10 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.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), 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.5 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.5 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.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)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num_books = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num_books) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num_books)
%0 = load i32, ptr %num_books, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 10
br i1 %1, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %entry, %switch.lookup
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num_books) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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"}
|
/* 3_2
Y_Aizaki */
#include <stdio.h>
int main(void){
int pencil; // 本数
scanf("%d", &pencil);
int first = pencil % 10; // first place
if(first == 2 || first == 4 || first == 5 || first == 7 || first == 9){
printf("hon\n");
}else if(first == 3){
printf("bon\n");
}else{
printf("pon\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216198/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216198/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@reltable.main = private unnamed_addr constant [8 x 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.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.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), 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), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.5 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:
%pencil = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %pencil) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %pencil)
%0 = load i32, ptr %pencil, align 4, !tbaa !5
%rem = srem i32 %0, 10
%switch.tableidx = add nsw i32 %rem, -2
%1 = icmp ult i32 %switch.tableidx, 8
br i1 %1, label %switch.lookup, label %if.end14
switch.lookup: ; preds = %entry
%2 = sext i32 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end14
if.end14: ; preds = %entry, %switch.lookup
%str.4.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str, %entry ]
%puts23 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %pencil) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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(void){
int a;
scanf("%d",&a);
if(a % 10 == 2 || a % 10 == 4 || a % 10 == 5 || a % 10 == 7 || a % 10 == 9){
printf("hon");
}else if(a % 10 == 0 || a % 10 == 1 || a % 10 == 6 || a % 10 == 8){
printf("pon");
}else{
printf("bon");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216240/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"hon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@reltable.main = private unnamed_addr constant [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 10
br i1 %1, label %switch.lookup, label %if.end28
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end28
if.end28: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int a;
scanf("%d", &a);
if ((a % 10) == 2 || (a % 10) == 4 || (a % 10) == 5 || (a % 10) == 7 || (a % 10) == 9)
printf("hon");
if ((a % 10) == 0 || (a % 10) == 1 || (a % 10) == 6 || (a % 10) == 8)
printf("pon");
if ((a % 10) == 3)
printf("bon");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216284/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"hon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 10
switch i32 %rem, label %if.end [
i32 2, label %if.then
i32 4, label %if.then
i32 5, label %if.then
i32 7, label %if.then
i32 9, label %if.then
]
if.then: ; preds = %entry, %entry, %entry, %entry, %entry
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre33 = srem i32 %.pre, 10
br label %if.end
if.end: ; preds = %entry, %if.then
%rem13.pre-phi = phi i32 [ %rem, %entry ], [ %.pre33, %if.then ]
%1 = phi i32 [ %0, %entry ], [ %.pre, %if.then ]
switch i32 %rem13.pre-phi, label %if.end26 [
i32 0, label %if.then24
i32 1, label %if.then24
i32 6, label %if.then24
i32 8, label %if.then24
]
if.then24: ; preds = %if.end, %if.end, %if.end, %if.end
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%.pre32 = load i32, ptr %a, align 4, !tbaa !5
br label %if.end26
if.end26: ; preds = %if.end, %if.then24
%2 = phi i32 [ %1, %if.end ], [ %.pre32, %if.then24 ]
%rem27 = srem i32 %2, 10
%cmp28 = icmp eq i32 %rem27, 3
br i1 %cmp28, label %if.then29, label %if.end31
if.then29: ; preds = %if.end26
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end31
if.end31: ; preds = %if.then29, %if.end26
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a=0;
scanf("%d",&a);
a=a%10;
switch(a){
case 0:
case 1:
case 6:
case 8:
printf("pon");
break;
case 2:
case 4:
case 5:
case 7:
case 9:
printf("hon");
break;
case 3:
printf("bon");
break;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216349/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216349/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"pon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@reltable.main = private unnamed_addr constant [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
store i32 0, ptr %a, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 10
store i32 %rem, ptr %a, align 4, !tbaa !5
%1 = icmp ult i32 %rem, 10
br i1 %1, label %switch.lookup, label %sw.epilog
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %reltable.intrinsic)
br label %sw.epilog
sw.epilog: ; preds = %entry, %switch.lookup
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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,s;
scanf("%d",&n);
if(n>9)
{
s=n%10;
if(s==2 || s==4 || s==5 || s==7 || s==9)
{
printf("hon");
}
if(s==0 || s==1 || s==6 || s==8)
{
printf("pon");
}
if(s==3)
{
printf("bon");
}
}
else
{
if(n==2 || n==4 || n==5 || n==7 || n==9)
{
printf("hon");
}
if(n==0 || n==1 || n==6 || n==8)
{
printf("pon");
}
if(n==3)
{
printf("bon");
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216392/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216392/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"hon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"bon\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
%.fr = freeze i32 %0
%cmp = icmp sgt i32 %.fr, 9
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%rem = urem i32 %.fr, 10
%1 = and i32 %rem, 14
%2 = icmp eq i32 %1, 4
br i1 %2, label %if.then9, label %switch.early.test
switch.early.test: ; preds = %if.then
switch i32 %rem, label %if.end51 [
i32 9, label %if.then9
i32 7, label %if.then9
i32 2, label %if.then9
i32 8, label %if.then18
i32 6, label %if.then18
i32 1, label %if.then18
i32 0, label %if.then18
i32 3, label %if.end51.sink.split
]
if.then9: ; preds = %switch.early.test, %switch.early.test, %switch.early.test, %if.then
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
switch i32 %rem, label %if.end51 [
i32 8, label %if.then18
i32 6, label %if.then18
i32 3, label %if.end51.sink.split
]
if.then18: ; preds = %switch.early.test, %switch.early.test, %switch.early.test, %switch.early.test, %if.then9, %if.then9
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%cmp21 = icmp eq i32 %rem, 3
br i1 %cmp21, label %if.end51.sink.split, label %if.end51
if.else: ; preds = %entry
switch i32 %.fr, label %if.end36 [
i32 9, label %if.then34
i32 7, label %if.then34
i32 5, label %if.then34
i32 4, label %if.then34
i32 2, label %if.then34
]
if.then34: ; preds = %if.else, %if.else, %if.else, %if.else, %if.else
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%.pr = load i32, ptr %n, align 4
br label %if.end36
if.end36: ; preds = %if.else, %if.then34
%3 = phi i32 [ %.fr, %if.else ], [ %.pr, %if.then34 ]
switch i32 %3, label %if.end46 [
i32 8, label %if.then44
i32 6, label %if.then44
i32 1, label %if.then44
i32 0, label %if.then44
]
if.then44: ; preds = %if.end36, %if.end36, %if.end36, %if.end36
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end46
if.end46: ; preds = %if.end36, %if.then44
%4 = phi i32 [ %3, %if.end36 ], [ %.pre, %if.then44 ]
%cmp47 = icmp eq i32 %4, 3
br i1 %cmp47, label %if.end51.sink.split, label %if.end51
if.end51.sink.split: ; preds = %if.end46, %if.then18, %switch.early.test, %if.then9
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end51
if.end51: ; preds = %if.end51.sink.split, %switch.early.test, %if.then9, %if.end46, %if.then18
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
n %= 10;
if(n == 3) puts("bon");
else if(n == 0 || n == 1 || n == 6 || n == 8) puts("pon");
else puts("hon");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216435/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216435/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"bon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@reltable.main = private unnamed_addr constant [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%rem = srem i32 %0, 10
store i32 %rem, ptr %n, align 4, !tbaa !5
%1 = icmp ult i32 %rem, 9
br i1 %1, label %switch.lookup, label %if.end12
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end12
if.end12: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
void main()
{
int kazu;
int iti;
scanf("%d", &kazu);
iti = kazu % 10;
if ((iti == 2) || (iti == 4) || (iti == 5) || (iti == 7) || (iti == 9)) {
printf("hon");
}
else if ((iti == 0) || (iti == 1) || (iti == 6) || (iti == 8)) {
printf("pon");
}
else {
printf("bon");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216486/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216486/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"hon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@reltable.main = private unnamed_addr constant [10 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local void @main() local_unnamed_addr #0 {
entry:
%kazu = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %kazu) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %kazu)
%0 = load i32, ptr %kazu, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 10
br i1 %1, label %switch.lookup, label %if.end20
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end20
if.end20: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %kazu) #4
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int N;
scanf("%d", &N);
int r;
r = N % 10;
if(r==3){
puts("bon");
}else if(r==0 || r==1 || r==6 || r==8){
puts("pon");
}else{
puts("hon");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216529/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216529/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"bon\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"hon\00", align 1
@reltable.main = private unnamed_addr constant [9 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.1 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.3 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @.str.2 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%rem = srem i32 %0, 10
%1 = icmp ult i32 %rem, 9
br i1 %1, label %switch.lookup, label %if.end12
switch.lookup: ; preds = %entry
%2 = sext i32 %rem to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end12
if.end12: ; preds = %entry, %switch.lookup
%.str.2.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @.str.3, %entry ]
%call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(){
char s[4]; scanf("%s", s);
if(s[strlen(s)-1] == '3'){
printf("bon\n");
}else if(s[strlen(s)-1]=='0' || s[strlen(s)-1]=='1' || s[strlen(s)-1]=='6' || s[strlen(s)-1]=='8'){
printf("pon\n");
}else{
printf("hon\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216572/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"hon\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"pon\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"bon\00", align 1
@reltable.main = private unnamed_addr constant [9 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.4 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), 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), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.4 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [4 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%sub = add i64 %call2, -1
%arrayidx = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 %sub
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%switch.tableidx = add i8 %0, -48
%1 = icmp ult i8 %switch.tableidx, 9
br i1 %1, label %switch.lookup, label %if.end39
switch.lookup: ; preds = %entry
%2 = sext i8 %switch.tableidx to i64
%reltable.shift = shl i64 %2, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %if.end39
if.end39: ; preds = %entry, %switch.lookup
%str.4.sink = phi ptr [ %reltable.intrinsic, %switch.lookup ], [ @str, %entry ]
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink)
call void @llvm.lifetime.end.p0(i64 4, 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 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 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define MOD 1000000007
long long factorial[100010];
long long fact_inv[100010];
long long power(long long n, int p) {
if (p == 0) {
return 1;
}
if (p == 1) {
return n % MOD;
}
long long s;
s = power(n, p/2);
if (p % 2 == 0) {
return s*s % MOD;
}
if (p % 2 == 1) {
return n*power(n, p-1) % MOD;
} else {
return 0;
}
}
long long combi(long long n, int p) {
if (p > n || p < 0) {
return 0;
} else {
return factorial[n] * fact_inv[p] % MOD * fact_inv[n-p] % MOD;
}
}
int main() {
int n, i, temp, lr;
int twice;
int a[100010];
int b[100010];
int num[2];
long long ans[100010] = {};
scanf("%d", &n);
for (i = 0; i < n+1; i++) {
a[i] = -1;
}
for (i = 0; i < n+1; i++) {
scanf("%d", &temp);
if (a[temp] == -1) {
a[temp] = i;
} else {
lr = a[temp] + n - i;
}
}
for (i = 0; i < n; i++) {
if (b[i] == 2) {
twice = i;
}
}
/*printf("%d\n", twice);*/
int dd = 0;
for (i = 0; i < n+1; i++) {
if (a[i] == twice) {
num[dd] = i;
dd = 1;
}
}
factorial[0] = 1;
fact_inv[0] = 1;
for (i = 1; i < n+2; i++) {
factorial[i] = factorial[i-1] * i % MOD;
/*printf("%lld\n", fact_inv[i]);*/
}
fact_inv[n+1] = power(factorial[n+1], MOD-2);
for (i = n; i > 0; i--) {
fact_inv[i] = fact_inv[i+1] * (i+1) % MOD;
}
/*printf("l=%d r=%d\n", l, r);*/
for (i = 1; i < n+1; i++) {
ans[i] = (combi(n+1, i) - combi(lr, i-1) + MOD) % MOD;
}
for (i = 1; i < n+1; i++) {
printf("%lld\n", ans[i]);
}
printf("1\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216615/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216615/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@factorial = dso_local local_unnamed_addr global [100010 x i64] zeroinitializer, align 16
@fact_inv = dso_local local_unnamed_addr global [100010 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @power(i64 noundef %n, i32 noundef %p) local_unnamed_addr #0 {
entry:
switch i32 %p, label %if.end3 [
i32 0, label %common.ret24
i32 1, label %if.then2
]
if.then2: ; preds = %entry
%rem = srem i64 %n, 1000000007
br label %common.ret24
if.end3: ; preds = %entry
%div = sdiv i32 %p, 2
%call = tail call i64 @power(i64 noundef %n, i32 noundef %div), !range !5
%rem4 = srem i32 %p, 2
switch i32 %rem4, label %common.ret24 [
i32 0, label %if.then6
i32 1, label %if.then11
]
if.then6: ; preds = %if.end3
%mul = mul nsw i64 %call, %call
%rem7 = urem i64 %mul, 1000000007
br label %common.ret24
common.ret24: ; preds = %if.then6, %if.end3, %entry, %if.then2, %if.then11
%common.ret24.op = phi i64 [ %rem14, %if.then11 ], [ %rem, %if.then2 ], [ 1, %entry ], [ %rem7, %if.then6 ], [ 0, %if.end3 ]
ret i64 %common.ret24.op
if.then11: ; preds = %if.end3
%sub = add nsw i32 %p, -1
%call12 = tail call i64 @power(i64 noundef %n, i32 noundef %sub), !range !5
%mul13 = mul nsw i64 %call12, %n
%rem14 = srem i64 %mul13, 1000000007
br label %common.ret24
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @combi(i64 noundef %n, i32 noundef %p) local_unnamed_addr #2 {
entry:
%conv = sext i32 %p to i64
%cmp = icmp sgt i64 %conv, %n
%cmp2 = icmp slt i32 %p, 0
%or.cond = or i1 %cmp2, %cmp
br i1 %or.cond, label %return, label %if.else
if.else: ; preds = %entry
%arrayidx = getelementptr inbounds [100010 x i64], ptr @factorial, i64 0, i64 %n
%0 = load i64, ptr %arrayidx, align 8, !tbaa !6
%arrayidx4 = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %conv
%1 = load i64, ptr %arrayidx4, align 8, !tbaa !6
%mul = mul nsw i64 %1, %0
%rem = srem i64 %mul, 1000000007
%sub = sub nsw i64 %n, %conv
%arrayidx6 = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %sub
%2 = load i64, ptr %arrayidx6, align 8, !tbaa !6
%mul7 = mul nsw i64 %rem, %2
%rem8 = srem i64 %mul7, 1000000007
br label %return
return: ; preds = %entry, %if.else
%retval.0 = phi i64 [ %rem8, %if.else ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%temp = alloca i32, align 4
%a = alloca [100010 x i32], align 16
%ans = alloca [100010 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %temp) #7
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 800080, ptr nonnull %ans) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800080) %ans, i8 0, i64 800080, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !10
%cmp.not152 = icmp slt i32 %0, 0
br i1 %cmp.not152, label %for.cond28.preheader.thread, label %for.body4.preheader
for.cond28.preheader.thread: ; preds = %entry
store i64 1, ptr @factorial, align 16, !tbaa !6
store i64 1, ptr @fact_inv, align 16, !tbaa !6
br label %for.end53
for.body4.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%2 = zext i32 %1 to i64
%3 = shl nuw nsw i64 %2, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %a, i8 -1, i64 %3, i1 false), !tbaa !10
br label %for.body4
for.cond17.preheader: ; preds = %for.inc14
%4 = sext i32 %lr.1 to i64
%cmp18158 = icmp sgt i32 %8, 0
store i64 1, ptr @factorial, align 16, !tbaa !6
store i64 1, ptr @fact_inv, align 16, !tbaa !6
%cmp44161 = icmp sgt i32 %8, -1
br i1 %cmp44161, label %for.body45.preheader, label %for.end53
for.body4: ; preds = %for.body4.preheader, %for.inc14
%lr.0156 = phi i32 [ %lr.1, %for.inc14 ], [ undef, %for.body4.preheader ]
%i.1155 = phi i32 [ %inc15, %for.inc14 ], [ 0, %for.body4.preheader ]
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %temp)
%5 = load i32, ptr %temp, align 4, !tbaa !10
%idxprom6 = sext i32 %5 to i64
%arrayidx7 = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %idxprom6
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !10
%cmp8 = icmp eq i32 %6, -1
br i1 %cmp8, label %if.then, label %if.else
if.then: ; preds = %for.body4
store i32 %i.1155, ptr %arrayidx7, align 4, !tbaa !10
%.pre = load i32, ptr %n, align 4, !tbaa !10
br label %for.inc14
if.else: ; preds = %for.body4
%7 = load i32, ptr %n, align 4, !tbaa !10
%add13 = sub i32 %6, %i.1155
%sub = add i32 %add13, %7
br label %for.inc14
for.inc14: ; preds = %if.then, %if.else
%8 = phi i32 [ %.pre, %if.then ], [ %7, %if.else ]
%lr.1 = phi i32 [ %lr.0156, %if.then ], [ %sub, %if.else ]
%inc15 = add nuw nsw i32 %i.1155, 1
%cmp3.not.not = icmp slt i32 %i.1155, %8
br i1 %cmp3.not.not, label %for.body4, label %for.cond17.preheader, !llvm.loop !12
for.body45.preheader: ; preds = %for.cond17.preheader
%9 = add nuw i32 %8, 1
%10 = zext i32 %9 to i64
%xtraiter = and i64 %10, 1
%11 = icmp eq i32 %8, 0
br i1 %11, label %for.end53.loopexit.unr-lcssa, label %for.body45.preheader.new
for.body45.preheader.new: ; preds = %for.body45.preheader
%unroll_iter = and i64 %10, 4294967294
br label %for.body45
for.body45: ; preds = %for.body45, %for.body45.preheader.new
%12 = phi i64 [ 1, %for.body45.preheader.new ], [ %rem.1, %for.body45 ]
%indvars.iv = phi i64 [ 1, %for.body45.preheader.new ], [ %indvars.iv.next.1, %for.body45 ]
%niter = phi i64 [ 0, %for.body45.preheader.new ], [ %niter.next.1, %for.body45 ]
%mul = mul nsw i64 %12, %indvars.iv
%rem = srem i64 %mul, 1000000007
%arrayidx50 = getelementptr inbounds [100010 x i64], ptr @factorial, i64 0, i64 %indvars.iv
store i64 %rem, ptr %arrayidx50, align 8, !tbaa !6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul.1 = mul nsw i64 %rem, %indvars.iv.next
%rem.1 = srem i64 %mul.1, 1000000007
%arrayidx50.1 = getelementptr inbounds [100010 x i64], ptr @factorial, i64 0, i64 %indvars.iv.next
store i64 %rem.1, ptr %arrayidx50.1, align 8, !tbaa !6
%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.end53.loopexit.unr-lcssa, label %for.body45, !llvm.loop !14
for.end53.loopexit.unr-lcssa: ; preds = %for.body45, %for.body45.preheader
%.unr = phi i64 [ 1, %for.body45.preheader ], [ %rem.1, %for.body45 ]
%indvars.iv.unr = phi i64 [ 1, %for.body45.preheader ], [ %indvars.iv.next.1, %for.body45 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end53, label %for.body45.epil
for.body45.epil: ; preds = %for.end53.loopexit.unr-lcssa
%mul.epil = mul nsw i64 %.unr, %indvars.iv.unr
%rem.epil = srem i64 %mul.epil, 1000000007
%arrayidx50.epil = getelementptr inbounds [100010 x i64], ptr @factorial, i64 0, i64 %indvars.iv.unr
store i64 %rem.epil, ptr %arrayidx50.epil, align 8, !tbaa !6
br label %for.end53
for.end53: ; preds = %for.body45.epil, %for.end53.loopexit.unr-lcssa, %for.cond28.preheader.thread, %for.cond17.preheader
%lr.0.lcssa189195 = phi i64 [ 0, %for.cond28.preheader.thread ], [ %4, %for.cond17.preheader ], [ %4, %for.end53.loopexit.unr-lcssa ], [ %4, %for.body45.epil ]
%13 = phi i32 [ %0, %for.cond28.preheader.thread ], [ %8, %for.cond17.preheader ], [ %8, %for.end53.loopexit.unr-lcssa ], [ %8, %for.body45.epil ]
%cmp18158190194 = phi i1 [ false, %for.cond28.preheader.thread ], [ %cmp18158, %for.cond17.preheader ], [ %cmp18158, %for.end53.loopexit.unr-lcssa ], [ %cmp18158, %for.body45.epil ]
%add54 = add nsw i32 %13, 1
%idxprom55 = sext i32 %add54 to i64
%arrayidx56 = getelementptr inbounds [100010 x i64], ptr @factorial, i64 0, i64 %idxprom55
%14 = load i64, ptr %arrayidx56, align 8, !tbaa !6
%call57 = call i64 @power(i64 noundef %14, i32 noundef 1000000005), !range !5
%arrayidx60 = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %idxprom55
store i64 %call57, ptr %arrayidx60, align 8, !tbaa !6
br i1 %cmp18158190194, label %for.body64.preheader, label %for.cond76.preheader
for.body64.preheader: ; preds = %for.end53
%15 = zext i32 %13 to i64
%16 = shl nuw nsw i64 %15, 3
%17 = getelementptr i8, ptr @fact_inv, i64 %16
%scevgep = getelementptr i8, ptr %17, i64 8
%load_initial = load i64, ptr %scevgep, align 8
br label %for.body64
for.cond76.preheader: ; preds = %for.body64, %for.end53
%cmp78.not165 = icmp slt i32 %13, 1
br i1 %cmp78.not165, label %for.end105, label %for.body80.lr.ph
for.body80.lr.ph: ; preds = %for.cond76.preheader
%arrayidx.i142 = getelementptr inbounds [100010 x i64], ptr @factorial, i64 0, i64 %lr.0.lcssa189195
%wide.trip.count182 = zext i32 %add54 to i64
br label %for.body80
for.body64: ; preds = %for.body64.preheader, %for.body64
%store_forwarded = phi i64 [ %load_initial, %for.body64.preheader ], [ %rem71, %for.body64 ]
%indvars.iv174 = phi i64 [ %15, %for.body64.preheader ], [ %indvars.iv.next175, %for.body64 ]
%18 = add nuw nsw i64 %indvars.iv174, 1
%mul70 = mul nsw i64 %store_forwarded, %18
%rem71 = srem i64 %mul70, 1000000007
%arrayidx73 = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %indvars.iv174
store i64 %rem71, ptr %arrayidx73, align 8, !tbaa !6
%indvars.iv.next175 = add nsw i64 %indvars.iv174, -1
%cmp62 = icmp ugt i64 %indvars.iv174, 1
br i1 %cmp62, label %for.body64, label %for.cond76.preheader, !llvm.loop !15
for.cond95.preheader: ; preds = %combi.exit151
br i1 %cmp78.not165, label %for.end105, label %for.body99
for.body80: ; preds = %for.body80.lr.ph, %combi.exit151
%indvars.iv178 = phi i64 [ 1, %for.body80.lr.ph ], [ %indvars.iv.next179, %combi.exit151 ]
%arrayidx4.i = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %indvars.iv178
%19 = load i64, ptr %arrayidx4.i, align 8, !tbaa !6
%mul.i = mul nsw i64 %19, %14
%rem.i = srem i64 %mul.i, 1000000007
%sub.i = sub nsw i64 %idxprom55, %indvars.iv178
%arrayidx6.i = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %sub.i
%20 = load i64, ptr %arrayidx6.i, align 8, !tbaa !6
%mul7.i = mul nsw i64 %rem.i, %20
%rem8.i = srem i64 %mul7.i, 1000000007
%21 = add nsw i64 %indvars.iv178, -1
%cmp.i140 = icmp sgt i64 %21, %lr.0.lcssa189195
br i1 %cmp.i140, label %combi.exit151, label %if.else.i141
if.else.i141: ; preds = %for.body80
%22 = load i64, ptr %arrayidx.i142, align 8, !tbaa !6
%arrayidx4.i143 = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %21
%23 = load i64, ptr %arrayidx4.i143, align 8, !tbaa !6
%mul.i144 = mul nsw i64 %23, %22
%rem.i145 = srem i64 %mul.i144, 1000000007
%sub.i146 = sub nsw i64 %lr.0.lcssa189195, %21
%arrayidx6.i147 = getelementptr inbounds [100010 x i64], ptr @fact_inv, i64 0, i64 %sub.i146
%24 = load i64, ptr %arrayidx6.i147, align 8, !tbaa !6
%mul7.i148 = mul nsw i64 %rem.i145, %24
%rem8.i149 = srem i64 %mul7.i148, 1000000007
br label %combi.exit151
combi.exit151: ; preds = %for.body80, %if.else.i141
%retval.0.i150 = phi i64 [ %rem8.i149, %if.else.i141 ], [ 0, %for.body80 ]
%sub87 = add nsw i64 %rem8.i, 1000000007
%add88 = sub nsw i64 %sub87, %retval.0.i150
%rem89 = srem i64 %add88, 1000000007
%arrayidx91 = getelementptr inbounds [100010 x i64], ptr %ans, i64 0, i64 %indvars.iv178
store i64 %rem89, ptr %arrayidx91, align 8, !tbaa !6
%indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1
%exitcond183.not = icmp eq i64 %indvars.iv.next179, %wide.trip.count182
br i1 %exitcond183.not, label %for.cond95.preheader, label %for.body80, !llvm.loop !16
for.body99: ; preds = %for.cond95.preheader, %for.body99
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body99 ], [ 1, %for.cond95.preheader ]
%arrayidx101 = getelementptr inbounds [100010 x i64], ptr %ans, i64 0, i64 %indvars.iv184
%25 = load i64, ptr %arrayidx101, align 8, !tbaa !6
%call102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %25)
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%26 = load i32, ptr %n, align 4, !tbaa !10
%27 = sext i32 %26 to i64
%cmp97.not.not = icmp slt i64 %indvars.iv184, %27
br i1 %cmp97.not.not, label %for.body99, label %for.end105, !llvm.loop !17
for.end105: ; preds = %for.body99, %for.cond76.preheader, %for.cond95.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
call void @llvm.lifetime.end.p0(i64 800080, ptr nonnull %ans) #7
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %temp) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nofree nounwind }
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 = !{i64 -1000000006, i64 1000000007}
!6 = !{!7, !7, i64 0}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
#include<string.h>
int main(){
int k,str=0;
char s[101];
scanf("%d %s",&k,s);
for(int i=0;s[i]!='\0';i++){
str++;
}
if(str<=k){
printf("%s",s);
}else{
for(int i=k;i<=k+3;i++){
if(i<k+3){
s[i]='.';
}else{
s[i]='\0';
}
}
printf("%s",s);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216659/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216659/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not34 = icmp eq i8 %0, 0
br i1 %cmp.not34, label %for.cond.cleanup, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
%indvars39 = trunc i64 %indvars.iv.next to i32
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%str.0.lcssa = phi i32 [ 0, %entry ], [ %indvars39, %for.cond.cleanup.loopexit ]
%1 = load i32, ptr %k, align 4, !tbaa !8
%cmp3.not = icmp sgt i32 %str.0.lcssa, %1
br i1 %cmp3.not, label %for.inc22, label %if.end27
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !10
for.inc22: ; preds = %for.cond.cleanup
%3 = sext i32 %1 to i64
%4 = add i32 %1, 4
%5 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %3
store i8 46, ptr %5, align 1
%indvars.iv.next42 = add nsw i64 %3, 1
%lftr.wideiv = trunc i64 %indvars.iv.next42 to i32
%exitcond.not = icmp eq i32 %4, %lftr.wideiv
br i1 %exitcond.not, label %if.end27, label %for.body12.1, !llvm.loop !12
for.body12.1: ; preds = %for.inc22
%add = add nsw i32 %1, 3
%6 = sext i32 %add to i64
%cmp14.1 = icmp slt i64 %indvars.iv.next42, %6
%spec.select = select i1 %cmp14.1, i8 46, i8 0
%7 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next42
store i8 %spec.select, ptr %7, align 1
%indvars.iv.next42.1 = add nsw i64 %3, 2
%cmp14.2 = icmp slt i64 %indvars.iv.next42.1, %6
%.sink45 = select i1 %cmp14.2, i8 46, i8 0
%8 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next42.1
store i8 %.sink45, ptr %8, align 1
%indvars.iv.next42.2 = add nsw i64 %3, 3
%cmp14.3 = icmp slt i64 %indvars.iv.next42.2, %6
%.sink46 = select i1 %cmp14.3, i8 46, i8 0
%9 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next42.2
store i8 %.sink46, ptr %9, align 1
br label %if.end27
if.end27: ; preds = %for.inc22, %for.body12.1, %for.cond.cleanup
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
#include<string.h>
int main(void) {
int i,j;
int k_len = 0;
char s[100];
int s_len;
scanf("%d",&k_len);
scanf("%s",s);
s_len = strlen(s);
if(s_len <= k_len) {
printf("%s\n",s);
}
if(k_len < s_len) {
for(i = 0; i < k_len; i++) {
printf("%c",s[i]);
}
printf("...\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216701/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216701/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"...\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k_len = alloca i32, align 4
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k_len) #5
store i32 0, ptr %k_len, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k_len)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call3 to i32
%0 = load i32, ptr %k_len, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %conv
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
%.pre = load i32, ptr %k_len, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%1 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%cmp7 = icmp slt i32 %1, %conv
br i1 %cmp7, label %for.cond.preheader, label %if.end15
for.cond.preheader: ; preds = %if.end
%cmp1020 = icmp sgt i32 %1, 0
br i1 %cmp1020, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv12 = sext i8 %2 to i32
%putchar = call i32 @putchar(i32 %conv12)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %k_len, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp10 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp10, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %for.cond.preheader
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end15
if.end15: ; preds = %for.end, %if.end
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k_len) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
#include<string.h>
int main()
{
int K;
int i,n;
char S[100];
scanf("%d",&K);
scanf("%s",S);
n=strlen(S);
if(n>K){
for(i=0;i<K;i++){
printf("%c",S[i]);
}
printf("...\n");
}else{
printf("%s\n",S);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216745/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216745/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"...\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%S = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call3 to i32
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %conv
br i1 %cmp, label %for.cond.preheader, label %if.end
for.cond.preheader: ; preds = %entry
%cmp515 = icmp sgt i32 %0, 0
br i1 %cmp515, label %for.body, label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv7 = sext i8 %1 to i32
%putchar = call i32 @putchar(i32 %conv7)
%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
%cmp5 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp5, label %for.body, label %if.end, !llvm.loop !10
if.end: ; preds = %for.body, %entry, %for.cond.preheader
%S.sink = phi ptr [ @str, %for.cond.preheader ], [ %S, %entry ], [ @str, %for.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %S.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
int main(void)
{
int num_K;
char str_S[101];
int i;
int word_count;
scanf("%d", &num_K);
scanf("%s", str_S);
word_count = 0;
for (i = 0; str_S[i] != '\0'; i++)
{
word_count++;
}
if (word_count > num_K)
{
for (i = 0; i < num_K; i++)
{
printf("%c", str_S[i]);
}
printf("...\n");
}
else
{
printf("%s", str_S);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216796/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216796/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"...\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num_K = alloca i32, align 4
%str_S = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num_K) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %str_S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num_K)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str_S)
%0 = load i8, ptr %str_S, align 16, !tbaa !5
%cmp.not25 = icmp eq i8 %0, 0
br i1 %cmp.not25, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [101 x i8], ptr %str_S, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %1, 0
br i1 %cmp.not, label %for.end.loopexit, label %for.body, !llvm.loop !8
for.end.loopexit: ; preds = %for.body
%indvars = trunc i64 %indvars.iv.next to i32
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%word_count.0.lcssa = phi i32 [ 0, %entry ], [ %indvars, %for.end.loopexit ]
%2 = load i32, ptr %num_K, align 4, !tbaa !10
%cmp4 = icmp sgt i32 %word_count.0.lcssa, %2
br i1 %cmp4, label %for.cond6.preheader, label %if.else
for.cond6.preheader: ; preds = %for.end
%cmp728 = icmp sgt i32 %2, 0
br i1 %cmp728, label %for.body9, label %for.end16
for.body9: ; preds = %for.cond6.preheader, %for.body9
%indvars.iv33 = phi i64 [ %indvars.iv.next34, %for.body9 ], [ 0, %for.cond6.preheader ]
%arrayidx11 = getelementptr inbounds [101 x i8], ptr %str_S, i64 0, i64 %indvars.iv33
%3 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%conv12 = sext i8 %3 to i32
%putchar = call i32 @putchar(i32 %conv12)
%indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
%4 = load i32, ptr %num_K, align 4, !tbaa !10
%5 = sext i32 %4 to i64
%cmp7 = icmp slt i64 %indvars.iv.next34, %5
br i1 %cmp7, label %for.body9, label %for.end16, !llvm.loop !12
for.end16: ; preds = %for.body9, %for.cond6.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %for.end
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %str_S)
br label %if.end
if.end: ; preds = %if.else, %for.end16
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %str_S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num_K) #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
; 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"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
|
#include<stdio.h>
int main(){
int K,i;
char S[100];
scanf("%d",&K);
scanf("%s",&S);
for(i=0;i<K;i++){
if(S[i])printf("%c",S[i]);
else break;
}
if(i==K&&S[i])puts("...");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216839/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216839/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"...\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%S = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp19 = icmp sle i32 %0, 0
%1 = load i8, ptr %S, align 16
%tobool.not25 = icmp eq i8 %1, 0
%or.cond = select i1 %cmp19, i1 true, i1 %tobool.not25
br i1 %or.cond, label %for.end, label %if.then
for.body: ; preds = %if.then
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%tobool.not = icmp eq i8 %2, 0
br i1 %tobool.not, label %for.end.loopexit.loopexit, label %if.then, !llvm.loop !10
if.then: ; preds = %entry, %for.body
%3 = phi i8 [ %2, %for.body ], [ %1, %entry ]
%indvars.iv26 = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%conv = sext i8 %3 to i32
%putchar = call i32 @putchar(i32 %conv)
%indvars.iv.next = add nuw nsw i64 %indvars.iv26, 1
%4 = load i32, ptr %K, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end.loopexit.loopexit, !llvm.loop !10
for.end.loopexit.loopexit: ; preds = %for.body, %if.then
%6 = trunc i64 %indvars.iv.next to i32
br label %for.end
for.end: ; preds = %for.end.loopexit.loopexit, %entry
%i.0.lcssa = phi i32 [ 0, %entry ], [ %6, %for.end.loopexit.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %4, %for.end.loopexit.loopexit ]
%cmp5 = icmp eq i32 %i.0.lcssa, %.lcssa
br i1 %cmp5, label %land.lhs.true, label %if.end13
land.lhs.true: ; preds = %for.end
%idxprom7 = zext i32 %i.0.lcssa to i64
%arrayidx8 = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %idxprom7
%7 = load i8, ptr %arrayidx8, align 1, !tbaa !9
%tobool10.not = icmp eq i8 %7, 0
br i1 %tobool10.not, label %if.end13, label %if.then11
if.then11: ; preds = %land.lhs.true
%call12 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end13
if.end13: ; preds = %if.then11, %land.lhs.true, %for.end
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void){
// Your code here!
int N,i;
char S[100];
scanf("%d",&N);
scanf("%s",S);
i=strlen(S);
if(i<=N){
for(i=0;S[i]!='\0';i++){
printf("%s\n",S);
break;
}
}else{
S[N]='\0';
for(i=0;S[i]!='\0';i++){
printf("%s...\n",S);
break;
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216882/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216882/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%s...\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%S = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #5
%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 %S)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call3 to i32
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %conv
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%1 = load i8, ptr %S, align 16, !tbaa !9
%cmp6.not = icmp eq i8 %1, 0
br i1 %cmp6.not, label %if.end, label %for.body
for.body: ; preds = %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %S)
br label %if.end
if.else: ; preds = %entry
%idxprom10 = sext i32 %0 to i64
%arrayidx11 = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %idxprom10
store i8 0, ptr %arrayidx11, align 1, !tbaa !9
%2 = load i8, ptr %S, align 16, !tbaa !9
%cmp16.not = icmp eq i8 %2, 0
br i1 %cmp16.not, label %if.end, label %for.body18
for.body18: ; preds = %if.else
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %S)
br label %if.end
if.end: ; preds = %if.else, %for.body18, %if.then, %for.body
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!"int", !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>
int main(int argc, char const *argv[]) {
int K;
char S[110];
scanf("%d", &K);
scanf("%s", S);
int len = strlen(S);
if (len <= K) {
printf("%s\n", S);
} else {
S[K] = '\0';
printf("%s...\n", S);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216925/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216925/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%s...\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%S = alloca [110 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.start.p0(i64 110, ptr nonnull %S) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call3 to i32
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %conv
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %S)
br label %if.end
if.else: ; preds = %entry
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [110 x i8], ptr %S, i64 0, i64 %idxprom
store i8 0, ptr %arrayidx, align 1, !tbaa !9
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %S)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 110, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
int main(){
int N,i;
char str[100] = {0};
scanf("%d",&N);
scanf("%s",str);
if(str[N] == 0){
printf("%s",str);
}
else{
for(i = 0; i< N ; i++){
printf("%c",str[i]);
}
printf("...");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_216969/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_216969/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"...\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%str = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %str, i8 0, i64 100, i1 false)
%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 %str)
%0 = load i32, ptr %N, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%arrayidx = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp = icmp eq i8 %1, 0
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp514 = icmp sgt i32 %0, 0
br i1 %cmp514, label %for.body, label %for.end
if.then: ; preds = %entry
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %str)
br label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx8 = getelementptr inbounds [100 x i8], ptr %str, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !9
%conv9 = sext i8 %2 to i32
%putchar = call i32 @putchar(i32 %conv9)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp5 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp5, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %for.cond.preheader
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
br label %if.end
if.end: ; preds = %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main( int argc, char *argv[] )
{
int k;
char s[110];
scanf( "%d", &k );
scanf( "%s", s );
if( strlen( s ) > k ) {
s[k] = '\0';
strcat( s, "..." );
}
printf( "%s\n", s );
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217010/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217010/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%s = alloca [110 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 110, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%0 = load i32, ptr %k, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%cmp = icmp ugt i64 %call3, %conv
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%arrayidx = getelementptr inbounds [110 x i8], ptr %s, i64 0, i64 %conv
store i8 0, ptr %arrayidx, align 1, !tbaa !9
%strlen = call i64 @strlen(ptr nonnull dereferenceable(1) %s)
%endptr = getelementptr inbounds i8, ptr %s, i64 %strlen
store i32 3026478, ptr %endptr, align 1
br label %if.end
if.end: ; preds = %if.then, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 110, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
/*
* main.c
*
* Created on: 2020/03/28
* Author: family
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a > b ? b : a)
typedef long long int ll;
typedef unsigned long long int ull;
int sort_inc(const void *a, const void *b) { return (*(int*)a - *(int*)b);}
int sort_dec(const void* a, const void* b) { return (*(int*)b - *(int*)a);}
int sort_dec_ll(const void *a, const void *b) {
ll da = *(ll*)a, db = *(ll*)b; int val = 0;
if(da > db) { val = -1; }
else if (da == db) { val = 0; }
else { val = 1; }
return val;
}
int sort_inc_ll(const void *a, const void *b) {
ll da = *(ll*)a, db = *(ll*)b; int val = 0;
if(da > db) { val = 1; }
else if (da == db) { val = 0; }
else { val = -1; }
return val;
}
int sort_dic(const void *a, const void *b) {
char *pa = (char *)a; char *pb = (char *)b; int i = 0, val = 0, N = 10;
for (i = 0; i < N; i++) {
char da = pa[i], db = pb[i];
if (da == db) continue;
if (da > db) val = 1; else val = -1;
break;
}
return val;
}
void yesno(int ans) {
if (ans == 1) { printf("Yes\n");
} else { printf("No\n"); }
return;
}
void okng(int ans) {
if (ans == 1) { printf("OK\n");
} else { printf("NG\n"); }
return;
}
char S[101] = {0};
char s[101] = {0};
int main()
{
int K = 0, len = 0;
scanf("%d", &K);
scanf("%s", S);
len = strlen(S);
if (len <= K) {
printf("%s\n",S);
} else {
strncpy(s, S, K);
printf("%s...\n",s);
}
//yesno(ans);
//okng(ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217061/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217061/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@S = dso_local global [101 x i8] zeroinitializer, align 16
@s = dso_local global [101 x i8] zeroinitializer, align 16
@.str.4 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%s...\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.8 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.9 = private unnamed_addr constant [3 x i8] c"NG\00", align 1
@str.10 = private unnamed_addr constant [3 x i8] c"OK\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_inc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_dec(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_dec_ll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = zext i1 %cmp1 to i32
%val.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %val.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_inc_ll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%val.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %val.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sort_dic(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !11
%1 = load i8, ptr %b, align 1, !tbaa !11
%cmp4 = icmp eq i8 %0, %1
br i1 %cmp4, label %for.cond, label %for.end.split.loop.exit
for.cond: ; preds = %entry
%arrayidx.1 = getelementptr inbounds i8, ptr %a, i64 1
%2 = load i8, ptr %arrayidx.1, align 1, !tbaa !11
%arrayidx2.1 = getelementptr inbounds i8, ptr %b, i64 1
%3 = load i8, ptr %arrayidx2.1, align 1, !tbaa !11
%cmp4.1 = icmp eq i8 %2, %3
br i1 %cmp4.1, label %for.cond.1, label %for.end.split.loop.exit
for.cond.1: ; preds = %for.cond
%arrayidx.2 = getelementptr inbounds i8, ptr %a, i64 2
%4 = load i8, ptr %arrayidx.2, align 1, !tbaa !11
%arrayidx2.2 = getelementptr inbounds i8, ptr %b, i64 2
%5 = load i8, ptr %arrayidx2.2, align 1, !tbaa !11
%cmp4.2 = icmp eq i8 %4, %5
br i1 %cmp4.2, label %for.cond.2, label %for.end.split.loop.exit
for.cond.2: ; preds = %for.cond.1
%arrayidx.3 = getelementptr inbounds i8, ptr %a, i64 3
%6 = load i8, ptr %arrayidx.3, align 1, !tbaa !11
%arrayidx2.3 = getelementptr inbounds i8, ptr %b, i64 3
%7 = load i8, ptr %arrayidx2.3, align 1, !tbaa !11
%cmp4.3 = icmp eq i8 %6, %7
br i1 %cmp4.3, label %for.cond.3, label %for.end.split.loop.exit
for.cond.3: ; preds = %for.cond.2
%arrayidx.4 = getelementptr inbounds i8, ptr %a, i64 4
%8 = load i8, ptr %arrayidx.4, align 1, !tbaa !11
%arrayidx2.4 = getelementptr inbounds i8, ptr %b, i64 4
%9 = load i8, ptr %arrayidx2.4, align 1, !tbaa !11
%cmp4.4 = icmp eq i8 %8, %9
br i1 %cmp4.4, label %for.cond.4, label %for.end.split.loop.exit
for.cond.4: ; preds = %for.cond.3
%arrayidx.5 = getelementptr inbounds i8, ptr %a, i64 5
%10 = load i8, ptr %arrayidx.5, align 1, !tbaa !11
%arrayidx2.5 = getelementptr inbounds i8, ptr %b, i64 5
%11 = load i8, ptr %arrayidx2.5, align 1, !tbaa !11
%cmp4.5 = icmp eq i8 %10, %11
br i1 %cmp4.5, label %for.cond.5, label %for.end.split.loop.exit
for.cond.5: ; preds = %for.cond.4
%arrayidx.6 = getelementptr inbounds i8, ptr %a, i64 6
%12 = load i8, ptr %arrayidx.6, align 1, !tbaa !11
%arrayidx2.6 = getelementptr inbounds i8, ptr %b, i64 6
%13 = load i8, ptr %arrayidx2.6, align 1, !tbaa !11
%cmp4.6 = icmp eq i8 %12, %13
br i1 %cmp4.6, label %for.cond.6, label %for.end.split.loop.exit
for.cond.6: ; preds = %for.cond.5
%arrayidx.7 = getelementptr inbounds i8, ptr %a, i64 7
%14 = load i8, ptr %arrayidx.7, align 1, !tbaa !11
%arrayidx2.7 = getelementptr inbounds i8, ptr %b, i64 7
%15 = load i8, ptr %arrayidx2.7, align 1, !tbaa !11
%cmp4.7 = icmp eq i8 %14, %15
br i1 %cmp4.7, label %for.cond.7, label %for.end.split.loop.exit
for.cond.7: ; preds = %for.cond.6
%arrayidx.8 = getelementptr inbounds i8, ptr %a, i64 8
%16 = load i8, ptr %arrayidx.8, align 1, !tbaa !11
%arrayidx2.8 = getelementptr inbounds i8, ptr %b, i64 8
%17 = load i8, ptr %arrayidx2.8, align 1, !tbaa !11
%cmp4.8 = icmp eq i8 %16, %17
br i1 %cmp4.8, label %for.cond.8, label %for.end.split.loop.exit
for.cond.8: ; preds = %for.cond.7
%arrayidx.9 = getelementptr inbounds i8, ptr %a, i64 9
%18 = load i8, ptr %arrayidx.9, align 1, !tbaa !11
%arrayidx2.9 = getelementptr inbounds i8, ptr %b, i64 9
%19 = load i8, ptr %arrayidx2.9, align 1, !tbaa !11
%cmp4.9 = icmp eq i8 %18, %19
br i1 %cmp4.9, label %for.end, label %for.end.split.loop.exit
for.end.split.loop.exit: ; preds = %for.cond.8, %for.cond.7, %for.cond.6, %for.cond.5, %for.cond.4, %for.cond.3, %for.cond.2, %for.cond.1, %for.cond, %entry
%.lcssa28 = phi i8 [ %0, %entry ], [ %2, %for.cond ], [ %4, %for.cond.1 ], [ %6, %for.cond.2 ], [ %8, %for.cond.3 ], [ %10, %for.cond.4 ], [ %12, %for.cond.5 ], [ %14, %for.cond.6 ], [ %16, %for.cond.7 ], [ %18, %for.cond.8 ]
%.lcssa = phi i8 [ %1, %entry ], [ %3, %for.cond ], [ %5, %for.cond.1 ], [ %7, %for.cond.2 ], [ %9, %for.cond.3 ], [ %11, %for.cond.4 ], [ %13, %for.cond.5 ], [ %15, %for.cond.6 ], [ %17, %for.cond.7 ], [ %19, %for.cond.8 ]
%cmp8.le = icmp sgt i8 %.lcssa28, %.lcssa
%..le = select i1 %cmp8.le, i32 1, i32 -1
br label %for.end
for.end: ; preds = %for.cond.8, %for.end.split.loop.exit
%val.3 = phi i32 [ %..le, %for.end.split.loop.exit ], [ 0, %for.cond.8 ]
ret i32 %val.3
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @yesno(i32 noundef %ans) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %ans, 1
%str.8.str = select i1 %cmp, ptr @str.8, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.8.str)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @okng(i32 noundef %ans) local_unnamed_addr #2 {
entry:
%cmp = icmp eq i32 %ans, 1
%str.10.str.9 = select i1 %cmp, ptr @str.10, ptr @str.9
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.10.str.9)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #7
store i32 0, ptr %K, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %K)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @S)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @S) #8
%conv = trunc i64 %call2 to i32
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %conv
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @S)
br label %if.end
if.else: ; preds = %entry
%conv5 = sext i32 %0 to i64
%call6 = call ptr @strncpy(ptr noundef nonnull @s, ptr noundef nonnull @S, i64 noundef %conv5) #7
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef nonnull @s)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree 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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!7, !7, i64 0}
|
#include <stdio.h> // printf(), fgets()
#include <stdlib.h> // strtod()
const char NUL = '\0';
int
main(int argc, char **argv)
{
char line[81];
double stack[20];
char *nextp = NULL;
while (fgets(line, sizeof(line), stdin) != NULL)
{
double a, b;
double d;
int sp = 0;
const char *s = line;
while (*s != '\n' && *s != NUL)
{
while (*s == ' ')
s++;
d = strtod(s, &nextp);
if (s != nextp)
{
stack[sp++] = d;
s = nextp;
}
else
{
b = stack[--sp];
a = stack[--sp];
switch (*s)
{
case '+':
d = a + b;
break;
case '-':
d = a - b;
break;
case '*':
d = a * b;
break;
case '/':
d = a / b;
break;
}
stack[sp++] = d;
s++;
}
}
d = stack[--sp];
printf("%.8f\n", d);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217126/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217126/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@NUL = dso_local local_unnamed_addr constant i8 0, align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [6 x i8] c"%.8f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%line = alloca [81 x i8], align 16
%stack = alloca [20 x double], align 16
%nextp = alloca ptr, align 8
call void @llvm.lifetime.start.p0(i64 81, ptr nonnull %line) #4
call void @llvm.lifetime.start.p0(i64 160, ptr nonnull %stack) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %nextp) #4
store ptr null, ptr %nextp, align 8, !tbaa !5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call57 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 81, ptr noundef %0)
%cmp.not58 = icmp eq ptr %call57, null
br i1 %cmp.not58, label %while.end35, label %while.cond2
while.cond2: ; preds = %entry, %while.cond2.backedge
%sp.0 = phi i32 [ %sp.0.be, %while.cond2.backedge ], [ 0, %entry ]
%s.0 = phi ptr [ %s.0.be, %while.cond2.backedge ], [ %line, %entry ]
%1 = load i8, ptr %s.0, align 1, !tbaa !9
switch i8 %1, label %while.end [
i8 10, label %while.end30
i8 0, label %while.end30
i8 32, label %while.body13
]
while.body13: ; preds = %while.cond2, %while.body13
%s.156 = phi ptr [ %incdec.ptr, %while.body13 ], [ %s.0, %while.cond2 ]
%incdec.ptr = getelementptr inbounds i8, ptr %s.156, i64 1
%.pr = load i8, ptr %incdec.ptr, align 1, !tbaa !9
%cmp11 = icmp eq i8 %.pr, 32
br i1 %cmp11, label %while.body13, label %while.end, !llvm.loop !10
while.end: ; preds = %while.body13, %while.cond2
%s.1.lcssa = phi ptr [ %s.0, %while.cond2 ], [ %incdec.ptr, %while.body13 ]
%call14 = call double @strtod(ptr noundef nonnull %s.1.lcssa, ptr noundef nonnull %nextp) #4
%2 = load ptr, ptr %nextp, align 8, !tbaa !5
%cmp15.not = icmp eq ptr %s.1.lcssa, %2
br i1 %cmp15.not, label %if.else, label %if.then
if.then: ; preds = %while.end
%inc = add nsw i32 %sp.0, 1
%idxprom = sext i32 %sp.0 to i64
%arrayidx = getelementptr inbounds [20 x double], ptr %stack, i64 0, i64 %idxprom
store double %call14, ptr %arrayidx, align 8, !tbaa !12
br label %while.cond2.backedge
if.else: ; preds = %while.end
%dec = add nsw i32 %sp.0, -1
%idxprom17 = sext i32 %dec to i64
%arrayidx18 = getelementptr inbounds [20 x double], ptr %stack, i64 0, i64 %idxprom17
%3 = load double, ptr %arrayidx18, align 8, !tbaa !12
%dec19 = add nsw i32 %sp.0, -2
%idxprom20 = sext i32 %dec19 to i64
%arrayidx21 = getelementptr inbounds [20 x double], ptr %stack, i64 0, i64 %idxprom20
%4 = load double, ptr %arrayidx21, align 8, !tbaa !12
%5 = load i8, ptr %s.1.lcssa, align 1, !tbaa !9
%conv22 = sext i8 %5 to i32
switch i32 %conv22, label %sw.epilog [
i32 43, label %sw.bb
i32 45, label %sw.bb23
i32 42, label %sw.bb24
i32 47, label %sw.bb25
]
sw.bb: ; preds = %if.else
%add = fadd double %3, %4
br label %sw.epilog
sw.bb23: ; preds = %if.else
%sub = fsub double %4, %3
br label %sw.epilog
sw.bb24: ; preds = %if.else
%mul = fmul double %3, %4
br label %sw.epilog
sw.bb25: ; preds = %if.else
%div = fdiv double %4, %3
br label %sw.epilog
sw.epilog: ; preds = %if.else, %sw.bb25, %sw.bb24, %sw.bb23, %sw.bb
%d.0 = phi double [ %call14, %if.else ], [ %div, %sw.bb25 ], [ %mul, %sw.bb24 ], [ %sub, %sw.bb23 ], [ %add, %sw.bb ]
store double %d.0, ptr %arrayidx21, align 8, !tbaa !12
%incdec.ptr29 = getelementptr inbounds i8, ptr %s.1.lcssa, i64 1
br label %while.cond2.backedge
while.end30: ; preds = %while.cond2, %while.cond2
%dec31 = add nsw i32 %sp.0, -1
%idxprom32 = sext i32 %dec31 to i64
%arrayidx33 = getelementptr inbounds [20 x double], ptr %stack, i64 0, i64 %idxprom32
%6 = load double, ptr %arrayidx33, align 8, !tbaa !12
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, double noundef %6)
%7 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 81, ptr noundef %7)
%cmp.not = icmp eq ptr %call, null
br i1 %cmp.not, label %while.end35, label %while.cond2.backedge
while.cond2.backedge: ; preds = %while.end30, %sw.epilog, %if.then
%sp.0.be = phi i32 [ 0, %while.end30 ], [ %inc, %if.then ], [ %dec, %sw.epilog ]
%s.0.be = phi ptr [ %line, %while.end30 ], [ %2, %if.then ], [ %incdec.ptr29, %sw.epilog ]
br label %while.cond2, !llvm.loop !14
while.end35: ; preds = %while.end30, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %nextp) #4
call void @llvm.lifetime.end.p0(i64 160, ptr nonnull %stack) #4
call void @llvm.lifetime.end.p0(i64 81, ptr nonnull %line) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn
declare double @strtod(ptr noundef readonly, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn "no-trapping-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 = !{!"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 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = distinct !{!14, !11}
|
#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
#include<string.h>
typedef int32_t i32;
typedef int64_t i64;
static void print_int(i64 n){if(n<0){putchar('-');n=-n;}if(n==0){putchar('0');return;}int s[20],len=0;while(n>0){s[len++]=n%10+'0';n/=10;}while(len>0){putchar(s[--len]);}}
static i64 read_int(void){int prev='\0';int c=getchar();while(!('0'<=c && c<='9')){prev=c;c=getchar();}i64 res=0;while('0'<=c && c<='9'){res=10*res+c-'0';c=getchar();}return prev=='-'?-res:res;}
typedef struct range {
i32 l, r;
} range;
typedef range radix_type;
typedef uint32_t u32;
#define RADIX_WIDTH 9
const u32 radix_type_max = 17;
const u32 radix_type_begin = 0;
const u32 radix_width = RADIX_WIDTH;
const u32 radix_mask = (1 << RADIX_WIDTH) - 1;
#undef RADIX_WIDTH
static inline u32 radix_get_bit (radix_type v, u32 shift) {
return (u32)(v.r - v.l) >> shift & radix_mask;
}
void radix_sort (radix_type *a, u32 n) {
radix_type * const array = (radix_type *) calloc (n, sizeof (radix_type));
i32 *next = (i32 *) calloc (n + (1 << radix_width), sizeof (i32));
i32 *start = next + n;
for (u32 shift = radix_type_begin; shift < radix_type_max; shift += radix_width) {
for (i32 i = 0; i < (i32)(1 << radix_width); ++i) {
start[i] = -1;
}
for (i32 i = 0; i < (i32)n; ++i) {
u32 bit = radix_get_bit (a[i], shift);
array[i] = a[i];
next[i] = start[bit];
start[bit] = i;
}
for (i32 bit = radix_mask, i = n - 1; bit >= 0; --bit) {
for (i32 p = start[bit]; p != -1; p = next[p]) {
a[i--] = array[p];
}
}
}
free (array);
free (next);
}
void add (i32 *bit, i32 x, i32 v) {
i32 n = bit[0];
for (i32 i = x; i <= n; i += i & -i) {
bit[i] += v;
}
}
i32 find (i32 *bit, i32 x) {
i32 sum = 0;
for (i32 i = x; i > 0; i -= i & -i) {
sum += bit[i];
}
return sum;
}
void run (void) {
i32 n = read_int();
i32 m = read_int();
range *p = (range *) calloc (n, sizeof (range));
for (i32 i = 0; i < n; ++i) {
p[i].l = read_int();
p[i].r = read_int() + 1;
}
radix_sort (p, n);
i32 *bit = (i32 *) calloc (m + 2, sizeof (i32));
bit[0] = m + 1;
for (i32 d = 1, i = 0; d <= m; ++d) {
for (; i < n && p[i].r - p[i].l < d; ++i) {
add (bit, p[i].l, 1);
add (bit, p[i].r, -1);
}
i32 ans = n - i;
for (i32 j = d; j <= m; j += d) {
ans += find (bit, j);
}
print_int (ans);
putchar ('\n');
}
}
int main (void) {
run();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217205/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217205/source.c"
target datalayout = "e-m:e-p270: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.range = type { i32, i32 }
@radix_type_max = dso_local local_unnamed_addr constant i32 17, align 4
@radix_type_begin = dso_local local_unnamed_addr constant i32 0, align 4
@radix_width = dso_local local_unnamed_addr constant i32 9, align 4
@radix_mask = dso_local local_unnamed_addr constant i32 511, align 4
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local void @radix_sort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%conv = zext i32 %n to i64
%call = tail call noalias ptr @calloc(i64 noundef %conv, i64 noundef 8) #9
%add = add i32 %n, 512
%conv1 = zext i32 %add to i64
%call2 = tail call noalias ptr @calloc(i64 noundef %conv1, i64 noundef 4) #9
%add.ptr = getelementptr i32, ptr %call2, i64 %conv
%cmp1189 = icmp sgt i32 %n, 0
%sub = add i32 %n, -1
br i1 %cmp1189, label %for.cond4.preheader.us.preheader, label %for.cond4.preheader.preheader
for.cond4.preheader.preheader: ; preds = %entry
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2048) %add.ptr, i8 -1, i64 2048, i1 false), !tbaa !5
br label %for.body37
for.cond4.preheader.us.preheader: ; preds = %entry
%0 = shl nuw nsw i64 %conv, 3
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2048) %add.ptr, i8 -1, i64 2048, i1 false), !tbaa !5
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %call, ptr align 4 %a, i64 %0, i1 false)
%1 = add nsw i64 %conv, -1
%xtraiter = and i64 %conv, 1
%2 = icmp eq i64 %1, 0
br i1 %2, label %for.body37.us.preheader.unr-lcssa, label %for.cond4.preheader.us.preheader.new
for.cond4.preheader.us.preheader.new: ; preds = %for.cond4.preheader.us.preheader
%unroll_iter = and i64 %conv, 4294967294
br label %for.body14.us
for.cond.cleanup36.us: ; preds = %for.cond.cleanup43.us
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2048) %add.ptr, i8 -1, i64 2048, i1 false), !tbaa !5
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %call, ptr align 4 %a, i64 %0, i1 false)
%xtraiter128 = and i64 %conv, 1
%3 = icmp eq i64 %1, 0
br i1 %3, label %for.body37.us.1.preheader.unr-lcssa, label %for.cond.cleanup36.us.new
for.cond.cleanup36.us.new: ; preds = %for.cond.cleanup36.us
%unroll_iter130 = and i64 %conv, 4294967294
br label %for.body14.us.1
for.body14.us.1: ; preds = %for.body14.us.1, %for.cond.cleanup36.us.new
%indvars.iv107.1 = phi i64 [ 0, %for.cond.cleanup36.us.new ], [ %indvars.iv.next108.1.1, %for.body14.us.1 ]
%niter131 = phi i64 [ 0, %for.cond.cleanup36.us.new ], [ %niter131.next.1, %for.body14.us.1 ]
%arrayidx16.us.1 = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv107.1
%4 = load i64, ptr %arrayidx16.us.1, align 4
%v.sroa.2.0.extract.shift.i.us.1 = lshr i64 %4, 32
%sub.i.us.1 = sub i64 %v.sroa.2.0.extract.shift.i.us.1, %4
%shr.i.us.1 = lshr i64 %sub.i.us.1, 9
%and.i.us.1 = and i64 %shr.i.us.1, 511
%arrayidx23.us.1 = getelementptr inbounds i32, ptr %add.ptr, i64 %and.i.us.1
%5 = load i32, ptr %arrayidx23.us.1, align 4, !tbaa !5
%arrayidx25.us.1 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv107.1
store i32 %5, ptr %arrayidx25.us.1, align 4, !tbaa !5
%6 = trunc i64 %indvars.iv107.1 to i32
store i32 %6, ptr %arrayidx23.us.1, align 4, !tbaa !5
%indvars.iv.next108.1 = or i64 %indvars.iv107.1, 1
%arrayidx16.us.1.1 = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv.next108.1
%7 = load i64, ptr %arrayidx16.us.1.1, align 4
%v.sroa.2.0.extract.shift.i.us.1.1 = lshr i64 %7, 32
%sub.i.us.1.1 = sub i64 %v.sroa.2.0.extract.shift.i.us.1.1, %7
%shr.i.us.1.1 = lshr i64 %sub.i.us.1.1, 9
%and.i.us.1.1 = and i64 %shr.i.us.1.1, 511
%arrayidx23.us.1.1 = getelementptr inbounds i32, ptr %add.ptr, i64 %and.i.us.1.1
%8 = load i32, ptr %arrayidx23.us.1.1, align 4, !tbaa !5
%arrayidx25.us.1.1 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.next108.1
store i32 %8, ptr %arrayidx25.us.1.1, align 4, !tbaa !5
%9 = trunc i64 %indvars.iv.next108.1 to i32
store i32 %9, ptr %arrayidx23.us.1.1, align 4, !tbaa !5
%indvars.iv.next108.1.1 = add nuw nsw i64 %indvars.iv107.1, 2
%niter131.next.1 = add i64 %niter131, 2
%niter131.ncmp.1 = icmp eq i64 %niter131.next.1, %unroll_iter130
br i1 %niter131.ncmp.1, label %for.body37.us.1.preheader.unr-lcssa, label %for.body14.us.1, !llvm.loop !9
for.body37.us.1.preheader.unr-lcssa: ; preds = %for.body14.us.1, %for.cond.cleanup36.us
%indvars.iv107.1.unr = phi i64 [ 0, %for.cond.cleanup36.us ], [ %indvars.iv.next108.1.1, %for.body14.us.1 ]
%lcmp.mod129.not = icmp eq i64 %xtraiter128, 0
br i1 %lcmp.mod129.not, label %for.body37.us.1.preheader, label %for.body14.us.1.epil
for.body14.us.1.epil: ; preds = %for.body37.us.1.preheader.unr-lcssa
%arrayidx16.us.1.epil = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv107.1.unr
%10 = load i64, ptr %arrayidx16.us.1.epil, align 4
%v.sroa.2.0.extract.shift.i.us.1.epil = lshr i64 %10, 32
%sub.i.us.1.epil = sub i64 %v.sroa.2.0.extract.shift.i.us.1.epil, %10
%shr.i.us.1.epil = lshr i64 %sub.i.us.1.epil, 9
%and.i.us.1.epil = and i64 %shr.i.us.1.epil, 511
%arrayidx23.us.1.epil = getelementptr inbounds i32, ptr %add.ptr, i64 %and.i.us.1.epil
%11 = load i32, ptr %arrayidx23.us.1.epil, align 4, !tbaa !5
%arrayidx25.us.1.epil = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv107.1.unr
store i32 %11, ptr %arrayidx25.us.1.epil, align 4, !tbaa !5
%12 = trunc i64 %indvars.iv107.1.unr to i32
store i32 %12, ptr %arrayidx23.us.1.epil, align 4, !tbaa !5
br label %for.body37.us.1.preheader
for.body37.us.1.preheader: ; preds = %for.body37.us.1.preheader.unr-lcssa, %for.body14.us.1.epil
br label %for.body37.us.1
for.body37.us.1: ; preds = %for.body37.us.1.preheader, %for.cond.cleanup43.us.1
%indvars.iv113.1 = phi i64 [ %indvars.iv.next114.1, %for.cond.cleanup43.us.1 ], [ 511, %for.body37.us.1.preheader ]
%i32.096.us.1 = phi i32 [ %i32.1.lcssa.us.1, %for.cond.cleanup43.us.1 ], [ %sub, %for.body37.us.1.preheader ]
%arrayidx39.us.1 = getelementptr inbounds i32, ptr %add.ptr, i64 %indvars.iv113.1
%p.091.us.1 = load i32, ptr %arrayidx39.us.1, align 4, !tbaa !5
%cmp41.not92.us.1 = icmp eq i32 %p.091.us.1, -1
br i1 %cmp41.not92.us.1, label %for.cond.cleanup43.us.1, label %for.body44.us.preheader.1
for.body44.us.preheader.1: ; preds = %for.body37.us.1
%13 = sext i32 %i32.096.us.1 to i64
br label %for.body44.us.1
for.body44.us.1: ; preds = %for.body44.us.1, %for.body44.us.preheader.1
%indvars.iv110.1 = phi i64 [ %13, %for.body44.us.preheader.1 ], [ %indvars.iv.next111.1, %for.body44.us.1 ]
%p.094.us.1 = phi i32 [ %p.091.us.1, %for.body44.us.preheader.1 ], [ %p.0.us.1, %for.body44.us.1 ]
%indvars.iv.next111.1 = add i64 %indvars.iv110.1, -1
%arrayidx46.us.1 = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv110.1
%idxprom47.us.1 = sext i32 %p.094.us.1 to i64
%arrayidx48.us.1 = getelementptr inbounds %struct.range, ptr %call, i64 %idxprom47.us.1
%14 = load i64, ptr %arrayidx48.us.1, align 4
store i64 %14, ptr %arrayidx46.us.1, align 4
%arrayidx51.us.1 = getelementptr inbounds i32, ptr %call2, i64 %idxprom47.us.1
%p.0.us.1 = load i32, ptr %arrayidx51.us.1, align 4, !tbaa !5
%cmp41.not.us.1 = icmp eq i32 %p.0.us.1, -1
br i1 %cmp41.not.us.1, label %for.cond.cleanup43.us.loopexit.1, label %for.body44.us.1, !llvm.loop !11
for.cond.cleanup43.us.loopexit.1: ; preds = %for.body44.us.1
%15 = trunc i64 %indvars.iv.next111.1 to i32
br label %for.cond.cleanup43.us.1
for.cond.cleanup43.us.1: ; preds = %for.cond.cleanup43.us.loopexit.1, %for.body37.us.1
%i32.1.lcssa.us.1 = phi i32 [ %i32.096.us.1, %for.body37.us.1 ], [ %15, %for.cond.cleanup43.us.loopexit.1 ]
%indvars.iv.next114.1 = add nsw i64 %indvars.iv113.1, -1
%cmp34.us.1.not = icmp eq i64 %indvars.iv113.1, 0
br i1 %cmp34.us.1.not, label %for.cond.cleanup, label %for.body37.us.1, !llvm.loop !12
for.body37.us: ; preds = %for.body37.us.preheader, %for.cond.cleanup43.us
%indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.cond.cleanup43.us ], [ 511, %for.body37.us.preheader ]
%i32.096.us = phi i32 [ %i32.1.lcssa.us, %for.cond.cleanup43.us ], [ %sub, %for.body37.us.preheader ]
%arrayidx39.us = getelementptr inbounds i32, ptr %add.ptr, i64 %indvars.iv113
%p.091.us = load i32, ptr %arrayidx39.us, align 4, !tbaa !5
%cmp41.not92.us = icmp eq i32 %p.091.us, -1
br i1 %cmp41.not92.us, label %for.cond.cleanup43.us, label %for.body44.us.preheader
for.body44.us.preheader: ; preds = %for.body37.us
%16 = sext i32 %i32.096.us to i64
br label %for.body44.us
for.body44.us: ; preds = %for.body44.us.preheader, %for.body44.us
%indvars.iv110 = phi i64 [ %16, %for.body44.us.preheader ], [ %indvars.iv.next111, %for.body44.us ]
%p.094.us = phi i32 [ %p.091.us, %for.body44.us.preheader ], [ %p.0.us, %for.body44.us ]
%indvars.iv.next111 = add i64 %indvars.iv110, -1
%arrayidx46.us = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv110
%idxprom47.us = sext i32 %p.094.us to i64
%arrayidx48.us = getelementptr inbounds %struct.range, ptr %call, i64 %idxprom47.us
%17 = load i64, ptr %arrayidx48.us, align 4
store i64 %17, ptr %arrayidx46.us, align 4
%arrayidx51.us = getelementptr inbounds i32, ptr %call2, i64 %idxprom47.us
%p.0.us = load i32, ptr %arrayidx51.us, align 4, !tbaa !5
%cmp41.not.us = icmp eq i32 %p.0.us, -1
br i1 %cmp41.not.us, label %for.cond.cleanup43.us.loopexit, label %for.body44.us, !llvm.loop !11
for.cond.cleanup43.us.loopexit: ; preds = %for.body44.us
%18 = trunc i64 %indvars.iv.next111 to i32
br label %for.cond.cleanup43.us
for.cond.cleanup43.us: ; preds = %for.cond.cleanup43.us.loopexit, %for.body37.us
%i32.1.lcssa.us = phi i32 [ %i32.096.us, %for.body37.us ], [ %18, %for.cond.cleanup43.us.loopexit ]
%indvars.iv.next114 = add nsw i64 %indvars.iv113, -1
%cmp34.us.not = icmp eq i64 %indvars.iv113, 0
br i1 %cmp34.us.not, label %for.cond.cleanup36.us, label %for.body37.us, !llvm.loop !12
for.body14.us: ; preds = %for.body14.us, %for.cond4.preheader.us.preheader.new
%indvars.iv107 = phi i64 [ 0, %for.cond4.preheader.us.preheader.new ], [ %indvars.iv.next108.1126, %for.body14.us ]
%niter = phi i64 [ 0, %for.cond4.preheader.us.preheader.new ], [ %niter.next.1, %for.body14.us ]
%arrayidx16.us = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv107
%19 = load i64, ptr %arrayidx16.us, align 4
%v.sroa.2.0.extract.shift.i.us = lshr i64 %19, 32
%sub.i.us = sub i64 %v.sroa.2.0.extract.shift.i.us, %19
%and.i.us = and i64 %sub.i.us, 511
%arrayidx23.us = getelementptr inbounds i32, ptr %add.ptr, i64 %and.i.us
%20 = load i32, ptr %arrayidx23.us, align 4, !tbaa !5
%arrayidx25.us = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv107
store i32 %20, ptr %arrayidx25.us, align 4, !tbaa !5
%21 = trunc i64 %indvars.iv107 to i32
store i32 %21, ptr %arrayidx23.us, align 4, !tbaa !5
%indvars.iv.next108 = or i64 %indvars.iv107, 1
%arrayidx16.us.1120 = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv.next108
%22 = load i64, ptr %arrayidx16.us.1120, align 4
%v.sroa.2.0.extract.shift.i.us.1121 = lshr i64 %22, 32
%sub.i.us.1122 = sub i64 %v.sroa.2.0.extract.shift.i.us.1121, %22
%and.i.us.1123 = and i64 %sub.i.us.1122, 511
%arrayidx23.us.1124 = getelementptr inbounds i32, ptr %add.ptr, i64 %and.i.us.1123
%23 = load i32, ptr %arrayidx23.us.1124, align 4, !tbaa !5
%arrayidx25.us.1125 = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv.next108
store i32 %23, ptr %arrayidx25.us.1125, align 4, !tbaa !5
%24 = trunc i64 %indvars.iv.next108 to i32
store i32 %24, ptr %arrayidx23.us.1124, align 4, !tbaa !5
%indvars.iv.next108.1126 = add nuw nsw i64 %indvars.iv107, 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.body37.us.preheader.unr-lcssa, label %for.body14.us, !llvm.loop !9
for.body37.us.preheader.unr-lcssa: ; preds = %for.body14.us, %for.cond4.preheader.us.preheader
%indvars.iv107.unr = phi i64 [ 0, %for.cond4.preheader.us.preheader ], [ %indvars.iv.next108.1126, %for.body14.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body37.us.preheader, label %for.body14.us.epil
for.body14.us.epil: ; preds = %for.body37.us.preheader.unr-lcssa
%arrayidx16.us.epil = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv107.unr
%25 = load i64, ptr %arrayidx16.us.epil, align 4
%v.sroa.2.0.extract.shift.i.us.epil = lshr i64 %25, 32
%sub.i.us.epil = sub i64 %v.sroa.2.0.extract.shift.i.us.epil, %25
%and.i.us.epil = and i64 %sub.i.us.epil, 511
%arrayidx23.us.epil = getelementptr inbounds i32, ptr %add.ptr, i64 %and.i.us.epil
%26 = load i32, ptr %arrayidx23.us.epil, align 4, !tbaa !5
%arrayidx25.us.epil = getelementptr inbounds i32, ptr %call2, i64 %indvars.iv107.unr
store i32 %26, ptr %arrayidx25.us.epil, align 4, !tbaa !5
%27 = trunc i64 %indvars.iv107.unr to i32
store i32 %27, ptr %arrayidx23.us.epil, align 4, !tbaa !5
br label %for.body37.us.preheader
for.body37.us.preheader: ; preds = %for.body37.us.preheader.unr-lcssa, %for.body14.us.epil
br label %for.body37.us
for.cond.cleanup: ; preds = %for.cond.cleanup43.1, %for.cond.cleanup43.us.1
tail call void @free(ptr noundef %call) #10
tail call void @free(ptr noundef nonnull %call2) #10
ret void
for.cond.cleanup36: ; preds = %for.cond.cleanup43
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(2048) %add.ptr, i8 -1, i64 2048, i1 false), !tbaa !5
br label %for.body37.1
for.body37.1: ; preds = %for.cond.cleanup43.1, %for.cond.cleanup36
%indvars.iv101.1 = phi i64 [ 511, %for.cond.cleanup36 ], [ %indvars.iv.next102.1, %for.cond.cleanup43.1 ]
%i32.096.1 = phi i32 [ %sub, %for.cond.cleanup36 ], [ %i32.1.lcssa.1, %for.cond.cleanup43.1 ]
%arrayidx39.1 = getelementptr inbounds i32, ptr %add.ptr, i64 %indvars.iv101.1
%p.091.1 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5
%cmp41.not92.1 = icmp eq i32 %p.091.1, -1
br i1 %cmp41.not92.1, label %for.cond.cleanup43.1, label %for.body44.preheader.1
for.body44.preheader.1: ; preds = %for.body37.1
%28 = sext i32 %i32.096.1 to i64
br label %for.body44.1
for.body44.1: ; preds = %for.body44.1, %for.body44.preheader.1
%indvars.iv.1 = phi i64 [ %28, %for.body44.preheader.1 ], [ %indvars.iv.next.1, %for.body44.1 ]
%p.094.1 = phi i32 [ %p.091.1, %for.body44.preheader.1 ], [ %p.0.1, %for.body44.1 ]
%indvars.iv.next.1 = add i64 %indvars.iv.1, -1
%arrayidx46.1 = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv.1
%idxprom47.1 = sext i32 %p.094.1 to i64
%arrayidx48.1 = getelementptr inbounds %struct.range, ptr %call, i64 %idxprom47.1
%29 = load i64, ptr %arrayidx48.1, align 4
store i64 %29, ptr %arrayidx46.1, align 4
%arrayidx51.1 = getelementptr inbounds i32, ptr %call2, i64 %idxprom47.1
%p.0.1 = load i32, ptr %arrayidx51.1, align 4, !tbaa !5
%cmp41.not.1 = icmp eq i32 %p.0.1, -1
br i1 %cmp41.not.1, label %for.cond.cleanup43.loopexit.1, label %for.body44.1, !llvm.loop !11
for.cond.cleanup43.loopexit.1: ; preds = %for.body44.1
%30 = trunc i64 %indvars.iv.next.1 to i32
br label %for.cond.cleanup43.1
for.cond.cleanup43.1: ; preds = %for.cond.cleanup43.loopexit.1, %for.body37.1
%i32.1.lcssa.1 = phi i32 [ %i32.096.1, %for.body37.1 ], [ %30, %for.cond.cleanup43.loopexit.1 ]
%indvars.iv.next102.1 = add nsw i64 %indvars.iv101.1, -1
%cmp34.1.not = icmp eq i64 %indvars.iv101.1, 0
br i1 %cmp34.1.not, label %for.cond.cleanup, label %for.body37.1, !llvm.loop !12
for.body37: ; preds = %for.cond4.preheader.preheader, %for.cond.cleanup43
%indvars.iv101 = phi i64 [ 511, %for.cond4.preheader.preheader ], [ %indvars.iv.next102, %for.cond.cleanup43 ]
%i32.096 = phi i32 [ %sub, %for.cond4.preheader.preheader ], [ %i32.1.lcssa, %for.cond.cleanup43 ]
%arrayidx39 = getelementptr inbounds i32, ptr %add.ptr, i64 %indvars.iv101
%p.091 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%cmp41.not92 = icmp eq i32 %p.091, -1
br i1 %cmp41.not92, label %for.cond.cleanup43, label %for.body44.preheader
for.body44.preheader: ; preds = %for.body37
%31 = sext i32 %i32.096 to i64
br label %for.body44
for.cond.cleanup43.loopexit: ; preds = %for.body44
%32 = trunc i64 %indvars.iv.next to i32
br label %for.cond.cleanup43
for.cond.cleanup43: ; preds = %for.cond.cleanup43.loopexit, %for.body37
%i32.1.lcssa = phi i32 [ %i32.096, %for.body37 ], [ %32, %for.cond.cleanup43.loopexit ]
%indvars.iv.next102 = add nsw i64 %indvars.iv101, -1
%cmp34.not = icmp eq i64 %indvars.iv101, 0
br i1 %cmp34.not, label %for.cond.cleanup36, label %for.body37, !llvm.loop !12
for.body44: ; preds = %for.body44.preheader, %for.body44
%indvars.iv = phi i64 [ %31, %for.body44.preheader ], [ %indvars.iv.next, %for.body44 ]
%p.094 = phi i32 [ %p.091, %for.body44.preheader ], [ %p.0, %for.body44 ]
%indvars.iv.next = add i64 %indvars.iv, -1
%arrayidx46 = getelementptr inbounds %struct.range, ptr %a, i64 %indvars.iv
%idxprom47 = sext i32 %p.094 to i64
%arrayidx48 = getelementptr inbounds %struct.range, ptr %call, i64 %idxprom47
%33 = load i64, ptr %arrayidx48, align 4
store i64 %33, ptr %arrayidx46, align 4
%arrayidx51 = getelementptr inbounds i32, ptr %call2, i64 %idxprom47
%p.0 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%cmp41.not = icmp eq i32 %p.0, -1
br i1 %cmp41.not, label %for.cond.cleanup43.loopexit, label %for.body44, !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: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @add(ptr nocapture noundef %bit, i32 noundef %x, i32 noundef %v) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %bit, align 4, !tbaa !5
%cmp.not8 = icmp slt i32 %0, %x
br i1 %cmp.not8, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %add2, %for.body ], [ %x, %entry ]
%idxprom = sext i32 %i.09 to i64
%arrayidx1 = getelementptr inbounds i32, ptr %bit, i64 %idxprom
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%add = add nsw i32 %1, %v
store i32 %add, ptr %arrayidx1, align 4, !tbaa !5
%sub = sub nsw i32 0, %i.09
%and = and i32 %i.09, %sub
%add2 = add nsw i32 %and, %i.09
%cmp.not = icmp sgt i32 %add2, %0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @find(ptr nocapture noundef readonly %bit, i32 noundef %x) local_unnamed_addr #6 {
entry:
%cmp7 = icmp sgt i32 %x, 0
br i1 %cmp7, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ]
ret i32 %sum.0.lcssa
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %sub1, %for.body ], [ %x, %entry ]
%sum.08 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%idxprom = zext i32 %i.09 to i64
%arrayidx = getelementptr inbounds i32, ptr %bit, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %0, %sum.08
%sub.not = add nsw i32 %i.09, -1
%sub1 = and i32 %sub.not, %i.09
%cmp.not = icmp eq i32 %sub1, 0
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !14
}
; Function Attrs: nounwind uwtable
define dso_local void @run() local_unnamed_addr #0 {
entry:
%s.i = alloca [20 x i32], align 16
%0 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i.i = tail call i32 @getc(ptr noundef %0)
%1 = add i32 %call.i.i, -58
%2 = icmp ult i32 %1, -10
br i1 %2, label %while.body.i, label %while.body8.preheader.i
while.cond3.preheader.loopexit.i: ; preds = %while.body.i
%3 = icmp eq i32 %c.023.i, 45
br label %while.body8.preheader.i
while.body8.preheader.i: ; preds = %while.cond3.preheader.loopexit.i, %entry
%prev.0.lcssa.i = phi i1 [ false, %entry ], [ %3, %while.cond3.preheader.loopexit.i ]
%c.0.lcssa.i = phi i32 [ %call.i.i, %entry ], [ %call.i21.i, %while.cond3.preheader.loopexit.i ]
br label %while.body8.i
while.body.i: ; preds = %entry, %while.body.i
%c.023.i = phi i32 [ %call.i21.i, %while.body.i ], [ %call.i.i, %entry ]
%4 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i21.i = tail call i32 @getc(ptr noundef %4)
%5 = add i32 %call.i21.i, -58
%6 = icmp ult i32 %5, -10
br i1 %6, label %while.body.i, label %while.cond3.preheader.loopexit.i, !llvm.loop !17
while.body8.i: ; preds = %while.body8.i, %while.body8.preheader.i
%res.026.i = phi i64 [ %sub.i, %while.body8.i ], [ 0, %while.body8.preheader.i ]
%c.125.i = phi i32 [ %call.i22.i, %while.body8.i ], [ %c.0.lcssa.i, %while.body8.preheader.i ]
%mul.i = mul nsw i64 %res.026.i, 10
%conv.i = zext i32 %c.125.i to i64
%add.i = add i64 %mul.i, -48
%sub.i = add i64 %add.i, %conv.i
%7 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i22.i = tail call i32 @getc(ptr noundef %7)
%8 = add i32 %call.i22.i, -48
%9 = icmp ult i32 %8, 10
br i1 %9, label %while.body8.i, label %read_int.exit, !llvm.loop !18
read_int.exit: ; preds = %while.body8.i
%sub13.i = sub nsw i64 0, %sub.i
%cond.i = select i1 %prev.0.lcssa.i, i64 %sub13.i, i64 %sub.i
%conv = trunc i64 %cond.i to i32
%10 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i.i93 = tail call i32 @getc(ptr noundef %10)
%11 = add i32 %call.i.i93, -58
%12 = icmp ult i32 %11, -10
br i1 %12, label %while.body.i107, label %while.body8.preheader.i94
while.cond3.preheader.loopexit.i110: ; preds = %while.body.i107
%13 = icmp eq i32 %c.023.i108, 45
br label %while.body8.preheader.i94
while.body8.preheader.i94: ; preds = %while.cond3.preheader.loopexit.i110, %read_int.exit
%prev.0.lcssa.i95 = phi i1 [ false, %read_int.exit ], [ %13, %while.cond3.preheader.loopexit.i110 ]
%c.0.lcssa.i96 = phi i32 [ %call.i.i93, %read_int.exit ], [ %call.i21.i109, %while.cond3.preheader.loopexit.i110 ]
br label %while.body8.i97
while.body.i107: ; preds = %read_int.exit, %while.body.i107
%c.023.i108 = phi i32 [ %call.i21.i109, %while.body.i107 ], [ %call.i.i93, %read_int.exit ]
%14 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i21.i109 = tail call i32 @getc(ptr noundef %14)
%15 = add i32 %call.i21.i109, -58
%16 = icmp ult i32 %15, -10
br i1 %16, label %while.body.i107, label %while.cond3.preheader.loopexit.i110, !llvm.loop !17
while.body8.i97: ; preds = %while.body8.i97, %while.body8.preheader.i94
%res.026.i98 = phi i64 [ %sub.i103, %while.body8.i97 ], [ 0, %while.body8.preheader.i94 ]
%c.125.i99 = phi i32 [ %call.i22.i104, %while.body8.i97 ], [ %c.0.lcssa.i96, %while.body8.preheader.i94 ]
%mul.i100 = mul nsw i64 %res.026.i98, 10
%conv.i101 = zext i32 %c.125.i99 to i64
%add.i102 = add i64 %mul.i100, -48
%sub.i103 = add i64 %add.i102, %conv.i101
%17 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i22.i104 = tail call i32 @getc(ptr noundef %17)
%18 = add i32 %call.i22.i104, -48
%19 = icmp ult i32 %18, 10
br i1 %19, label %while.body8.i97, label %read_int.exit111, !llvm.loop !18
read_int.exit111: ; preds = %while.body8.i97
%sub13.i105 = sub nsw i64 0, %sub.i103
%cond.i106 = select i1 %prev.0.lcssa.i95, i64 %sub13.i105, i64 %sub.i103
%conv2 = trunc i64 %cond.i106 to i32
%sext = shl i64 %cond.i, 32
%conv3 = ashr exact i64 %sext, 32
%call4 = tail call noalias ptr @calloc(i64 noundef %conv3, i64 noundef 8) #9
%cmp175 = icmp sgt i32 %conv, 0
br i1 %cmp175, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %read_int.exit111
%wide.trip.count = and i64 %cond.i, 4294967295
br label %for.body
for.cond.cleanup: ; preds = %read_int.exit149, %read_int.exit111
tail call void @radix_sort(ptr noundef %call4, i32 noundef %conv)
%add12 = shl i64 %cond.i106, 32
%sext92 = add i64 %add12, 8589934592
%conv13 = ashr exact i64 %sext92, 32
%call14 = tail call noalias ptr @calloc(i64 noundef %conv13, i64 noundef 4) #9
%add15 = add i32 %conv2, 1
store i32 %add15, ptr %call14, align 4, !tbaa !5
%cmp19.not184 = icmp slt i32 %conv2, 1
br i1 %cmp19.not184, label %for.cond.cleanup21, label %for.cond23.preheader.preheader
for.cond23.preheader.preheader: ; preds = %for.cond.cleanup
%sext193 = shl i64 %cond.i, 32
%20 = ashr exact i64 %sext193, 32
br label %for.cond23.preheader
for.body: ; preds = %for.body.preheader, %read_int.exit149
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %read_int.exit149 ]
%21 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i.i112 = tail call i32 @getc(ptr noundef %21)
%22 = add i32 %call.i.i112, -58
%23 = icmp ult i32 %22, -10
br i1 %23, label %while.body.i126, label %while.body8.preheader.i113
while.cond3.preheader.loopexit.i129: ; preds = %while.body.i126
%24 = icmp eq i32 %c.023.i127, 45
br label %while.body8.preheader.i113
while.body8.preheader.i113: ; preds = %while.cond3.preheader.loopexit.i129, %for.body
%prev.0.lcssa.i114 = phi i1 [ false, %for.body ], [ %24, %while.cond3.preheader.loopexit.i129 ]
%c.0.lcssa.i115 = phi i32 [ %call.i.i112, %for.body ], [ %call.i21.i128, %while.cond3.preheader.loopexit.i129 ]
br label %while.body8.i116
while.body.i126: ; preds = %for.body, %while.body.i126
%c.023.i127 = phi i32 [ %call.i21.i128, %while.body.i126 ], [ %call.i.i112, %for.body ]
%25 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i21.i128 = tail call i32 @getc(ptr noundef %25)
%26 = add i32 %call.i21.i128, -58
%27 = icmp ult i32 %26, -10
br i1 %27, label %while.body.i126, label %while.cond3.preheader.loopexit.i129, !llvm.loop !17
while.body8.i116: ; preds = %while.body8.i116, %while.body8.preheader.i113
%res.026.i117 = phi i32 [ %sub.i122, %while.body8.i116 ], [ 0, %while.body8.preheader.i113 ]
%c.125.i118 = phi i32 [ %call.i22.i123, %while.body8.i116 ], [ %c.0.lcssa.i115, %while.body8.preheader.i113 ]
%mul.i119 = mul i32 %res.026.i117, 10
%add.i121 = add nsw i32 %c.125.i118, -48
%sub.i122 = add i32 %add.i121, %mul.i119
%28 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i22.i123 = tail call i32 @getc(ptr noundef %28)
%29 = add i32 %call.i22.i123, -48
%30 = icmp ult i32 %29, 10
br i1 %30, label %while.body8.i116, label %read_int.exit130, !llvm.loop !18
read_int.exit130: ; preds = %while.body8.i116
%sub13.i124 = sub i32 0, %sub.i122
%cond.i125 = select i1 %prev.0.lcssa.i114, i32 %sub13.i124, i32 %sub.i122
%arrayidx = getelementptr inbounds %struct.range, ptr %call4, i64 %indvars.iv
store i32 %cond.i125, ptr %arrayidx, align 4, !tbaa !19
%31 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i.i131 = tail call i32 @getc(ptr noundef %31)
%32 = add i32 %call.i.i131, -58
%33 = icmp ult i32 %32, -10
br i1 %33, label %while.body.i145, label %while.body8.preheader.i132
while.cond3.preheader.loopexit.i148: ; preds = %while.body.i145
%34 = icmp eq i32 %c.023.i146, 45
br label %while.body8.preheader.i132
while.body8.preheader.i132: ; preds = %while.cond3.preheader.loopexit.i148, %read_int.exit130
%prev.0.lcssa.i133 = phi i1 [ false, %read_int.exit130 ], [ %34, %while.cond3.preheader.loopexit.i148 ]
%c.0.lcssa.i134 = phi i32 [ %call.i.i131, %read_int.exit130 ], [ %call.i21.i147, %while.cond3.preheader.loopexit.i148 ]
br label %while.body8.i135
while.body.i145: ; preds = %read_int.exit130, %while.body.i145
%c.023.i146 = phi i32 [ %call.i21.i147, %while.body.i145 ], [ %call.i.i131, %read_int.exit130 ]
%35 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i21.i147 = tail call i32 @getc(ptr noundef %35)
%36 = add i32 %call.i21.i147, -58
%37 = icmp ult i32 %36, -10
br i1 %37, label %while.body.i145, label %while.cond3.preheader.loopexit.i148, !llvm.loop !17
while.body8.i135: ; preds = %while.body8.i135, %while.body8.preheader.i132
%res.026.i136 = phi i32 [ %sub.i141, %while.body8.i135 ], [ 0, %while.body8.preheader.i132 ]
%c.125.i137 = phi i32 [ %call.i22.i142, %while.body8.i135 ], [ %c.0.lcssa.i134, %while.body8.preheader.i132 ]
%mul.i138 = mul i32 %res.026.i136, 10
%add.i140 = add nsw i32 %c.125.i137, -48
%sub.i141 = add i32 %add.i140, %mul.i138
%38 = load ptr, ptr @stdin, align 8, !tbaa !15
%call.i22.i142 = tail call i32 @getc(ptr noundef %38)
%39 = add i32 %call.i22.i142, -48
%40 = icmp ult i32 %39, 10
br i1 %40, label %while.body8.i135, label %read_int.exit149, !llvm.loop !18
read_int.exit149: ; preds = %while.body8.i135
%sub13.i143 = sub i32 0, %sub.i141
%cond.i144 = select i1 %prev.0.lcssa.i133, i32 %sub13.i143, i32 %sub.i141
%conv9 = add i32 %cond.i144, 1
%r = getelementptr inbounds %struct.range, ptr %call4, i64 %indvars.iv, i32 1
store i32 %conv9, ptr %r, align 4, !tbaa !21
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !22
for.cond23.preheader: ; preds = %for.cond23.preheader.preheader, %print_int.exit
%i17.0186 = phi i32 [ %i17.1.lcssa, %print_int.exit ], [ 0, %for.cond23.preheader.preheader ]
%d.0185 = phi i32 [ %inc58, %print_int.exit ], [ 1, %for.cond23.preheader.preheader ]
%cmp24177 = icmp slt i32 %i17.0186, %conv
br i1 %cmp24177, label %land.rhs.preheader, label %for.body.i169.preheader.preheader
land.rhs.preheader: ; preds = %for.cond23.preheader
%41 = sext i32 %i17.0186 to i64
br label %land.rhs
for.cond.cleanup21: ; preds = %print_int.exit, %for.cond.cleanup
ret void
land.rhs: ; preds = %land.rhs.preheader, %add.exit162
%indvars.iv188 = phi i64 [ %41, %land.rhs.preheader ], [ %indvars.iv.next189, %add.exit162 ]
%arrayidx27 = getelementptr inbounds %struct.range, ptr %call4, i64 %indvars.iv188
%r28 = getelementptr inbounds %struct.range, ptr %call4, i64 %indvars.iv188, i32 1
%42 = load i32, ptr %r28, align 4, !tbaa !21
%43 = load i32, ptr %arrayidx27, align 4, !tbaa !19
%sub = sub nsw i32 %42, %43
%cmp32 = icmp slt i32 %sub, %d.0185
br i1 %cmp32, label %for.body34, label %for.body.i169.preheader.preheader.loopexit.split.loop.exit
for.body34: ; preds = %land.rhs
%44 = load i32, ptr %call14, align 4, !tbaa !5
%cmp.not8.i = icmp slt i32 %44, %43
br i1 %cmp.not8.i, label %add.exit, label %for.body.i
for.body.i: ; preds = %for.body34, %for.body.i
%i.09.i = phi i32 [ %add2.i, %for.body.i ], [ %43, %for.body34 ]
%idxprom.i = sext i32 %i.09.i to i64
%arrayidx1.i = getelementptr inbounds i32, ptr %call14, i64 %idxprom.i
%45 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
%add.i150 = add nsw i32 %45, 1
store i32 %add.i150, ptr %arrayidx1.i, align 4, !tbaa !5
%sub.i151 = sub nsw i32 0, %i.09.i
%and.i = and i32 %i.09.i, %sub.i151
%add2.i = add nsw i32 %and.i, %i.09.i
%cmp.not.i = icmp sgt i32 %add2.i, %44
br i1 %cmp.not.i, label %add.exit.loopexit, label %for.body.i, !llvm.loop !13
add.exit.loopexit: ; preds = %for.body.i
%.pre = load i32, ptr %call14, align 4, !tbaa !5
br label %add.exit
add.exit: ; preds = %add.exit.loopexit, %for.body34
%46 = phi i32 [ %.pre, %add.exit.loopexit ], [ %44, %for.body34 ]
%cmp.not8.i152 = icmp slt i32 %46, %42
br i1 %cmp.not8.i152, label %add.exit162, label %for.body.i153
for.body.i153: ; preds = %add.exit, %for.body.i153
%i.09.i154 = phi i32 [ %add2.i160, %for.body.i153 ], [ %42, %add.exit ]
%idxprom.i155 = sext i32 %i.09.i154 to i64
%arrayidx1.i156 = getelementptr inbounds i32, ptr %call14, i64 %idxprom.i155
%47 = load i32, ptr %arrayidx1.i156, align 4, !tbaa !5
%add.i157 = add nsw i32 %47, -1
store i32 %add.i157, ptr %arrayidx1.i156, align 4, !tbaa !5
%sub.i158 = sub nsw i32 0, %i.09.i154
%and.i159 = and i32 %i.09.i154, %sub.i158
%add2.i160 = add nsw i32 %and.i159, %i.09.i154
%cmp.not.i161 = icmp sgt i32 %add2.i160, %46
br i1 %cmp.not.i161, label %add.exit162, label %for.body.i153, !llvm.loop !13
add.exit162: ; preds = %for.body.i153, %add.exit
%indvars.iv.next189 = add nsw i64 %indvars.iv188, 1
%exitcond191.not = icmp eq i64 %indvars.iv.next189, %20
br i1 %exitcond191.not, label %for.body.i169.preheader.preheader, label %land.rhs, !llvm.loop !23
for.body.i169.preheader.preheader.loopexit.split.loop.exit: ; preds = %land.rhs
%48 = trunc i64 %indvars.iv188 to i32
br label %for.body.i169.preheader.preheader
for.body.i169.preheader.preheader: ; preds = %add.exit162, %for.body.i169.preheader.preheader.loopexit.split.loop.exit, %for.cond23.preheader
%i17.1.lcssa = phi i32 [ %i17.0186, %for.cond23.preheader ], [ %48, %for.body.i169.preheader.preheader.loopexit.split.loop.exit ], [ %conv, %add.exit162 ]
%sub44 = sub nsw i32 %conv, %i17.1.lcssa
br label %for.body.i169.preheader
for.body.i169.preheader: ; preds = %for.body.i169.preheader.preheader, %find.exit
%j.0182 = phi i32 [ %add53, %find.exit ], [ %d.0185, %for.body.i169.preheader.preheader ]
%ans.0181 = phi i32 [ %add51, %find.exit ], [ %sub44, %for.body.i169.preheader.preheader ]
br label %for.body.i169
for.cond.cleanup48: ; preds = %find.exit
%conv55 = sext i32 %add51 to i64
%cmp.i = icmp slt i32 %add51, 0
br i1 %cmp.i, label %if.end.thread.i, label %if.end.i
if.end.thread.i: ; preds = %for.cond.cleanup48
%49 = load ptr, ptr @stdout, align 8, !tbaa !15
%call.i.i167 = tail call i32 @putc(i32 noundef 45, ptr noundef %49)
%sub.i168 = sub nsw i64 0, %conv55
br label %while.body.preheader.i
if.end.i: ; preds = %for.cond.cleanup48
%cmp1.i = icmp eq i32 %add51, 0
br i1 %cmp1.i, label %if.then2.i, label %while.body.preheader.i
if.then2.i: ; preds = %if.end.i
%50 = load ptr, ptr @stdout, align 8, !tbaa !15
%call.i21.i166 = tail call i32 @putc(i32 noundef 48, ptr noundef %50)
br label %print_int.exit
while.body.preheader.i: ; preds = %if.end.i, %if.end.thread.i
%n.addr.025.i = phi i64 [ %sub.i168, %if.end.thread.i ], [ %conv55, %if.end.i ]
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %s.i) #10
br label %while.body.i163
while.cond6.preheader.i: ; preds = %while.body.i163
%51 = trunc i64 %indvars.iv.next.i to i32
%cmp729.i = icmp sgt i32 %51, 0
br i1 %cmp729.i, label %while.body9.preheader.i, label %while.end13.i
while.body9.preheader.i: ; preds = %while.cond6.preheader.i
%52 = and i64 %indvars.iv.next.i, 4294967295
br label %while.body9.i
while.body.i163: ; preds = %while.body.i163, %while.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %while.body.preheader.i ], [ %indvars.iv.next.i, %while.body.i163 ]
%n.addr.127.i = phi i64 [ %n.addr.025.i, %while.body.preheader.i ], [ %div.i, %while.body.i163 ]
%rem.i = urem i64 %n.addr.127.i, 10
%53 = trunc i64 %rem.i to i32
%conv.i164 = or i32 %53, 48
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%arrayidx.i = getelementptr inbounds [20 x i32], ptr %s.i, i64 0, i64 %indvars.iv.i
store i32 %conv.i164, ptr %arrayidx.i, align 4, !tbaa !5
%div.i = udiv i64 %n.addr.127.i, 10
%cmp5.not.i = icmp ult i64 %n.addr.127.i, 10
br i1 %cmp5.not.i, label %while.cond6.preheader.i, label %while.body.i163, !llvm.loop !24
while.body9.i: ; preds = %while.body9.i, %while.body9.preheader.i
%indvars.iv32.i = phi i64 [ %52, %while.body9.preheader.i ], [ %indvars.iv.next33.i, %while.body9.i ]
%indvars.iv.next33.i = add nsw i64 %indvars.iv32.i, -1
%idxprom10.i = and i64 %indvars.iv.next33.i, 4294967295
%arrayidx11.i = getelementptr inbounds [20 x i32], ptr %s.i, i64 0, i64 %idxprom10.i
%54 = load i32, ptr %arrayidx11.i, align 4, !tbaa !5
%55 = load ptr, ptr @stdout, align 8, !tbaa !15
%call.i22.i165 = tail call i32 @putc(i32 noundef %54, ptr noundef %55)
%cmp7.i = icmp ugt i64 %indvars.iv32.i, 1
br i1 %cmp7.i, label %while.body9.i, label %while.end13.i, !llvm.loop !25
while.end13.i: ; preds = %while.body9.i, %while.cond6.preheader.i
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %s.i) #10
br label %print_int.exit
print_int.exit: ; preds = %if.then2.i, %while.end13.i
%56 = load ptr, ptr @stdout, align 8, !tbaa !15
%call.i = tail call i32 @putc(i32 noundef 10, ptr noundef %56)
%inc58 = add nuw i32 %d.0185, 1
%exitcond192.not = icmp eq i32 %d.0185, %conv2
br i1 %exitcond192.not, label %for.cond.cleanup21, label %for.cond23.preheader, !llvm.loop !26
for.body.i169: ; preds = %for.body.i169.preheader, %for.body.i169
%i.09.i170 = phi i32 [ %sub1.i, %for.body.i169 ], [ %j.0182, %for.body.i169.preheader ]
%sum.08.i = phi i32 [ %add.i173, %for.body.i169 ], [ 0, %for.body.i169.preheader ]
%idxprom.i171 = zext i32 %i.09.i170 to i64
%arrayidx.i172 = getelementptr inbounds i32, ptr %call14, i64 %idxprom.i171
%57 = load i32, ptr %arrayidx.i172, align 4, !tbaa !5
%add.i173 = add nsw i32 %57, %sum.08.i
%sub.not.i = add nsw i32 %i.09.i170, -1
%sub1.i = and i32 %sub.not.i, %i.09.i170
%cmp.not.i174 = icmp eq i32 %sub1.i, 0
br i1 %cmp.not.i174, label %find.exit, label %for.body.i169, !llvm.loop !14
find.exit: ; preds = %for.body.i169
%add51 = add nsw i32 %add.i173, %ans.0181
%add53 = add nuw nsw i32 %j.0182, %d.0185
%cmp46.not = icmp sgt i32 %add53, %conv2
br i1 %cmp46.not, label %for.cond.cleanup48, label %for.body.i169.preheader, !llvm.loop !27
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
tail call void @run()
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind allocsize(0,1) }
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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 0}
!20 = !{!"range", !6, i64 0, !6, i64 4}
!21 = !{!20, !6, i64 4}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
|
#include<stdio.h>
int main(){
int H,W,i,j;
while(1){
scanf("%d %d",&H,&W);
if(H==0 && W==0) break;
for(i=0;i<H;i++){
for(j=0;j<W;j++){
if((i+j)%2==0)printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217263/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217263/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp28 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp129 = icmp eq i32 %1, 0
%or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false
br i1 %or.cond30, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp225 = icmp sgt i32 %2, 0
br i1 %cmp225, label %for.cond3.preheader, label %for.end14
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.026 = phi i32 [ %inc13, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.024 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%add = add nuw nsw i32 %j.024, %i.026
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar22 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.024, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar20 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %i.026, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc13, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int a,b,i,j;
while(1)
{
scanf("%d%d",&a,&b);
if(a==0&&b==0){break;}
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
{
if(j%2==1)
{
if(i%2==1)printf("#");
else printf(".");
}
else
{
if(i%2==1)printf(".");
else printf("#");
}
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217313/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217313/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call54 = 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
%cmp55 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp156 = icmp eq i32 %1, 0
%or.cond57 = select i1 %cmp55, i1 %cmp156, i1 false
br i1 %or.cond57, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end26
%2 = phi i32 [ %7, %for.end26 ], [ %0, %entry ]
%cmp2.not52 = icmp slt i32 %2, 1
br i1 %cmp2.not52, label %for.end26, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.053 = phi i32 [ %inc25, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not38 = icmp slt i32 %3, 1
br i1 %cmp4.not38, label %for.end, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%rem8 = and i32 %i.053, 1
%cmp9.not = icmp eq i32 %rem8, 0
br i1 %cmp9.not, label %for.body5.us.us, label %for.body5
for.body5.us.us: ; preds = %for.body5.lr.ph, %for.body5.us.us
%j.039.us.us = phi i32 [ %inc.us.us, %for.body5.us.us ], [ 1, %for.body5.lr.ph ]
%rem.us.us = and i32 %j.039.us.us, 1
%cmp6.not.us.us = icmp eq i32 %rem.us.us, 0
%. = select i1 %cmp6.not.us.us, i32 35, i32 46
%putchar34.us.us = call i32 @putchar(i32 %.)
%inc.us.us = add nuw nsw i32 %j.039.us.us, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not.us.us.not = icmp slt i32 %j.039.us.us, %4
br i1 %cmp4.not.us.us.not, label %for.body5.us.us, label %for.end, !llvm.loop !9
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%j.039 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body5.lr.ph ]
%rem = and i32 %j.039, 1
%cmp6.not = icmp eq i32 %rem, 0
%.63 = select i1 %cmp6.not, i32 46, i32 35
%putchar37 = call i32 @putchar(i32 %.63)
%inc = add nuw nsw i32 %j.039, 1
%5 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.039, %5
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body5.us.us, %for.cond3.preheader
%putchar33 = call i32 @putchar(i32 10)
%inc25 = add i32 %i.053, 1
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %inc25, %6
br i1 %cmp2.not, label %for.end26, label %for.cond3.preheader, !llvm.loop !11
for.end26: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%7 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
%8 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end26, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int h, w, i, j;
while (scanf("%d%d", &h, &w) && h != 0 && w != 0){
for (i = 0; i < h; i++){
for (j = 0; j < w; j++){
if ((i + j) % 2 == 0){
printf("#");
}
else{
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217357/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217357/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%tobool27 = icmp ne i32 %call26, 0
%0 = load i32, ptr %h, align 4
%cmp28 = icmp ne i32 %0, 0
%or.cond29 = select i1 %tobool27, i1 %cmp28, i1 false
%1 = load i32, ptr %w, align 4
%cmp130 = icmp ne i32 %1, 0
%or.cond1431 = select i1 %or.cond29, i1 %cmp130, i1 false
br i1 %or.cond1431, label %for.cond.preheader, label %while.end
for.cond.preheader: ; preds = %entry, %for.end12
%2 = phi i32 [ %6, %for.end12 ], [ %0, %entry ]
%cmp224 = icmp sgt i32 %2, 0
br i1 %cmp224, label %for.cond3.preheader, label %for.end12
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.025 = phi i32 [ %inc11, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp422 = icmp sgt i32 %3, 0
br i1 %cmp422, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.023 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%add = add nuw nsw i32 %j.023, %i.025
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar21 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.023, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar19 = call i32 @putchar(i32 10)
%inc11 = add nuw nsw i32 %i.025, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc11, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%tobool = icmp ne i32 %call, 0
%6 = load i32, ptr %h, align 4
%cmp = icmp ne i32 %6, 0
%or.cond = select i1 %tobool, i1 %cmp, i1 false
%7 = load i32, ptr %w, align 4
%cmp1 = icmp ne i32 %7, 0
%or.cond14 = select i1 %or.cond, i1 %cmp1, i1 false
br i1 %or.cond14, label %for.cond.preheader, label %while.end, !llvm.loop !12
while.end: ; preds = %for.end12, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
int i;
int a[2003];
for (i = 0; i < 2 * n; i++)
scanf("%d", &a[i]);
int x;
for (i = 0; i < 2 * n - 1; i++)
{
if (a[i] > a[i + 1])
{
x = a[i];
a[i] = a[i + 1];
a[i + 1] = x;
if (i > 0)
i -= 2;
}
}
if (a[0] == a[2 * n - 1])
printf("-1\n");
else
{
printf("%d", a[0]);
for (i = 1; i < 2 * n; i++)
printf(" %d", a[i]);
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21740/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21740/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [2003 x i32], align 16
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)
call void @llvm.lifetime.start.p0(i64 8012, ptr nonnull %a) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%mul67 = shl nsw i32 %0, 1
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%mul.lcssa = phi i32 [ %mul67, %entry ], [ %mul, %for.body ]
%sub = add nsw i32 %mul.lcssa, -1
%cmp470 = icmp sgt i32 %mul.lcssa, 1
br i1 %cmp470, label %for.body5, label %for.end27
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%mul = shl nsw i32 %1, 1
%2 = sext i32 %mul to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body5: ; preds = %for.cond2.preheader, %for.inc25
%i.171 = phi i32 [ %inc26.pre-phi, %for.inc25 ], [ 0, %for.cond2.preheader ]
%idxprom6 = sext i32 %i.171 to i64
%arrayidx7 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %idxprom6
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %i.171, 1
%idxprom8 = sext i32 %add to i64
%arrayidx9 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %idxprom8
%4 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %3, %4
br i1 %cmp10, label %if.then, label %for.inc25
if.then: ; preds = %for.body5
store i32 %4, ptr %arrayidx7, align 4, !tbaa !5
store i32 %3, ptr %arrayidx9, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %i.171, 0
%sub23 = add nsw i32 %i.171, -2
%spec.select = select i1 %cmp21, i32 %sub23, i32 %i.171
%.pre = add nsw i32 %spec.select, 1
br label %for.inc25
for.inc25: ; preds = %if.then, %for.body5
%inc26.pre-phi = phi i32 [ %.pre, %if.then ], [ %add, %for.body5 ]
%cmp4 = icmp slt i32 %inc26.pre-phi, %sub
br i1 %cmp4, label %for.body5, label %for.end27, !llvm.loop !11
for.end27: ; preds = %for.inc25, %for.cond2.preheader
%5 = load i32, ptr %a, align 16, !tbaa !5
%idxprom31 = sext i32 %sub to i64
%arrayidx32 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %idxprom31
%6 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%cmp33 = icmp eq i32 %5, %6
br i1 %cmp33, label %if.then34, label %if.else
if.then34: ; preds = %for.end27
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end49
if.else: ; preds = %for.end27
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp4074 = icmp sgt i32 %7, 0
br i1 %cmp4074, label %for.body41, label %for.end47
for.body41: ; preds = %if.else, %for.body41
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.body41 ], [ 1, %if.else ]
%arrayidx43 = getelementptr inbounds [2003 x i32], ptr %a, i64 0, i64 %indvars.iv78
%8 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%mul39 = shl nsw i32 %9, 1
%10 = sext i32 %mul39 to i64
%cmp40 = icmp slt i64 %indvars.iv.next79, %10
br i1 %cmp40, label %for.body41, label %for.end47, !llvm.loop !12
for.end47: ; preds = %for.body41, %if.else
%putchar = call i32 @putchar(i32 10)
br label %if.end49
if.end49: ; preds = %for.end47, %if.then34
call void @llvm.lifetime.end.p0(i64 8012, 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 @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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void)
{
int tate[100];
int yoko[100];
int a=0;
int i=0;
int j,l;
for (;;) {
scanf("%d%d",&tate[i],&yoko[i]);
if (tate[i]==0 && yoko[i]==0) break;
a++;
i++;
}
for (i=0; i<a; i++) {
for (j=0; j<tate[i]; j++) {
for (l=0; l<yoko[i]; l++) {
if ((j+l)%2==0) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217443/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217443/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%tate = alloca [100 x i32], align 16
%yoko = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %tate) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %yoko) #4
br label %for.cond
for.cond: ; preds = %if.end, %entry
%indvars.iv64 = phi i32 [ %indvars.iv.next65, %if.end ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %tate, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100 x i32], ptr %yoko, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %for.cond
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp7 = icmp eq i32 %1, 0
br i1 %cmp7, label %for.cond9.preheader, label %if.end
for.cond9.preheader: ; preds = %land.lhs.true
%2 = and i64 %indvars.iv, 4294967295
%cmp1056.not = icmp eq i64 %2, 0
br i1 %cmp1056.not, label %for.end35, label %for.cond11.preheader.preheader
for.cond11.preheader.preheader: ; preds = %for.cond9.preheader
%wide.trip.count = zext i32 %indvars.iv64 to i64
br label %for.cond11.preheader
if.end: ; preds = %land.lhs.true, %for.cond
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next65 = add nuw i32 %indvars.iv64, 1
br label %for.cond
for.cond11.preheader: ; preds = %for.cond11.preheader.preheader, %for.end31
%indvars.iv61 = phi i64 [ 0, %for.cond11.preheader.preheader ], [ %indvars.iv.next62, %for.end31 ]
%arrayidx13 = getelementptr inbounds [100 x i32], ptr %tate, i64 0, i64 %indvars.iv61
%3 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp1454 = icmp sgt i32 %3, 0
br i1 %cmp1454, label %for.cond16.preheader.lr.ph, label %for.end31
for.cond16.preheader.lr.ph: ; preds = %for.cond11.preheader
%arrayidx18 = getelementptr inbounds [100 x i32], ptr %yoko, i64 0, i64 %indvars.iv61
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.lr.ph, %for.end27
%j.055 = phi i32 [ 0, %for.cond16.preheader.lr.ph ], [ %inc30, %for.end27 ]
%4 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp1952 = icmp sgt i32 %4, 0
br i1 %cmp1952, label %for.body20, label %for.end27
for.body20: ; preds = %for.cond16.preheader, %for.body20
%l.053 = phi i32 [ %inc26, %for.body20 ], [ 0, %for.cond16.preheader ]
%add = add nuw nsw i32 %l.053, %j.055
%rem = and i32 %add, 1
%cmp21 = icmp eq i32 %rem, 0
%. = select i1 %cmp21, i32 35, i32 46
%putchar51 = call i32 @putchar(i32 %.)
%inc26 = add nuw nsw i32 %l.053, 1
%5 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp19 = icmp slt i32 %inc26, %5
br i1 %cmp19, label %for.body20, label %for.end27, !llvm.loop !9
for.end27: ; preds = %for.body20, %for.cond16.preheader
%putchar49 = call i32 @putchar(i32 10)
%inc30 = add nuw nsw i32 %j.055, 1
%6 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc30, %6
br i1 %cmp14, label %for.cond16.preheader, label %for.end31, !llvm.loop !11
for.end31: ; preds = %for.end27, %for.cond11.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%exitcond.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count
br i1 %exitcond.not, label %for.end35, label %for.cond11.preheader, !llvm.loop !12
for.end35: ; preds = %for.end31, %for.cond9.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %yoko) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %tate) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void){
int i,j,h,w;
while(1){
scanf("%d %d",&h,&w);
if(h==0&&w==0)break;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if((i%2==0&&j%2==0)||(i%2==1&&j%2==1))printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217494/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217494/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp41 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp142 = icmp eq i32 %1, 0
%or.cond43 = select i1 %cmp41, i1 %cmp142, i1 false
br i1 %or.cond43, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end22
%2 = phi i32 [ %10, %for.end22 ], [ %0, %entry ]
%cmp238 = icmp sgt i32 %2, 0
br i1 %cmp238, label %for.cond3.preheader, label %for.end22
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.039 = phi i32 [ %inc21, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %for.body5.lr.ph, label %for.end
for.body5.lr.ph: ; preds = %for.cond3.preheader
%4 = and i32 %i.039, 1
br label %for.body5
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%j.037 = phi i32 [ 0, %for.body5.lr.ph ], [ %inc, %for.body5 ]
%5 = or i32 %j.037, %i.039
%6 = and i32 %5, 1
%or.cond33 = icmp ne i32 %6, 0
%7 = and i32 %4, %j.037
%or.cond34 = icmp eq i32 %7, 0
%or.cond35 = and i1 %or.cond34, %or.cond33
%. = select i1 %or.cond35, i32 46, i32 35
%putchar32 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.037, 1
%8 = load i32, ptr %w, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %8
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar30 = call i32 @putchar(i32 10)
%inc21 = add nuw nsw i32 %i.039, 1
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc21, %9
br i1 %cmp2, label %for.cond3.preheader, label %for.end22, !llvm.loop !11
for.end22: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%10 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %10, 0
%11 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %11, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end22, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int i,n,H,W;
while(1){
scanf("%d %d",&H,&W);
if(H==0 && W==0) break;
for(i=1;i<=H;i++){
for(n=1;n<=W;n++){
if(i%2==0){
if(n%2==0){
printf("#");
}
else{
printf(".");
}
}
else{
if(n%2==0){
printf(".");
}
else{
printf("#");
}
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217537/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217537/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp43 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp144 = icmp eq i32 %1, 0
%or.cond45 = select i1 %cmp43, i1 %cmp144, i1 false
br i1 %or.cond45, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end26
%2 = phi i32 [ %7, %for.end26 ], [ %0, %entry ]
%cmp2.not40 = icmp slt i32 %2, 1
br i1 %cmp2.not40, label %for.end26, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.041 = phi i32 [ %inc25, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not38 = icmp slt i32 %3, 1
br i1 %cmp4.not38, label %for.end, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%rem = and i32 %i.041, 1
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %for.body5.us, label %for.body5
for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us
%n.039.us = phi i32 [ %inc.us, %for.body5.us ], [ 1, %for.body5.lr.ph ]
%rem8.us = and i32 %n.039.us, 1
%cmp9.us = icmp eq i32 %rem8.us, 0
%. = select i1 %cmp9.us, i32 35, i32 46
%putchar37.us = call i32 @putchar(i32 %.)
%inc.us = add nuw nsw i32 %n.039.us, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not.us.not = icmp slt i32 %n.039.us, %4
br i1 %cmp4.not.us.not, label %for.body5.us, label %for.end, !llvm.loop !9
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%n.039 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body5.lr.ph ]
%rem15 = and i32 %n.039, 1
%cmp16 = icmp eq i32 %rem15, 0
%.49 = select i1 %cmp16, i32 46, i32 35
%putchar34 = call i32 @putchar(i32 %.49)
%inc = add nuw nsw i32 %n.039, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %n.039, %5
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader
%putchar33 = call i32 @putchar(i32 10)
%inc25 = add nuw nsw i32 %i.041, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.041, %6
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end26, !llvm.loop !11
for.end26: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
%8 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end26, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int h, w, i, j;
while (1){
scanf("%d %d", &h, &w);
if (h == 0 && w == 0) return 0;
for (i = 1; i <= h; i++){
for (j = 1; j <= w; j++){
if (((i + j) % 2) == 0)
printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217580/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217580/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp28 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp129 = icmp eq i32 %1, 0
%or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false
br i1 %or.cond30, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp2.not25 = icmp slt i32 %2, 1
br i1 %cmp2.not25, label %for.end14, label %for.cond3.preheader
if.then: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.026 = phi i32 [ %inc13, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp4.not23 = icmp slt i32 %3, 1
br i1 %cmp4.not23, label %for.end, label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.024 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ]
%add = add nuw nsw i32 %j.024, %i.026
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar22 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.024, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.024, %4
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar20 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %i.026, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.026, %5
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %for.cond.preheader
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
void drawing(int H,int W)
{
int i, j;
for (i = 0; i < H; i++) {
if (i % 2 == 0) {
for (j = 0; j < W / 2; j++) {
printf("#.");
}
if (W % 2 == 1) {
putchar('#');
}
}
else {
for (j = 0; j < W / 2; j++) {
printf(".#");
}
if (W % 2 == 1) {
putchar('.');
}
}
putchar('\n');
}
putchar('\n');
return;
}
int main(void)
{
int H, W;
while (1) {
scanf("%d %d", &H, &W);
if (H == 0 && W == 0) {
break;
}
drawing(H, W);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"#.\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c".#\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @drawing(i32 noundef %H, i32 noundef %W) local_unnamed_addr #0 {
entry:
%cmp43 = icmp sgt i32 %H, 0
br i1 %cmp43, label %for.body.lr.ph, label %for.end26
for.body.lr.ph: ; preds = %entry
%div10 = sdiv i32 %W, 2
%cmp1139 = icmp sgt i32 %W, 1
%0 = and i32 %W, -2147483647
%cmp18 = icmp eq i32 %0, 1
br i1 %cmp1139, label %for.body.us, label %for.body.lr.ph.split.split
for.body.us: ; preds = %for.body.lr.ph, %if.end22.us
%i.044.us = phi i32 [ %inc25.us, %if.end22.us ], [ 0, %for.body.lr.ph ]
%rem.us = and i32 %i.044.us, 1
%cmp1.us = icmp eq i32 %rem.us, 0
br i1 %cmp1.us, label %for.body4.us, label %for.body12.us
for.end16.us: ; preds = %for.body12.us
br i1 %cmp18, label %if.end22.us.sink.split, label %if.end22.us
for.body12.us: ; preds = %for.body.us, %for.body12.us
%j.140.us = phi i32 [ %inc15.us, %for.body12.us ], [ 0, %for.body.us ]
%call13.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%inc15.us = add nuw nsw i32 %j.140.us, 1
%exitcond103.not = icmp eq i32 %inc15.us, %div10
br i1 %exitcond103.not, label %for.end16.us, label %for.body12.us, !llvm.loop !5
if.end22.us.sink.split: ; preds = %for.cond2.for.end_crit_edge.us, %for.end16.us
%.sink = phi i32 [ 46, %for.end16.us ], [ 35, %for.cond2.for.end_crit_edge.us ]
%1 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i.us = tail call i32 @putc(i32 noundef %.sink, ptr noundef %1)
br label %if.end22.us
if.end22.us: ; preds = %if.end22.us.sink.split, %for.cond2.for.end_crit_edge.us, %for.end16.us
%2 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i37.us = tail call i32 @putc(i32 noundef 10, ptr noundef %2)
%inc25.us = add nuw nsw i32 %i.044.us, 1
%exitcond105.not = icmp eq i32 %inc25.us, %H
br i1 %exitcond105.not, label %for.end26, label %for.body.us, !llvm.loop !11
for.body4.us: ; preds = %for.body.us, %for.body4.us
%j.042.us = phi i32 [ %inc.us, %for.body4.us ], [ 0, %for.body.us ]
%call.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
%inc.us = add nuw nsw i32 %j.042.us, 1
%exitcond104.not = icmp eq i32 %inc.us, %div10
br i1 %exitcond104.not, label %for.cond2.for.end_crit_edge.us, label %for.body4.us, !llvm.loop !12
for.cond2.for.end_crit_edge.us: ; preds = %for.body4.us
br i1 %cmp18, label %if.end22.us.sink.split, label %if.end22.us
for.body.lr.ph.split.split: ; preds = %for.body.lr.ph
br i1 %cmp18, label %for.body.us67.us, label %for.body
for.body.us67.us: ; preds = %for.body.lr.ph.split.split, %for.body.us67.us
%i.044.us68.us = phi i32 [ %inc25.us77.us, %for.body.us67.us ], [ 0, %for.body.lr.ph.split.split ]
%rem.us69.us = and i32 %i.044.us68.us, 1
%cmp1.us70.us = icmp eq i32 %rem.us69.us, 0
%3 = load ptr, ptr @stdout, align 8, !tbaa !7
%spec.select = select i1 %cmp1.us70.us, i32 35, i32 46
%call.i.us74.us = tail call i32 @putc(i32 noundef %spec.select, ptr noundef %3)
%4 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i37.us76.us = tail call i32 @putc(i32 noundef 10, ptr noundef %4)
%inc25.us77.us = add nuw nsw i32 %i.044.us68.us, 1
%exitcond100.not = icmp eq i32 %inc25.us77.us, %H
br i1 %exitcond100.not, label %for.end26, label %for.body.us67.us, !llvm.loop !11
for.body: ; preds = %for.body.lr.ph.split.split, %for.body
%i.044 = phi i32 [ %inc25, %for.body ], [ 0, %for.body.lr.ph.split.split ]
%5 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i37 = tail call i32 @putc(i32 noundef 10, ptr noundef %5)
%inc25 = add nuw nsw i32 %i.044, 1
%exitcond.not = icmp eq i32 %inc25, %H
br i1 %exitcond.not, label %for.end26, label %for.body, !llvm.loop !11
for.end26: ; preds = %for.body, %for.body.us67.us, %if.end22.us, %entry
%6 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i38 = tail call i32 @putc(i32 noundef 10, ptr noundef %6)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !13
%cmp3 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp14 = icmp eq i32 %1, 0
%or.cond5 = select i1 %cmp3, i1 %cmp14, i1 false
br i1 %or.cond5, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%2 = phi i32 [ %5, %if.end ], [ %1, %entry ]
%3 = phi i32 [ %4, %if.end ], [ %0, %entry ]
call void @drawing(i32 noundef %3, i32 noundef %2)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %H, ptr noundef nonnull %W)
%4 = load i32, ptr %H, align 4, !tbaa !13
%cmp = icmp eq i32 %4, 0
%5 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %5, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %if.end
while.end: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !9, i64 0}
|
#include<stdio.h>
int main(void) {
char line[10];
int H,W;
int i,j;
int sharpFirst = 0;
while ( ( fgets(line, sizeof(line), stdin) ) ) {
sscanf(line, "%d %d", &H, &W);
if( ( H == 0 ) && ( W == 0) ) break;
for ( i = 1; i <= H; i++ ) {
for ( j = 1; j <= W; j++ ) {
if ( (i % 2) == (j % 2) ) printf("#");
else printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217717/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217717/source.c"
target datalayout = "e-m:e-p270: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 [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%line = alloca [10 x i8], align 1
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %line) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call30 = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 10, ptr noundef %0)
%tobool.not31 = icmp eq ptr %call30, null
br i1 %tobool.not31, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end17
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W) #4
%1 = load i32, ptr %H, align 4, !tbaa !9
%cmp = icmp eq i32 %1, 0
%2 = load i32, ptr %W, align 4
%cmp3 = icmp eq i32 %2, 0
%or.cond = select i1 %cmp, i1 %cmp3, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %while.body
%cmp4.not28 = icmp slt i32 %1, 1
br i1 %cmp4.not28, label %for.end17, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.cond.preheader, %for.end
%i.029 = phi i32 [ %inc16, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !9
%cmp6.not26 = icmp slt i32 %3, 1
br i1 %cmp6.not26, label %for.end, label %for.body7
for.body7: ; preds = %for.cond5.preheader, %for.body7
%j.027 = phi i32 [ %inc, %for.body7 ], [ 1, %for.cond5.preheader ]
%4 = xor i32 %j.027, %i.029
%5 = and i32 %4, 1
%cmp9 = icmp eq i32 %5, 0
%. = select i1 %cmp9, i32 35, i32 46
%putchar25 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.027, 1
%6 = load i32, ptr %W, align 4, !tbaa !9
%cmp6.not.not = icmp slt i32 %j.027, %6
br i1 %cmp6.not.not, label %for.body7, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body7, %for.cond5.preheader
%putchar23 = call i32 @putchar(i32 10)
%inc16 = add nuw nsw i32 %i.029, 1
%7 = load i32, ptr %H, align 4, !tbaa !9
%cmp4.not.not = icmp slt i32 %i.029, %7
br i1 %cmp4.not.not, label %for.cond5.preheader, label %for.end17, !llvm.loop !13
for.end17: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%8 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 10, ptr noundef %8)
%tobool.not = icmp eq ptr %call, null
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %for.end17, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %line) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
|
#include <stdio.h>
int main(void)
{
int H;
int W;
int i;
int j;
H = 1;
W = 1;
while(1)
{
scanf("%d %d", &H, &W);
if(H == 0 && W == 0)
{
break;
}
for(i = 0; i < H; i++)
{
for(j = 0; j < W; j++)
{
if((i + j) % 2 == 0)
{
printf("#");
}
else
{
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217768/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217768/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
store i32 1, ptr %H, align 4, !tbaa !5
store i32 1, ptr %W, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp28 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp129 = icmp eq i32 %1, 0
%or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false
br i1 %or.cond30, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp225 = icmp sgt i32 %2, 0
br i1 %cmp225, label %for.cond3.preheader, label %for.end14
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.026 = phi i32 [ %inc13, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.024 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%add = add nuw nsw i32 %j.024, %i.026
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar22 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.024, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar20 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %i.026, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc13, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void)
{
int H[1024],W[1024],i,j,k,l;
for(k=0;k<1024;k++){
scanf("%d %d",&H[k],&W[k]);
if(H[k]==0&&W[k]==0) break;
}
for(l=0;l<1024;l++){
if(H[l]==0&&W[l]==0) break;
for(i=0;i<H[l];i++){
if(i%2==0){
for(j=0;j<W[l];j++){
if(j%2==0){
printf("#");
}else{
printf(".");
}
}
}else{
for(j=0;j<W[l];j++){
if(j%2==0){
printf(".");
}else{
printf("#");
}
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217818/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217818/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca [1024 x i32], align 16
%W = alloca [1024 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %W) #4
br label %for.body
for.body: ; preds = %for.body.backedge, %entry
%k.091 = phi i32 [ 0, %entry ], [ %k.091.be, %for.body.backedge ]
%idxprom = zext i32 %k.091 to i64
%arrayidx = getelementptr inbounds [1024 x i32], ptr %H, i64 0, i64 %idxprom
%arrayidx2 = getelementptr inbounds [1024 x i32], ptr %W, i64 0, i64 %idxprom
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5 = icmp eq i32 %0, 0
br i1 %cmp5, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.body
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp8 = icmp ne i32 %1, 0
%cmp = icmp ult i32 %k.091, 1023
%or.cond = and i1 %cmp8, %cmp
br i1 %or.cond, label %for.body.backedge, label %for.body11.preheader
for.inc: ; preds = %for.body
%cmp.old = icmp ult i32 %k.091, 1023
br i1 %cmp.old, label %for.body.backedge, label %for.body11.preheader
for.body11.preheader: ; preds = %land.lhs.true, %for.inc
br label %for.body11
for.body.backedge: ; preds = %for.inc, %land.lhs.true
%k.091.be = add nuw nsw i32 %k.091, 1
br label %for.body, !llvm.loop !9
for.body11: ; preds = %for.body11.preheader, %for.end62
%indvars.iv = phi i64 [ %indvars.iv.next, %for.end62 ], [ 0, %for.body11.preheader ]
%arrayidx13 = getelementptr inbounds [1024 x i32], ptr %H, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp14 = icmp eq i32 %2, 0
br i1 %cmp14, label %land.lhs.true15, label %if.end20
land.lhs.true15: ; preds = %for.body11
%arrayidx17 = getelementptr inbounds [1024 x i32], ptr %W, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp eq i32 %3, 0
br i1 %cmp18, label %for.end66, label %for.end62
if.end20: ; preds = %for.body11
%cmp2496 = icmp sgt i32 %2, 0
br i1 %cmp2496, label %for.body25.lr.ph, label %for.end62
for.body25.lr.ph: ; preds = %if.end20
%arrayidx45 = getelementptr inbounds [1024 x i32], ptr %W, i64 0, i64 %indvars.iv
br label %for.body25
for.body25: ; preds = %for.body25.lr.ph, %if.end58
%i.097 = phi i32 [ 0, %for.body25.lr.ph ], [ %inc61, %if.end58 ]
%rem = and i32 %i.097, 1
%cmp26 = icmp eq i32 %rem, 0
%4 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%cmp3194 = icmp sgt i32 %4, 0
br i1 %cmp26, label %for.cond28.preheader, label %for.cond43.preheader
for.cond43.preheader: ; preds = %for.body25
br i1 %cmp3194, label %for.body47, label %if.end58
for.cond28.preheader: ; preds = %for.body25
br i1 %cmp3194, label %for.body32, label %if.end58
for.body32: ; preds = %for.cond28.preheader, %for.body32
%j.095 = phi i32 [ %inc40, %for.body32 ], [ 0, %for.cond28.preheader ]
%rem33 = and i32 %j.095, 1
%cmp34 = icmp eq i32 %rem33, 0
%. = select i1 %cmp34, i32 35, i32 46
%putchar89 = call i32 @putchar(i32 %.)
%inc40 = add nuw nsw i32 %j.095, 1
%5 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%cmp31 = icmp slt i32 %inc40, %5
br i1 %cmp31, label %for.body32, label %if.end58, !llvm.loop !11
for.body47: ; preds = %for.cond43.preheader, %for.body47
%j.193 = phi i32 [ %inc56, %for.body47 ], [ 0, %for.cond43.preheader ]
%rem48 = and i32 %j.193, 1
%cmp49 = icmp eq i32 %rem48, 0
%.104 = select i1 %cmp49, i32 46, i32 35
%putchar86 = call i32 @putchar(i32 %.104)
%inc56 = add nuw nsw i32 %j.193, 1
%6 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%cmp46 = icmp slt i32 %inc56, %6
br i1 %cmp46, label %for.body47, label %if.end58, !llvm.loop !12
if.end58: ; preds = %for.body47, %for.body32, %for.cond43.preheader, %for.cond28.preheader
%putchar87 = call i32 @putchar(i32 10)
%inc61 = add nuw nsw i32 %i.097, 1
%7 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%cmp24 = icmp slt i32 %inc61, %7
br i1 %cmp24, label %for.body25, label %for.end62, !llvm.loop !13
for.end62: ; preds = %if.end58, %land.lhs.true15, %if.end20
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1024
br i1 %exitcond.not, label %for.end66, label %for.body11, !llvm.loop !14
for.end66: ; preds = %land.lhs.true15, %for.end62
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main(){
int H[3000], W[3000], i, l, k, n;
for(i=0;;i++){
scanf("%d %d", &H[i], &W[i]);
if(H[i]==0 && W[i]==0){
break;
}
}
n = i-1;
for(i=0;i<=n;i++){
for(l=0;l<H[i];l++){
for(k=0;k<W[i];k++){
if(l%2==1 && k%2==1){
printf("#");
}else if(l%2==1 && k%2==0){
printf(".");
}else if(l%2==0 && k%2==1){
printf(".");
}else if(l%2==0 && k%2==0){
printf("#");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217876/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217876/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca [3000 x i32], align 16
%W = alloca [3000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 12000, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 12000, ptr nonnull %W) #4
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv103 = phi i32 [ %indvars.iv.next104, %for.inc ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [3000 x i32], ptr %H, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [3000 x i32], ptr %W, i64 0, i64 %indvars.iv
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
br i1 %cmp, label %land.lhs.true, label %for.inc
land.lhs.true: ; preds = %for.cond
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp7 = icmp eq i32 %1, 0
br i1 %cmp7, label %for.cond8.preheader, label %for.inc
for.cond8.preheader: ; preds = %land.lhs.true
%2 = and i64 %indvars.iv, 4294967295
%cmp9.not.not96.not = icmp eq i64 %2, 0
br i1 %cmp9.not.not96.not, label %for.end63, label %for.cond10.preheader.preheader
for.cond10.preheader.preheader: ; preds = %for.cond8.preheader
%wide.trip.count = zext i32 %indvars.iv103 to i64
br label %for.cond10.preheader
for.inc: ; preds = %for.cond, %land.lhs.true
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%indvars.iv.next104 = add nuw i32 %indvars.iv103, 1
br label %for.cond
for.cond10.preheader: ; preds = %for.cond10.preheader.preheader, %for.end59
%indvars.iv100 = phi i64 [ 0, %for.cond10.preheader.preheader ], [ %indvars.iv.next101, %for.end59 ]
%arrayidx12 = getelementptr inbounds [3000 x i32], ptr %H, i64 0, i64 %indvars.iv100
%3 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp1393 = icmp sgt i32 %3, 0
br i1 %cmp1393, label %for.cond15.preheader.lr.ph, label %for.end59
for.cond15.preheader.lr.ph: ; preds = %for.cond10.preheader
%arrayidx17 = getelementptr inbounds [3000 x i32], ptr %W, i64 0, i64 %indvars.iv100
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.lr.ph, %for.end55
%l.094 = phi i32 [ 0, %for.cond15.preheader.lr.ph ], [ %inc58, %for.end55 ]
%4 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp1891 = icmp sgt i32 %4, 0
br i1 %cmp1891, label %for.body19.lr.ph, label %for.end55
for.body19.lr.ph: ; preds = %for.cond15.preheader
%5 = and i32 %l.094, 1
%cmp20.not.not = icmp eq i32 %5, 0
br i1 %cmp20.not.not, label %if.else.us, label %for.body19
if.else.us: ; preds = %for.body19.lr.ph, %for.inc53.us
%k.092.us = phi i32 [ %inc54.us, %for.inc53.us ], [ 0, %for.body19.lr.ph ]
%rem22.us = and i32 %k.092.us, 1
%cmp23.not.us = icmp eq i32 %rem22.us, 0
br i1 %cmp23.not.us, label %if.else41.us, label %for.inc53.us.sink.split
if.else41.us: ; preds = %if.else.us
%6 = or i32 %k.092.us, %l.094
%7 = and i32 %6, 1
%or.cond90.us = icmp eq i32 %7, 0
br i1 %or.cond90.us, label %for.inc53.us.sink.split, label %for.inc53.us
for.inc53.us.sink.split: ; preds = %if.else41.us, %if.else.us
%.sink = phi i32 [ 46, %if.else.us ], [ 35, %if.else41.us ]
%putchar84.us = call i32 @putchar(i32 %.sink)
br label %for.inc53.us
for.inc53.us: ; preds = %for.inc53.us.sink.split, %if.else41.us
%inc54.us = add nuw nsw i32 %k.092.us, 1
%8 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18.us = icmp slt i32 %inc54.us, %8
br i1 %cmp18.us, label %if.else.us, label %for.end55, !llvm.loop !9
for.body19: ; preds = %for.body19.lr.ph, %for.inc53
%k.092 = phi i32 [ %inc54, %for.inc53 ], [ 0, %for.body19.lr.ph ]
%9 = and i32 %5, %k.092
%or.cond.not.not = icmp eq i32 %9, 0
br i1 %or.cond.not.not, label %if.else, label %for.inc53.sink.split
if.else: ; preds = %for.body19
%rem22 = and i32 %k.092, 1
%cmp23.not = icmp eq i32 %rem22, 0
br i1 %cmp23.not, label %for.inc53.sink.split, label %if.else33
if.else33: ; preds = %if.else
%10 = or i32 %k.092, %l.094
%11 = and i32 %10, 1
%or.cond90 = icmp eq i32 %11, 0
br i1 %or.cond90, label %for.inc53.sink.split, label %for.inc53
for.inc53.sink.split: ; preds = %if.else33, %if.else, %for.body19
%.sink106 = phi i32 [ 35, %for.body19 ], [ 46, %if.else ], [ 35, %if.else33 ]
%putchar87 = call i32 @putchar(i32 %.sink106)
br label %for.inc53
for.inc53: ; preds = %for.inc53.sink.split, %if.else33
%inc54 = add nuw nsw i32 %k.092, 1
%12 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%cmp18 = icmp slt i32 %inc54, %12
br i1 %cmp18, label %for.body19, label %for.end55, !llvm.loop !9
for.end55: ; preds = %for.inc53, %for.inc53.us, %for.cond15.preheader
%putchar83 = call i32 @putchar(i32 10)
%inc58 = add nuw nsw i32 %l.094, 1
%13 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %inc58, %13
br i1 %cmp13, label %for.cond15.preheader, label %for.end59, !llvm.loop !11
for.end59: ; preds = %for.end55, %for.cond10.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%exitcond.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count
br i1 %exitcond.not, label %for.end63, label %for.cond10.preheader, !llvm.loop !12
for.end63: ; preds = %for.end59, %for.cond8.preheader
call void @llvm.lifetime.end.p0(i64 12000, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 12000, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
int main(void){
int h,w,i,j=0;
while(1){
scanf("%d %d",&h,&w);
if((h==0)&&(w==0))break;
for(i=1;i<=h;i++){
if((i%2)!=0){
for(j=0;j<(w/2);j++){
printf("#.");
}
if((w%2)!=0)printf("#");
printf("\n");
}else{
for(j=0;j<(w/2);j++){
printf(".#");
}
if((w%2)!=0)printf(".");
printf("\n");
}
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_217926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_217926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"#.\00", align 1
@.str.4 = private unnamed_addr constant [3 x i8] c".#\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp54 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp155 = icmp eq i32 %1, 0
%or.cond56 = select i1 %cmp54, i1 %cmp155, i1 false
br i1 %or.cond56, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end32
%2 = phi i32 [ %9, %for.end32 ], [ %0, %entry ]
%cmp2.not51 = icmp slt i32 %2, 1
br i1 %cmp2.not51, label %for.end32, label %for.body
for.body: ; preds = %for.cond.preheader, %for.inc30
%i.052 = phi i32 [ %inc31, %for.inc30 ], [ 1, %for.cond.preheader ]
%rem = and i32 %i.052, 1
%cmp3.not = icmp eq i32 %rem, 0
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp1748 = icmp sgt i32 %3, 1
br i1 %cmp3.not, label %for.cond15.preheader, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body
br i1 %cmp1748, label %for.body7, label %for.end
for.cond15.preheader: ; preds = %for.body
br i1 %cmp1748, label %for.body18, label %for.end22
for.body7: ; preds = %for.cond5.preheader, %for.body7
%j.046 = phi i32 [ %inc, %for.body7 ], [ 0, %for.cond5.preheader ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%inc = add nuw nsw i32 %j.046, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%div = sdiv i32 %4, 2
%cmp6 = icmp slt i32 %inc, %div
br i1 %cmp6, label %for.body7, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body7, %for.cond5.preheader
%.lcssa = phi i32 [ %3, %for.cond5.preheader ], [ %4, %for.body7 ]
%5 = and i32 %.lcssa, 1
%cmp10.not = icmp eq i32 %5, 0
br i1 %cmp10.not, label %for.inc30, label %for.inc30.sink.split
for.body18: ; preds = %for.cond15.preheader, %for.body18
%j.149 = phi i32 [ %inc21, %for.body18 ], [ 0, %for.cond15.preheader ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
%inc21 = add nuw nsw i32 %j.149, 1
%6 = load i32, ptr %w, align 4, !tbaa !5
%div16 = sdiv i32 %6, 2
%cmp17 = icmp slt i32 %inc21, %div16
br i1 %cmp17, label %for.body18, label %for.end22, !llvm.loop !11
for.end22: ; preds = %for.body18, %for.cond15.preheader
%.lcssa43 = phi i32 [ %3, %for.cond15.preheader ], [ %6, %for.body18 ]
%7 = and i32 %.lcssa43, 1
%cmp24.not = icmp eq i32 %7, 0
br i1 %cmp24.not, label %for.inc30, label %for.inc30.sink.split
for.inc30.sink.split: ; preds = %for.end22, %for.end
%.sink = phi i32 [ 35, %for.end ], [ 46, %for.end22 ]
%putchar39 = call i32 @putchar(i32 %.sink)
br label %for.inc30
for.inc30: ; preds = %for.inc30.sink.split, %for.end22, %for.end
%putchar42 = call i32 @putchar(i32 10)
%inc31 = add nuw nsw i32 %i.052, 1
%8 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.052, %8
br i1 %cmp2.not.not, label %for.body, label %for.end32, !llvm.loop !12
for.end32: ; preds = %for.inc30, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%9 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %9, 0
%10 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %10, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end32, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <assert.h>
#define MAX 1010
#define clr(ar) memset(ar, 0, sizeof(ar))
#define read() freopen("lol.txt", "r", stdin)
int n;
long long ar[MAX];
int main(){
int i, j, k;
long long a, d, x, res;
while (scanf("%d", &n) != EOF){
for (i = 0; i < n; i++) scanf("%lld", &ar[i]);
d = ar[1] - ar[0];
for (i = 1; i < n; i++){
if ((ar[i] - ar[i - 1]) != d) break;
}
if (i == n) res = ar[n - 1] + d;
else res = ar[n - 1];
printf("%lld\n", res);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@ar = dso_local global [1010 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:
%call40 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%cmp.not41 = icmp eq i32 %call40, -1
br i1 %cmp.not41, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end24
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp134 = icmp sgt i32 %0, 0
br i1 %cmp134, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond.preheader
%1 = load i64, ptr getelementptr inbounds ([1010 x i64], ptr @ar, i64 0, i64 1), align 8, !tbaa !9
%2 = load i64, ptr @ar, align 16, !tbaa !9
%sub49 = sub nsw i64 %1, %2
br label %for.end15
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1010 x i64], ptr @ar, i64 0, i64 %indvars.iv
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%5 = load i64, ptr getelementptr inbounds ([1010 x i64], ptr @ar, i64 0, i64 1), align 8, !tbaa !9
%6 = load i64, ptr @ar, align 16, !tbaa !9
%sub = sub nsw i64 %5, %6
%cmp436 = icmp sgt i32 %3, 1
br i1 %cmp436, label %for.body5.preheader, label %for.end15
for.body5.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc13
%7 = phi i64 [ %6, %for.body5.preheader ], [ %8, %for.inc13 ]
%indvars.iv44 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next45, %for.inc13 ]
%arrayidx7 = getelementptr inbounds [1010 x i64], ptr @ar, i64 0, i64 %indvars.iv44
%8 = load i64, ptr %arrayidx7, align 8, !tbaa !9
%sub11 = sub nsw i64 %8, %7
%cmp12.not = icmp eq i64 %sub11, %sub
br i1 %cmp12.not, label %for.inc13, label %for.end15.loopexit
for.inc13: ; preds = %for.body5
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count
br i1 %exitcond.not, label %if.then17, label %for.body5, !llvm.loop !13
for.end15.loopexit: ; preds = %for.body5
%9 = trunc i64 %indvars.iv44 to i32
br label %for.end15
for.end15: ; preds = %for.end15.loopexit, %for.end.thread, %for.end
%sub52 = phi i64 [ %sub, %for.end ], [ %sub49, %for.end.thread ], [ %sub, %for.end15.loopexit ]
%.lcssa51 = phi i32 [ %3, %for.end ], [ %0, %for.end.thread ], [ %3, %for.end15.loopexit ]
%i.1.lcssa = phi i32 [ 1, %for.end ], [ 1, %for.end.thread ], [ %9, %for.end15.loopexit ]
%cmp16 = icmp eq i32 %i.1.lcssa, %.lcssa51
br i1 %cmp16, label %if.then17, label %if.else
if.then17: ; preds = %for.inc13, %for.end15
%.lcssa5158 = phi i32 [ %.lcssa51, %for.end15 ], [ %3, %for.inc13 ]
%sub5257 = phi i64 [ %sub52, %for.end15 ], [ %sub, %for.inc13 ]
%sub18 = add nsw i32 %.lcssa5158, -1
%idxprom19 = sext i32 %sub18 to i64
%arrayidx20 = getelementptr inbounds [1010 x i64], ptr @ar, i64 0, i64 %idxprom19
%10 = load i64, ptr %arrayidx20, align 8, !tbaa !9
%add = add nsw i64 %10, %sub5257
br label %if.end24
if.else: ; preds = %for.end15
%sub21 = add nsw i32 %.lcssa51, -1
%idxprom22 = sext i32 %sub21 to i64
%arrayidx23 = getelementptr inbounds [1010 x i64], ptr @ar, i64 0, i64 %idxprom22
%11 = load i64, ptr %arrayidx23, align 8, !tbaa !9
br label %if.end24
if.end24: ; preds = %if.else, %if.then17
%res.0 = phi i64 [ %add, %if.then17 ], [ %11, %if.else ]
%call25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %res.0)
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !14
while.end: ; preds = %if.end24, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!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>
int main(void){
int i,j,m,H,W;
m = 1;
while(1){
scanf("%d %d",&H,&W);
if(H == 0 && W == 0)break;
for(j = 0;j < H; j++){
for(i = 0;i < W; i++){
if((i + j)%2 == 0){
printf("#");
}else{
printf(".");
}
}
printf("\n");
}
printf("\n");
m++;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218011/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218011/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp29 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp130 = icmp eq i32 %1, 0
%or.cond31 = select i1 %cmp29, i1 %cmp130, i1 false
br i1 %or.cond31, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp226 = icmp sgt i32 %2, 0
br i1 %cmp226, label %for.cond3.preheader, label %for.end14
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%j.027 = phi i32 [ %inc13, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp424 = icmp sgt i32 %3, 0
br i1 %cmp424, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.025 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%add = add nuw nsw i32 %i.025, %j.027
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar23 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %i.025, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar21 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %j.027, 1
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc13, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void){
int i,j,k,H,W,n;
for ( k = 0; k < 300; k++ ){
scanf("%d",&H);
scanf("%d",&W);
if(H == 0&&W == 0)break;
for ( i = 0; i < H; i++ ){
for ( j = 0; j < W; j++ ){
if((i+j)%2==0)
printf("#");
else
printf(".");
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218055/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218055/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
br label %for.body
for.body: ; preds = %entry, %for.end18
%k.035 = phi i32 [ 0, %entry ], [ %inc21, %for.end18 ]
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp2 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp3 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp2, i1 %cmp3, i1 false
br i1 %or.cond, label %for.end22, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body
%cmp533 = icmp sgt i32 %0, 0
br i1 %cmp533, label %for.cond7.preheader, label %for.end18
for.cond7.preheader: ; preds = %for.cond4.preheader, %for.end
%i.034 = phi i32 [ %inc17, %for.end ], [ 0, %for.cond4.preheader ]
%2 = load i32, ptr %W, align 4, !tbaa !5
%cmp831 = icmp sgt i32 %2, 0
br i1 %cmp831, label %for.body9, label %for.end
for.body9: ; preds = %for.cond7.preheader, %for.body9
%j.032 = phi i32 [ %inc, %for.body9 ], [ 0, %for.cond7.preheader ]
%add = add nuw nsw i32 %j.032, %i.034
%rem = and i32 %add, 1
%cmp10 = icmp eq i32 %rem, 0
%. = select i1 %cmp10, i32 35, i32 46
%putchar30 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.032, 1
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp8 = icmp slt i32 %inc, %3
br i1 %cmp8, label %for.body9, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body9, %for.cond7.preheader
%putchar28 = call i32 @putchar(i32 10)
%inc17 = add nuw nsw i32 %i.034, 1
%4 = load i32, ptr %H, align 4, !tbaa !5
%cmp5 = icmp slt i32 %inc17, %4
br i1 %cmp5, label %for.cond7.preheader, label %for.end18, !llvm.loop !11
for.end18: ; preds = %for.end, %for.cond4.preheader
%putchar = call i32 @putchar(i32 10)
%inc21 = add nuw nsw i32 %k.035, 1
%exitcond.not = icmp eq i32 %inc21, 300
br i1 %exitcond.not, label %for.end22, label %for.body, !llvm.loop !12
for.end22: ; preds = %for.body, %for.end18
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void){
int h,w,i,j;
while(1){
scanf("%d %d",&h,&w);
if( h==0 && w==0)
break;
for(i=1; i<=h; i++){
for(j=1; j<=w; j++){
if((i+j)%2 == 0)
printf("#");
else
printf(".");
}printf("\n");
}printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218105/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218105/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%cmp28 = icmp eq i32 %0, 0
%1 = load i32, ptr %w, align 4
%cmp129 = icmp eq i32 %1, 0
%or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false
br i1 %or.cond30, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp2.not25 = icmp slt i32 %2, 1
br i1 %cmp2.not25, label %for.end14, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.026 = phi i32 [ %inc13, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %w, align 4, !tbaa !5
%cmp4.not23 = icmp slt i32 %3, 1
br i1 %cmp4.not23, label %for.end, label %for.body5
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.024 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ]
%add = add nuw nsw i32 %j.024, %i.026
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar22 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.024, 1
%4 = load i32, ptr %w, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.024, %4
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar20 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %i.026, 1
%5 = load i32, ptr %h, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.026, %5
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%6 = load i32, ptr %h, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %w, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main(){
int a;
int b;
int x;
int y;
while(1){
scanf("%d %d",&a,&b);
if(a==0&&b==0)break;
for(x=0;x<a;x++){
for(y=0;y<b;y++){
if((x+y)%2==0){
printf("#");
}
else{
printf(".");
}
}
printf("\n");
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218149/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call27 = 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
%cmp28 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp129 = icmp eq i32 %1, 0
%or.cond30 = select i1 %cmp28, i1 %cmp129, i1 false
br i1 %or.cond30, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end14
%2 = phi i32 [ %6, %for.end14 ], [ %0, %entry ]
%cmp225 = icmp sgt i32 %2, 0
br i1 %cmp225, label %for.cond3.preheader, label %for.end14
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%x.026 = phi i32 [ %inc13, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp423 = icmp sgt i32 %3, 0
br i1 %cmp423, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%y.024 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%add = add nuw nsw i32 %y.024, %x.026
%rem = and i32 %add, 1
%cmp6 = icmp eq i32 %rem, 0
%. = select i1 %cmp6, i32 35, i32 46
%putchar22 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %y.024, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar20 = call i32 @putchar(i32 10)
%inc13 = add nuw nsw i32 %x.026, 1
%5 = load i32, ptr %a, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc13, %5
br i1 %cmp2, label %for.cond3.preheader, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
%7 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %7, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end14, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
char a[1005][10];
int b[10];
int main(){
int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%s",a[i]);
}
for(int i=0;i<7;i++){
for(int j=0;j<n;j++){
if(a[j][i]=='1'){
b[i]+=1;
}
}
}
int max=-1;
for(int i=0;i<7;i++){
if(max<b[i]) max=b[i];
}
printf("%d\n",max);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21825/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21825/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@a = dso_local global [1005 x [10 x i8]] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.cond26.preheader
for.cond3.preheader: ; preds = %for.body
%cmp856 = icmp sgt i32 %50, 0
br i1 %cmp856, label %for.cond7.preheader.us.preheader, label %for.cond26.preheader
for.cond7.preheader.us.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %50 to i64
%b.promoted = load i32, ptr @b, align 16, !tbaa !5
%1 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%2 = icmp eq i64 %1, 0
br i1 %2, label %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa, label %for.cond7.preheader.us.preheader.new
for.cond7.preheader.us.preheader.new: ; preds = %for.cond7.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body10.us
for.body10.us: ; preds = %for.inc19.us.189, %for.cond7.preheader.us.preheader.new
%3 = phi i32 [ %b.promoted, %for.cond7.preheader.us.preheader.new ], [ %7, %for.inc19.us.189 ]
%indvars.iv64 = phi i64 [ 0, %for.cond7.preheader.us.preheader.new ], [ %indvars.iv.next65.188, %for.inc19.us.189 ]
%niter = phi i64 [ 0, %for.cond7.preheader.us.preheader.new ], [ %niter.next.1, %for.inc19.us.189 ]
%arrayidx14.us = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64, i64 0
%4 = load i8, ptr %arrayidx14.us, align 4, !tbaa !9
%cmp15.us = icmp eq i8 %4, 49
br i1 %cmp15.us, label %if.then.us, label %for.inc19.us
if.then.us: ; preds = %for.body10.us
%add.us = add nsw i32 %3, 1
store i32 %add.us, ptr @b, align 16, !tbaa !5
br label %for.inc19.us
for.inc19.us: ; preds = %if.then.us, %for.body10.us
%5 = phi i32 [ %add.us, %if.then.us ], [ %3, %for.body10.us ]
%indvars.iv.next65 = or i64 %indvars.iv64, 1
%arrayidx14.us.183 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65, i64 0
%6 = load i8, ptr %arrayidx14.us.183, align 2, !tbaa !9
%cmp15.us.184 = icmp eq i8 %6, 49
br i1 %cmp15.us.184, label %if.then.us.187, label %for.inc19.us.189
if.then.us.187: ; preds = %for.inc19.us
%add.us.186 = add nsw i32 %5, 1
store i32 %add.us.186, ptr @b, align 16, !tbaa !5
br label %for.inc19.us.189
for.inc19.us.189: ; preds = %if.then.us.187, %for.inc19.us
%7 = phi i32 [ %add.us.186, %if.then.us.187 ], [ %5, %for.inc19.us ]
%indvars.iv.next65.188 = add nuw nsw i64 %indvars.iv64, 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.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa, label %for.body10.us, !llvm.loop !10
for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa: ; preds = %for.inc19.us.189, %for.cond7.preheader.us.preheader
%.unr = phi i32 [ %b.promoted, %for.cond7.preheader.us.preheader ], [ %7, %for.inc19.us.189 ]
%indvars.iv64.unr = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next65.188, %for.inc19.us.189 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond7.for.cond.cleanup9_crit_edge.us, label %for.body10.us.epil
for.body10.us.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa
%arrayidx14.us.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.unr, i64 0
%8 = load i8, ptr %arrayidx14.us.epil, align 2, !tbaa !9
%cmp15.us.epil = icmp eq i8 %8, 49
br i1 %cmp15.us.epil, label %if.then.us.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us
if.then.us.epil: ; preds = %for.body10.us.epil
%add.us.epil = add nsw i32 %.unr, 1
store i32 %add.us.epil, ptr @b, align 16, !tbaa !5
br label %for.cond7.for.cond.cleanup9_crit_edge.us
for.cond7.for.cond.cleanup9_crit_edge.us: ; preds = %for.body10.us.epil, %if.then.us.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.unr-lcssa
%.promoted = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
%xtraiter90 = and i64 %wide.trip.count, 1
%9 = icmp eq i64 %1, 0
br i1 %9, label %for.cond7.for.cond.cleanup9_crit_edge.us.1.unr-lcssa, label %for.cond7.for.cond.cleanup9_crit_edge.us.new
for.cond7.for.cond.cleanup9_crit_edge.us.new: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us
%unroll_iter93 = and i64 %wide.trip.count, 4294967294
br label %for.body10.us.1
for.body10.us.1: ; preds = %for.inc19.us.1.1, %for.cond7.for.cond.cleanup9_crit_edge.us.new
%10 = phi i32 [ %.promoted, %for.cond7.for.cond.cleanup9_crit_edge.us.new ], [ %14, %for.inc19.us.1.1 ]
%indvars.iv64.1 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.new ], [ %indvars.iv.next65.1.1, %for.inc19.us.1.1 ]
%niter94 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.new ], [ %niter94.next.1, %for.inc19.us.1.1 ]
%arrayidx14.us.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.1, i64 1
%11 = load i8, ptr %arrayidx14.us.1, align 1, !tbaa !9
%cmp15.us.1 = icmp eq i8 %11, 49
br i1 %cmp15.us.1, label %if.then.us.1, label %for.inc19.us.1
if.then.us.1: ; preds = %for.body10.us.1
%add.us.1 = add nsw i32 %10, 1
store i32 %add.us.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc19.us.1
for.inc19.us.1: ; preds = %if.then.us.1, %for.body10.us.1
%12 = phi i32 [ %add.us.1, %if.then.us.1 ], [ %10, %for.body10.us.1 ]
%indvars.iv.next65.1 = or i64 %indvars.iv64.1, 1
%arrayidx14.us.1.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65.1, i64 1
%13 = load i8, ptr %arrayidx14.us.1.1, align 1, !tbaa !9
%cmp15.us.1.1 = icmp eq i8 %13, 49
br i1 %cmp15.us.1.1, label %if.then.us.1.1, label %for.inc19.us.1.1
if.then.us.1.1: ; preds = %for.inc19.us.1
%add.us.1.1 = add nsw i32 %12, 1
store i32 %add.us.1.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
br label %for.inc19.us.1.1
for.inc19.us.1.1: ; preds = %if.then.us.1.1, %for.inc19.us.1
%14 = phi i32 [ %add.us.1.1, %if.then.us.1.1 ], [ %12, %for.inc19.us.1 ]
%indvars.iv.next65.1.1 = add nuw nsw i64 %indvars.iv64.1, 2
%niter94.next.1 = add i64 %niter94, 2
%niter94.ncmp.1 = icmp eq i64 %niter94.next.1, %unroll_iter93
br i1 %niter94.ncmp.1, label %for.cond7.for.cond.cleanup9_crit_edge.us.1.unr-lcssa, label %for.body10.us.1, !llvm.loop !10
for.cond7.for.cond.cleanup9_crit_edge.us.1.unr-lcssa: ; preds = %for.inc19.us.1.1, %for.cond7.for.cond.cleanup9_crit_edge.us
%.unr91 = phi i32 [ %.promoted, %for.cond7.for.cond.cleanup9_crit_edge.us ], [ %14, %for.inc19.us.1.1 ]
%indvars.iv64.1.unr = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us ], [ %indvars.iv.next65.1.1, %for.inc19.us.1.1 ]
%lcmp.mod92.not = icmp eq i64 %xtraiter90, 0
br i1 %lcmp.mod92.not, label %for.cond7.for.cond.cleanup9_crit_edge.us.1, label %for.body10.us.1.epil
for.body10.us.1.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.1.unr-lcssa
%arrayidx14.us.1.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.1.unr, i64 1
%15 = load i8, ptr %arrayidx14.us.1.epil, align 1, !tbaa !9
%cmp15.us.1.epil = icmp eq i8 %15, 49
br i1 %cmp15.us.1.epil, label %if.then.us.1.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us.1
if.then.us.1.epil: ; preds = %for.body10.us.1.epil
%add.us.1.epil = add nsw i32 %.unr91, 1
store i32 %add.us.1.epil, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
br label %for.cond7.for.cond.cleanup9_crit_edge.us.1
for.cond7.for.cond.cleanup9_crit_edge.us.1: ; preds = %for.body10.us.1.epil, %if.then.us.1.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.1.unr-lcssa
%.promoted77 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
%xtraiter95 = and i64 %wide.trip.count, 1
%16 = icmp eq i64 %1, 0
br i1 %16, label %for.cond7.for.cond.cleanup9_crit_edge.us.2.unr-lcssa, label %for.cond7.for.cond.cleanup9_crit_edge.us.1.new
for.cond7.for.cond.cleanup9_crit_edge.us.1.new: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.1
%unroll_iter98 = and i64 %wide.trip.count, 4294967294
br label %for.body10.us.2
for.body10.us.2: ; preds = %for.inc19.us.2.1, %for.cond7.for.cond.cleanup9_crit_edge.us.1.new
%17 = phi i32 [ %.promoted77, %for.cond7.for.cond.cleanup9_crit_edge.us.1.new ], [ %21, %for.inc19.us.2.1 ]
%indvars.iv64.2 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.1.new ], [ %indvars.iv.next65.2.1, %for.inc19.us.2.1 ]
%niter99 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.1.new ], [ %niter99.next.1, %for.inc19.us.2.1 ]
%arrayidx14.us.2 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.2, i64 2
%18 = load i8, ptr %arrayidx14.us.2, align 2, !tbaa !9
%cmp15.us.2 = icmp eq i8 %18, 49
br i1 %cmp15.us.2, label %if.then.us.2, label %for.inc19.us.2
if.then.us.2: ; preds = %for.body10.us.2
%add.us.2 = add nsw i32 %17, 1
store i32 %add.us.2, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
br label %for.inc19.us.2
for.inc19.us.2: ; preds = %if.then.us.2, %for.body10.us.2
%19 = phi i32 [ %add.us.2, %if.then.us.2 ], [ %17, %for.body10.us.2 ]
%indvars.iv.next65.2 = or i64 %indvars.iv64.2, 1
%arrayidx14.us.2.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65.2, i64 2
%20 = load i8, ptr %arrayidx14.us.2.1, align 4, !tbaa !9
%cmp15.us.2.1 = icmp eq i8 %20, 49
br i1 %cmp15.us.2.1, label %if.then.us.2.1, label %for.inc19.us.2.1
if.then.us.2.1: ; preds = %for.inc19.us.2
%add.us.2.1 = add nsw i32 %19, 1
store i32 %add.us.2.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
br label %for.inc19.us.2.1
for.inc19.us.2.1: ; preds = %if.then.us.2.1, %for.inc19.us.2
%21 = phi i32 [ %add.us.2.1, %if.then.us.2.1 ], [ %19, %for.inc19.us.2 ]
%indvars.iv.next65.2.1 = add nuw nsw i64 %indvars.iv64.2, 2
%niter99.next.1 = add i64 %niter99, 2
%niter99.ncmp.1 = icmp eq i64 %niter99.next.1, %unroll_iter98
br i1 %niter99.ncmp.1, label %for.cond7.for.cond.cleanup9_crit_edge.us.2.unr-lcssa, label %for.body10.us.2, !llvm.loop !10
for.cond7.for.cond.cleanup9_crit_edge.us.2.unr-lcssa: ; preds = %for.inc19.us.2.1, %for.cond7.for.cond.cleanup9_crit_edge.us.1
%.unr96 = phi i32 [ %.promoted77, %for.cond7.for.cond.cleanup9_crit_edge.us.1 ], [ %21, %for.inc19.us.2.1 ]
%indvars.iv64.2.unr = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.1 ], [ %indvars.iv.next65.2.1, %for.inc19.us.2.1 ]
%lcmp.mod97.not = icmp eq i64 %xtraiter95, 0
br i1 %lcmp.mod97.not, label %for.cond7.for.cond.cleanup9_crit_edge.us.2, label %for.body10.us.2.epil
for.body10.us.2.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.2.unr-lcssa
%arrayidx14.us.2.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.2.unr, i64 2
%22 = load i8, ptr %arrayidx14.us.2.epil, align 2, !tbaa !9
%cmp15.us.2.epil = icmp eq i8 %22, 49
br i1 %cmp15.us.2.epil, label %if.then.us.2.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us.2
if.then.us.2.epil: ; preds = %for.body10.us.2.epil
%add.us.2.epil = add nsw i32 %.unr96, 1
store i32 %add.us.2.epil, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
br label %for.cond7.for.cond.cleanup9_crit_edge.us.2
for.cond7.for.cond.cleanup9_crit_edge.us.2: ; preds = %for.body10.us.2.epil, %if.then.us.2.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.2.unr-lcssa
%.promoted78 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
%xtraiter100 = and i64 %wide.trip.count, 1
%23 = icmp eq i64 %1, 0
br i1 %23, label %for.cond7.for.cond.cleanup9_crit_edge.us.3.unr-lcssa, label %for.cond7.for.cond.cleanup9_crit_edge.us.2.new
for.cond7.for.cond.cleanup9_crit_edge.us.2.new: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.2
%unroll_iter103 = and i64 %wide.trip.count, 4294967294
br label %for.body10.us.3
for.body10.us.3: ; preds = %for.inc19.us.3.1, %for.cond7.for.cond.cleanup9_crit_edge.us.2.new
%24 = phi i32 [ %.promoted78, %for.cond7.for.cond.cleanup9_crit_edge.us.2.new ], [ %28, %for.inc19.us.3.1 ]
%indvars.iv64.3 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.2.new ], [ %indvars.iv.next65.3.1, %for.inc19.us.3.1 ]
%niter104 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.2.new ], [ %niter104.next.1, %for.inc19.us.3.1 ]
%arrayidx14.us.3 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.3, i64 3
%25 = load i8, ptr %arrayidx14.us.3, align 1, !tbaa !9
%cmp15.us.3 = icmp eq i8 %25, 49
br i1 %cmp15.us.3, label %if.then.us.3, label %for.inc19.us.3
if.then.us.3: ; preds = %for.body10.us.3
%add.us.3 = add nsw i32 %24, 1
store i32 %add.us.3, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
br label %for.inc19.us.3
for.inc19.us.3: ; preds = %if.then.us.3, %for.body10.us.3
%26 = phi i32 [ %add.us.3, %if.then.us.3 ], [ %24, %for.body10.us.3 ]
%indvars.iv.next65.3 = or i64 %indvars.iv64.3, 1
%arrayidx14.us.3.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65.3, i64 3
%27 = load i8, ptr %arrayidx14.us.3.1, align 1, !tbaa !9
%cmp15.us.3.1 = icmp eq i8 %27, 49
br i1 %cmp15.us.3.1, label %if.then.us.3.1, label %for.inc19.us.3.1
if.then.us.3.1: ; preds = %for.inc19.us.3
%add.us.3.1 = add nsw i32 %26, 1
store i32 %add.us.3.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
br label %for.inc19.us.3.1
for.inc19.us.3.1: ; preds = %if.then.us.3.1, %for.inc19.us.3
%28 = phi i32 [ %add.us.3.1, %if.then.us.3.1 ], [ %26, %for.inc19.us.3 ]
%indvars.iv.next65.3.1 = add nuw nsw i64 %indvars.iv64.3, 2
%niter104.next.1 = add i64 %niter104, 2
%niter104.ncmp.1 = icmp eq i64 %niter104.next.1, %unroll_iter103
br i1 %niter104.ncmp.1, label %for.cond7.for.cond.cleanup9_crit_edge.us.3.unr-lcssa, label %for.body10.us.3, !llvm.loop !10
for.cond7.for.cond.cleanup9_crit_edge.us.3.unr-lcssa: ; preds = %for.inc19.us.3.1, %for.cond7.for.cond.cleanup9_crit_edge.us.2
%.unr101 = phi i32 [ %.promoted78, %for.cond7.for.cond.cleanup9_crit_edge.us.2 ], [ %28, %for.inc19.us.3.1 ]
%indvars.iv64.3.unr = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.2 ], [ %indvars.iv.next65.3.1, %for.inc19.us.3.1 ]
%lcmp.mod102.not = icmp eq i64 %xtraiter100, 0
br i1 %lcmp.mod102.not, label %for.cond7.for.cond.cleanup9_crit_edge.us.3, label %for.body10.us.3.epil
for.body10.us.3.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.3.unr-lcssa
%arrayidx14.us.3.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.3.unr, i64 3
%29 = load i8, ptr %arrayidx14.us.3.epil, align 1, !tbaa !9
%cmp15.us.3.epil = icmp eq i8 %29, 49
br i1 %cmp15.us.3.epil, label %if.then.us.3.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us.3
if.then.us.3.epil: ; preds = %for.body10.us.3.epil
%add.us.3.epil = add nsw i32 %.unr101, 1
store i32 %add.us.3.epil, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
br label %for.cond7.for.cond.cleanup9_crit_edge.us.3
for.cond7.for.cond.cleanup9_crit_edge.us.3: ; preds = %for.body10.us.3.epil, %if.then.us.3.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.3.unr-lcssa
%.promoted79 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
%xtraiter105 = and i64 %wide.trip.count, 1
%30 = icmp eq i64 %1, 0
br i1 %30, label %for.cond7.for.cond.cleanup9_crit_edge.us.4.unr-lcssa, label %for.cond7.for.cond.cleanup9_crit_edge.us.3.new
for.cond7.for.cond.cleanup9_crit_edge.us.3.new: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.3
%unroll_iter108 = and i64 %wide.trip.count, 4294967294
br label %for.body10.us.4
for.body10.us.4: ; preds = %for.inc19.us.4.1, %for.cond7.for.cond.cleanup9_crit_edge.us.3.new
%31 = phi i32 [ %.promoted79, %for.cond7.for.cond.cleanup9_crit_edge.us.3.new ], [ %35, %for.inc19.us.4.1 ]
%indvars.iv64.4 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.3.new ], [ %indvars.iv.next65.4.1, %for.inc19.us.4.1 ]
%niter109 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.3.new ], [ %niter109.next.1, %for.inc19.us.4.1 ]
%arrayidx14.us.4 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.4, i64 4
%32 = load i8, ptr %arrayidx14.us.4, align 4, !tbaa !9
%cmp15.us.4 = icmp eq i8 %32, 49
br i1 %cmp15.us.4, label %if.then.us.4, label %for.inc19.us.4
if.then.us.4: ; preds = %for.body10.us.4
%add.us.4 = add nsw i32 %31, 1
store i32 %add.us.4, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
br label %for.inc19.us.4
for.inc19.us.4: ; preds = %if.then.us.4, %for.body10.us.4
%33 = phi i32 [ %add.us.4, %if.then.us.4 ], [ %31, %for.body10.us.4 ]
%indvars.iv.next65.4 = or i64 %indvars.iv64.4, 1
%arrayidx14.us.4.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65.4, i64 4
%34 = load i8, ptr %arrayidx14.us.4.1, align 2, !tbaa !9
%cmp15.us.4.1 = icmp eq i8 %34, 49
br i1 %cmp15.us.4.1, label %if.then.us.4.1, label %for.inc19.us.4.1
if.then.us.4.1: ; preds = %for.inc19.us.4
%add.us.4.1 = add nsw i32 %33, 1
store i32 %add.us.4.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
br label %for.inc19.us.4.1
for.inc19.us.4.1: ; preds = %if.then.us.4.1, %for.inc19.us.4
%35 = phi i32 [ %add.us.4.1, %if.then.us.4.1 ], [ %33, %for.inc19.us.4 ]
%indvars.iv.next65.4.1 = add nuw nsw i64 %indvars.iv64.4, 2
%niter109.next.1 = add i64 %niter109, 2
%niter109.ncmp.1 = icmp eq i64 %niter109.next.1, %unroll_iter108
br i1 %niter109.ncmp.1, label %for.cond7.for.cond.cleanup9_crit_edge.us.4.unr-lcssa, label %for.body10.us.4, !llvm.loop !10
for.cond7.for.cond.cleanup9_crit_edge.us.4.unr-lcssa: ; preds = %for.inc19.us.4.1, %for.cond7.for.cond.cleanup9_crit_edge.us.3
%.unr106 = phi i32 [ %.promoted79, %for.cond7.for.cond.cleanup9_crit_edge.us.3 ], [ %35, %for.inc19.us.4.1 ]
%indvars.iv64.4.unr = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.3 ], [ %indvars.iv.next65.4.1, %for.inc19.us.4.1 ]
%lcmp.mod107.not = icmp eq i64 %xtraiter105, 0
br i1 %lcmp.mod107.not, label %for.cond7.for.cond.cleanup9_crit_edge.us.4, label %for.body10.us.4.epil
for.body10.us.4.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.4.unr-lcssa
%arrayidx14.us.4.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.4.unr, i64 4
%36 = load i8, ptr %arrayidx14.us.4.epil, align 2, !tbaa !9
%cmp15.us.4.epil = icmp eq i8 %36, 49
br i1 %cmp15.us.4.epil, label %if.then.us.4.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us.4
if.then.us.4.epil: ; preds = %for.body10.us.4.epil
%add.us.4.epil = add nsw i32 %.unr106, 1
store i32 %add.us.4.epil, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
br label %for.cond7.for.cond.cleanup9_crit_edge.us.4
for.cond7.for.cond.cleanup9_crit_edge.us.4: ; preds = %for.body10.us.4.epil, %if.then.us.4.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.4.unr-lcssa
%.promoted80 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
%xtraiter110 = and i64 %wide.trip.count, 1
%37 = icmp eq i64 %1, 0
br i1 %37, label %for.cond7.for.cond.cleanup9_crit_edge.us.5.unr-lcssa, label %for.cond7.for.cond.cleanup9_crit_edge.us.4.new
for.cond7.for.cond.cleanup9_crit_edge.us.4.new: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.4
%unroll_iter113 = and i64 %wide.trip.count, 4294967294
br label %for.body10.us.5
for.body10.us.5: ; preds = %for.inc19.us.5.1, %for.cond7.for.cond.cleanup9_crit_edge.us.4.new
%38 = phi i32 [ %.promoted80, %for.cond7.for.cond.cleanup9_crit_edge.us.4.new ], [ %42, %for.inc19.us.5.1 ]
%indvars.iv64.5 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.4.new ], [ %indvars.iv.next65.5.1, %for.inc19.us.5.1 ]
%niter114 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.4.new ], [ %niter114.next.1, %for.inc19.us.5.1 ]
%arrayidx14.us.5 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.5, i64 5
%39 = load i8, ptr %arrayidx14.us.5, align 1, !tbaa !9
%cmp15.us.5 = icmp eq i8 %39, 49
br i1 %cmp15.us.5, label %if.then.us.5, label %for.inc19.us.5
if.then.us.5: ; preds = %for.body10.us.5
%add.us.5 = add nsw i32 %38, 1
store i32 %add.us.5, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
br label %for.inc19.us.5
for.inc19.us.5: ; preds = %if.then.us.5, %for.body10.us.5
%40 = phi i32 [ %add.us.5, %if.then.us.5 ], [ %38, %for.body10.us.5 ]
%indvars.iv.next65.5 = or i64 %indvars.iv64.5, 1
%arrayidx14.us.5.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65.5, i64 5
%41 = load i8, ptr %arrayidx14.us.5.1, align 1, !tbaa !9
%cmp15.us.5.1 = icmp eq i8 %41, 49
br i1 %cmp15.us.5.1, label %if.then.us.5.1, label %for.inc19.us.5.1
if.then.us.5.1: ; preds = %for.inc19.us.5
%add.us.5.1 = add nsw i32 %40, 1
store i32 %add.us.5.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
br label %for.inc19.us.5.1
for.inc19.us.5.1: ; preds = %if.then.us.5.1, %for.inc19.us.5
%42 = phi i32 [ %add.us.5.1, %if.then.us.5.1 ], [ %40, %for.inc19.us.5 ]
%indvars.iv.next65.5.1 = add nuw nsw i64 %indvars.iv64.5, 2
%niter114.next.1 = add i64 %niter114, 2
%niter114.ncmp.1 = icmp eq i64 %niter114.next.1, %unroll_iter113
br i1 %niter114.ncmp.1, label %for.cond7.for.cond.cleanup9_crit_edge.us.5.unr-lcssa, label %for.body10.us.5, !llvm.loop !10
for.cond7.for.cond.cleanup9_crit_edge.us.5.unr-lcssa: ; preds = %for.inc19.us.5.1, %for.cond7.for.cond.cleanup9_crit_edge.us.4
%.unr111 = phi i32 [ %.promoted80, %for.cond7.for.cond.cleanup9_crit_edge.us.4 ], [ %42, %for.inc19.us.5.1 ]
%indvars.iv64.5.unr = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.4 ], [ %indvars.iv.next65.5.1, %for.inc19.us.5.1 ]
%lcmp.mod112.not = icmp eq i64 %xtraiter110, 0
br i1 %lcmp.mod112.not, label %for.cond7.for.cond.cleanup9_crit_edge.us.5, label %for.body10.us.5.epil
for.body10.us.5.epil: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.5.unr-lcssa
%arrayidx14.us.5.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.5.unr, i64 5
%43 = load i8, ptr %arrayidx14.us.5.epil, align 1, !tbaa !9
%cmp15.us.5.epil = icmp eq i8 %43, 49
br i1 %cmp15.us.5.epil, label %if.then.us.5.epil, label %for.cond7.for.cond.cleanup9_crit_edge.us.5
if.then.us.5.epil: ; preds = %for.body10.us.5.epil
%add.us.5.epil = add nsw i32 %.unr111, 1
store i32 %add.us.5.epil, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
br label %for.cond7.for.cond.cleanup9_crit_edge.us.5
for.cond7.for.cond.cleanup9_crit_edge.us.5: ; preds = %for.body10.us.5.epil, %if.then.us.5.epil, %for.cond7.for.cond.cleanup9_crit_edge.us.5.unr-lcssa
%.promoted81 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
%xtraiter115 = and i64 %wide.trip.count, 1
%44 = icmp eq i64 %1, 0
br i1 %44, label %for.cond26.preheader.loopexit.unr-lcssa, label %for.cond7.for.cond.cleanup9_crit_edge.us.5.new
for.cond7.for.cond.cleanup9_crit_edge.us.5.new: ; preds = %for.cond7.for.cond.cleanup9_crit_edge.us.5
%unroll_iter118 = and i64 %wide.trip.count, 4294967294
br label %for.body10.us.6
for.body10.us.6: ; preds = %for.inc19.us.6.1, %for.cond7.for.cond.cleanup9_crit_edge.us.5.new
%45 = phi i32 [ %.promoted81, %for.cond7.for.cond.cleanup9_crit_edge.us.5.new ], [ %49, %for.inc19.us.6.1 ]
%indvars.iv64.6 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.5.new ], [ %indvars.iv.next65.6.1, %for.inc19.us.6.1 ]
%niter119 = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.5.new ], [ %niter119.next.1, %for.inc19.us.6.1 ]
%arrayidx14.us.6 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.6, i64 6
%46 = load i8, ptr %arrayidx14.us.6, align 2, !tbaa !9
%cmp15.us.6 = icmp eq i8 %46, 49
br i1 %cmp15.us.6, label %if.then.us.6, label %for.inc19.us.6
if.then.us.6: ; preds = %for.body10.us.6
%add.us.6 = add nsw i32 %45, 1
store i32 %add.us.6, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
br label %for.inc19.us.6
for.inc19.us.6: ; preds = %if.then.us.6, %for.body10.us.6
%47 = phi i32 [ %add.us.6, %if.then.us.6 ], [ %45, %for.body10.us.6 ]
%indvars.iv.next65.6 = or i64 %indvars.iv64.6, 1
%arrayidx14.us.6.1 = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv.next65.6, i64 6
%48 = load i8, ptr %arrayidx14.us.6.1, align 4, !tbaa !9
%cmp15.us.6.1 = icmp eq i8 %48, 49
br i1 %cmp15.us.6.1, label %if.then.us.6.1, label %for.inc19.us.6.1
if.then.us.6.1: ; preds = %for.inc19.us.6
%add.us.6.1 = add nsw i32 %47, 1
store i32 %add.us.6.1, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
br label %for.inc19.us.6.1
for.inc19.us.6.1: ; preds = %if.then.us.6.1, %for.inc19.us.6
%49 = phi i32 [ %add.us.6.1, %if.then.us.6.1 ], [ %47, %for.inc19.us.6 ]
%indvars.iv.next65.6.1 = add nuw nsw i64 %indvars.iv64.6, 2
%niter119.next.1 = add i64 %niter119, 2
%niter119.ncmp.1 = icmp eq i64 %niter119.next.1, %unroll_iter118
br i1 %niter119.ncmp.1, label %for.cond26.preheader.loopexit.unr-lcssa, label %for.body10.us.6, !llvm.loop !10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%50 = load i32, ptr %n, align 4, !tbaa !5
%51 = sext i32 %50 to i64
%cmp = icmp slt i64 %indvars.iv.next, %51
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !12
for.cond26.preheader.loopexit.unr-lcssa: ; preds = %for.inc19.us.6.1, %for.cond7.for.cond.cleanup9_crit_edge.us.5
%.unr116 = phi i32 [ %.promoted81, %for.cond7.for.cond.cleanup9_crit_edge.us.5 ], [ %49, %for.inc19.us.6.1 ]
%indvars.iv64.6.unr = phi i64 [ 0, %for.cond7.for.cond.cleanup9_crit_edge.us.5 ], [ %indvars.iv.next65.6.1, %for.inc19.us.6.1 ]
%lcmp.mod117.not = icmp eq i64 %xtraiter115, 0
br i1 %lcmp.mod117.not, label %for.cond26.preheader, label %for.body10.us.6.epil
for.body10.us.6.epil: ; preds = %for.cond26.preheader.loopexit.unr-lcssa
%arrayidx14.us.6.epil = getelementptr inbounds [1005 x [10 x i8]], ptr @a, i64 0, i64 %indvars.iv64.6.unr, i64 6
%52 = load i8, ptr %arrayidx14.us.6.epil, align 2, !tbaa !9
%cmp15.us.6.epil = icmp eq i8 %52, 49
br i1 %cmp15.us.6.epil, label %if.then.us.6.epil, label %for.cond26.preheader
if.then.us.6.epil: ; preds = %for.body10.us.6.epil
%add.us.6.epil = add nsw i32 %.unr116, 1
store i32 %add.us.6.epil, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
br label %for.cond26.preheader
for.cond26.preheader: ; preds = %for.cond26.preheader.loopexit.unr-lcssa, %if.then.us.6.epil, %for.body10.us.6.epil, %entry, %for.cond3.preheader
%53 = load i32, ptr @b, align 16, !tbaa !5
%54 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 1), align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %53, i32 %54)
%55 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 2), align 8, !tbaa !5
%spec.select.1 = call i32 @llvm.smax.i32(i32 %spec.select, i32 %55)
%56 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 3), align 4, !tbaa !5
%spec.select.2 = call i32 @llvm.smax.i32(i32 %spec.select.1, i32 %56)
%57 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 4), align 16, !tbaa !5
%spec.select.3 = call i32 @llvm.smax.i32(i32 %spec.select.2, i32 %57)
%58 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 5), align 4, !tbaa !5
%spec.select.4 = call i32 @llvm.smax.i32(i32 %spec.select.3, i32 %58)
%59 = load i32, ptr getelementptr inbounds ([10 x i32], ptr @b, i64 0, i64 6), align 8, !tbaa !5
%spec.select.5 = call i32 @llvm.smax.i32(i32 %spec.select.4, i32 %59)
%spec.select.6 = call i32 @llvm.smax.i32(i32 %spec.select.5, i32 -1)
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.select.6)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind 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"}
!12 = distinct !{!12, !11}
|
#include <stdio.h>
int main(void)
{
int H, W;
int i, j;
while (1){
scanf("%d%d", &H, &W);
if (H == 0 && W == 0){
break;
}
for (i = 1; i <= H; i++){
for (j = 1; j <= W; j++){
if (i % 2 == 0){
if (j % 2 == 0){
printf("#");
}
else {
printf(".");
}
}
else {
if (j % 2 != 0){
printf("#");
}
else {
printf(".");
}
}
}
printf("\n");
}
printf("\n");
}
return (0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218293/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218293/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call42 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp43 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp144 = icmp eq i32 %1, 0
%or.cond45 = select i1 %cmp43, i1 %cmp144, i1 false
br i1 %or.cond45, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end26
%2 = phi i32 [ %7, %for.end26 ], [ %0, %entry ]
%cmp2.not40 = icmp slt i32 %2, 1
br i1 %cmp2.not40, label %for.end26, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.041 = phi i32 [ %inc25, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not38 = icmp slt i32 %3, 1
br i1 %cmp4.not38, label %for.end, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%rem = and i32 %i.041, 1
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %for.body5.us, label %for.body5
for.body5.us: ; preds = %for.body5.lr.ph, %for.body5.us
%j.039.us = phi i32 [ %inc.us, %for.body5.us ], [ 1, %for.body5.lr.ph ]
%rem8.us = and i32 %j.039.us, 1
%cmp9.us = icmp eq i32 %rem8.us, 0
%. = select i1 %cmp9.us, i32 35, i32 46
%putchar37.us = call i32 @putchar(i32 %.)
%inc.us = add nuw nsw i32 %j.039.us, 1
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not.us.not = icmp slt i32 %j.039.us, %4
br i1 %cmp4.not.us.not, label %for.body5.us, label %for.end, !llvm.loop !9
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%j.039 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body5.lr.ph ]
%rem15 = and i32 %j.039, 1
%cmp16.not = icmp eq i32 %rem15, 0
%.49 = select i1 %cmp16.not, i32 46, i32 35
%putchar34 = call i32 @putchar(i32 %.49)
%inc = add nuw nsw i32 %j.039, 1
%5 = load i32, ptr %W, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.039, %5
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body5.us, %for.cond3.preheader
%putchar33 = call i32 @putchar(i32 10)
%inc25 = add nuw nsw i32 %i.041, 1
%6 = load i32, ptr %H, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.041, %6
br i1 %cmp2.not.not, label %for.cond3.preheader, label %for.end26, !llvm.loop !11
for.end26: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%7 = load i32, ptr %H, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
%8 = load i32, ptr %W, align 4
%cmp1 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end26, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int a,b,i,j;
while(1)
{
scanf("%d%d",&a,&b);
if(a==0&&b==0){break;}
for(i=1;i<=a;i++)
{
for(j=1;j<=b;j++)
{
if(j%2==1)
{
if(i%2==1)printf("#");
else printf(".");
}
else
{
if(i%2==1)printf(".");
else printf("#");
}
}
printf("\n");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218343/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218343/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call54 = 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
%cmp55 = icmp eq i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp156 = icmp eq i32 %1, 0
%or.cond57 = select i1 %cmp55, i1 %cmp156, i1 false
br i1 %or.cond57, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end26
%2 = phi i32 [ %7, %for.end26 ], [ %0, %entry ]
%cmp2.not52 = icmp slt i32 %2, 1
br i1 %cmp2.not52, label %for.end26, label %for.cond3.preheader
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.053 = phi i32 [ %inc25, %for.end ], [ 1, %for.cond.preheader ]
%3 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not38 = icmp slt i32 %3, 1
br i1 %cmp4.not38, label %for.end, label %for.body5.lr.ph
for.body5.lr.ph: ; preds = %for.cond3.preheader
%rem8 = and i32 %i.053, 1
%cmp9.not = icmp eq i32 %rem8, 0
br i1 %cmp9.not, label %for.body5.us.us, label %for.body5
for.body5.us.us: ; preds = %for.body5.lr.ph, %for.body5.us.us
%j.039.us.us = phi i32 [ %inc.us.us, %for.body5.us.us ], [ 1, %for.body5.lr.ph ]
%rem.us.us = and i32 %j.039.us.us, 1
%cmp6.not.us.us = icmp eq i32 %rem.us.us, 0
%. = select i1 %cmp6.not.us.us, i32 35, i32 46
%putchar34.us.us = call i32 @putchar(i32 %.)
%inc.us.us = add nuw nsw i32 %j.039.us.us, 1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not.us.us.not = icmp slt i32 %j.039.us.us, %4
br i1 %cmp4.not.us.us.not, label %for.body5.us.us, label %for.end, !llvm.loop !9
for.body5: ; preds = %for.body5.lr.ph, %for.body5
%j.039 = phi i32 [ %inc, %for.body5 ], [ 1, %for.body5.lr.ph ]
%rem = and i32 %j.039, 1
%cmp6.not = icmp eq i32 %rem, 0
%.63 = select i1 %cmp6.not, i32 46, i32 35
%putchar37 = call i32 @putchar(i32 %.63)
%inc = add nuw nsw i32 %j.039, 1
%5 = load i32, ptr %b, align 4, !tbaa !5
%cmp4.not.not = icmp slt i32 %j.039, %5
br i1 %cmp4.not.not, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.body5.us.us, %for.cond3.preheader
%putchar33 = call i32 @putchar(i32 10)
%inc25 = add i32 %i.053, 1
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp2.not = icmp sgt i32 %inc25, %6
br i1 %cmp2.not, label %for.end26, label %for.cond3.preheader, !llvm.loop !11
for.end26: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%7 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp eq i32 %7, 0
%8 = load i32, ptr %b, align 4
%cmp1 = icmp eq i32 %8, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end26, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<math.h>
int main (void)
{
int input1,input2;
int i,j;
do
{
scanf("%d %d",&input1,&input2);
if(input1 == 0 && input2 == 0)
{
break;
}
for(i = 0 ; i < input1 ; i++)
{
for(j = 0 ; j < input2 ; j++)
{
if(j % 2 == i % 2 )
{
printf("#");
}
else
{
printf(".");
}
}
printf("\n");
}
printf("\n");
}while(1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218387/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218387/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%input1 = alloca i32, align 4
%input2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %input2) #4
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input1, ptr noundef nonnull %input2)
%0 = load i32, ptr %input1, align 4, !tbaa !5
%cmp29 = icmp eq i32 %0, 0
%1 = load i32, ptr %input2, align 4
%cmp130 = icmp eq i32 %1, 0
%or.cond31 = select i1 %cmp29, i1 %cmp130, i1 false
br i1 %or.cond31, label %do.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end15
%2 = phi i32 [ %8, %for.end15 ], [ %0, %entry ]
%cmp226 = icmp sgt i32 %2, 0
br i1 %cmp226, label %for.cond3.preheader, label %for.end15
for.cond3.preheader: ; preds = %for.cond.preheader, %for.end
%i.027 = phi i32 [ %inc14, %for.end ], [ 0, %for.cond.preheader ]
%3 = load i32, ptr %input2, align 4, !tbaa !5
%cmp424 = icmp sgt i32 %3, 0
br i1 %cmp424, label %for.body5, label %for.end
for.body5: ; preds = %for.cond3.preheader, %for.body5
%j.025 = phi i32 [ %inc, %for.body5 ], [ 0, %for.cond3.preheader ]
%4 = xor i32 %j.025, %i.027
%5 = and i32 %4, 1
%cmp7 = icmp eq i32 %5, 0
%. = select i1 %cmp7, i32 35, i32 46
%putchar23 = call i32 @putchar(i32 %.)
%inc = add nuw nsw i32 %j.025, 1
%6 = load i32, ptr %input2, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %6
br i1 %cmp4, label %for.body5, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body5, %for.cond3.preheader
%putchar21 = call i32 @putchar(i32 10)
%inc14 = add nuw nsw i32 %i.027, 1
%7 = load i32, ptr %input1, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc14, %7
br i1 %cmp2, label %for.cond3.preheader, label %for.end15, !llvm.loop !11
for.end15: ; preds = %for.end, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input1, ptr noundef nonnull %input2)
%8 = load i32, ptr %input1, align 4, !tbaa !5
%cmp = icmp eq i32 %8, 0
%9 = load i32, ptr %input2, align 4
%cmp1 = icmp eq i32 %9, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %do.end, label %for.cond.preheader
do.end: ; preds = %for.end15, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input2) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %input1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main ()
{
int a,b,c,x,y,z,l,m,n,d ;
int input[1000] ;
int flag = 0 ;
scanf ("%d",&n);
for (a=0 ;a<n;a++)
{
scanf ("%d",&input[a]);
}
d = input[1] - input[0] ;
for (a=0 ;a<n-1 ;a++)
{
if (input[a+1] - input[a] != d)
{
flag= -1 ;
break ;
}
}
if (flag == -1)
{
printf ("%d\n",input[n-1]);
}
else
{
printf ("%d\n",( input[0] + ((n)*d ))) ;
}
return 0 ;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21843/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21843/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%input = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %input) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %input, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%arrayidx2.phi.trans.insert = getelementptr inbounds [1000 x i32], ptr %input, i64 0, i64 1
%.pre = load i32, ptr %arrayidx2.phi.trans.insert, align 4, !tbaa !5
%.pre42 = load i32, ptr %input, align 16, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%3 = phi i32 [ undef, %entry ], [ %.pre42, %for.end.loopexit ]
%4 = phi i32 [ undef, %entry ], [ %.pre, %for.end.loopexit ]
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.end.loopexit ]
%sub = sub nsw i32 %4, %3
%sub5 = add nsw i32 %.lcssa, -1
%smax = call i32 @llvm.smax.i32(i32 %sub5, i32 0)
%wide.trip.count = zext i32 %smax to i64
br label %for.cond4
for.cond4: ; preds = %for.body7, %for.end
%5 = phi i32 [ %6, %for.body7 ], [ %3, %for.end ]
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body7 ], [ 0, %for.end ]
%exitcond.not = icmp eq i64 %indvars.iv39, %wide.trip.count
br i1 %exitcond.not, label %if.else, label %for.body7
for.body7: ; preds = %for.cond4
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %input, i64 0, i64 %indvars.iv.next40
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%sub12 = sub nsw i32 %6, %5
%cmp13.not = icmp eq i32 %sub12, %sub
br i1 %cmp13.not, label %for.cond4, label %if.then18, !llvm.loop !11
if.then18: ; preds = %for.body7
%idxprom20 = sext i32 %sub5 to i64
%arrayidx21 = getelementptr inbounds [1000 x i32], ptr %input, i64 0, i64 %idxprom20
%7 = load i32, ptr %arrayidx21, align 4, !tbaa !5
br label %if.end26
if.else: ; preds = %for.cond4
%mul = mul nsw i32 %sub, %.lcssa
%add24 = add nsw i32 %mul, %3
br label %if.end26
if.end26: ; preds = %if.else, %if.then18
%add24.sink = phi i32 [ %add24, %if.else ], [ %7, %if.then18 ]
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add24.sink)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %input) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#define N 100000
int main(void){
int a, b,i=0, j=0,k,l;
int p[N], q[N];
while(scanf("%d %d", &a, &b), a!=0 && b!=0){
p[i] = a;
q[i] = b;
i++;
}
while(j<i){
for(k=1; k<=p[j]; k++){
for(l=1; l<=q[j]; l++){
if((k%2!=0 && l%2!=0) || (k%2==0 && l%2==0))
printf("#");
else
printf(".");
}
printf("\n");
}
printf("\n");
j++;
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218473/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218473/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%p = alloca [100000 x i32], align 16
%q = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %p) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %q) #4
%call51 = 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
%cmp52 = icmp ne i32 %0, 0
%1 = load i32, ptr %b, align 4
%cmp153 = icmp ne i32 %1, 0
%2 = select i1 %cmp52, i1 %cmp153, i1 false
br i1 %2, label %while.body, label %while.end32
while.cond4.preheader: ; preds = %while.body
%3 = and i64 %indvars.iv.next, 4294967295
%cmp559.not = icmp eq i64 %3, 0
br i1 %cmp559.not, label %while.end32, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %while.cond4.preheader
%wide.trip.count = and i64 %indvars.iv.next, 4294967295
br label %for.cond.preheader
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%4 = phi i32 [ %7, %while.body ], [ %1, %entry ]
%5 = phi i32 [ %6, %while.body ], [ %0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %p, i64 0, i64 %indvars.iv
store i32 %5, ptr %arrayidx, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds [100000 x i32], ptr %q, i64 0, i64 %indvars.iv
store i32 %4, ptr %arrayidx3, align 4, !tbaa !5
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%6 = load i32, ptr %a, align 4, !tbaa !5
%cmp = icmp ne i32 %6, 0
%7 = load i32, ptr %b, align 4
%cmp1 = icmp ne i32 %7, 0
%8 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %8, label %while.body, label %while.cond4.preheader, !llvm.loop !9
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.end29
%indvars.iv65 = phi i64 [ 0, %for.cond.preheader.preheader ], [ %indvars.iv.next66, %for.end29 ]
%arrayidx8 = getelementptr inbounds [100000 x i32], ptr %p, i64 0, i64 %indvars.iv65
%9 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9.not57 = icmp slt i32 %9, 1
br i1 %cmp9.not57, label %for.end29, label %for.cond10.preheader.lr.ph
for.cond10.preheader.lr.ph: ; preds = %for.cond.preheader
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr %q, i64 0, i64 %indvars.iv65
%10 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13.not55 = icmp slt i32 %10, 1
br i1 %cmp13.not55, label %for.cond10.preheader.us, label %for.cond10.preheader
for.cond10.preheader.us: ; preds = %for.cond10.preheader.lr.ph, %for.cond10.preheader.us
%k.058.us = phi i32 [ %inc28.us, %for.cond10.preheader.us ], [ 1, %for.cond10.preheader.lr.ph ]
%putchar45.us = call i32 @putchar(i32 10)
%inc28.us = add nuw i32 %k.058.us, 1
%exitcond64.not = icmp eq i32 %k.058.us, %9
br i1 %exitcond64.not, label %for.end29, label %for.cond10.preheader.us, !llvm.loop !11
for.cond10.preheader: ; preds = %for.cond10.preheader.lr.ph, %for.cond10.for.end_crit_edge
%k.058 = phi i32 [ %inc28, %for.cond10.for.end_crit_edge ], [ 1, %for.cond10.preheader.lr.ph ]
%11 = and i32 %k.058, 1
br label %for.body14
for.body14: ; preds = %for.cond10.preheader, %for.body14
%l.056 = phi i32 [ 1, %for.cond10.preheader ], [ %inc25, %for.body14 ]
%12 = and i32 %11, %l.056
%or.cond.not50 = icmp ne i32 %12, 0
%13 = or i32 %l.056, %k.058
%14 = and i32 %13, 1
%or.cond48 = icmp eq i32 %14, 0
%or.cond49 = or i1 %or.cond.not50, %or.cond48
%. = select i1 %or.cond49, i32 35, i32 46
%putchar47 = call i32 @putchar(i32 %.)
%inc25 = add nuw i32 %l.056, 1
%exitcond.not = icmp eq i32 %l.056, %10
br i1 %exitcond.not, label %for.cond10.for.end_crit_edge, label %for.body14, !llvm.loop !12
for.cond10.for.end_crit_edge: ; preds = %for.body14
%putchar45 = call i32 @putchar(i32 10)
%inc28 = add nuw i32 %k.058, 1
%exitcond63.not = icmp eq i32 %k.058, %9
br i1 %exitcond63.not, label %for.end29, label %for.cond10.preheader, !llvm.loop !11
for.end29: ; preds = %for.cond10.for.end_crit_edge, %for.cond10.preheader.us, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond68.not = icmp eq i64 %indvars.iv.next66, %wide.trip.count
br i1 %exitcond68.not, label %while.end32, label %for.cond.preheader, !llvm.loop !13
while.end32: ; preds = %for.end29, %entry, %while.cond4.preheader
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %q) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %p) #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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
long long a,b,k,c,d;
scanf("%lld %lld %lld",&a,&b,&k);
if(a>k)
{
c=a-k;
printf("%lld %lld",c,b);
}
else if(a<k)
{
c=k-a;
if(c>b)
{
printf("0 0");
}
else{
printf("0 %lld",b-c);}
}
else if(a==k)
{
printf("0 %lld",b);
}
else if(a==0 && b==0)
{
printf("0 0");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218567/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218567/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"0 0\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"0 %lld\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
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %k, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr %b, align 8, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub, i64 noundef %2)
br label %if.end23
if.else: ; preds = %entry
%cmp2 = icmp slt i64 %0, %1
br i1 %cmp2, label %if.then3, label %if.else11
if.then3: ; preds = %if.else
%sub4 = sub nsw i64 %1, %0
%3 = load i64, ptr %b, align 8, !tbaa !5
%cmp5 = icmp sgt i64 %sub4, %3
br i1 %cmp5, label %if.then6, label %if.else8
if.then6: ; preds = %if.then3
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end23
if.else8: ; preds = %if.then3
%sub9 = sub nsw i64 %3, %sub4
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %sub9)
br label %if.end23
if.else11: ; preds = %if.else
%cmp12 = icmp eq i64 %0, %1
br i1 %cmp12, label %if.then13, label %if.else15
if.then13: ; preds = %if.else11
%4 = load i64, ptr %b, align 8, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %4)
br label %if.end23
if.else15: ; preds = %if.else11
%cmp16 = icmp eq i64 %0, 0
%5 = load i64, ptr %b, align 8
%cmp17 = icmp eq i64 %5, 0
%or.cond = select i1 %cmp16, i1 %cmp17, i1 false
br i1 %or.cond, label %if.then18, label %if.end23
if.then18: ; preds = %if.else15
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end23
if.end23: ; preds = %if.else8, %if.then6, %if.else15, %if.then18, %if.then13, %if.then
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
long long a, b, k;
scanf("%lld %lld %lld", &a, &b, &k);
if (a >= k)
{
printf("%lld %lld\n", a - k, b);
return 0;
}
if (a + b >= k)
{
printf("0 %lld\n", b + a - k);
return 0;
}
printf("0 0\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218617/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218617/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"0 %lld\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"0 0\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
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %k, align 8, !tbaa !5
%cmp.not = icmp slt i64 %0, %1
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr %b, align 8, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub, i64 noundef %2)
br label %cleanup
if.end: ; preds = %entry
%3 = load i64, ptr %b, align 8, !tbaa !5
%add = add nsw i64 %3, %0
%cmp2.not = icmp slt i64 %add, %1
br i1 %cmp2.not, label %if.end7, label %if.then3
if.then3: ; preds = %if.end
%sub5 = sub nsw i64 %add, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sub5)
br label %cleanup
if.end7: ; preds = %if.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
cleanup: ; preds = %if.end7, %if.then3, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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>
int main()
{
long long int A,B,K;
scanf("%lld %lld %lld",&A,&B,&K);
if (A>K) {
printf("%lld %lld",A-K,B);
}
else if (A<=K && A+B>K) {
printf("%d %lld",0,A+B-K);
}
else printf("%d %d",0,0);
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218660/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218660/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.2 = private unnamed_addr constant [8 x i8] c"%d %lld\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
%K = 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 %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %K)
%0 = load i64, ptr %A, align 8, !tbaa !5
%1 = load i64, ptr %K, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, %1
br i1 %cmp, label %if.then, label %land.lhs.true
if.then: ; preds = %entry
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr %B, align 8, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub, i64 noundef %2)
br label %if.end10
land.lhs.true: ; preds = %entry
%3 = load i64, ptr %B, align 8, !tbaa !5
%add = add nsw i64 %3, %0
%cmp3 = icmp sgt i64 %add, %1
br i1 %cmp3, label %if.then4, label %if.else8
if.then4: ; preds = %land.lhs.true
%sub6 = sub nsw i64 %add, %1
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0, i64 noundef %sub6)
br label %if.end10
if.else8: ; preds = %land.lhs.true
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 0, i32 noundef 0)
br label %if.end10
if.end10: ; preds = %if.then4, %if.else8, %if.then
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 = !{!"long 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,k;
scanf("%lld%lld%lld",&a,&b,&k);
if(a>=k)
{
a-=k;
}
else
{
k-=a;
b-=k;
a=0;
if(b<0)
{
b=0;
}
}
printf("%lld %lld",a,b);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218710/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218710/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%lld %lld\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
%k = 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 %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %k, align 8, !tbaa !5
%cmp.not = icmp slt i64 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%sub = sub nsw i64 %0, %1
store i64 %sub, ptr %a, align 8, !tbaa !5
%.pre = load i64, ptr %b, align 8, !tbaa !5
br label %if.end5
if.else: ; preds = %entry
%sub1 = sub nsw i64 %1, %0
store i64 %sub1, ptr %k, align 8, !tbaa !5
%2 = load i64, ptr %b, align 8, !tbaa !5
%sub2 = sub nsw i64 %2, %sub1
store i64 %sub2, ptr %b, align 8, !tbaa !5
store i64 0, ptr %a, align 8, !tbaa !5
%cmp3 = icmp slt i64 %sub2, 0
br i1 %cmp3, label %if.then4, label %if.end5
if.then4: ; preds = %if.else
store i64 0, ptr %b, align 8, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.else, %if.then4, %if.then
%3 = phi i64 [ %sub2, %if.else ], [ 0, %if.then4 ], [ %.pre, %if.then ]
%4 = phi i64 [ 0, %if.else ], [ 0, %if.then4 ], [ %sub, %if.then ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4, i64 noundef %3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #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>
long int a,b,k;
int main(){
scanf("%ld %ld %ld", &a, &b, &k);
if(a >= k){
printf("%ld %ld", a - k, b);
} else if(b - k + a > 0){
printf("%ld %ld", 0, b - k + a);
} else{
printf("%ld %ld", 0, 0);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218754/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218754/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@a = dso_local global i64 0, align 8
@b = dso_local global i64 0, align 8
@k = dso_local global i64 0, align 8
@.str.1 = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @k)
%0 = load i64, ptr @a, align 8, !tbaa !5
%1 = load i64, ptr @k, align 8, !tbaa !5
%cmp.not = icmp slt i64 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr @b, align 8, !tbaa !5
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %sub, i64 noundef %2)
br label %if.end10
if.else: ; preds = %entry
%3 = load i64, ptr @b, align 8, !tbaa !5
%sub2 = sub nsw i64 %3, %1
%add = add nsw i64 %sub2, %0
%cmp3 = icmp sgt i64 %add, 0
br i1 %cmp3, label %if.then4, label %if.else8
if.then4: ; preds = %if.else
%call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0, i64 noundef %add)
br label %if.end10
if.else8: ; preds = %if.else
%call9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0, i32 noundef 0)
br label %if.end10
if.end10: ; preds = %if.then4, %if.else8, %if.then
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 A,B,K;
scanf("%lld" "%lld" "%lld",&A,&B,&K);
if(A>=K){
A = A-K;
}else if(A+B>=K){
B = A+B-K;
A = 0;
}else{
A = 0;
B = 0;
}
printf("%lld" " %lld",A,B);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218798/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218798/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%lld %lld\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
%K = 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 %K) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %K)
%0 = load i64, ptr %A, align 8, !tbaa !5
%1 = load i64, ptr %K, align 8, !tbaa !5
%cmp.not = icmp slt i64 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%sub = sub nsw i64 %0, %1
store i64 %sub, ptr %A, align 8, !tbaa !5
%.pre = load i64, ptr %B, align 8, !tbaa !5
br label %if.end6
if.else: ; preds = %entry
%2 = load i64, ptr %B, align 8, !tbaa !5
%add = add nsw i64 %2, %0
%cmp1.not = icmp slt i64 %add, %1
br i1 %cmp1.not, label %if.else5, label %if.then2
if.then2: ; preds = %if.else
%sub4 = sub nsw i64 %add, %1
store i64 %sub4, ptr %B, align 8, !tbaa !5
store i64 0, ptr %A, align 8, !tbaa !5
br label %if.end6
if.else5: ; preds = %if.else
store i64 0, ptr %A, align 8, !tbaa !5
store i64 0, ptr %B, align 8, !tbaa !5
br label %if.end6
if.end6: ; preds = %if.then2, %if.else5, %if.then
%3 = phi i64 [ %sub4, %if.then2 ], [ 0, %if.else5 ], [ %.pre, %if.then ]
%4 = phi i64 [ 0, %if.then2 ], [ 0, %if.else5 ], [ %sub, %if.then ]
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4, i64 noundef %3)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %K) #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>
int main(){
long long int a, b, k;
scanf("%lld %lld %lld", &a, &b, &k);
long long int x, y = b;
x = a-k;
if(x >= 0){
k = 0;
}else{
k = -1 * x;
x = 0;
}
y -= k;
if(y < 0){
y = 0;
}
printf("%lld %lld", x, y);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218840/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218840/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\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
%k = 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 %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %k)
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i64, ptr %k, align 8, !tbaa !5
%sub = sub nsw i64 %1, %2
%cmp = icmp sgt i64 %sub, -1
%mul = sub nsw i64 0, %sub
%storemerge = select i1 %cmp, i64 0, i64 %mul
%x.0 = select i1 %cmp, i64 %sub, i64 0
store i64 %storemerge, ptr %k, align 8, !tbaa !5
%sub1 = sub nsw i64 %0, %storemerge
%spec.store.select = call i64 @llvm.smax.i64(i64 %sub1, i64 0)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %x.0, i64 noundef %spec.store.select)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){n+= n<0?((-n)/MOD1+1)*MOD1:0; return n%=MOD1;}
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);}
typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}
/*aのb進数時の桁数*/
ll digits(ll a, ll b){return a/b?1+digits(a/b,b):1;}
/*nをa進数にしたときの、i桁目の数*/
ll a_base2(ll n, ll a, ll i){return i==1?n%a:a_base2(n/a,a,i-1);}
ll n;
ll dfs(ll a, ll dig){
if(a>n) return 0;
if(digits(n,10)==dig) return 1;
ll ans=1,one=a%10;
rep(i,0,10){
ans+=dfs(a*10-9*one+10*i,dig+1);
}
return ans;
}
int main(void){
ll ans=0;
// char ;
scanf("%lld",&n);
// ll [n];
rep(i,1,10){
rep(j,i,10){
ll a=0,b=0;
if(i==j){
if(i>n) continue;
a++;
a+=dfs(10*i+j,2);
ans+=a*a;
b=a;
}else{
a+=dfs(10*i+j,2);
b+=dfs(10*j+i,2);
ans+=a*b*2;
}
// printf("%lld %lld ||",a,b);
// ans+=a*b;
}
// PN;
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218891/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218891/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = dso_local global i64 0, align 8
@.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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #1 {
entry:
%cmp.not = icmp sgt i64 %a, %b
%cmp1.not = icmp sgt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #1 {
entry:
%cmp.not = icmp slt i64 %a, %b
%cmp1.not = icmp slt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #2 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #2 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #1 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %c.04.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %c.04, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod(i64 noundef %n) local_unnamed_addr #4 {
entry:
%cmp = icmp slt i64 %n, 0
br i1 %cmp, label %cond.true, label %cond.end
cond.true: ; preds = %entry
%n.nonneg = sub i64 0, %n
%0 = urem i64 %n.nonneg, 1000000007
%1 = add nsw i64 %0, %n
%mul = sub i64 1000000007, %1
br label %cond.end
cond.end: ; preds = %entry, %cond.true
%cond = phi i64 [ %mul, %cond.true ], [ 0, %entry ]
%add1 = add nsw i64 %cond, %n
%rem = srem i64 %add1, 1000000007
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
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) #5 {
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 #6 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #11
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #6 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #11
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #5 {
entry:
%0 = load i64, ptr %p, align 8, !tbaa !19
%1 = load i64, ptr %q, align 8, !tbaa !19
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #5 {
entry:
%0 = load i64, ptr %q, align 8, !tbaa !19
%1 = load i64, ptr %p, align 8, !tbaa !19
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #6 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #11
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #6 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #11
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @digits(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%accumulator.tr = phi i64 [ 0, %entry ], [ %add, %tailrecurse ]
%a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse ]
%div = sdiv i64 %a.tr, %b
%tobool.not = icmp eq i64 %div, 0
%add = add nuw nsw i64 %accumulator.tr, 1
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i64 %add
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @a_base2(i64 noundef %n, i64 noundef %a, i64 noundef %i) local_unnamed_addr #3 {
entry:
%cmp5 = icmp eq i64 %i, 1
br i1 %cmp5, label %cond.true, label %cond.false.preheader
cond.false.preheader: ; preds = %entry
%0 = add i64 %i, 3
%1 = add i64 %i, -2
%xtraiter = and i64 %0, 3
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %cond.false.prol.loopexit, label %cond.false.prol
cond.false.prol: ; preds = %cond.false.preheader, %cond.false.prol
%i.tr7.prol = phi i64 [ %sub.prol, %cond.false.prol ], [ %i, %cond.false.preheader ]
%n.tr6.prol = phi i64 [ %div.prol, %cond.false.prol ], [ %n, %cond.false.preheader ]
%prol.iter = phi i64 [ %prol.iter.next, %cond.false.prol ], [ 0, %cond.false.preheader ]
%div.prol = sdiv i64 %n.tr6.prol, %a
%sub.prol = add nsw i64 %i.tr7.prol, -1
%prol.iter.next = add i64 %prol.iter, 1
%prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
br i1 %prol.iter.cmp.not, label %cond.false.prol.loopexit, label %cond.false.prol, !llvm.loop !21
cond.false.prol.loopexit: ; preds = %cond.false.prol, %cond.false.preheader
%div.lcssa.unr = phi i64 [ undef, %cond.false.preheader ], [ %div.prol, %cond.false.prol ]
%i.tr7.unr = phi i64 [ %i, %cond.false.preheader ], [ %sub.prol, %cond.false.prol ]
%n.tr6.unr = phi i64 [ %n, %cond.false.preheader ], [ %div.prol, %cond.false.prol ]
%2 = icmp ult i64 %1, 3
br i1 %2, label %cond.true, label %cond.false
cond.true: ; preds = %cond.false.prol.loopexit, %cond.false, %entry
%n.tr.lcssa = phi i64 [ %n, %entry ], [ %div.lcssa.unr, %cond.false.prol.loopexit ], [ %div.3, %cond.false ]
%rem = srem i64 %n.tr.lcssa, %a
ret i64 %rem
cond.false: ; preds = %cond.false.prol.loopexit, %cond.false
%i.tr7 = phi i64 [ %sub.3, %cond.false ], [ %i.tr7.unr, %cond.false.prol.loopexit ]
%n.tr6 = phi i64 [ %div.3, %cond.false ], [ %n.tr6.unr, %cond.false.prol.loopexit ]
%div = sdiv i64 %n.tr6, %a
%div.1 = sdiv i64 %div, %a
%div.2 = sdiv i64 %div.1, %a
%div.3 = sdiv i64 %div.2, %a
%sub.3 = add nsw i64 %i.tr7, -4
%cmp.3 = icmp eq i64 %sub.3, 1
br i1 %cmp.3, label %cond.true, label %cond.false
}
; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @dfs(i64 noundef %a, i64 noundef %dig) local_unnamed_addr #8 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end3, %entry
%accumulator.tr = phi i64 [ 0, %entry ], [ %add9.9, %if.end3 ]
%a.tr = phi i64 [ %a, %entry ], [ %add.9, %if.end3 ]
%dig.tr = phi i64 [ %dig, %entry ], [ %add7, %if.end3 ]
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %a.tr
br i1 %cmp, label %return, label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse, %tailrecurse.i
%accumulator.tr.i = phi i64 [ %add.i, %tailrecurse.i ], [ 0, %tailrecurse ]
%a.tr.i = phi i64 [ %div.i, %tailrecurse.i ], [ %0, %tailrecurse ]
%div.i = sdiv i64 %a.tr.i, 10
%a.tr.i.off = add i64 %a.tr.i, 9
%tobool.not.i = icmp ult i64 %a.tr.i.off, 19
%add.i = add nuw nsw i64 %accumulator.tr.i, 1
br i1 %tobool.not.i, label %digits.exit, label %tailrecurse.i
digits.exit: ; preds = %tailrecurse.i
%cmp1 = icmp eq i64 %add.i, %dig.tr
br i1 %cmp1, label %return, label %if.end3
if.end3: ; preds = %digits.exit
%rem = srem i64 %a.tr, 10
%mul5.neg = mul nsw i64 %rem, -9
%add7 = add nsw i64 %dig.tr, 1
%reass.mul = mul i64 %a.tr, 10
%add = add i64 %reass.mul, %mul5.neg
%call8 = tail call i64 @dfs(i64 noundef %add, i64 noundef %add7)
%add9 = add nsw i64 %call8, 1
%1 = mul i64 %a.tr, 10
%reass.mul.1 = add i64 %1, 10
%add.1 = add i64 %reass.mul.1, %mul5.neg
%call8.1 = tail call i64 @dfs(i64 noundef %add.1, i64 noundef %add7)
%add9.1 = add nsw i64 %call8.1, %add9
%2 = mul i64 %a.tr, 10
%reass.mul.2 = add i64 %2, 20
%add.2 = add i64 %reass.mul.2, %mul5.neg
%call8.2 = tail call i64 @dfs(i64 noundef %add.2, i64 noundef %add7)
%add9.2 = add nsw i64 %call8.2, %add9.1
%3 = mul i64 %a.tr, 10
%reass.mul.3 = add i64 %3, 30
%add.3 = add i64 %reass.mul.3, %mul5.neg
%call8.3 = tail call i64 @dfs(i64 noundef %add.3, i64 noundef %add7)
%add9.3 = add nsw i64 %call8.3, %add9.2
%4 = mul i64 %a.tr, 10
%reass.mul.4 = add i64 %4, 40
%add.4 = add i64 %reass.mul.4, %mul5.neg
%call8.4 = tail call i64 @dfs(i64 noundef %add.4, i64 noundef %add7)
%add9.4 = add nsw i64 %call8.4, %add9.3
%5 = mul i64 %a.tr, 10
%reass.mul.5 = add i64 %5, 50
%add.5 = add i64 %reass.mul.5, %mul5.neg
%call8.5 = tail call i64 @dfs(i64 noundef %add.5, i64 noundef %add7)
%add9.5 = add nsw i64 %call8.5, %add9.4
%6 = mul i64 %a.tr, 10
%reass.mul.6 = add i64 %6, 60
%add.6 = add i64 %reass.mul.6, %mul5.neg
%call8.6 = tail call i64 @dfs(i64 noundef %add.6, i64 noundef %add7)
%add9.6 = add nsw i64 %call8.6, %add9.5
%7 = mul i64 %a.tr, 10
%reass.mul.7 = add i64 %7, 70
%add.7 = add i64 %reass.mul.7, %mul5.neg
%call8.7 = tail call i64 @dfs(i64 noundef %add.7, i64 noundef %add7)
%add9.7 = add nsw i64 %call8.7, %add9.6
%8 = mul i64 %a.tr, 10
%reass.mul.8 = add i64 %8, 80
%add.8 = add i64 %reass.mul.8, %mul5.neg
%call8.8 = tail call i64 @dfs(i64 noundef %add.8, i64 noundef %add7)
%add9.8 = add nsw i64 %call8.8, %add9.7
%9 = mul i64 %a.tr, 10
%reass.mul.9 = add i64 %9, 90
%add.9 = add i64 %reass.mul.9, %mul5.neg
%add9.9 = add nsw i64 %accumulator.tr, %add9.8
br label %tailrecurse
return: ; preds = %digits.exit, %tailrecurse
%retval.0 = phi i64 [ 0, %tailrecurse ], [ 1, %digits.exit ]
%accumulator.ret.tr = add nsw i64 %accumulator.tr, %retval.0
ret i64 %accumulator.ret.tr
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i64, ptr @n, align 8
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.cond.cleanup3
%i.058 = phi i64 [ 1, %entry ], [ %inc28, %for.cond.cleanup3 ]
%ans.057 = phi i64 [ 0, %entry ], [ %.us-phi, %for.cond.cleanup3 ]
%mul12 = mul nuw nsw i64 %i.058, 10
%cmp6 = icmp sgt i64 %i.058, %0
%cmp6.fr = freeze i1 %cmp6
br i1 %cmp6.fr, label %for.body4.us, label %for.body4.preheader
for.body4.preheader: ; preds = %for.cond1.preheader
%add = mul nuw nsw i64 %i.058, 11
br label %for.body4
for.body4.us: ; preds = %for.cond1.preheader, %cleanup.us
%j.055.us = phi i64 [ %inc25.us, %cleanup.us ], [ %i.058, %for.cond1.preheader ]
%ans.154.us = phi i64 [ %ans.3.us, %cleanup.us ], [ %ans.057, %for.cond1.preheader ]
%cmp5.us = icmp eq i64 %i.058, %j.055.us
br i1 %cmp5.us, label %cleanup.us, label %if.else.us
if.else.us: ; preds = %for.body4.us
%add13.us = add nuw nsw i64 %j.055.us, %mul12
%call14.us = tail call i64 @dfs(i64 noundef %add13.us, i64 noundef 2)
%mul16.us = mul nuw nsw i64 %j.055.us, 10
%add17.us = add nuw nsw i64 %mul16.us, %i.058
%call18.us = tail call i64 @dfs(i64 noundef %add17.us, i64 noundef 2)
%mul20.us = shl i64 %call14.us, 1
%mul21.us = mul i64 %mul20.us, %call18.us
%ans.2.us = add nsw i64 %mul21.us, %ans.154.us
br label %cleanup.us
cleanup.us: ; preds = %for.body4.us, %if.else.us
%ans.3.us = phi i64 [ %ans.2.us, %if.else.us ], [ %ans.154.us, %for.body4.us ]
%inc25.us = add nuw nsw i64 %j.055.us, 1
%cmp2.us = icmp ult i64 %j.055.us, 9
br i1 %cmp2.us, label %for.body4.us, label %for.cond.cleanup3, !llvm.loop !22
for.cond.cleanup: ; preds = %for.cond.cleanup3
%call31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.us-phi)
ret i32 0
for.cond.cleanup3: ; preds = %if.end23, %cleanup.us
%.us-phi = phi i64 [ %ans.3.us, %cleanup.us ], [ %ans.2, %if.end23 ]
%inc28 = add nuw nsw i64 %i.058, 1
%exitcond.not = icmp eq i64 %inc28, 10
br i1 %exitcond.not, label %for.cond.cleanup, label %for.cond1.preheader, !llvm.loop !23
for.body4: ; preds = %for.body4.preheader, %if.end23
%j.055 = phi i64 [ %inc25, %if.end23 ], [ %i.058, %for.body4.preheader ]
%ans.154 = phi i64 [ %ans.2, %if.end23 ], [ %ans.057, %for.body4.preheader ]
%cmp5 = icmp eq i64 %i.058, %j.055
br i1 %cmp5, label %if.then, label %if.else
if.then: ; preds = %for.body4
%call8 = tail call i64 @dfs(i64 noundef %add, i64 noundef 2)
%add9 = add nsw i64 %call8, 1
%mul10 = mul nsw i64 %add9, %add9
br label %if.end23
if.else: ; preds = %for.body4
%add13 = add nuw nsw i64 %j.055, %mul12
%call14 = tail call i64 @dfs(i64 noundef %add13, i64 noundef 2)
%mul16 = mul nuw nsw i64 %j.055, 10
%add17 = add nuw nsw i64 %mul16, %i.058
%call18 = tail call i64 @dfs(i64 noundef %add17, i64 noundef 2)
%mul20 = shl i64 %call14, 1
%mul21 = mul i64 %mul20, %call18
br label %if.end23
if.end23: ; preds = %if.else, %if.then
%mul10.pn = phi i64 [ %mul10, %if.then ], [ %mul21, %if.else ]
%ans.2 = add nsw i64 %mul10.pn, %ans.154
%inc25 = add nuw nsw i64 %j.055, 1
%cmp2 = icmp ult i64 %j.055, 9
br i1 %cmp2, label %for.body4, label %for.cond.cleanup3, !llvm.loop !22
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #10
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 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 nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree "no-trapping-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 nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !6, i64 8}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10}
|
//set many funcs template
//Ver.20190820
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#include<assert.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
void swap(int *a,int *b){int c;c=(*a);(*a)=(*b);(*b)=c;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
void llswap(long long *a,long long *b){long long c;c=(*a);(*a)=(*b);(*b)=c;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
void dbswap(double *a,double *b){double c;c=(*a);(*a)=(*b);(*b)=c;}
void chswap(char *a,char *b){char c;c=(*a);(*a)=(*b);(*b)=c;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
void shuffledget(int x[],int n){
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
void prarr(int arr[],int n){
int i;
for(i=0;i<n;i++){
if(i){printf(" ");}
printf("%d",arr[i]);
}
printf("\n");
return;
}
void getperm(int a[],int n){
int i,p;
for(i=0;i<n;i++){
a[i]=i;
}
for(i=n-1;i>=1;i--){
p=rand()%(i+1);
swap(&a[p],&a[i]);
}
}
typedef struct{
int val;
int node;
}sd;
int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}
void coordinate_comp(int a[],int n){
int i,c=0;
sd dat[524288];
for(i=0;i<n;i++){
dat[i].val=a[i];
dat[i].node=i;
}
qsort(dat,n,sizeof(dat[0]),sdsortfnc);
a[dat[0].node]=c;
for(i=1;i<n;i++){
if(dat[i-1].val!=dat[i].val){c++;}
a[dat[i].node]=c;
}
}
int main(void){
long long i,j,n,m,k,a[524288],b,c,h,w,r=0,l,t;
char s[32];
scanf("%lld",&n);
for(i=1;i<=n;i++){
if(i%10==0){continue;}
sprintf(s,"%lld",i);
h=s[0]-'0';
w=s[strlen(s)-1]-'0';
if(h==w){r++;}
for(j=1;j<7;j++){
t=w*llpow(10,j)+h;
if(t<=n){
r++;
r+=llmin((n-t)/10,llpow(10,j-1)-1);
}
}
}
printf("%lld\n",r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218934/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218934/source.c"
target datalayout = "e-m:e-p270: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.sd = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
@.str.3 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.4 = 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 i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
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 #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
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.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; 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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
store i32 %1, ptr %a, align 4, !tbaa !16
store i32 %0, ptr %b, align 4, !tbaa !16
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !20
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !21
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !22
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !23
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !25
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !26
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !27
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !28
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @llswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
store i64 %1, ptr %a, align 8, !tbaa !29
store i64 %0, ptr %b, align 8, !tbaa !29
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dbswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
store double %1, ptr %a, align 8, !tbaa !31
store double %0, ptr %b, align 8, !tbaa !31
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @chswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
store i8 %1, ptr %a, align 1, !tbaa !33
store i8 %0, ptr %b, align 1, !tbaa !33
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp sgt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #8 {
entry:
%b = alloca [524288 x i32], align 16
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #17
%cmp40 = icmp sgt i32 %n, 0
br i1 %cmp40, label %for.body.preheader, label %for.end25
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader57, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !16
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader57
for.body.preheader57: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block
br i1 %cmp40, label %for.body3.preheader, label %for.end25
for.body3.preheader: ; preds = %for.cond1.preheader
%3 = zext i32 %n to i64
br label %for.body3
for.body: ; preds = %for.body.preheader57, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader57 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !16
%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.cond1.preheader, label %for.body, !llvm.loop !35
for.cond15.preheader: ; preds = %for.body3
br i1 %cmp40, label %for.body17.preheader, label %for.end25
for.body17.preheader: ; preds = %for.cond15.preheader
%wide.trip.count54 = zext i32 %n to i64
br label %for.body17
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv47 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next48, %for.body3 ]
%call = tail call i32 @rand() #17
%5 = trunc i64 %indvars.iv47 to i32
%rem = srem i32 %call, %5
%indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
%idxprom4 = and i64 %indvars.iv.next48, 4294967295
%arrayidx5 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom4
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !16
%idxprom6 = sext i32 %rem to i64
%arrayidx7 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom6
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !16
store i32 %7, ptr %arrayidx5, align 4, !tbaa !16
store i32 %6, ptr %arrayidx7, align 4, !tbaa !16
%cmp2 = icmp ugt i64 %indvars.iv47, 1
br i1 %cmp2, label %for.body3, label %for.cond15.preheader, !llvm.loop !36
for.body17: ; preds = %for.body17.preheader, %for.body17
%indvars.iv50 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next51, %for.body17 ]
%arrayidx19 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv50
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !16
%idxprom20 = sext i32 %8 to i64
%arrayidx21 = getelementptr inbounds i32, ptr %x, i64 %idxprom20
%call22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx21)
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54
br i1 %exitcond55.not, label %for.end25, label %for.body17, !llvm.loop !37
for.end25: ; preds = %for.body17, %entry, %for.cond1.preheader, %for.cond15.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #17
ret void
}
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #11 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !16
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #12 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !16
%call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar6 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !16
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nounwind uwtable
define dso_local void @getperm(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%cmp20 = icmp sgt i32 %n, 0
br i1 %cmp20, label %for.body.preheader, label %for.end9
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader30, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds i32, ptr %a, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 4, !tbaa !16
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 4, !tbaa !16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !41
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader30
for.body.preheader30: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block
%cmp222 = icmp sgt i32 %n, 1
br i1 %cmp222, label %for.body3.preheader, label %for.end9
for.body3.preheader: ; preds = %for.cond1.preheader
%3 = zext i32 %n to i64
br label %for.body3
for.body: ; preds = %for.body.preheader30, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader30 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !16
%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.cond1.preheader, label %for.body, !llvm.loop !42
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv25 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next26, %for.body3 ]
%indvars.iv.next26 = add nsw i64 %indvars.iv25, -1
%call = tail call i32 @rand() #17
%5 = trunc i64 %indvars.iv25 to i32
%rem = srem i32 %call, %5
%idxprom4 = sext i32 %rem to i64
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %idxprom4
%idxprom6 = and i64 %indvars.iv.next26, 4294967295
%arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %idxprom6
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !16
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !16
store i32 %7, ptr %arrayidx5, align 4, !tbaa !16
store i32 %6, ptr %arrayidx7, align 4, !tbaa !16
%cmp2 = icmp ugt i64 %indvars.iv25, 2
br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !43
for.end9: ; preds = %for.body3, %entry, %for.cond1.preheader
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !44
%1 = load i32, ptr %b, align 4, !tbaa !44
%cmp = icmp slt i32 %0, %1
%cmp4 = icmp sgt i32 %0, %1
%. = zext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @coordinate_comp(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #12 {
entry:
%dat = alloca [524288 x %struct.sd], align 16
call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %dat) #17
%cmp46 = icmp sgt i32 %n, 0
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 4
br i1 %min.iters.check, label %for.body.preheader61, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
%0 = or i64 %index, 2
%1 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <2 x i32>, ptr %1, align 4, !tbaa !16
%2 = getelementptr inbounds i32, ptr %1, i64 2
%wide.load59 = load <2 x i32>, ptr %2, align 4, !tbaa !16
%3 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %index
%4 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %0
%interleaved.vec = shufflevector <2 x i32> %wide.load, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %3, align 16, !tbaa !16
%interleaved.vec60 = shufflevector <2 x i32> %wide.load59, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec60, ptr %4, align 16, !tbaa !16
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !46
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader61
for.body.preheader61: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%6 = load i32, ptr %arrayidx, align 4, !tbaa !16
%arrayidx2 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv
store i32 %6, ptr %arrayidx2, align 8, !tbaa !44
%node = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv, i32 1
%7 = trunc i64 %indvars.iv to i32
store i32 %7, ptr %node, align 4, !tbaa !47
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !48
for.end: ; preds = %for.body, %middle.block, %entry
%conv = sext i32 %n to i64
call void @qsort(ptr noundef nonnull %dat, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @sdsortfnc) #17
%node6 = getelementptr inbounds %struct.sd, ptr %dat, i64 0, i32 1
%8 = load i32, ptr %node6, align 4, !tbaa !47
%idxprom7 = sext i32 %8 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7
store i32 0, ptr %arrayidx8, align 4, !tbaa !16
%cmp1048 = icmp sgt i32 %n, 1
br i1 %cmp1048, label %for.body12.preheader, label %for.end29
for.body12.preheader: ; preds = %for.end
%wide.trip.count56 = zext i32 %n to i64
%.pre = load i32, ptr %dat, align 16, !tbaa !44
%9 = add nsw i64 %wide.trip.count56, -1
%xtraiter = and i64 %9, 1
%10 = icmp eq i32 %n, 2
br i1 %10, label %for.end29.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %9, -2
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%11 = phi i32 [ %.pre, %for.body12.preheader.new ], [ %14, %for.body12 ]
%indvars.iv52 = phi i64 [ 1, %for.body12.preheader.new ], [ %indvars.iv.next53.1, %for.body12 ]
%c.050 = phi i32 [ 0, %for.body12.preheader.new ], [ %spec.select.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx17 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52
%12 = load i32, ptr %arrayidx17, align 8, !tbaa !44
%cmp19.not = icmp ne i32 %11, %12
%inc21 = zext i1 %cmp19.not to i32
%spec.select = add nuw nsw i32 %c.050, %inc21
%node24 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52, i32 1
%13 = load i32, ptr %node24, align 4, !tbaa !47
%idxprom25 = sext i32 %13 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %a, i64 %idxprom25
store i32 %spec.select, ptr %arrayidx26, align 4, !tbaa !16
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%arrayidx17.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53
%14 = load i32, ptr %arrayidx17.1, align 8, !tbaa !44
%cmp19.not.1 = icmp ne i32 %12, %14
%inc21.1 = zext i1 %cmp19.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc21.1
%node24.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53, i32 1
%15 = load i32, ptr %node24.1, align 4, !tbaa !47
%idxprom25.1 = sext i32 %15 to i64
%arrayidx26.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom25.1
store i32 %spec.select.1, ptr %arrayidx26.1, align 4, !tbaa !16
%indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 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.end29.loopexit.unr-lcssa, label %for.body12, !llvm.loop !49
for.end29.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%.unr = phi i32 [ %.pre, %for.body12.preheader ], [ %14, %for.body12 ]
%indvars.iv52.unr = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next53.1, %for.body12 ]
%c.050.unr = phi i32 [ 0, %for.body12.preheader ], [ %spec.select.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.body12.epil
for.body12.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx17.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr
%16 = load i32, ptr %arrayidx17.epil, align 8, !tbaa !44
%cmp19.not.epil = icmp ne i32 %.unr, %16
%inc21.epil = zext i1 %cmp19.not.epil to i32
%spec.select.epil = add nuw nsw i32 %c.050.unr, %inc21.epil
%node24.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr, i32 1
%17 = load i32, ptr %node24.epil, align 4, !tbaa !47
%idxprom25.epil = sext i32 %17 to i64
%arrayidx26.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom25.epil
store i32 %spec.select.epil, ptr %arrayidx26.epil, align 4, !tbaa !16
br label %for.end29
for.end29: ; preds = %for.body12.epil, %for.end29.loopexit.unr-lcssa, %for.end
call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %dat) #17
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #12 {
entry:
%n = alloca i64, align 8
%s = alloca [32 x i8], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #17
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %s) #17
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !29
%cmp.not57 = icmp slt i64 %0, 1
br i1 %cmp.not57, label %for.end34, label %for.body
for.body: ; preds = %entry, %for.inc32
%1 = phi i64 [ %5, %for.inc32 ], [ %0, %entry ]
%i.059 = phi i64 [ %inc33, %for.inc32 ], [ 1, %entry ]
%r.058 = phi i64 [ %r.4, %for.inc32 ], [ 0, %entry ]
%rem = urem i64 %i.059, 10
%cmp1 = icmp eq i64 %rem, 0
br i1 %cmp1, label %for.inc32, label %if.end
if.end: ; preds = %for.body
%call2 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %i.059) #17
%2 = load i8, ptr %s, align 16, !tbaa !33
%conv = sext i8 %2 to i64
%sub = add nsw i64 %conv, -48
%call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #16
%sub6 = add i64 %call5, -1
%arrayidx7 = getelementptr inbounds [32 x i8], ptr %s, i64 0, i64 %sub6
%3 = load i8, ptr %arrayidx7, align 1, !tbaa !33
%conv8 = sext i8 %3 to i64
%sub9 = add nsw i64 %conv8, -48
%cmp11 = icmp eq i8 %2, %3
%inc = zext i1 %cmp11 to i64
%spec.select = add nsw i64 %r.058, %inc
%4 = load i64, ptr %n, align 8, !tbaa !29
%mul = mul nsw i64 %sub9, 10
%add = add nsw i64 %sub, %mul
%cmp20.not = icmp sgt i64 %add, %4
br i1 %cmp20.not, label %for.inc, label %llpow.exit54
llpow.exit54: ; preds = %if.end
%sub24 = sub nsw i64 %4, %add
%div = sdiv i64 %sub24, 10
%inc23 = add nsw i64 %spec.select, 1
%a.b.i = call i64 @llvm.smin.i64(i64 %div, i64 0)
%add29 = add nsw i64 %inc23, %a.b.i
br label %for.inc
for.inc: ; preds = %if.end, %llpow.exit54
%r.3 = phi i64 [ %add29, %llpow.exit54 ], [ %spec.select, %if.end ]
%mul.1 = mul nsw i64 %sub9, 100
%add.1 = add nsw i64 %sub, %mul.1
%cmp20.not.1 = icmp sgt i64 %add.1, %4
br i1 %cmp20.not.1, label %for.inc.1, label %llpow.exit54.1
llpow.exit54.1: ; preds = %for.inc
%inc23.1 = add nsw i64 %r.3, 1
%sub24.1 = sub nsw i64 %4, %add.1
%div.1 = sdiv i64 %sub24.1, 10
%a.b.i.1 = call i64 @llvm.smin.i64(i64 %div.1, i64 9)
%add29.1 = add nsw i64 %inc23.1, %a.b.i.1
br label %for.inc.1
for.inc.1: ; preds = %llpow.exit54.1, %for.inc
%r.3.1 = phi i64 [ %add29.1, %llpow.exit54.1 ], [ %r.3, %for.inc ]
%mul.2 = mul nsw i64 %sub9, 1000
%add.2 = add nsw i64 %sub, %mul.2
%cmp20.not.2 = icmp sgt i64 %add.2, %4
br i1 %cmp20.not.2, label %for.inc.2, label %llpow.exit54.2
llpow.exit54.2: ; preds = %for.inc.1
%inc23.2 = add nsw i64 %r.3.1, 1
%sub24.2 = sub nsw i64 %4, %add.2
%div.2 = sdiv i64 %sub24.2, 10
%a.b.i.2 = call i64 @llvm.smin.i64(i64 %div.2, i64 99)
%add29.2 = add nsw i64 %inc23.2, %a.b.i.2
br label %for.inc.2
for.inc.2: ; preds = %llpow.exit54.2, %for.inc.1
%r.3.2 = phi i64 [ %add29.2, %llpow.exit54.2 ], [ %r.3.1, %for.inc.1 ]
%mul.3 = mul nsw i64 %sub9, 10000
%add.3 = add nsw i64 %sub, %mul.3
%cmp20.not.3 = icmp sgt i64 %add.3, %4
br i1 %cmp20.not.3, label %for.inc.3, label %llpow.exit54.3
llpow.exit54.3: ; preds = %for.inc.2
%inc23.3 = add nsw i64 %r.3.2, 1
%sub24.3 = sub nsw i64 %4, %add.3
%div.3 = sdiv i64 %sub24.3, 10
%a.b.i.3 = call i64 @llvm.smin.i64(i64 %div.3, i64 999)
%add29.3 = add nsw i64 %inc23.3, %a.b.i.3
br label %for.inc.3
for.inc.3: ; preds = %llpow.exit54.3, %for.inc.2
%r.3.3 = phi i64 [ %add29.3, %llpow.exit54.3 ], [ %r.3.2, %for.inc.2 ]
%mul.4 = mul nsw i64 %sub9, 100000
%add.4 = add nsw i64 %sub, %mul.4
%cmp20.not.4 = icmp sgt i64 %add.4, %4
br i1 %cmp20.not.4, label %for.inc.4, label %llpow.exit54.4
llpow.exit54.4: ; preds = %for.inc.3
%inc23.4 = add nsw i64 %r.3.3, 1
%sub24.4 = sub nsw i64 %4, %add.4
%div.4 = sdiv i64 %sub24.4, 10
%a.b.i.4 = call i64 @llvm.smin.i64(i64 %div.4, i64 9999)
%add29.4 = add nsw i64 %inc23.4, %a.b.i.4
br label %for.inc.4
for.inc.4: ; preds = %llpow.exit54.4, %for.inc.3
%r.3.4 = phi i64 [ %add29.4, %llpow.exit54.4 ], [ %r.3.3, %for.inc.3 ]
%mul.5 = mul nsw i64 %sub9, 1000000
%add.5 = add nsw i64 %sub, %mul.5
%cmp20.not.5 = icmp sgt i64 %add.5, %4
br i1 %cmp20.not.5, label %for.inc32, label %llpow.exit54.5
llpow.exit54.5: ; preds = %for.inc.4
%inc23.5 = add nsw i64 %r.3.4, 1
%sub24.5 = sub nsw i64 %4, %add.5
%div.5 = sdiv i64 %sub24.5, 10
%a.b.i.5 = call i64 @llvm.smin.i64(i64 %div.5, i64 99999)
%add29.5 = add nsw i64 %inc23.5, %a.b.i.5
br label %for.inc32
for.inc32: ; preds = %for.inc.4, %llpow.exit54.5, %for.body
%5 = phi i64 [ %1, %for.body ], [ %4, %llpow.exit54.5 ], [ %4, %for.inc.4 ]
%r.4 = phi i64 [ %r.058, %for.body ], [ %add29.5, %llpow.exit54.5 ], [ %r.3.4, %for.inc.4 ]
%inc33 = add nuw nsw i64 %i.059, 1
%cmp.not.not = icmp slt i64 %i.059, %5
br i1 %cmp.not.not, label %for.body, label %for.end34, !llvm.loop !50
for.end34: ; preds = %for.inc32, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %r.4, %for.inc32 ]
%call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %r.0.lcssa)
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %s) #17
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #17
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #15
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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nofree nounwind }
attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !18, i64 0}
!18 = !{!"omnipotent char", !19, i64 0}
!19 = !{!"Simple C/C++ TBAA"}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !6}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !6}
!28 = distinct !{!28, !6}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !18, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !18, i64 0}
!33 = !{!18, !18, i64 0}
!34 = distinct !{!34, !6, !9, !10}
!35 = distinct !{!35, !6, !10, !9}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !40}
!40 = !{!"llvm.loop.peeled.count", i32 1}
!41 = distinct !{!41, !6, !9, !10}
!42 = distinct !{!42, !6, !10, !9}
!43 = distinct !{!43, !6}
!44 = !{!45, !17, i64 0}
!45 = !{!"", !17, i64 0, !17, i64 4}
!46 = distinct !{!46, !6, !9, !10}
!47 = !{!45, !17, i64 4}
!48 = distinct !{!48, !6, !10, !9}
!49 = distinct !{!49, !6}
!50 = distinct !{!50, !6}
|
#include<stdio.h>
int gcd(int a,int b)
{
if(b==0)
return a;
else
return gcd(b,a%b);
}
int main()
{
int n,ans;
scanf("%d",&n);
ans=(360*n)/gcd(360,n);
printf("%d",ans/n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_218978/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_218978/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq i32 %b, 0
br i1 %cmp4, label %return, label %if.else
if.else: ; preds = %entry, %if.else
%b.tr6 = phi i32 [ %rem, %if.else ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.else ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%cmp = icmp eq i32 %rem, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.else, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.else ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.i = icmp eq i32 %0, 0
br i1 %cmp4.i, label %gcd.exit, label %if.else.i
if.else.i: ; preds = %entry, %if.else.i
%b.tr6.i = phi i32 [ %rem.i, %if.else.i ], [ %0, %entry ]
%a.tr5.i = phi i32 [ %b.tr6.i, %if.else.i ], [ 360, %entry ]
%rem.i = srem i32 %a.tr5.i, %b.tr6.i
%cmp.i = icmp eq i32 %rem.i, 0
br i1 %cmp.i, label %gcd.exit, label %if.else.i
gcd.exit: ; preds = %if.else.i, %entry
%a.tr.lcssa.i = phi i32 [ 360, %entry ], [ %b.tr6.i, %if.else.i ]
%div2 = sdiv i32 360, %a.tr.lcssa.i
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %div2)
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) #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>
enum {
MAXD = 1010,
MAXCOL = 1010
};
int min(int a, int b) {
return a < b ? a : b;
}
int cnt[MAXD][MAXCOL][2];
int main(void) {
//freopen("input", "r", stdin);
int n, m;
int i, j, color, d;
scanf("%d %d", &n, &m);
for(i = 0; i < n; i++) {
scanf("%d %d", &color, &d);
cnt[d][color][0]++;
}
for(i = 0; i < m; i++) {
scanf("%d %d", &color, &d);
cnt[d][color][1]++;
}
int beautiful = 0, ugly = 0;
for(i = 0; i < MAXD; i++) {
int restOfMarkers = 0, restOfCaps = 0;
for(j = 0; j < MAXCOL; j++) {
int delta = min(cnt[i][j][0], cnt[i][j][1]);
cnt[i][j][0] -= delta;
cnt[i][j][1] -= delta;
beautiful += delta;
restOfCaps += cnt[i][j][1];
restOfMarkers += cnt[i][j][0];
}
ugly += min(restOfCaps, restOfMarkers);
}
printf("%d %d\n", ugly + beautiful, beautiful);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21902/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21902/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@cnt = dso_local local_unnamed_addr global [1010 x [1010 x [2 x i32]]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%color = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %color) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp95 = icmp sgt i32 %0, 0
br i1 %cmp95, label %for.body, label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.body, %entry
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp797 = icmp sgt i32 %1, 0
br i1 %cmp797, label %for.body8, label %vector.ph.preheader
for.body: ; preds = %entry, %for.body
%i.096 = phi i32 [ %inc5, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %color, ptr noundef nonnull %d)
%2 = load i32, ptr %d, align 4, !tbaa !5
%idxprom = sext i32 %2 to i64
%3 = load i32, ptr %color, align 4, !tbaa !5
%idxprom2 = sext i32 %3 to i64
%arrayidx3 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %idxprom, i64 %idxprom2
%4 = load i32, ptr %arrayidx3, align 8, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %arrayidx3, align 8, !tbaa !5
%inc5 = add nuw nsw i32 %i.096, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc5, %5
br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !9
for.body8: ; preds = %for.cond6.preheader, %for.body8
%i.198 = phi i32 [ %inc17, %for.body8 ], [ 0, %for.cond6.preheader ]
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %color, ptr noundef nonnull %d)
%6 = load i32, ptr %d, align 4, !tbaa !5
%idxprom10 = sext i32 %6 to i64
%7 = load i32, ptr %color, align 4, !tbaa !5
%idxprom12 = sext i32 %7 to i64
%arrayidx14 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %idxprom10, i64 %idxprom12, i64 1
%8 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%inc15 = add nsw i32 %8, 1
store i32 %inc15, ptr %arrayidx14, align 4, !tbaa !5
%inc17 = add nuw nsw i32 %i.198, 1
%9 = load i32, ptr %m, align 4, !tbaa !5
%cmp7 = icmp slt i32 %inc17, %9
br i1 %cmp7, label %for.body8, label %vector.ph.preheader, !llvm.loop !11
vector.ph.preheader: ; preds = %for.body8, %for.cond6.preheader
br label %vector.ph
vector.ph: ; preds = %vector.ph.preheader, %for.body24
%indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.body24 ], [ 0, %vector.ph.preheader ]
%ugly.0104 = phi i32 [ %add63, %for.body24 ], [ 0, %vector.ph.preheader ]
%beautiful.0103 = phi i32 [ %add.1, %for.body24 ], [ 0, %vector.ph.preheader ]
%10 = insertelement <2 x i32> <i32 poison, i32 0>, i32 %beautiful.0103, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
%vec.phi111 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%vec.phi112 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
%vec.phi113 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %27, %vector.body ]
%vec.phi114 = phi <2 x i32> [ %10, %vector.ph ], [ %22, %vector.body ]
%vec.phi115 = phi <2 x i32> [ zeroinitializer, %vector.ph ], [ %23, %vector.body ]
%11 = or i64 %index, 2
%12 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 %index
%13 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 %11
%wide.vec = load <4 x i32>, ptr %12, align 16, !tbaa !5
%wide.vec116 = load <4 x i32>, ptr %13, align 16, !tbaa !5
%strided.vec = shufflevector <4 x i32> %wide.vec, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%strided.vec117 = shufflevector <4 x i32> %wide.vec116, <4 x i32> poison, <2 x i32> <i32 0, i32 2>
%strided.vec118 = shufflevector <4 x i32> %wide.vec, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
%strided.vec119 = shufflevector <4 x i32> %wide.vec116, <4 x i32> poison, <2 x i32> <i32 1, i32 3>
%14 = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %strided.vec, <2 x i32> %strided.vec118)
%15 = call <2 x i32> @llvm.smin.v2i32(<2 x i32> %strided.vec117, <2 x i32> %strided.vec119)
%16 = sub nsw <2 x i32> %strided.vec, %14
%17 = sub nsw <2 x i32> %strided.vec117, %15
%18 = sub nsw <2 x i32> %strided.vec118, %14
%19 = sub nsw <2 x i32> %strided.vec119, %15
%20 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 %index
%21 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 %11
%interleaved.vec = shufflevector <2 x i32> %16, <2 x i32> %18, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %20, align 16, !tbaa !5
%interleaved.vec120 = shufflevector <2 x i32> %17, <2 x i32> %19, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec120, ptr %21, align 16, !tbaa !5
%22 = add <2 x i32> %14, %vec.phi114
%23 = add <2 x i32> %15, %vec.phi115
%24 = add <2 x i32> %18, %vec.phi
%25 = add <2 x i32> %19, %vec.phi111
%26 = add <2 x i32> %16, %vec.phi112
%27 = add <2 x i32> %17, %vec.phi113
%index.next = add nuw i64 %index, 4
%28 = icmp eq i64 %index.next, 1008
br i1 %28, label %for.body24, label %vector.body, !llvm.loop !12
for.body24: ; preds = %vector.body
%bin.rdx = add <2 x i32> %25, %24
%29 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx)
%bin.rdx121 = add <2 x i32> %27, %26
%30 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx121)
%bin.rdx123 = add <2 x i32> %23, %22
%31 = call i32 @llvm.vector.reduce.add.v2i32(<2 x i32> %bin.rdx123)
%arrayidx28 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 1008
%32 = load i32, ptr %arrayidx28, align 16, !tbaa !5
%arrayidx34 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 1008, i64 1
%33 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cond.i = call i32 @llvm.smin.i32(i32 %32, i32 %33)
%sub = sub nsw i32 %32, %cond.i
store i32 %sub, ptr %arrayidx28, align 16, !tbaa !5
%sub46 = sub nsw i32 %33, %cond.i
store i32 %sub46, ptr %arrayidx34, align 4, !tbaa !5
%add = add nsw i32 %cond.i, %31
%add52 = add nsw i32 %sub46, %29
%add58 = add nsw i32 %sub, %30
%arrayidx28.1 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 1009
%34 = load i32, ptr %arrayidx28.1, align 8, !tbaa !5
%arrayidx34.1 = getelementptr inbounds [1010 x [1010 x [2 x i32]]], ptr @cnt, i64 0, i64 %indvars.iv107, i64 1009, i64 1
%35 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5
%cond.i.1 = call i32 @llvm.smin.i32(i32 %34, i32 %35)
%sub.1 = sub nsw i32 %34, %cond.i.1
store i32 %sub.1, ptr %arrayidx28.1, align 8, !tbaa !5
%sub46.1 = sub nsw i32 %35, %cond.i.1
store i32 %sub46.1, ptr %arrayidx34.1, align 4, !tbaa !5
%add.1 = add nsw i32 %cond.i.1, %add
%add52.1 = add nsw i32 %sub46.1, %add52
%add58.1 = add nsw i32 %sub.1, %add58
%cond.i94 = call i32 @llvm.smin.i32(i32 %add52.1, i32 %add58.1)
%add63 = add nsw i32 %cond.i94, %ugly.0104
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%exitcond110.not = icmp eq i64 %indvars.iv.next108, 1010
br i1 %exitcond110.not, label %for.end66, label %vector.ph, !llvm.loop !15
for.end66: ; preds = %for.body24
%add67 = add nsw i32 %add63, %add.1
%call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add67, i32 noundef %add.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %color) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v2i32(<2 x i32>) #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define lli long long int
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define true 1
#define false 0
int main(void){
int i;
int n;
lli t,a;
lli mltt,mlta,mlt;
lli anst,ansa;
scanf("%d",&n);
scanf("%lld%lld",&t,&a);
anst = t;ansa = a;
for(i=1;i<n;i++){
scanf("%lld%lld",&t,&a);
mlt = t < a ? anst / t : ansa / a;
mltt = anst / t;
if(anst % t)mltt++;
mlta = ansa / a;
if(ansa % a)mlta++;
mlt = max(mltt,mlta);
anst = t*mlt;ansa = a*mlt;
}
printf("%lld\n",anst + ansa );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219063/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219063/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%lld%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:
%n = alloca i32, align 4
%t = alloca i64, align 8
%a = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %a)
%0 = load i64, ptr %t, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%2 = load i32, ptr %n, align 4, !tbaa !9
%cmp32 = icmp sgt i32 %2, 1
br i1 %cmp32, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%ansa.035 = phi i64 [ %mul17, %for.body ], [ %1, %entry ]
%anst.034 = phi i64 [ %mul, %for.body ], [ %0, %entry ]
%i.033 = phi i32 [ %inc18, %for.body ], [ 1, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t, ptr noundef nonnull %a)
%3 = load i64, ptr %t, align 8, !tbaa !5
%div5 = sdiv i64 %anst.034, %3
%rem = srem i64 %anst.034, %3
%tobool.not = icmp ne i64 %rem, 0
%inc = zext i1 %tobool.not to i64
%mltt.0 = add nsw i64 %div5, %inc
%4 = load i64, ptr %a, align 8, !tbaa !5
%div6 = sdiv i64 %ansa.035, %4
%rem7 = srem i64 %ansa.035, %4
%tobool8.not = icmp ne i64 %rem7, 0
%inc10 = zext i1 %tobool8.not to i64
%mlta.0 = add nsw i64 %div6, %inc10
%cond16 = call i64 @llvm.smax.i64(i64 %mltt.0, i64 %mlta.0)
%mul = mul nsw i64 %cond16, %3
%mul17 = mul nsw i64 %cond16, %4
%inc18 = add nuw nsw i32 %i.033, 1
%5 = load i32, ptr %n, align 4, !tbaa !9
%cmp = icmp slt i32 %inc18, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%anst.0.lcssa = phi i64 [ %0, %entry ], [ %mul, %for.body ]
%ansa.0.lcssa = phi i64 [ %1, %entry ], [ %mul17, %for.body ]
%add = add nsw i64 %ansa.0.lcssa, %anst.0.lcssa
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int N;
char s[101];
char t[101];
int cmp(){
int d=N;
int flag=0;
int i,j;
for( i=N-1;i>=0;i--){
flag=0;
if(s[i]==t[0]){
for(j=1;i+j<N;j++){
if(s[i+j]!=t[j]){
//printf("not %c %c\n",s[i+j],t[j]);
flag=1;
}
}
if(flag==0)d=i;
}
// printf("%d\n",d);
}
return d;
}
int main(){
int len;
scanf("%d",&N);
scanf("%s %s",s,t);
if(N==1){
if(s[0]==t[0])printf("1\n");
else printf("2\n");
return 0;
}
len=cmp();
printf("%d\n",len+N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219113/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219113/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@N = dso_local global i32 0, align 4
@s = dso_local global [101 x i8] zeroinitializer, align 16
@t = dso_local global [101 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"2\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @cmp() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %for.body.lr.ph, label %for.end24
for.body.lr.ph: ; preds = %entry
%1 = load i8, ptr @t, align 16, !tbaa !9
%2 = zext i32 %0 to i64
%3 = zext i32 %0 to i64
%4 = add nuw i32 %0, 1
%wide.trip.count60 = zext i32 %4 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc23
%indvar = phi i64 [ 0, %for.body.lr.ph ], [ %indvar.next, %for.inc23 ]
%indvars.iv55 = phi i64 [ %3, %for.body.lr.ph ], [ %indvars.iv.next56, %for.inc23 ]
%indvars.iv53 = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next54, %for.inc23 ]
%indvars.iv = phi i64 [ %2, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc23 ]
%d.040 = phi i32 [ %0, %for.body.lr.ph ], [ %d.1, %for.inc23 ]
%5 = add i64 %indvar, -1
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%indvars58 = trunc i64 %indvars.iv.next to i32
%idxprom = and i64 %indvars.iv.next, 4294967295
%arrayidx = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %idxprom
%6 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp2 = icmp eq i8 %6, %1
br i1 %cmp2, label %for.cond4.preheader, label %for.inc23
for.cond4.preheader: ; preds = %for.body
%cmp534 = icmp slt i64 %indvars.iv55, %2
br i1 %cmp534, label %for.body7.preheader, label %for.end.thread
for.body7.preheader: ; preds = %for.cond4.preheader
%xtraiter = and i64 %indvar, 3
%7 = icmp ult i64 %5, 3
br i1 %7, label %for.end.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %indvar, -4
br label %for.body7
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%indvars.iv46 = phi i64 [ 1, %for.body7.preheader.new ], [ %indvars.iv.next47.3, %for.body7 ]
%indvars.iv44 = phi i64 [ %indvars.iv, %for.body7.preheader.new ], [ %indvars.iv.next45.3, %for.body7 ]
%flag.035 = phi i32 [ 0, %for.body7.preheader.new ], [ %spec.select.3, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.3, %for.body7 ]
%arrayidx10 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv44
%8 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%arrayidx13 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv46
%9 = load i8, ptr %arrayidx13, align 1, !tbaa !9
%cmp15.not = icmp eq i8 %8, %9
%cmp15.not.fr = freeze i1 %cmp15.not
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%indvars.iv.next45 = add nsw i64 %indvars.iv44, 1
%arrayidx10.1 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next45
%10 = load i8, ptr %arrayidx10.1, align 1, !tbaa !9
%arrayidx13.1 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next47
%11 = load i8, ptr %arrayidx13.1, align 1, !tbaa !9
%cmp15.not.1 = icmp eq i8 %10, %11
%cmp15.not.fr.1 = freeze i1 %cmp15.not.1
%12 = and i1 %cmp15.not.fr.1, %cmp15.not.fr
%indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46, 2
%indvars.iv.next45.1 = add nsw i64 %indvars.iv44, 2
%arrayidx10.2 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next45.1
%13 = load i8, ptr %arrayidx10.2, align 1, !tbaa !9
%arrayidx13.2 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next47.1
%14 = load i8, ptr %arrayidx13.2, align 1, !tbaa !9
%cmp15.not.2 = icmp eq i8 %13, %14
%cmp15.not.fr.2 = freeze i1 %cmp15.not.2
%15 = and i1 %cmp15.not.fr.2, %12
%indvars.iv.next47.2 = add nuw nsw i64 %indvars.iv46, 3
%indvars.iv.next45.2 = add nsw i64 %indvars.iv44, 3
%arrayidx10.3 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next45.2
%16 = load i8, ptr %arrayidx10.3, align 1, !tbaa !9
%arrayidx13.3 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next47.2
%17 = load i8, ptr %arrayidx13.3, align 1, !tbaa !9
%cmp15.not.3 = icmp eq i8 %16, %17
%cmp15.not.fr.3 = freeze i1 %cmp15.not.3
%18 = and i1 %cmp15.not.fr.3, %15
%spec.select.3 = select i1 %18, i32 %flag.035, i32 1
%indvars.iv.next47.3 = add nuw nsw i64 %indvars.iv46, 4
%indvars.iv.next45.3 = add nsw i64 %indvars.iv44, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.unr-lcssa, label %for.body7, !llvm.loop !10
for.end.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body7.preheader ], [ %spec.select.3, %for.body7 ]
%indvars.iv46.unr = phi i64 [ 1, %for.body7.preheader ], [ %indvars.iv.next47.3, %for.body7 ]
%indvars.iv44.unr = phi i64 [ %indvars.iv, %for.body7.preheader ], [ %indvars.iv.next45.3, %for.body7 ]
%flag.035.unr = phi i32 [ 0, %for.body7.preheader ], [ %spec.select.3, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body7.epil
for.body7.epil: ; preds = %for.end.unr-lcssa, %for.body7.epil
%indvars.iv46.epil = phi i64 [ %indvars.iv.next47.epil, %for.body7.epil ], [ %indvars.iv46.unr, %for.end.unr-lcssa ]
%indvars.iv44.epil = phi i64 [ %indvars.iv.next45.epil, %for.body7.epil ], [ %indvars.iv44.unr, %for.end.unr-lcssa ]
%flag.035.epil = phi i32 [ %spec.select.epil, %for.body7.epil ], [ %flag.035.unr, %for.end.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body7.epil ], [ 0, %for.end.unr-lcssa ]
%arrayidx10.epil = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv44.epil
%19 = load i8, ptr %arrayidx10.epil, align 1, !tbaa !9
%arrayidx13.epil = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv46.epil
%20 = load i8, ptr %arrayidx13.epil, align 1, !tbaa !9
%cmp15.not.epil = icmp eq i8 %19, %20
%cmp15.not.fr.epil = freeze i1 %cmp15.not.epil
%spec.select.epil = select i1 %cmp15.not.fr.epil, i32 %flag.035.epil, i32 1
%indvars.iv.next47.epil = add nuw nsw i64 %indvars.iv46.epil, 1
%indvars.iv.next45.epil = add nsw i64 %indvars.iv44.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body7.epil, !llvm.loop !12
for.end: ; preds = %for.body7.epil, %for.end.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.unr-lcssa ], [ %spec.select.epil, %for.body7.epil ]
%cmp18 = icmp eq i32 %spec.select.lcssa, 0
br i1 %cmp18, label %for.end.thread, label %for.inc23
for.end.thread: ; preds = %for.cond4.preheader, %for.end
br label %for.inc23
for.inc23: ; preds = %for.end.thread, %for.end, %for.body
%d.1 = phi i32 [ %d.040, %for.body ], [ %indvars58, %for.end.thread ], [ %d.040, %for.end ]
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%indvars.iv.next56 = add nsw i64 %indvars.iv55, -1
%exitcond61.not = icmp eq i64 %indvars.iv.next54, %wide.trip.count60
%indvar.next = add i64 %indvar, 1
br i1 %exitcond61.not, label %for.end24, label %for.body, !llvm.loop !14
for.end24: ; preds = %for.inc23, %entry
%d.0.lcssa = phi i32 [ %0, %entry ], [ %d.1, %for.inc23 ]
ret i32 %d.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @N)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s, ptr noundef nonnull @t)
%0 = load i32, ptr @N, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 1
br i1 %cmp, label %if.then, label %if.end8
if.then: ; preds = %entry
%1 = load i8, ptr @s, align 16, !tbaa !9
%2 = load i8, ptr @t, align 16, !tbaa !9
%cmp3 = icmp eq i8 %1, %2
br i1 %cmp3, label %if.then5, label %if.else
if.then5: ; preds = %if.then
%puts11 = tail call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup
if.else: ; preds = %if.then
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
if.end8: ; preds = %entry
%cmp39.i = icmp sgt i32 %0, 0
br i1 %cmp39.i, label %for.body.lr.ph.i, label %cmp.exit
for.body.lr.ph.i: ; preds = %if.end8
%3 = load i8, ptr @t, align 16, !tbaa !9
%4 = zext i32 %0 to i64
%5 = add nuw i32 %0, 1
%wide.trip.count60.i = zext i32 %5 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc23.i, %for.body.lr.ph.i
%indvar = phi i64 [ %indvar.next, %for.inc23.i ], [ 0, %for.body.lr.ph.i ]
%indvars.iv55.i = phi i64 [ %indvars.iv.next56.i, %for.inc23.i ], [ %4, %for.body.lr.ph.i ]
%indvars.iv53.i = phi i64 [ %indvars.iv.next54.i, %for.inc23.i ], [ 1, %for.body.lr.ph.i ]
%d.040.i = phi i32 [ %d.1.i, %for.inc23.i ], [ %0, %for.body.lr.ph.i ]
%6 = add i64 %indvar, -1
%indvars.iv.next56.i = add nsw i64 %indvars.iv55.i, -1
%indvars58.i = trunc i64 %indvars.iv.next56.i to i32
%idxprom.i = and i64 %indvars.iv.next56.i, 4294967295
%arrayidx.i = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %idxprom.i
%7 = load i8, ptr %arrayidx.i, align 1, !tbaa !9
%cmp2.i = icmp eq i8 %7, %3
br i1 %cmp2.i, label %for.cond4.preheader.i, label %for.inc23.i
for.cond4.preheader.i: ; preds = %for.body.i
%cmp534.i = icmp slt i64 %indvars.iv55.i, %4
br i1 %cmp534.i, label %for.body7.i.preheader, label %for.end.thread.i
for.body7.i.preheader: ; preds = %for.cond4.preheader.i
%xtraiter = and i64 %indvar, 3
%8 = icmp ult i64 %6, 3
br i1 %8, label %for.end.i.unr-lcssa, label %for.body7.i.preheader.new
for.body7.i.preheader.new: ; preds = %for.body7.i.preheader
%unroll_iter = and i64 %indvar, -4
br label %for.body7.i
for.body7.i: ; preds = %for.body7.i, %for.body7.i.preheader.new
%indvars.iv46.i = phi i64 [ 1, %for.body7.i.preheader.new ], [ %indvars.iv.next47.i.3, %for.body7.i ]
%indvars.iv44.i = phi i64 [ %indvars.iv55.i, %for.body7.i.preheader.new ], [ %indvars.iv.next45.i.3, %for.body7.i ]
%flag.035.i = phi i32 [ 0, %for.body7.i.preheader.new ], [ %spec.select.i.3, %for.body7.i ]
%niter = phi i64 [ 0, %for.body7.i.preheader.new ], [ %niter.next.3, %for.body7.i ]
%arrayidx10.i = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv44.i
%9 = load i8, ptr %arrayidx10.i, align 1, !tbaa !9
%arrayidx13.i = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv46.i
%10 = load i8, ptr %arrayidx13.i, align 1, !tbaa !9
%cmp15.not.i = icmp eq i8 %9, %10
%cmp15.not.fr.i = freeze i1 %cmp15.not.i
%indvars.iv.next47.i = add nuw nsw i64 %indvars.iv46.i, 1
%indvars.iv.next45.i = add nsw i64 %indvars.iv44.i, 1
%arrayidx10.i.1 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next45.i
%11 = load i8, ptr %arrayidx10.i.1, align 1, !tbaa !9
%arrayidx13.i.1 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next47.i
%12 = load i8, ptr %arrayidx13.i.1, align 1, !tbaa !9
%cmp15.not.i.1 = icmp eq i8 %11, %12
%cmp15.not.fr.i.1 = freeze i1 %cmp15.not.i.1
%13 = and i1 %cmp15.not.fr.i.1, %cmp15.not.fr.i
%indvars.iv.next47.i.1 = add nuw nsw i64 %indvars.iv46.i, 2
%indvars.iv.next45.i.1 = add nsw i64 %indvars.iv44.i, 2
%arrayidx10.i.2 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next45.i.1
%14 = load i8, ptr %arrayidx10.i.2, align 1, !tbaa !9
%arrayidx13.i.2 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next47.i.1
%15 = load i8, ptr %arrayidx13.i.2, align 1, !tbaa !9
%cmp15.not.i.2 = icmp eq i8 %14, %15
%cmp15.not.fr.i.2 = freeze i1 %cmp15.not.i.2
%16 = and i1 %cmp15.not.fr.i.2, %13
%indvars.iv.next47.i.2 = add nuw nsw i64 %indvars.iv46.i, 3
%indvars.iv.next45.i.2 = add nsw i64 %indvars.iv44.i, 3
%arrayidx10.i.3 = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv.next45.i.2
%17 = load i8, ptr %arrayidx10.i.3, align 1, !tbaa !9
%arrayidx13.i.3 = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv.next47.i.2
%18 = load i8, ptr %arrayidx13.i.3, align 1, !tbaa !9
%cmp15.not.i.3 = icmp eq i8 %17, %18
%cmp15.not.fr.i.3 = freeze i1 %cmp15.not.i.3
%19 = and i1 %cmp15.not.fr.i.3, %16
%spec.select.i.3 = select i1 %19, i32 %flag.035.i, i32 1
%indvars.iv.next47.i.3 = add nuw nsw i64 %indvars.iv46.i, 4
%indvars.iv.next45.i.3 = add nsw i64 %indvars.iv44.i, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.i.unr-lcssa, label %for.body7.i, !llvm.loop !10
for.end.i.unr-lcssa: ; preds = %for.body7.i, %for.body7.i.preheader
%spec.select.i.lcssa.ph = phi i32 [ undef, %for.body7.i.preheader ], [ %spec.select.i.3, %for.body7.i ]
%indvars.iv46.i.unr = phi i64 [ 1, %for.body7.i.preheader ], [ %indvars.iv.next47.i.3, %for.body7.i ]
%indvars.iv44.i.unr = phi i64 [ %indvars.iv55.i, %for.body7.i.preheader ], [ %indvars.iv.next45.i.3, %for.body7.i ]
%flag.035.i.unr = phi i32 [ 0, %for.body7.i.preheader ], [ %spec.select.i.3, %for.body7.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.i, label %for.body7.i.epil
for.body7.i.epil: ; preds = %for.end.i.unr-lcssa, %for.body7.i.epil
%indvars.iv46.i.epil = phi i64 [ %indvars.iv.next47.i.epil, %for.body7.i.epil ], [ %indvars.iv46.i.unr, %for.end.i.unr-lcssa ]
%indvars.iv44.i.epil = phi i64 [ %indvars.iv.next45.i.epil, %for.body7.i.epil ], [ %indvars.iv44.i.unr, %for.end.i.unr-lcssa ]
%flag.035.i.epil = phi i32 [ %spec.select.i.epil, %for.body7.i.epil ], [ %flag.035.i.unr, %for.end.i.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body7.i.epil ], [ 0, %for.end.i.unr-lcssa ]
%arrayidx10.i.epil = getelementptr inbounds [101 x i8], ptr @s, i64 0, i64 %indvars.iv44.i.epil
%20 = load i8, ptr %arrayidx10.i.epil, align 1, !tbaa !9
%arrayidx13.i.epil = getelementptr inbounds [101 x i8], ptr @t, i64 0, i64 %indvars.iv46.i.epil
%21 = load i8, ptr %arrayidx13.i.epil, align 1, !tbaa !9
%cmp15.not.i.epil = icmp eq i8 %20, %21
%cmp15.not.fr.i.epil = freeze i1 %cmp15.not.i.epil
%spec.select.i.epil = select i1 %cmp15.not.fr.i.epil, i32 %flag.035.i.epil, i32 1
%indvars.iv.next47.i.epil = add nuw nsw i64 %indvars.iv46.i.epil, 1
%indvars.iv.next45.i.epil = add nsw i64 %indvars.iv44.i.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.i, label %for.body7.i.epil, !llvm.loop !15
for.end.i: ; preds = %for.body7.i.epil, %for.end.i.unr-lcssa
%spec.select.i.lcssa = phi i32 [ %spec.select.i.lcssa.ph, %for.end.i.unr-lcssa ], [ %spec.select.i.epil, %for.body7.i.epil ]
%cmp18.i = icmp eq i32 %spec.select.i.lcssa, 0
br i1 %cmp18.i, label %for.end.thread.i, label %for.inc23.i
for.end.thread.i: ; preds = %for.end.i, %for.cond4.preheader.i
br label %for.inc23.i
for.inc23.i: ; preds = %for.end.thread.i, %for.end.i, %for.body.i
%d.1.i = phi i32 [ %d.040.i, %for.body.i ], [ %indvars58.i, %for.end.thread.i ], [ %d.040.i, %for.end.i ]
%indvars.iv.next54.i = add nuw nsw i64 %indvars.iv53.i, 1
%exitcond61.not.i = icmp eq i64 %indvars.iv.next54.i, %wide.trip.count60.i
%indvar.next = add i64 %indvar, 1
br i1 %exitcond61.not.i, label %cmp.exit, label %for.body.i, !llvm.loop !14
cmp.exit: ; preds = %for.inc23.i, %if.end8
%d.0.lcssa.i = phi i32 [ %0, %if.end8 ], [ %d.1.i, %for.inc23.i ]
%add = add nsw i32 %d.0.lcssa.i, %0
%call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %add)
br label %cleanup
cleanup: ; preds = %if.then5, %if.else, %cmp.exit
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.unroll.disable"}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !13}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void
solver(char *s)
{
int b=5*100000+2;
int i;
int p=0, mp=0;
long long sum=0;
s[strlen(s)+1] = '\0';
s[strlen(s)] = ' ';
p=0;
for (i=0; i<strlen(s)-1; i++) {
if (s[i]==s[i+1]) {
p++;
sum += p;
}
else {
p++;
if (s[i]=='>') {
sum += mp>p?mp:p;
}
else if(s[i]=='<' && s[i+1]==' ')
sum += p;
mp=p;
p=0;
}
}
printf("%lld\n", sum);
}
int
main(int argc, char *argv[])
{
char s[5*100000+2];
bzero(s, sizeof(s));
scanf("%s", s);
solver(s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219157/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219157/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld\0A\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 void @solver(ptr nocapture noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%0 = getelementptr i8, ptr %s, i64 %call
%arrayidx = getelementptr i8, ptr %0, i64 1
store i8 0, ptr %arrayidx, align 1, !tbaa !5
%call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%arrayidx2 = getelementptr inbounds i8, ptr %s, i64 %call1
store i8 32, ptr %arrayidx2, align 1, !tbaa !5
%call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%sub = add i64 %call3, -1
%cmp70.not = icmp eq i64 %sub, 0
br i1 %cmp70.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%.pre = load i8, ptr %s, align 1, !tbaa !5
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%1 = phi i8 [ %.pre, %for.body.preheader ], [ %2, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%sum.074 = phi i64 [ 0, %for.body.preheader ], [ %sum.2, %for.inc ]
%mp.073 = phi i32 [ 0, %for.body.preheader ], [ %mp.1, %for.inc ]
%p.072 = phi i32 [ 0, %for.body.preheader ], [ %p.1, %for.inc ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx9 = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%cmp11 = icmp eq i8 %1, %2
%inc = add nsw i32 %p.072, 1
br i1 %cmp11, label %if.then, label %if.else
if.then: ; preds = %for.body
%conv13 = sext i32 %inc to i64
%add14 = add nsw i64 %sum.074, %conv13
br label %for.inc
if.else: ; preds = %for.body
switch i8 %1, label %for.inc [
i8 62, label %if.then21
i8 60, label %land.lhs.true
]
if.then21: ; preds = %if.else
%cond = tail call i32 @llvm.smax.i32(i32 %mp.073, i32 %inc)
%conv24 = sext i32 %cond to i64
%add25 = add nsw i64 %sum.074, %conv24
br label %for.inc
land.lhs.true: ; preds = %if.else
%cmp36 = icmp eq i8 %2, 32
br i1 %cmp36, label %if.then38, label %for.inc
if.then38: ; preds = %land.lhs.true
%conv39 = sext i32 %inc to i64
%add40 = add nsw i64 %sum.074, %conv39
br label %for.inc
for.inc: ; preds = %if.then21, %if.then38, %land.lhs.true, %if.else, %if.then
%p.1 = phi i32 [ %inc, %if.then ], [ 0, %if.else ], [ 0, %land.lhs.true ], [ 0, %if.then38 ], [ 0, %if.then21 ]
%mp.1 = phi i32 [ %mp.073, %if.then ], [ %inc, %if.else ], [ %inc, %land.lhs.true ], [ %inc, %if.then38 ], [ %inc, %if.then21 ]
%sum.2 = phi i64 [ %add14, %if.then ], [ %sum.074, %if.else ], [ %sum.074, %land.lhs.true ], [ %add40, %if.then38 ], [ %add25, %if.then21 ]
%exitcond.not = icmp eq i64 %indvars.iv.next, %sub
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
%sum.0.lcssa = phi i64 [ 0, %entry ], [ %sum.2, %for.inc ]
%call44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.0.lcssa)
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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #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) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%s = alloca [500002 x i8], align 16
call void @llvm.lifetime.start.p0(i64 500002, ptr nonnull %s) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(500002) %s, i8 0, i64 500002, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%call.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%0 = getelementptr i8, ptr %s, i64 %call.i
%arrayidx.i = getelementptr i8, ptr %0, i64 1
store i8 0, ptr %arrayidx.i, align 1, !tbaa !5
%call1.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%arrayidx2.i = getelementptr inbounds i8, ptr %s, i64 %call1.i
store i8 32, ptr %arrayidx2.i, align 1, !tbaa !5
%call3.i = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%sub.i = add i64 %call3.i, -1
%cmp70.not.i = icmp eq i64 %sub.i, 0
br i1 %cmp70.not.i, label %solver.exit, label %for.body.preheader.i
for.body.preheader.i: ; preds = %entry
%.pre.i = load i8, ptr %s, align 16, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%1 = phi i8 [ %.pre.i, %for.body.preheader.i ], [ %2, %for.inc.i ]
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%sum.074.i = phi i64 [ 0, %for.body.preheader.i ], [ %sum.2.i, %for.inc.i ]
%mp.073.i = phi i32 [ 0, %for.body.preheader.i ], [ %mp.1.i, %for.inc.i ]
%p.072.i = phi i32 [ 0, %for.body.preheader.i ], [ %p.1.i, %for.inc.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%arrayidx9.i = getelementptr inbounds i8, ptr %s, i64 %indvars.iv.next.i
%2 = load i8, ptr %arrayidx9.i, align 1, !tbaa !5
%cmp11.i = icmp eq i8 %1, %2
%inc.i = add nsw i32 %p.072.i, 1
br i1 %cmp11.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %for.body.i
%conv13.i = sext i32 %inc.i to i64
%add14.i = add nsw i64 %sum.074.i, %conv13.i
br label %for.inc.i
if.else.i: ; preds = %for.body.i
switch i8 %1, label %for.inc.i [
i8 62, label %if.then21.i
i8 60, label %land.lhs.true.i
]
if.then21.i: ; preds = %if.else.i
%cond.i = call i32 @llvm.smax.i32(i32 %mp.073.i, i32 %inc.i)
%conv24.i = sext i32 %cond.i to i64
%add25.i = add nsw i64 %sum.074.i, %conv24.i
br label %for.inc.i
land.lhs.true.i: ; preds = %if.else.i
%cmp36.i = icmp eq i8 %2, 32
br i1 %cmp36.i, label %if.then38.i, label %for.inc.i
if.then38.i: ; preds = %land.lhs.true.i
%conv39.i = sext i32 %inc.i to i64
%add40.i = add nsw i64 %sum.074.i, %conv39.i
br label %for.inc.i
for.inc.i: ; preds = %if.then38.i, %land.lhs.true.i, %if.then21.i, %if.else.i, %if.then.i
%p.1.i = phi i32 [ %inc.i, %if.then.i ], [ 0, %if.else.i ], [ 0, %land.lhs.true.i ], [ 0, %if.then38.i ], [ 0, %if.then21.i ]
%mp.1.i = phi i32 [ %mp.073.i, %if.then.i ], [ %inc.i, %if.else.i ], [ %inc.i, %land.lhs.true.i ], [ %inc.i, %if.then38.i ], [ %inc.i, %if.then21.i ]
%sum.2.i = phi i64 [ %add14.i, %if.then.i ], [ %sum.074.i, %if.else.i ], [ %sum.074.i, %land.lhs.true.i ], [ %add40.i, %if.then38.i ], [ %add25.i, %if.then21.i ]
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %sub.i
br i1 %exitcond.not.i, label %solver.exit, label %for.body.i, !llvm.loop !8
solver.exit: ; preds = %for.inc.i, %entry
%sum.0.lcssa.i = phi i64 [ 0, %entry ], [ %sum.2.i, %for.inc.i ]
%call44.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sum.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 500002, ptr nonnull %s) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#define int long long
#define p (int)(1e9 + 7)
int MOD(int a){
a %= p;
return a >= 0 ? a : a + p;
}
signed compare(const void *a, const void *b){
int sub = *(int *)a - *(int *)b;
if(sub < 0){
return -1;
}
else if(sub == 0){
return 0;
}
else{
return 1;
}
}
signed main(){
int N, M, i, j;
scanf("%lld%lld", &N, &M);
int *A = (int *)malloc(sizeof(int) * (N + 1));
for(i = 0; i < N; i++){
scanf("%lld", &A[i]);
A[i]--;
}
A[N] = N * M;
int *B = (int *)malloc(sizeof(int) * (M + 1));
for(j = 0; j < M; j++){
scanf("%lld", &B[j]);
B[j]--;
}
B[M] = N * M;
qsort(A, N + 1, sizeof(int), compare);
qsort(B, M + 1, sizeof(int), compare);
for(i = 1; i <= N; i++){
if(A[i - 1] == A[i]){
printf("0\n");
return 0;
}
}
for(i = 1; i <= M; i++){
if(B[i - 1] == B[i]){
printf("0\n");
return 0;
}
}
int l, h, r, K, L, ans = 1;
for(i = N * M - 1; i >= 0; i--){
// printf("i = %lld\n", i);
l = -1;
r = N;
while(r - l > 1){
h = (l + r) / 2;
if(A[h] < i){
l = h;
}
else{
r = h;
}
}
K = r;
l = -1;
r = M;
while(r - l > 1){
h = (l + r) / 2;
if(B[h] < i){
l = h;
}
else{
r = h;
}
}
L = r;
// printf("(K, L) = (%lld, %lld)\n", K, L);
if(A[K] == i && B[L] == i){
// continue;
}
else if(A[K] == i && B[L] != i){
ans = MOD(ans * (M - L));
}
else if(A[K] != i && B[L] == i){
ans = MOD(ans * (N - K));
}
else{
if((N - K) * (M - L) - (N * M - i - 1) <= 0){
printf("0\n");
return 0;
}
else{
ans = MOD(ans * ((N - K) * (M - L) - (N * M - i - 1)));
}
}
// printf("ans = %lld\n", ans);
}
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219207/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219207/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str.5 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @MOD(i64 noundef %a) local_unnamed_addr #0 {
entry:
%rem = srem i64 %a, 1000000007
%add = add nsw i64 %rem, 1000000007
%cmp4 = icmp slt i64 %rem, 0
%cond = select i1 %cmp4, i64 %add, i64 %rem
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #1 {
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
%cmp2 = icmp ne i64 %0, %1
%. = zext i1 %cmp2 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%N = alloca i64, align 8
%M = 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 %M) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i64, ptr %N, align 8, !tbaa !5
%add = shl i64 %0, 3
%mul = add i64 %add, 8
%call1 = call noalias ptr @malloc(i64 noundef %mul) #9
%cmp223 = icmp sgt i64 %0, 0
br i1 %cmp223, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.0224 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %call1, i64 %i.0224
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx)
%1 = load i64, ptr %arrayidx, align 8, !tbaa !5
%dec = add nsw i64 %1, -1
store i64 %dec, ptr %arrayidx, align 8, !tbaa !5
%inc = add nuw nsw i64 %i.0224, 1
%2 = load i64, ptr %N, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa222 = phi i64 [ %0, %entry ], [ %2, %for.body ]
%3 = load i64, ptr %M, align 8, !tbaa !5
%mul4 = mul nsw i64 %3, %.lcssa222
%arrayidx5 = getelementptr inbounds i64, ptr %call1, i64 %.lcssa222
store i64 %mul4, ptr %arrayidx5, align 8, !tbaa !5
%add6 = shl i64 %3, 3
%mul7 = add i64 %add6, 8
%call8 = call noalias ptr @malloc(i64 noundef %mul7) #9
%cmp10225 = icmp sgt i64 %3, 0
br i1 %cmp10225, label %for.body11, label %for.end18
for.body11: ; preds = %for.end, %for.body11
%j.0226 = phi i64 [ %inc17, %for.body11 ], [ 0, %for.end ]
%arrayidx12 = getelementptr inbounds i64, ptr %call8, i64 %j.0226
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx12)
%4 = load i64, ptr %arrayidx12, align 8, !tbaa !5
%dec15 = add nsw i64 %4, -1
store i64 %dec15, ptr %arrayidx12, align 8, !tbaa !5
%inc17 = add nuw nsw i64 %j.0226, 1
%5 = load i64, ptr %M, align 8, !tbaa !5
%cmp10 = icmp slt i64 %inc17, %5
br i1 %cmp10, label %for.body11, label %for.end18.loopexit, !llvm.loop !11
for.end18.loopexit: ; preds = %for.body11
%.pre = load i64, ptr %N, align 8, !tbaa !5
%.pre252 = mul nsw i64 %.pre, %5
br label %for.end18
for.end18: ; preds = %for.end18.loopexit, %for.end
%mul19.pre-phi = phi i64 [ %.pre252, %for.end18.loopexit ], [ %mul4, %for.end ]
%6 = phi i64 [ %.pre, %for.end18.loopexit ], [ %.lcssa222, %for.end ]
%.lcssa221 = phi i64 [ %5, %for.end18.loopexit ], [ %3, %for.end ]
%arrayidx20 = getelementptr inbounds i64, ptr %call8, i64 %.lcssa221
store i64 %mul19.pre-phi, ptr %arrayidx20, align 8, !tbaa !5
%add21 = add nsw i64 %6, 1
call void @qsort(ptr noundef %call1, i64 noundef %add21, i64 noundef 8, ptr noundef nonnull @compare) #8
%7 = load i64, ptr %M, align 8, !tbaa !5
%add22 = add nsw i64 %7, 1
call void @qsort(ptr noundef %call8, i64 noundef %add22, i64 noundef 8, ptr noundef nonnull @compare) #8
%8 = load i64, ptr %N, align 8, !tbaa !5
%cmp24.not228 = icmp slt i64 %8, 1
br i1 %cmp24.not228, label %for.cond33.preheader, label %for.body25
for.cond23: ; preds = %for.body25
%inc31 = add nuw i64 %i.1229, 1
%exitcond.not = icmp eq i64 %i.1229, %8
br i1 %exitcond.not, label %for.cond33.preheader, label %for.body25, !llvm.loop !12
for.cond33.preheader: ; preds = %for.cond23, %for.end18
%9 = load i64, ptr %M, align 8, !tbaa !5
%cmp34.not231 = icmp slt i64 %9, 1
br i1 %cmp34.not231, label %for.end45, label %for.body35
for.body25: ; preds = %for.end18, %for.cond23
%i.1229 = phi i64 [ %inc31, %for.cond23 ], [ 1, %for.end18 ]
%10 = getelementptr i64, ptr %call1, i64 %i.1229
%arrayidx26 = getelementptr i64, ptr %10, i64 -1
%11 = load i64, ptr %arrayidx26, align 8, !tbaa !5
%12 = load i64, ptr %10, align 8, !tbaa !5
%cmp28 = icmp eq i64 %11, %12
br i1 %cmp28, label %if.then, label %for.cond23
if.then: ; preds = %for.body25
%puts208 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup129
for.cond33: ; preds = %for.body35
%inc44 = add nuw i64 %i.2232, 1
%exitcond251.not = icmp eq i64 %i.2232, %9
br i1 %exitcond251.not, label %for.end45, label %for.body35, !llvm.loop !13
for.body35: ; preds = %for.cond33.preheader, %for.cond33
%i.2232 = phi i64 [ %inc44, %for.cond33 ], [ 1, %for.cond33.preheader ]
%13 = getelementptr i64, ptr %call8, i64 %i.2232
%arrayidx37 = getelementptr i64, ptr %13, i64 -1
%14 = load i64, ptr %arrayidx37, align 8, !tbaa !5
%15 = load i64, ptr %13, align 8, !tbaa !5
%cmp39 = icmp eq i64 %14, %15
br i1 %cmp39, label %if.then40, label %for.cond33
if.then40: ; preds = %for.body35
%puts207 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup129
for.end45: ; preds = %for.cond33, %for.cond33.preheader
%mul46 = mul nsw i64 %9, %8
%cmp49245 = icmp sgt i64 %mul46, 0
br i1 %cmp49245, label %while.cond.preheader.lr.ph, label %for.end122
while.cond.preheader.lr.ph: ; preds = %for.end45
%cmp52235 = icmp sgt i64 %8, 0
%cmp60240 = icmp sgt i64 %9, 0
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %for.inc120
%ans.0247 = phi i64 [ 1, %while.cond.preheader.lr.ph ], [ %ans.1, %for.inc120 ]
%i.3.in246 = phi i64 [ %mul46, %while.cond.preheader.lr.ph ], [ %i.3248, %for.inc120 ]
%i.3248 = add nsw i64 %i.3.in246, -1
br i1 %cmp52235, label %while.body, label %while.cond58.preheader
while.cond58.preheader: ; preds = %while.body, %while.cond.preheader
%r.0.lcssa = phi i64 [ %8, %while.cond.preheader ], [ %r.0.div, %while.body ]
br i1 %cmp60240, label %while.body61, label %while.end69
while.body: ; preds = %while.cond.preheader, %while.body
%r.0237 = phi i64 [ %r.0.div, %while.body ], [ %8, %while.cond.preheader ]
%l.0236 = phi i64 [ %div.l.0, %while.body ], [ -1, %while.cond.preheader ]
%add53 = add nsw i64 %r.0237, %l.0236
%div = sdiv i64 %add53, 2
%arrayidx54 = getelementptr inbounds i64, ptr %call1, i64 %div
%16 = load i64, ptr %arrayidx54, align 8, !tbaa !5
%cmp55 = icmp slt i64 %16, %i.3248
%div.l.0 = select i1 %cmp55, i64 %div, i64 %l.0236
%r.0.div = select i1 %cmp55, i64 %r.0237, i64 %div
%sub51 = sub nsw i64 %r.0.div, %div.l.0
%cmp52 = icmp sgt i64 %sub51, 1
br i1 %cmp52, label %while.body, label %while.cond58.preheader, !llvm.loop !14
while.body61: ; preds = %while.cond58.preheader, %while.body61
%r.2242 = phi i64 [ %r.2.div63, %while.body61 ], [ %9, %while.cond58.preheader ]
%l.2241 = phi i64 [ %div63.l.2, %while.body61 ], [ -1, %while.cond58.preheader ]
%add62 = add nsw i64 %r.2242, %l.2241
%div63 = sdiv i64 %add62, 2
%arrayidx64 = getelementptr inbounds i64, ptr %call8, i64 %div63
%17 = load i64, ptr %arrayidx64, align 8, !tbaa !5
%cmp65 = icmp slt i64 %17, %i.3248
%div63.l.2 = select i1 %cmp65, i64 %div63, i64 %l.2241
%r.2.div63 = select i1 %cmp65, i64 %r.2242, i64 %div63
%sub59 = sub nsw i64 %r.2.div63, %div63.l.2
%cmp60 = icmp sgt i64 %sub59, 1
br i1 %cmp60, label %while.body61, label %while.end69, !llvm.loop !15
while.end69: ; preds = %while.body61, %while.cond58.preheader
%r.2.lcssa = phi i64 [ %9, %while.cond58.preheader ], [ %r.2.div63, %while.body61 ]
%arrayidx70 = getelementptr inbounds i64, ptr %call1, i64 %r.0.lcssa
%18 = load i64, ptr %arrayidx70, align 8, !tbaa !5
%cmp71 = icmp eq i64 %18, %i.3248
%arrayidx72 = getelementptr inbounds i64, ptr %call8, i64 %r.2.lcssa
%19 = load i64, ptr %arrayidx72, align 8, !tbaa !5
%cmp73 = icmp eq i64 %19, %i.3248
br i1 %cmp71, label %land.lhs.true, label %land.lhs.true88
land.lhs.true: ; preds = %while.end69
br i1 %cmp73, label %for.inc120, label %if.then81
if.then81: ; preds = %land.lhs.true
%sub82 = sub nsw i64 %9, %r.2.lcssa
%mul83 = mul nsw i64 %sub82, %ans.0247
%rem.i = srem i64 %mul83, 1000000007
%add.i = add nsw i64 %rem.i, 1000000007
%cmp4.i = icmp slt i64 %rem.i, 0
%cond.i = select i1 %cmp4.i, i64 %add.i, i64 %rem.i
br label %for.inc120
land.lhs.true88: ; preds = %while.end69
%sub92 = sub nsw i64 %8, %r.0.lcssa
br i1 %cmp73, label %if.then91, label %if.else95
if.then91: ; preds = %land.lhs.true88
%mul93 = mul nsw i64 %sub92, %ans.0247
%rem.i209 = srem i64 %mul93, 1000000007
%add.i210 = add nsw i64 %rem.i209, 1000000007
%cmp4.i211 = icmp slt i64 %rem.i209, 0
%cond.i212 = select i1 %cmp4.i211, i64 %add.i210, i64 %rem.i209
br label %for.inc120
if.else95: ; preds = %land.lhs.true88
%sub97 = sub nsw i64 %9, %r.2.lcssa
%mul98 = mul nsw i64 %sub97, %sub92
%sub101.neg = sub nsw i64 %i.3.in246, %mul46
%sub102 = add i64 %mul98, %sub101.neg
%cmp103 = icmp slt i64 %sub102, 1
br i1 %cmp103, label %if.then104, label %if.else106
if.then104: ; preds = %if.else95
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup129
if.else106: ; preds = %if.else95
%mul114 = mul nsw i64 %sub102, %ans.0247
%rem.i213 = srem i64 %mul114, 1000000007
%add.i214 = add nsw i64 %rem.i213, 1000000007
%cmp4.i215 = icmp slt i64 %rem.i213, 0
%cond.i216 = select i1 %cmp4.i215, i64 %add.i214, i64 %rem.i213
br label %for.inc120
for.inc120: ; preds = %land.lhs.true, %if.then91, %if.else106, %if.then81
%ans.1 = phi i64 [ %ans.0247, %land.lhs.true ], [ %cond.i, %if.then81 ], [ %cond.i212, %if.then91 ], [ %cond.i216, %if.else106 ]
%cmp49 = icmp sgt i64 %i.3.in246, 1
br i1 %cmp49, label %while.cond.preheader, label %for.end122, !llvm.loop !16
for.end122: ; preds = %for.inc120, %for.end45
%ans.0.lcssa = phi i64 [ 1, %for.end45 ], [ %ans.1, %for.inc120 ]
%call123 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.0.lcssa)
br label %cleanup129
cleanup129: ; preds = %if.then104, %for.end122, %if.then40, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %M) #8
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nofree nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE long long
#define MEMSET(a) memset(a,0,sizeof(a))
const int mod=(int)1e09+7;
int in(void){
int i;scanf("%d",&i);
return i;
}
long long llin(void){
long long i;scanf("%lld",&i);
return i;
}
double din(void){
double i;scanf("%lf",&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 dprint(double a){
printf("%.10f\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;
}
long long llabs(long long a){
return a>0?a:-a;
}
double dmax(double a,double b){
return a>b?a:b;
}
int cmp(const void *a,const void *b){
return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
int t=*a;
*a=*b;
*b=t;
}
long long gcd(long long x,long long y){
return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
return x/gcd(x,y)*y;
}
int main(void){
int n=in(),a=in(),b=in();
if((b-a)%2)puts("Borys");
else puts("Alice");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219258/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219258/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@mod = dso_local local_unnamed_addr constant i32 1000000007, align 4
@.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 [4 x i8] c"%lf\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1
@.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@.str.8 = private unnamed_addr constant [6 x i8] c"Borys\00", align 1
@.str.9 = private unnamed_addr constant [6 x i8] c"Alice\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) #11
%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) #11
ret i32 %0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(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) #11
%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) #11
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @din() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11
ret double %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.3, 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.4, 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.5, i64 noundef %a)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double 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.7, 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 nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llabs(i64 noundef %a) local_unnamed_addr #3 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 {
entry:
%cmp = fcmp ogt double %a, %b
%cond = select i1 %cmp, double %a, double %b
ret double %cond
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !9
%1 = load i64, ptr %a, align 8, !tbaa !9
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #8 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #9 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse ]
%y.tr = phi i64 [ %y, %entry ], [ %rem, %tailrecurse ]
%rem = srem i64 %x.tr, %y.tr
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %tailrecurse
cond.end: ; preds = %tailrecurse
ret i64 %y.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %x, i64 noundef %y) local_unnamed_addr #9 {
entry:
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i, %entry
%x.tr.i = phi i64 [ %x, %entry ], [ %y.tr.i, %tailrecurse.i ]
%y.tr.i = phi i64 [ %y, %entry ], [ %rem.i, %tailrecurse.i ]
%rem.i = srem i64 %x.tr.i, %y.tr.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %tailrecurse.i
gcd.exit: ; preds = %tailrecurse.i
%div = sdiv i64 %x, %y.tr.i
%mul = mul nsw i64 %div, %y
ret i64 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i.i7 = alloca i32, align 4
%i.i5 = alloca i32, align 4
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #11
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i5) #11
%call.i6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i5)
%0 = load i32, ptr %i.i5, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i5) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i7) #11
%call.i8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i.i7)
%1 = load i32, ptr %i.i7, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i7) #11
%sub = sub nsw i32 %1, %0
%2 = and i32 %sub, 1
%tobool.not = icmp eq i32 %2, 0
%.str.9..str.8 = select i1 %tobool.not, ptr @.str.9, ptr @.str.8
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.9..str.8)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #10
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { 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 #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
|
#include <stdio.h>
int main(){
int N,M,P,X[1000],Xsum,kake,win,i;
kake=0;
Xsum=0;
win=0;
while(1){
scanf("%d%d%d",&N,&M,&P);
if(N==0 && M==0 &&P==0)break;
for(i=0;i<N;i++)X[i]=0;
for(i=1;i<=N;i++){
scanf("%d",&X[i]);
Xsum += X[i];
if(M==i)win=X[i];
}
if(win==0)printf("0\n");
else{ kake=(Xsum*100-(Xsum*100*P/100))/win;
printf("%d\n",kake);
}
Xsum=0;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219315/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219315/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
%P = alloca i32, align 4
%X = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %P) #5
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %X) #5
%call48 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M, ptr noundef nonnull %P)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp49 = icmp eq i32 %0, 0
%1 = load i32, ptr %M, align 4
%cmp150 = icmp eq i32 %1, 0
%or.cond51 = select i1 %cmp49, i1 %cmp150, i1 false
%2 = load i32, ptr %P, align 4
%cmp352 = icmp eq i32 %2, 0
%or.cond2953 = select i1 %or.cond51, i1 %cmp352, i1 false
br i1 %or.cond2953, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end28
%3 = phi i32 [ %12, %if.end28 ], [ %0, %entry ]
%win.054 = phi i32 [ %win.1.lcssa, %if.end28 ], [ 0, %entry ]
%cmp441 = icmp sgt i32 %3, 0
br i1 %cmp441, label %for.body7.preheader, label %for.end20
for.body7.preheader: ; preds = %for.cond.preheader
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %X, i8 0, i64 %5, i1 false), !tbaa !5
br label %for.body7
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv = phi i64 [ 1, %for.body7.preheader ], [ %indvars.iv.next, %for.body7 ]
%win.145 = phi i32 [ %win.054, %for.body7.preheader ], [ %spec.select, %for.body7 ]
%Xsum.144 = phi i32 [ 0, %for.body7.preheader ], [ %add, %for.body7 ]
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %X, i64 0, i64 %indvars.iv
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9)
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%add = add nsw i32 %6, %Xsum.144
%7 = load i32, ptr %M, align 4, !tbaa !5
%8 = zext i32 %7 to i64
%cmp13 = icmp eq i64 %indvars.iv, %8
%spec.select = select i1 %cmp13, i32 %6, i32 %win.145
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp6.not.not = icmp slt i64 %indvars.iv, %10
br i1 %cmp6.not.not, label %for.body7, label %for.end20, !llvm.loop !9
for.end20: ; preds = %for.body7, %for.cond.preheader
%Xsum.1.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.body7 ]
%win.1.lcssa = phi i32 [ %win.054, %for.cond.preheader ], [ %spec.select, %for.body7 ]
%cmp21 = icmp eq i32 %win.1.lcssa, 0
br i1 %cmp21, label %if.then22, label %if.else
if.then22: ; preds = %for.end20
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end28
if.else: ; preds = %for.end20
%mul = mul nsw i32 %Xsum.1.lcssa, 100
%11 = load i32, ptr %P, align 4, !tbaa !5
%mul25 = mul nsw i32 %11, %mul
%div.neg = sdiv i32 %mul25, -100
%sub = add i32 %div.neg, %mul
%div26 = sdiv i32 %sub, %win.1.lcssa
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %div26)
br label %if.end28
if.end28: ; preds = %if.else, %if.then22
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M, ptr noundef nonnull %P)
%12 = load i32, ptr %N, align 4, !tbaa !5
%cmp = icmp eq i32 %12, 0
%13 = load i32, ptr %M, align 4
%cmp1 = icmp eq i32 %13, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%14 = load i32, ptr %P, align 4
%cmp3 = icmp eq i32 %14, 0
%or.cond29 = select i1 %or.cond, i1 %cmp3, i1 false
br i1 %or.cond29, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end28, %entry
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %X) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %P) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: 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(){
int n,m,p;
int i;
int mem[105];
int sum=0,result;
while (1) {
scanf("%d %d %d",&n,&m,&p);
if(n==0&&m==0&&p==0){
break;
}
sum=0;
for (i=0; i<n; i++) {
scanf("%d",&mem[i]);
sum+=mem[i];
}
if(mem[m-1]==0){
result=0;
}else{
result=(sum*(100-p))/mem[m-1];
}
printf("%d\n",result);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219366/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219366/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%p = alloca i32, align 4
%mem = alloca [105 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.start.p0(i64 420, ptr nonnull %mem) #3
%call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %p)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp27 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp128 = icmp eq i32 %1, 0
%or.cond29 = select i1 %cmp27, i1 %cmp128, i1 false
%2 = load i32, ptr %p, align 4
%cmp330 = icmp eq i32 %2, 0
%or.cond1831 = select i1 %or.cond29, i1 %cmp330, i1 false
br i1 %or.cond1831, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %if.end16
%3 = phi i32 [ %12, %if.end16 ], [ %1, %entry ]
%4 = phi i32 [ %11, %if.end16 ], [ %0, %entry ]
%cmp423 = icmp sgt i32 %4, 0
br i1 %cmp423, label %for.body, label %for.end
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%sum.025 = phi i32 [ %add, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [105 x i32], ptr %mem, i64 0, i64 %indvars.iv
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %5, %sum.025
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp4, label %for.body, label %for.end.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %m, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %for.end.loopexit, %for.cond.preheader
%8 = phi i32 [ %3, %for.cond.preheader ], [ %.pre, %for.end.loopexit ]
%sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %add, %for.end.loopexit ]
%sub = add nsw i32 %8, -1
%idxprom8 = sext i32 %sub to i64
%arrayidx9 = getelementptr inbounds [105 x i32], ptr %mem, i64 0, i64 %idxprom8
%9 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp eq i32 %9, 0
br i1 %cmp10, label %if.end16, label %if.else
if.else: ; preds = %for.end
%10 = load i32, ptr %p, align 4, !tbaa !5
%sub12 = sub nsw i32 100, %10
%mul = mul nsw i32 %sub12, %sum.0.lcssa
%div = sdiv i32 %mul, %9
br label %if.end16
if.end16: ; preds = %for.end, %if.else
%result.0 = phi i32 [ %div, %if.else ], [ 0, %for.end ]
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %result.0)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %p)
%11 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %11, 0
%12 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %12, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%13 = load i32, ptr %p, align 4
%cmp3 = icmp eq i32 %13, 0
%or.cond18 = select i1 %or.cond, i1 %cmp3, i1 false
br i1 %or.cond18, label %while.end, label %for.cond.preheader
while.end: ; preds = %if.end16, %entry
call void @llvm.lifetime.end.p0(i64 420, ptr nonnull %mem) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #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>
#include<stdlib.h>
int compare(const void *a, const void *b){
long long int *A = (long long int *)a;
long long int *B = (long long int *)b;
if (*A > *B) return 1;
if (*A < *B) return -1;
return 0;
}
long long ab(long long x){
if(x<0)return -x;
return x;
}
int main(){
int N,i;
scanf("%d",&N);
long long A[N],B[N],C[N];
long long ans=0,tmp=0;
for(i=0;i<N;i++)scanf("%lld",&A[i]);
qsort(A,N,sizeof(long long),compare);
B[N/2]=A[0];
int min=1;
int max=N-1;
for(i=1;i<=(N+1)/2-1;i++){
if(i%2==1){
B[N/2-i]=A[max--];
B[N/2+i]=A[max--];
}else{
B[N/2-i]=A[min++];
B[N/2+i]=A[min++];
}
}
if(N%2==0)B[0]=A[N/2];
for(i=0;i<N-1;i++)ans+=ab(B[i]-B[i+1]);
C[N/2]=A[N-1];
min=0;
max=N-2;
for(i=1;i<=(N+1)/2-1;i++){
if(i%2==1){
C[N/2-i]=A[min++];
C[N/2+i]=A[min++];
}else{
C[N/2-i]=A[max--];
C[N/2+i]=A[max--];
}
}
if(N%2==0)C[0]=A[N/2];
for(i=0;i<N-1;i++)tmp+=ab(C[i]-C[i+1]);
if(tmp>ans)ans=tmp;
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219409/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219409/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(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 sgt i64 %0, %1
%cmp1 = icmp slt i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ab(i64 noundef %x) local_unnamed_addr #2 {
entry:
%retval.0 = tail call i64 @llvm.abs.i64(i64 %x, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !9
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !9
%4 = zext i32 %3 to i64
%vla1 = alloca i64, i64 %4, align 16
%vla2 = alloca i64, i64 %4, align 16
%cmp186 = icmp sgt i32 %3, 0
br i1 %cmp186, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre235 = sext i32 %3 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !9
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre235, %entry.for.end_crit_edge ], [ %6, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @compare) #8
%7 = load i64, ptr %vla, align 16, !tbaa !5
%8 = load i32, ptr %N, align 4, !tbaa !9
%div = sdiv i32 %8, 2
%idxprom5 = sext i32 %div to i64
%arrayidx6 = getelementptr inbounds i64, ptr %vla1, i64 %idxprom5
store i64 %7, ptr %arrayidx6, align 8, !tbaa !5
%sub = add i32 %8, -1
%add = add nsw i32 %8, 1
%div8 = sdiv i32 %add, 2
%cmp10.not.not188 = icmp sgt i32 %8, 2
br i1 %cmp10.not.not188, label %for.body12.preheader, label %for.end44
for.body12.preheader: ; preds = %for.end
%smax = call i32 @llvm.smax.i32(i32 %div8, i32 2)
%wide.trip.count = zext i32 %smax to i64
%invariant.gep.sink = getelementptr i64, ptr %vla1, i64 %idxprom5
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %for.inc42
%indvars.iv207 = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next208, %for.inc42 ]
%max.0191 = phi i32 [ %sub, %for.body12.preheader ], [ %max.1, %for.inc42 ]
%min.0190 = phi i32 [ 1, %for.body12.preheader ], [ %min.1, %for.inc42 ]
%rem236 = and i64 %indvars.iv207, 1
%cmp13.not = icmp eq i64 %rem236, 0
%9 = sub nsw i64 %idxprom5, %indvars.iv207
%arrayidx34 = getelementptr inbounds i64, ptr %vla1, i64 %9
br i1 %cmp13.not, label %if.else, label %if.then
if.then: ; preds = %for.body12
%dec = add nsw i32 %max.0191, -1
%idxprom15 = sext i32 %max.0191 to i64
%arrayidx16 = getelementptr inbounds i64, ptr %vla, i64 %idxprom15
%10 = load i64, ptr %arrayidx16, align 8, !tbaa !5
store i64 %10, ptr %arrayidx34, align 8, !tbaa !5
%dec21 = add nsw i32 %max.0191, -2
br label %for.inc42
if.else: ; preds = %for.body12
%inc28 = add nsw i32 %min.0190, 1
%idxprom29 = sext i32 %min.0190 to i64
%arrayidx30 = getelementptr inbounds i64, ptr %vla, i64 %idxprom29
%11 = load i64, ptr %arrayidx30, align 8, !tbaa !5
store i64 %11, ptr %arrayidx34, align 8, !tbaa !5
%inc35 = add nsw i32 %min.0190, 2
br label %for.inc42
for.inc42: ; preds = %if.then, %if.else
%dec.sink = phi i32 [ %dec, %if.then ], [ %inc28, %if.else ]
%min.1 = phi i32 [ %min.0190, %if.then ], [ %inc35, %if.else ]
%max.1 = phi i32 [ %dec21, %if.then ], [ %max.0191, %if.else ]
%idxprom22 = sext i32 %dec.sink to i64
%arrayidx23 = getelementptr inbounds i64, ptr %vla, i64 %idxprom22
%12 = load i64, ptr %arrayidx23, align 8, !tbaa !5
%gep = getelementptr i64, ptr %invariant.gep.sink, i64 %indvars.iv207
store i64 %12, ptr %gep, align 8, !tbaa !5
%indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1
%exitcond.not = icmp eq i64 %indvars.iv.next208, %wide.trip.count
br i1 %exitcond.not, label %for.end44, label %for.body12, !llvm.loop !13
for.end44: ; preds = %for.inc42, %for.end
%13 = and i32 %8, 1
%cmp46 = icmp eq i32 %13, 0
br i1 %cmp46, label %if.then48, label %if.end53
if.then48: ; preds = %for.end44
%arrayidx51 = getelementptr inbounds i64, ptr %vla, i64 %idxprom5
%14 = load i64, ptr %arrayidx51, align 8, !tbaa !5
store i64 %14, ptr %vla1, align 16, !tbaa !5
br label %if.end53
if.end53: ; preds = %if.then48, %for.end44
%cmp56193 = icmp sgt i32 %8, 1
br i1 %cmp56193, label %for.body58.preheader, label %for.end69.thread
for.end69.thread: ; preds = %if.end53
%idxprom71239 = sext i32 %sub to i64
%arrayidx72240 = getelementptr inbounds i64, ptr %vla, i64 %idxprom71239
%15 = load i64, ptr %arrayidx72240, align 8, !tbaa !5
%arrayidx75241 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom5
store i64 %15, ptr %arrayidx75241, align 8, !tbaa !5
br label %for.end120
for.body58.preheader: ; preds = %if.end53
%wide.trip.count217 = zext i32 %sub to i64
%.pre = load i64, ptr %vla1, align 16, !tbaa !5
%min.iters.check = icmp ult i32 %8, 5
br i1 %min.iters.check, label %for.body58.preheader275, label %vector.ph
vector.ph: ; preds = %for.body58.preheader
%n.vec = and i64 %wide.trip.count217, 4294967292
%vector.recur.init = insertelement <2 x i64> poison, i64 %.pre, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %wide.load250, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %25, %vector.body ]
%vec.phi249 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %26, %vector.body ]
%16 = or i64 %index, 1
%17 = getelementptr inbounds i64, ptr %vla1, i64 %16
%wide.load = load <2 x i64>, ptr %17, align 8, !tbaa !5
%18 = getelementptr inbounds i64, ptr %17, i64 2
%wide.load250 = load <2 x i64>, ptr %18, align 8, !tbaa !5
%19 = shufflevector <2 x i64> %vector.recur, <2 x i64> %wide.load, <2 x i32> <i32 1, i32 2>
%20 = shufflevector <2 x i64> %wide.load, <2 x i64> %wide.load250, <2 x i32> <i32 1, i32 2>
%21 = sub nsw <2 x i64> %19, %wide.load
%22 = sub nsw <2 x i64> %20, %wide.load250
%23 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %21, i1 true)
%24 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %22, i1 true)
%25 = add <2 x i64> %23, %vec.phi
%26 = add <2 x i64> %24, %vec.phi249
%index.next = add nuw i64 %index, 4
%27 = icmp eq i64 %index.next, %n.vec
br i1 %27, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %26, %25
%28 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count217
%vector.recur.extract = extractelement <2 x i64> %wide.load250, i64 1
br i1 %cmp.n, label %for.end69, label %for.body58.preheader275
for.body58.preheader275: ; preds = %for.body58.preheader, %middle.block
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body58.preheader ]
%indvars.iv214.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body58.preheader ]
%ans.0195.ph = phi i64 [ %28, %middle.block ], [ 0, %for.body58.preheader ]
br label %for.body58
for.body58: ; preds = %for.body58.preheader275, %for.body58
%scalar.recur = phi i64 [ %29, %for.body58 ], [ %scalar.recur.ph, %for.body58.preheader275 ]
%indvars.iv214 = phi i64 [ %indvars.iv.next215, %for.body58 ], [ %indvars.iv214.ph, %for.body58.preheader275 ]
%ans.0195 = phi i64 [ %add66, %for.body58 ], [ %ans.0195.ph, %for.body58.preheader275 ]
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%arrayidx63 = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv.next215
%29 = load i64, ptr %arrayidx63, align 8, !tbaa !5
%sub64 = sub nsw i64 %scalar.recur, %29
%retval.0.i = call i64 @llvm.abs.i64(i64 %sub64, i1 true)
%add66 = add nuw nsw i64 %retval.0.i, %ans.0195
%exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count217
br i1 %exitcond218.not, label %for.end69, label %for.body58, !llvm.loop !17
for.end69: ; preds = %for.body58, %middle.block
%add66.lcssa = phi i64 [ %28, %middle.block ], [ %add66, %for.body58 ]
%idxprom71 = sext i32 %sub to i64
%arrayidx72 = getelementptr inbounds i64, ptr %vla, i64 %idxprom71
%30 = load i64, ptr %arrayidx72, align 8, !tbaa !5
%arrayidx75 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom5
store i64 %30, ptr %arrayidx75, align 8, !tbaa !5
br i1 %cmp10.not.not188, label %for.body83.preheader, label %for.end120
for.body83.preheader: ; preds = %for.end69
%sub76 = add nsw i32 %8, -2
%smax226 = call i32 @llvm.smax.i32(i32 %div8, i32 2)
%wide.trip.count227 = zext i32 %smax226 to i64
%invariant.gep245.sink = getelementptr i64, ptr %vla2, i64 %idxprom5
br label %for.body83
for.body83: ; preds = %for.body83.preheader, %for.inc118
%indvars.iv219 = phi i64 [ 1, %for.body83.preheader ], [ %indvars.iv.next220, %for.inc118 ]
%max.2200 = phi i32 [ %sub76, %for.body83.preheader ], [ %max.3, %for.inc118 ]
%min.2199 = phi i32 [ 0, %for.body83.preheader ], [ %min.3, %for.inc118 ]
%rem84237 = and i64 %indvars.iv219, 1
%cmp85.not = icmp eq i64 %rem84237, 0
%31 = sub nsw i64 %idxprom5, %indvars.iv219
%arrayidx109 = getelementptr inbounds i64, ptr %vla2, i64 %31
br i1 %cmp85.not, label %if.else102, label %if.then87
if.then87: ; preds = %for.body83
%inc88 = add nsw i32 %min.2199, 1
%idxprom89 = sext i32 %min.2199 to i64
%arrayidx90 = getelementptr inbounds i64, ptr %vla, i64 %idxprom89
%32 = load i64, ptr %arrayidx90, align 8, !tbaa !5
store i64 %32, ptr %arrayidx109, align 8, !tbaa !5
%inc95 = add nsw i32 %min.2199, 2
br label %for.inc118
if.else102: ; preds = %for.body83
%dec103 = add nsw i32 %max.2200, -1
%idxprom104 = sext i32 %max.2200 to i64
%arrayidx105 = getelementptr inbounds i64, ptr %vla, i64 %idxprom104
%33 = load i64, ptr %arrayidx105, align 8, !tbaa !5
store i64 %33, ptr %arrayidx109, align 8, !tbaa !5
%dec110 = add nsw i32 %max.2200, -2
br label %for.inc118
for.inc118: ; preds = %if.then87, %if.else102
%inc88.sink = phi i32 [ %inc88, %if.then87 ], [ %dec103, %if.else102 ]
%min.3 = phi i32 [ %inc95, %if.then87 ], [ %min.2199, %if.else102 ]
%max.3 = phi i32 [ %max.2200, %if.then87 ], [ %dec110, %if.else102 ]
%idxprom96 = sext i32 %inc88.sink to i64
%arrayidx97 = getelementptr inbounds i64, ptr %vla, i64 %idxprom96
%34 = load i64, ptr %arrayidx97, align 8, !tbaa !5
%gep246 = getelementptr i64, ptr %invariant.gep245.sink, i64 %indvars.iv219
store i64 %34, ptr %gep246, align 8, !tbaa !5
%indvars.iv.next220 = add nuw nsw i64 %indvars.iv219, 1
%exitcond228.not = icmp eq i64 %indvars.iv.next220, %wide.trip.count227
br i1 %exitcond228.not, label %for.end120, label %for.body83, !llvm.loop !18
for.end120: ; preds = %for.inc118, %for.end69.thread, %for.end69
%ans.0.lcssa242 = phi i64 [ 0, %for.end69.thread ], [ %add66.lcssa, %for.end69 ], [ %add66.lcssa, %for.inc118 ]
br i1 %cmp46, label %if.then124, label %if.end129
if.then124: ; preds = %for.end120
%arrayidx127 = getelementptr inbounds i64, ptr %vla, i64 %idxprom5
%35 = load i64, ptr %arrayidx127, align 8, !tbaa !5
store i64 %35, ptr %vla2, align 16, !tbaa !5
br label %if.end129
if.end129: ; preds = %if.then124, %for.end120
br i1 %cmp56193, label %for.body134.preheader, label %for.end145
for.body134.preheader: ; preds = %if.end129
%wide.trip.count232 = zext i32 %sub to i64
%.pre234 = load i64, ptr %vla2, align 16, !tbaa !5
%min.iters.check253 = icmp ult i32 %8, 5
br i1 %min.iters.check253, label %for.body134.preheader273, label %vector.ph254
vector.ph254: ; preds = %for.body134.preheader
%n.vec256 = and i64 %wide.trip.count232, 4294967292
%vector.recur.init261 = insertelement <2 x i64> poison, i64 %.pre234, i64 1
br label %vector.body259
vector.body259: ; preds = %vector.body259, %vector.ph254
%index260 = phi i64 [ 0, %vector.ph254 ], [ %index.next267, %vector.body259 ]
%vector.recur262 = phi <2 x i64> [ %vector.recur.init261, %vector.ph254 ], [ %wide.load266, %vector.body259 ]
%vec.phi263 = phi <2 x i64> [ zeroinitializer, %vector.ph254 ], [ %45, %vector.body259 ]
%vec.phi264 = phi <2 x i64> [ zeroinitializer, %vector.ph254 ], [ %46, %vector.body259 ]
%36 = or i64 %index260, 1
%37 = getelementptr inbounds i64, ptr %vla2, i64 %36
%wide.load265 = load <2 x i64>, ptr %37, align 8, !tbaa !5
%38 = getelementptr inbounds i64, ptr %37, i64 2
%wide.load266 = load <2 x i64>, ptr %38, align 8, !tbaa !5
%39 = shufflevector <2 x i64> %vector.recur262, <2 x i64> %wide.load265, <2 x i32> <i32 1, i32 2>
%40 = shufflevector <2 x i64> %wide.load265, <2 x i64> %wide.load266, <2 x i32> <i32 1, i32 2>
%41 = sub nsw <2 x i64> %39, %wide.load265
%42 = sub nsw <2 x i64> %40, %wide.load266
%43 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %41, i1 true)
%44 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %42, i1 true)
%45 = add <2 x i64> %43, %vec.phi263
%46 = add <2 x i64> %44, %vec.phi264
%index.next267 = add nuw i64 %index260, 4
%47 = icmp eq i64 %index.next267, %n.vec256
br i1 %47, label %middle.block251, label %vector.body259, !llvm.loop !19
middle.block251: ; preds = %vector.body259
%bin.rdx268 = add <2 x i64> %46, %45
%48 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx268)
%cmp.n258 = icmp eq i64 %n.vec256, %wide.trip.count232
%vector.recur.extract270 = extractelement <2 x i64> %wide.load266, i64 1
br i1 %cmp.n258, label %for.end145, label %for.body134.preheader273
for.body134.preheader273: ; preds = %for.body134.preheader, %middle.block251
%scalar.recur272.ph = phi i64 [ %vector.recur.extract270, %middle.block251 ], [ %.pre234, %for.body134.preheader ]
%indvars.iv229.ph = phi i64 [ %n.vec256, %middle.block251 ], [ 0, %for.body134.preheader ]
%tmp.0203.ph = phi i64 [ %48, %middle.block251 ], [ 0, %for.body134.preheader ]
br label %for.body134
for.body134: ; preds = %for.body134.preheader273, %for.body134
%scalar.recur272 = phi i64 [ %49, %for.body134 ], [ %scalar.recur272.ph, %for.body134.preheader273 ]
%indvars.iv229 = phi i64 [ %indvars.iv.next230, %for.body134 ], [ %indvars.iv229.ph, %for.body134.preheader273 ]
%tmp.0203 = phi i64 [ %add142, %for.body134 ], [ %tmp.0203.ph, %for.body134.preheader273 ]
%indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1
%arrayidx139 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv.next230
%49 = load i64, ptr %arrayidx139, align 8, !tbaa !5
%sub140 = sub nsw i64 %scalar.recur272, %49
%retval.0.i185 = call i64 @llvm.abs.i64(i64 %sub140, i1 true)
%add142 = add nuw nsw i64 %retval.0.i185, %tmp.0203
%exitcond233.not = icmp eq i64 %indvars.iv.next230, %wide.trip.count232
br i1 %exitcond233.not, label %for.end145, label %for.body134, !llvm.loop !20
for.end145: ; preds = %for.body134, %middle.block251, %if.end129
%tmp.0.lcssa = phi i64 [ 0, %if.end129 ], [ %48, %middle.block251 ], [ %add142, %for.body134 ]
%spec.select = call i64 @llvm.umax.i64(i64 %tmp.0.lcssa, i64 %ans.0.lcssa242)
%call150 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #7
; 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 <2 x i64> @llvm.abs.v2i64(<2 x i64>, i1 immarg) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !15, !16}
!20 = distinct !{!20, !12, !16, !15}
|
#include <stdio.h>
int main(void) {
int N;
if (scanf("%d", &N) != 1) return 1;
if (N < 100 || 999 < N) {
puts("unsupported");
} else {
puts(N / 100 == N % 10 ? "Yes" : "No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219452/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219452/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"unsupported\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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)
%cmp.not = icmp eq i32 %call, 1
br i1 %cmp.not, label %if.end, label %cleanup
if.end: ; preds = %entry
%0 = load i32, ptr %N, align 4
%1 = add i32 %0, -1000
%or.cond = icmp ult i32 %1, -900
br i1 %or.cond, label %cleanup.sink.split, label %if.else
if.else: ; preds = %if.end
%div.lhs.trunc = trunc i32 %0 to i16
%div8 = udiv i16 %div.lhs.trunc, 100
%rem9 = urem i16 %div.lhs.trunc, 10
%cmp5 = icmp eq i16 %div8, %rem9
%cond = select i1 %cmp5, ptr @.str.2, ptr @.str.3
br label %cleanup.sink.split
cleanup.sink.split: ; preds = %if.end, %if.else
%.str.1.sink = phi ptr [ %cond, %if.else ], [ @.str.1, %if.end ]
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
br label %cleanup
cleanup: ; preds = %cleanup.sink.split, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 0, %cleanup.sink.split ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
(n/100==n%10)?puts("Yes"):puts("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219496/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219496/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%div = sdiv i32 %0, 100
%rem = srem i32 %0, 10
%cmp = icmp eq i32 %div, %rem
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a;
scanf("%d",&a);
if(a%10==a/100)puts("Yes");
else puts("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219539/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219539/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%rem = srem i32 %0, 10
%div = sdiv i32 %0, 100
%cmp = icmp eq i32 %rem, %div
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int ar[100000];
int main()
{
long long int i,j,n,t,bs=0,b;
scanf("%lld",&n);
for(j=1;j<=n;j++){
scanf("%lld",&i);
ar[j]=i;
if(ar[j]>bs){
bs=ar[j];
b=j;
}
}
for(j=1;j<=n;j++){
if(j!=b)
bs-=ar[j];
}
printf("%lld",bs+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21959/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21959/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@ar = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #4
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
%cmp.not34 = icmp slt i64 %0, 1
br i1 %cmp.not34, label %for.end20, label %for.body
for.cond8.preheader: ; preds = %for.body
%cmp9.not40 = icmp slt i64 %3, 1
br i1 %cmp9.not40, label %for.end20, label %for.body11.preheader
for.body11.preheader: ; preds = %for.cond8.preheader
%xtraiter = and i64 %3, 1
%1 = icmp eq i64 %3, 1
br i1 %1, label %for.end20.loopexit.unr-lcssa, label %for.body11.preheader.new
for.body11.preheader.new: ; preds = %for.body11.preheader
%unroll_iter = and i64 %3, -2
br label %for.body11
for.body: ; preds = %entry, %for.body
%b.037 = phi i64 [ %spec.select33, %for.body ], [ undef, %entry ]
%bs.036 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ]
%j.035 = phi i64 [ %inc, %for.body ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i)
%2 = load i64, ptr %i, align 8, !tbaa !5
%conv = trunc i64 %2 to i32
%arrayidx = getelementptr inbounds [100000 x i32], ptr @ar, i64 0, i64 %j.035
store i32 %conv, ptr %arrayidx, align 4, !tbaa !9
%sext = shl i64 %2, 32
%conv3 = ashr exact i64 %sext, 32
%cmp4 = icmp sgt i64 %conv3, %bs.036
%spec.select = call i64 @llvm.smax.i64(i64 %conv3, i64 %bs.036)
%spec.select33 = select i1 %cmp4, i64 %j.035, i64 %b.037
%inc = add nuw nsw i64 %j.035, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %j.035, %3
br i1 %cmp.not.not, label %for.body, label %for.cond8.preheader, !llvm.loop !11
for.body11: ; preds = %for.inc18.1, %for.body11.preheader.new
%bs.242 = phi i64 [ %spec.select, %for.body11.preheader.new ], [ %bs.3.1, %for.inc18.1 ]
%j.141 = phi i64 [ 1, %for.body11.preheader.new ], [ %inc19.1, %for.inc18.1 ]
%niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.inc18.1 ]
%cmp12.not = icmp eq i64 %j.141, %spec.select33
br i1 %cmp12.not, label %for.inc18, label %if.then14
if.then14: ; preds = %for.body11
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr @ar, i64 0, i64 %j.141
%4 = load i32, ptr %arrayidx15, align 4, !tbaa !9
%conv16 = sext i32 %4 to i64
%sub = sub nsw i64 %bs.242, %conv16
br label %for.inc18
for.inc18: ; preds = %for.body11, %if.then14
%bs.3 = phi i64 [ %sub, %if.then14 ], [ %bs.242, %for.body11 ]
%inc19 = add nuw i64 %j.141, 1
%cmp12.not.1 = icmp eq i64 %inc19, %spec.select33
br i1 %cmp12.not.1, label %for.inc18.1, label %if.then14.1
if.then14.1: ; preds = %for.inc18
%arrayidx15.1 = getelementptr inbounds [100000 x i32], ptr @ar, i64 0, i64 %inc19
%5 = load i32, ptr %arrayidx15.1, align 4, !tbaa !9
%conv16.1 = sext i32 %5 to i64
%sub.1 = sub nsw i64 %bs.3, %conv16.1
br label %for.inc18.1
for.inc18.1: ; preds = %if.then14.1, %for.inc18
%bs.3.1 = phi i64 [ %sub.1, %if.then14.1 ], [ %bs.3, %for.inc18 ]
%inc19.1 = add nuw i64 %j.141, 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.end20.loopexit.unr-lcssa, label %for.body11, !llvm.loop !13
for.end20.loopexit.unr-lcssa: ; preds = %for.inc18.1, %for.body11.preheader
%bs.3.lcssa.ph = phi i64 [ undef, %for.body11.preheader ], [ %bs.3.1, %for.inc18.1 ]
%bs.242.unr = phi i64 [ %spec.select, %for.body11.preheader ], [ %bs.3.1, %for.inc18.1 ]
%j.141.unr = phi i64 [ 1, %for.body11.preheader ], [ %inc19.1, %for.inc18.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end20, label %for.body11.epil
for.body11.epil: ; preds = %for.end20.loopexit.unr-lcssa
%cmp12.not.epil = icmp eq i64 %j.141.unr, %spec.select33
br i1 %cmp12.not.epil, label %for.end20, label %if.then14.epil
if.then14.epil: ; preds = %for.body11.epil
%arrayidx15.epil = getelementptr inbounds [100000 x i32], ptr @ar, i64 0, i64 %j.141.unr
%6 = load i32, ptr %arrayidx15.epil, align 4, !tbaa !9
%conv16.epil = sext i32 %6 to i64
%sub.epil = sub nsw i64 %bs.242.unr, %conv16.epil
br label %for.end20
for.end20: ; preds = %for.end20.loopexit.unr-lcssa, %if.then14.epil, %for.body11.epil, %entry, %for.cond8.preheader
%bs.2.lcssa = phi i64 [ %spec.select, %for.cond8.preheader ], [ 0, %entry ], [ %bs.3.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %sub.epil, %if.then14.epil ], [ %bs.242.unr, %for.body11.epil ]
%add = add nsw i64 %bs.2.lcssa, 1
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %add)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include <stdio.h>
int main(){
char num[1000],i;
scanf("%s",num);
if(num[0]==num[2]){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219654/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219654/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%num = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i8, ptr %num, align 16, !tbaa !5
%arrayidx1 = getelementptr inbounds [1000 x i8], ptr %num, i64 0, i64 2
%1 = load i8, ptr %arrayidx1, align 2, !tbaa !5
%cmp = icmp eq i8 %0, %1
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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"}
|
//set many funcs
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define inf 1145141919
#define llinf 1145141919810364364
#define mod 1000000007
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int main(void){
int n;
scanf("%d",&n);
if(n/100 == n%10){printf("Yes\n");}else{printf("No\n");}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219698/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219698/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
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 #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
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.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; 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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !14
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !15
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 8
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !17
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !19
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !20
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !21
%1 = load i32, ptr %b, align 4, !tbaa !21
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !21
%1 = load i32, ptr %b, align 4, !tbaa !21
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !25
%1 = load i64, ptr %b, align 8, !tbaa !25
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !25
%1 = load i64, ptr %b, align 8, !tbaa !25
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !27
%1 = load double, ptr %b, align 8, !tbaa !27
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !27
%1 = load double, ptr %b, align 8, !tbaa !27
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !21
%div = sdiv i32 %0, 100
%rem = srem i32 %0, 10
%cmp = icmp eq i32 %div, %rem
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #8
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 = { 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"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 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.unroll.disable"}
!19 = distinct !{!19, !6}
!20 = distinct !{!20, !18}
!21 = !{!22, !22, i64 0}
!22 = !{!"int", !23, i64 0}
!23 = !{!"omnipotent char", !24, i64 0}
!24 = !{!"Simple C/C++ TBAA"}
!25 = !{!26, !26, i64 0}
!26 = !{!"long long", !23, i64 0}
!27 = !{!28, !28, i64 0}
!28 = !{!"double", !23, i64 0}
|
#include<stdio.h>
int main()
{
int A,B,M,a[150000],b[150000],m[150000],x[150000],y[150000],r,i,j,min,max;
scanf("%d %d %d",&A,&B,&M);
min=999999;
for(i=0;i<A;i++)
{
scanf("%d",&a[i]);
if(a[i]<min)
min=a[i];
}
max=9999999;
for(i=0;i<B;i++)
{
scanf("%d",&b[i]);
if(b[i]<max)
max=b[i];
}
for(i=0;i<M;i++)
{
scanf("%d %d %d",&x[i],&y[i],&m[i]);
}
int mat=9999999;
for(i=0;i<M;i++)
{
r=a[x[i]-1]+b[y[i]-1]-m[i];
if(r<mat)
mat=r;
}
if(max+min<mat)
printf("%d",max+min);
else
printf("%d",mat);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219748/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219748/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%M = alloca i32, align 4
%a = alloca [150000 x i32], align 16
%b = alloca [150000 x i32], align 16
%m = alloca [150000 x i32], align 16
%x = alloca [150000 x i32], align 16
%y = alloca [150000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.start.p0(i64 600000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 600000, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 600000, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 600000, ptr nonnull %x) #4
call void @llvm.lifetime.start.p0(i64 600000, ptr nonnull %y) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %M)
%0 = load i32, ptr %A, align 4, !tbaa !5
%cmp93 = icmp sgt i32 %0, 0
br i1 %cmp93, label %for.body, label %for.cond7.preheader
for.cond7.preheader: ; preds = %for.body, %entry
%min.0.lcssa = phi i32 [ 999999, %entry ], [ %spec.select, %for.body ]
%1 = load i32, ptr %B, align 4, !tbaa !5
%cmp896 = icmp sgt i32 %1, 0
br i1 %cmp896, label %for.body9, label %for.cond23.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%min.095 = phi i32 [ %spec.select, %for.body ], [ 999999, %entry ]
%arrayidx = getelementptr inbounds [150000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %2, i32 %min.095)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %A, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9
for.cond23.preheader: ; preds = %for.body9, %for.cond7.preheader
%max.0.lcssa = phi i32 [ 9999999, %for.cond7.preheader ], [ %spec.select91, %for.body9 ]
%5 = load i32, ptr %M, align 4, !tbaa !5
%cmp24100 = icmp sgt i32 %5, 0
br i1 %cmp24100, label %for.body25, label %for.end56
for.body9: ; preds = %for.cond7.preheader, %for.body9
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body9 ], [ 0, %for.cond7.preheader ]
%max.098 = phi i32 [ %spec.select91, %for.body9 ], [ 9999999, %for.cond7.preheader ]
%arrayidx11 = getelementptr inbounds [150000 x i32], ptr %b, i64 0, i64 %indvars.iv109
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx11)
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%spec.select91 = call i32 @llvm.smin.i32(i32 %6, i32 %max.098)
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
%7 = load i32, ptr %B, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp8 = icmp slt i64 %indvars.iv.next110, %8
br i1 %cmp8, label %for.body9, label %for.cond23.preheader, !llvm.loop !11
for.cond36.preheader: ; preds = %for.body25
%cmp37103 = icmp sgt i32 %9, 0
br i1 %cmp37103, label %for.body38.preheader, label %for.end56
for.body38.preheader: ; preds = %for.cond36.preheader
%wide.trip.count = zext i32 %9 to i64
br label %for.body38
for.body25: ; preds = %for.cond23.preheader, %for.body25
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.body25 ], [ 0, %for.cond23.preheader ]
%arrayidx27 = getelementptr inbounds [150000 x i32], ptr %x, i64 0, i64 %indvars.iv112
%arrayidx29 = getelementptr inbounds [150000 x i32], ptr %y, i64 0, i64 %indvars.iv112
%arrayidx31 = getelementptr inbounds [150000 x i32], ptr %m, i64 0, i64 %indvars.iv112
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx27, ptr noundef nonnull %arrayidx29, ptr noundef nonnull %arrayidx31)
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%9 = load i32, ptr %M, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp24 = icmp slt i64 %indvars.iv.next113, %10
br i1 %cmp24, label %for.body25, label %for.cond36.preheader, !llvm.loop !12
for.body38: ; preds = %for.body38.preheader, %for.body38
%indvars.iv115 = phi i64 [ 0, %for.body38.preheader ], [ %indvars.iv.next116, %for.body38 ]
%mat.0105 = phi i32 [ 9999999, %for.body38.preheader ], [ %spec.select92, %for.body38 ]
%arrayidx40 = getelementptr inbounds [150000 x i32], ptr %x, i64 0, i64 %indvars.iv115
%11 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%idxprom41 = sext i32 %sub to i64
%arrayidx42 = getelementptr inbounds [150000 x i32], ptr %a, i64 0, i64 %idxprom41
%12 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%arrayidx44 = getelementptr inbounds [150000 x i32], ptr %y, i64 0, i64 %indvars.iv115
%13 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%sub45 = add nsw i32 %13, -1
%idxprom46 = sext i32 %sub45 to i64
%arrayidx47 = getelementptr inbounds [150000 x i32], ptr %b, i64 0, i64 %idxprom46
%14 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%add = add nsw i32 %14, %12
%arrayidx49 = getelementptr inbounds [150000 x i32], ptr %m, i64 0, i64 %indvars.iv115
%15 = load i32, ptr %arrayidx49, align 4, !tbaa !5
%sub50 = sub i32 %add, %15
%spec.select92 = call i32 @llvm.smin.i32(i32 %sub50, i32 %mat.0105)
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%exitcond.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count
br i1 %exitcond.not, label %for.end56, label %for.body38, !llvm.loop !13
for.end56: ; preds = %for.body38, %for.cond23.preheader, %for.cond36.preheader
%mat.0.lcssa = phi i32 [ 9999999, %for.cond36.preheader ], [ 9999999, %for.cond23.preheader ], [ %spec.select92, %for.body38 ]
%add57 = add nsw i32 %max.0.lcssa, %min.0.lcssa
%add57.mat.0.lcssa = call i32 @llvm.smin.i32(i32 %add57, i32 %mat.0.lcssa)
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add57.mat.0.lcssa)
call void @llvm.lifetime.end.p0(i64 600000, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 600000, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 600000, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 600000, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 600000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(){
int i,a,b,m,aa[100000],bb[100000],t,x,y,c,min,ma=1000000,mb=1000000;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&m);
for(i=0;i<a;i++){
scanf("%d",&t);
aa[i]=t;
if(ma>t) ma=t;
}
for(i=0;i<b;i++){
scanf("%d",&t);
bb[i]=t;
if(mb>t) mb=t;
}
min=ma+mb;
for(i=0;i<m;i++){
scanf("%d",&x);
scanf("%d",&y);
scanf("%d",&c);
t=aa[x-1]+bb[y-1]-c;
if(min>t) min=t;
}
printf("%d",min);
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%m = alloca i32, align 4
%aa = alloca [100000 x i32], align 16
%bb = alloca [100000 x i32], align 16
%t = alloca i32, align 4
%x = alloca i32, align 4
%y = 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 %m) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %aa) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %bb) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %a, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body, %entry
%ma.0.lcssa = phi i32 [ 1000000, %entry ], [ %spec.select, %for.body ]
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp653 = icmp sgt i32 %1, 0
br i1 %cmp653, label %for.body7, label %for.end16
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%ma.052 = phi i32 [ %spec.select, %for.body ], [ 1000000, %entry ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%2 = load i32, ptr %t, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [100000 x i32], ptr %aa, i64 0, i64 %indvars.iv
store i32 %2, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smin.i32(i32 %ma.052, i32 %2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %a, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9
for.body7: ; preds = %for.cond5.preheader, %for.body7
%indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.body7 ], [ 0, %for.cond5.preheader ]
%mb.055 = phi i32 [ %spec.select48, %for.body7 ], [ 1000000, %for.cond5.preheader ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%5 = load i32, ptr %t, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [100000 x i32], ptr %bb, i64 0, i64 %indvars.iv62
store i32 %5, ptr %arrayidx10, align 4, !tbaa !5
%spec.select48 = call i32 @llvm.smin.i32(i32 %mb.055, i32 %5)
%indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
%6 = load i32, ptr %b, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp6 = icmp slt i64 %indvars.iv.next63, %7
br i1 %cmp6, label %for.body7, label %for.end16, !llvm.loop !11
for.end16: ; preds = %for.body7, %for.cond5.preheader
%mb.0.lcssa = phi i32 [ 1000000, %for.cond5.preheader ], [ %spec.select48, %for.body7 ]
%add = add nsw i32 %mb.0.lcssa, %ma.0.lcssa
%8 = load i32, ptr %m, align 4, !tbaa !5
%cmp1857 = icmp sgt i32 %8, 0
br i1 %cmp1857, label %for.body19, label %for.end35
for.body19: ; preds = %for.end16, %for.body19
%min.059 = phi i32 [ %spec.select49, %for.body19 ], [ %add, %for.end16 ]
%i.258 = phi i32 [ %inc34, %for.body19 ], [ 0, %for.end16 ]
%call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c)
%9 = load i32, ptr %x, align 4, !tbaa !5
%sub = add nsw i32 %9, -1
%idxprom23 = sext i32 %sub to i64
%arrayidx24 = getelementptr inbounds [100000 x i32], ptr %aa, i64 0, i64 %idxprom23
%10 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%11 = load i32, ptr %y, align 4, !tbaa !5
%sub25 = add nsw i32 %11, -1
%idxprom26 = sext i32 %sub25 to i64
%arrayidx27 = getelementptr inbounds [100000 x i32], ptr %bb, i64 0, i64 %idxprom26
%12 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%add28 = add nsw i32 %12, %10
%13 = load i32, ptr %c, align 4, !tbaa !5
%sub29 = sub i32 %add28, %13
store i32 %sub29, ptr %t, align 4, !tbaa !5
%spec.select49 = call i32 @llvm.smin.i32(i32 %min.059, i32 %sub29)
%inc34 = add nuw nsw i32 %i.258, 1
%14 = load i32, ptr %m, align 4, !tbaa !5
%cmp18 = icmp slt i32 %inc34, %14
br i1 %cmp18, label %for.body19, label %for.end35, !llvm.loop !12
for.end35: ; preds = %for.body19, %for.end16
%min.0.lcssa = phi i32 [ %add, %for.end16 ], [ %spec.select49, %for.body19 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %min.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %bb) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %aa) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(void){
int num,b,i,s,e;
scanf("%d%d",&num,&b);
s=b-num+1; e=b+num-1;
for(i=s;i<=e;i++)
printf("%d ",i);
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219834/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219834/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #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 %num, ptr noundef nonnull %b)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %num, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%add1 = add i32 %0, -1
%sub2 = add i32 %add1, %1
%cmp.not.not7 = icmp slt i32 %sub, %sub2
br i1 %cmp.not.not7, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.0.in8 = phi i32 [ %i.0, %for.body ], [ %sub, %entry ]
%i.0 = add nsw i32 %i.0.in8, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
%exitcond.not = icmp eq i32 %i.0, %sub2
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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>
int main(void){
int k,x;
scanf("%d %d", &k,&x);
int i;
if(x-k+1>=-1000000){
for(i=x-k+1;i<=x;i++){
printf("%d ",i);
}
}else{
for(i=-1000000;i<=x;x++){
printf("%d ",i);
}
}
if(x+k-1<=1000000){
for(i=x+1;i<=x+k-1;i++){
printf("%d ",i);
}
}else{
for(i=x+1;i<=1000000;i++){
printf("%d ",i);
}
}
putchar('\n');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219878/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219878/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%cmp = icmp sgt i32 %sub, -1000002
br i1 %cmp, label %for.cond.preheader, label %for.cond5.preheader
for.cond5.preheader: ; preds = %entry
%cmp649 = icmp sgt i32 %0, -1000001
br i1 %cmp649, label %for.body7, label %if.end
for.cond.preheader: ; preds = %entry
%cmp3.not.not50 = icmp sgt i32 %1, 0
br i1 %cmp3.not.not50, label %for.body, label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%i.0.in51 = phi i32 [ %i.0, %for.body ], [ %sub, %for.cond.preheader ]
%i.0 = add nsw i32 %i.0.in51, 1
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
%2 = load i32, ptr %x, align 4, !tbaa !5
%cmp3.not.not = icmp slt i32 %i.0, %2
br i1 %cmp3.not.not, label %for.body, label %if.end, !llvm.loop !9
for.body7: ; preds = %for.cond5.preheader, %for.body7
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef -1000000)
%3 = load i32, ptr %x, align 4, !tbaa !5
%inc10 = add nsw i32 %3, 1
store i32 %inc10, ptr %x, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %3, -1000002
br i1 %cmp6, label %for.body7, label %if.end, !llvm.loop !11
if.end: ; preds = %for.body7, %for.body, %for.cond5.preheader, %for.cond.preheader
%4 = phi i32 [ %0, %for.cond5.preheader ], [ %0, %for.cond.preheader ], [ %2, %for.body ], [ %inc10, %for.body7 ]
%5 = load i32, ptr %k, align 4, !tbaa !5
%add12 = add nsw i32 %5, %4
%cmp14 = icmp slt i32 %add12, 1000002
br i1 %cmp14, label %for.cond17.preheader, label %for.cond28.preheader
for.cond28.preheader: ; preds = %if.end
%cmp2952 = icmp slt i32 %4, 1000000
br i1 %cmp2952, label %for.body30, label %if.end35
for.cond17.preheader: ; preds = %if.end
%add1854 = add i32 %4, -1
%sub1955 = add i32 %add1854, %5
%cmp20.not.not56 = icmp slt i32 %4, %sub1955
br i1 %cmp20.not.not56, label %for.body21, label %if.end35
for.body21: ; preds = %for.cond17.preheader, %for.body21
%i.1.in57 = phi i32 [ %i.1, %for.body21 ], [ %4, %for.cond17.preheader ]
%i.1 = add nsw i32 %i.1.in57, 1
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.1)
%6 = load i32, ptr %x, align 4, !tbaa !5
%7 = load i32, ptr %k, align 4, !tbaa !5
%add18 = add i32 %6, -1
%sub19 = add i32 %add18, %7
%cmp20.not.not = icmp slt i32 %i.1, %sub19
br i1 %cmp20.not.not, label %for.body21, label %if.end35, !llvm.loop !12
for.body30: ; preds = %for.cond28.preheader, %for.body30
%i.2.in53 = phi i32 [ %i.2, %for.body30 ], [ %4, %for.cond28.preheader ]
%i.2 = add nsw i32 %i.2.in53, 1
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.2)
%exitcond.not = icmp eq i32 %i.2, 1000000
br i1 %exitcond.not, label %if.end35, label %for.body30, !llvm.loop !13
if.end35: ; preds = %for.body30, %for.body21, %for.cond28.preheader, %for.cond17.preheader
%8 = load ptr, ptr @stdout, align 8, !tbaa !14
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %8)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
|
#include<stdio.h>
int main(){
int a;
int b;
scanf("%d %d",&a,&b);
for(int i=a-1;i>=-a+2;i--){
printf("%d ",b-i);
}
printf("%d",a+b-1);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219920/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219920/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%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
%add9 = sub i32 2, %0
%cmp.not.not10 = icmp sgt i32 %0, %add9
br i1 %cmp.not.not10, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %3, %for.body ]
%1 = load i32, ptr %b, align 4, !tbaa !5
%add4 = add i32 %.lcssa, -1
%sub5 = add i32 %add4, %1
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub5)
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
for.body: ; preds = %entry, %for.body
%i.0.in11 = phi i32 [ %i.0, %for.body ], [ %0, %entry ]
%i.0 = add nsw i32 %i.0.in11, -1
%2 = load i32, ptr %b, align 4, !tbaa !5
%sub2 = sub nsw i32 %2, %i.0
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub2)
%3 = load i32, ptr %a, align 4, !tbaa !5
%add = sub i32 2, %3
%cmp.not.not = icmp sgt i32 %i.0, %add
br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int k,x;
int main(void){
scanf("%d%d",&k,&x);
int i;
for(i=x-k+1;i<x-k+1+k*2-1;i++){
printf("%d ",i);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_219964/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_219964/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@k = dso_local global i32 0, align 4
@x = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \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 @k, ptr noundef nonnull @x)
%0 = load i32, ptr @x, align 4, !tbaa !5
%1 = load i32, ptr @k, align 4, !tbaa !5
%sub = sub i32 %0, %1
%i.08 = add nsw i32 %sub, 1
%mul11 = shl nsw i32 %1, 1
%sub412 = add i32 %sub, %mul11
%cmp13 = icmp slt i32 %i.08, %sub412
br i1 %cmp13, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.014 = phi i32 [ %i.0, %for.body ], [ %i.08, %entry ]
%call5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.014)
%i.0 = add nsw i32 %i.014, 1
%2 = load i32, ptr @x, align 4, !tbaa !5
%3 = load i32, ptr @k, align 4, !tbaa !5
%sub1 = sub i32 %2, %3
%mul = shl nsw i32 %3, 1
%sub4 = add i32 %sub1, %mul
%cmp = icmp slt i32 %i.0, %sub4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main (void){
int k, x, i;
scanf("%d %d", &k, &x);
for(i = -(k-1); i < k ; i++){
printf("%d ",i+x);
}
printf("\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220005/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220005/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %x)
%0 = load i32, ptr %k, align 4, !tbaa !5
%sub1 = sub nsw i32 1, %0
%cmp6 = icmp slt i32 %sub1, %0
br i1 %cmp6, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.07 = phi i32 [ %inc, %for.body ], [ %sub1, %entry ]
%1 = load i32, ptr %x, align 4, !tbaa !5
%add = add nsw i32 %1, %i.07
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%inc = add nsw i32 %i.07, 1
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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"
int main(){
int K, X, i;
scanf("%d %d", &K, &X);
for(i = K; i > 0; i--){
printf("%d ", X - (i - 1));
}
for(i = 1; i < K; i++){
printf("%d ", X + i);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220049/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220049/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %X)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp14 = icmp sgt i32 %0, 0
br i1 %cmp14, label %for.body, label %for.end8
for.cond3.preheader: ; preds = %for.body
%.pre = load i32, ptr %K, align 4, !tbaa !5
%1 = icmp sgt i32 %.pre, 1
br i1 %1, label %for.body5, label %for.end8
for.body: ; preds = %entry, %for.body
%i.015 = phi i32 [ %sub, %for.body ], [ %0, %entry ]
%2 = load i32, ptr %X, align 4, !tbaa !5
%sub = add nsw i32 %i.015, -1
%sub1 = sub nsw i32 %2, %sub
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub1)
%cmp = icmp ugt i32 %i.015, 1
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%i.117 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ]
%3 = load i32, ptr %X, align 4, !tbaa !5
%add = add nsw i32 %3, %i.117
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
%inc = add nuw nsw i32 %i.117, 1
%4 = load i32, ptr %K, align 4, !tbaa !5
%cmp4 = icmp slt i32 %inc, %4
br i1 %cmp4, label %for.body5, label %for.end8, !llvm.loop !11
for.end8: ; preds = %for.body5, %entry, %for.cond3.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int k,x;
int i;
scanf("%d%d",&k,&x);
for(i=x-k+1;i<=x+k-1;i++)
{
printf("%d ",i);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220092/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220092/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%add16 = add i32 %0, -1
%sub27 = add i32 %add16, %1
%cmp.not.not8 = icmp slt i32 %sub, %sub27
br i1 %cmp.not.not8, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.0.in9 = phi i32 [ %i.0, %for.body ], [ %sub, %entry ]
%i.0 = add nsw i32 %i.0.in9, 1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
%2 = load i32, ptr %x, align 4, !tbaa !5
%3 = load i32, ptr %k, align 4, !tbaa !5
%add1 = add i32 %2, -1
%sub2 = add i32 %add1, %3
%cmp.not.not = icmp slt i32 %i.0, %sub2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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 k,x;
scanf("%d %d",&k,&x);
for(int i=x-k+1;i<x+k;i++){
printf("%d ",i);
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220135/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220135/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%i.06 = add nsw i32 %sub, 1
%add17 = add nsw i32 %1, %0
%cmp8 = icmp slt i32 %i.06, %add17
br i1 %cmp8, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
ret i32 0
for.body: ; preds = %entry, %for.body
%i.09 = phi i32 [ %i.0, %for.body ], [ %i.06, %entry ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.09)
%i.0 = add nsw i32 %i.09, 1
%2 = load i32, ptr %x, align 4, !tbaa !5
%3 = load i32, ptr %k, align 4, !tbaa !5
%add1 = add nsw i32 %3, %2
%cmp = icmp slt i32 %i.0, %add1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; 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>
int main(void){
int K, X, i;
scanf("%d%d", &K, &X);
for (i=X-K+1; i<=X+K-1; i++) {
if (i<X+K-1) printf("%d ", i);
else printf("%d", i);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220179/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220179/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%X = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %X) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K, ptr noundef nonnull %X)
%0 = load i32, ptr %X, align 4, !tbaa !5
%1 = load i32, ptr %K, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%add113 = add i32 %0, -1
%sub214 = add i32 %add113, %1
%cmp.not.not15 = icmp slt i32 %sub, %sub214
br i1 %cmp.not.not15, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%sub217 = phi i32 [ %sub2, %for.body ], [ %sub214, %entry ]
%i.016.in = phi i32 [ %i.016, %for.body ], [ %sub, %entry ]
%i.016 = add nsw i32 %i.016.in, 1
%cmp5 = icmp slt i32 %i.016, %sub217
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %i.016)
%2 = load i32, ptr %X, align 4, !tbaa !5
%3 = load i32, ptr %K, align 4, !tbaa !5
%add1 = add i32 %2, -1
%sub2 = add i32 %add1, %3
%cmp.not.not = icmp slt i32 %i.016, %sub2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %X) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #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"}
|
/*
cat <<EOF >mistaken-paste
*/
#pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#define BIG 2000000007
#define VERYBIG 2000000000000007LL
#define MOD 1000000007
#define FOD 998244353
typedef uint64_t ull;
typedef int64_t sll;
#define N_MAX 1000000
#define M_MAX 200000
#ifdef __cplusplus
#include <queue>
#include <stack>
#include <tuple>
#include <set>
#include <map>
#include <string>
// using namespace std; // HELL
using std::queue;
using std::priority_queue;
using std::stack;
using std::tuple;
using std::set;
using std::map;
using std::vector;
using std::greater;
using std::pair;
using std::string;
#endif
typedef struct {
int32_t a;
int32_t b;
} hw;
typedef struct {
sll a;
sll b;
} hwll;
typedef struct {
sll a;
sll b;
sll c;
} hwllc;
typedef struct {
hwll a;
hwll b;
} linell;
ull n, m;
ull h, w;
ull k;
ull q;
ull vua, vub, vuc, vud, vue, vuf;
sll vsa, vsb, vsc, vsd, vse, vsf;
long double vra, vrb, vrc;
double vda, vdb, vdc;
size_t slen;
size_t tlen;
char ch, dh;
ull umin (ull x, ull y) {
return (x < y) ? x : y;
}
ull umax (ull x, ull y) {
return (x > y) ? x : y;
}
sll smin (sll x, sll y) {
return (x < y) ? x : y;
}
sll smax (sll x, sll y) {
return (x > y) ? x : y;
}
ull gcd (ull x, ull y) {
if (x < y) {
return gcd(y, x);
} else if (y == 0) {
return x;
} else {
return gcd(y, x % y);
}
}
ull bitpow (ull a, ull x, ull modulo) {
ull result = 1;
while (x) {
if (x & 1) {
result *= a;
result %= modulo;
}
x /= 2;
a = (a * a) % modulo;
}
return result;
}
ull divide (ull a, ull b, ull modulo) {
return (a * bitpow(b, modulo - 2, modulo)) % modulo;
}
ull udiff (ull a, ull b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
sll sdiff (sll a, sll b) {
if (a >= b) {
return a - b;
} else {
return b - a;
}
}
void printUquotient (ull left, ull right) {
const int32_t digits = 20;
printf("%llu.", left / right);
left %= right;
for (int32_t i = 0; i < digits; i++) {
left *= 10;
printf("%1d", left / right);
left %= right;
}
puts("");
return;
}
void printSquotient (sll left, sll right) {
if (left * right < 0) putchar('-');
printUquotient(sdiff(left, 0), sdiff(right, 0));
return;
}
int bitcount (ull n) {
int result = 0;
while (n) {
if (n & 1) result++;
n /= 2;
}
return result;
}
#ifdef __cplusplus
bool setfind (set<ull> s, ull x) {
return (s.find(x) != s.end());
}
#endif
// double distance (sll x1, sll y1, sll x2, sll y2) {
// double xdist2, ydist2, origindist, dist;
// xdist2 = (x1 - x2) * (x1 - x2);
// ydist2 = (y1 - y2) * (y1 - y2);
// return sqrt(xdist2 + ydist2);
// }
int32_t pullcomp (const void *left, const void *right) {
ull l = *(ull*)left;
ull r = *(ull*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t psllcomp (const void *left, const void *right) {
sll l = *(sll*)left;
sll r = *(sll*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pcharcomp (const void *left, const void *right) {
char l = *(char*)left;
char r = *(char*)right;
if (l < r) {
return -1;
}
if (l > r) {
return +1;
}
return 0;
}
int32_t pstrcomp (const void *left, const void *right) {
char* l = *(char**)left;
char* r = *(char**)right;
return strcmp(l, r);
}
int32_t phwllABcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
return 0;
}
int32_t phwllREVcomp (const void *left, const void *right) {
hwll l = *(hwll*)left;
hwll r = *(hwll*)right;
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
return 0;
}
int32_t ptriplecomp (const void *left, const void *right) {
hwllc l = *(hwllc*)left;
hwllc r = *(hwllc*)right;
if (l.a < r.a) {
return -1;
}
if (l.a > r.a) {
return +1;
}
if (l.b < r.b) {
return -1;
}
if (l.b > r.b) {
return +1;
}
if (l.c < r.c) {
return -1;
}
if (l.c > r.c) {
return +1;
}
return 0;
}
bool isinrange (sll left, sll x, sll right) {
return (left <= x && x <= right);
}
bool isinrange_soft (sll left, sll x, sll right) {
return (left <= x && x <= right) || (left >= x && x >= right);
}
ull parent[N_MAX];
ull rank[N_MAX];
void uf_init (ull n) {
for (sll i = 0; i < n; i++) {
parent[i] = i;
rank[i] = 0;
}
}
ull uf_find (ull x) {
if (parent[x] == x) return x;
return parent[x] = uf_find(parent[x]);
}
sll uf_union (ull a, ull b) {
a = uf_find(a);
b = uf_find(b);
if (a == b) return -1;
if (rank[a] > rank[b]) {
a ^= (b ^= (a ^= b));
}
parent[a] = b;
if (rank[a] == rank[b]) {
rank[b]++;
}
return b;
}
sll a[N_MAX];
// sll a[3001][3001];
sll b[N_MAX];
sll c[N_MAX];
char s[N_MAX + 1];
// char s[3010][3010];
char t[N_MAX + 1];
// char t[3010][3010];
// hwll xy[N_MAX];
ull solve () {
sll i, j, ki, li;
// ull result = 0;
sll result = 0;
double dresult = 0;
// ull maybe = 0;
sll maybe = 0;
// ull sum = 0;
sll sum = 0;
sll item;
ull *dpcell;
dresult = (double)((double)(m - 1) * (double)(n - k) * (k ? 2 : 1)) / (double)((double)n * (double)n);
// printf("%llu\n", result);
printf("%.15lf\n", dresult);
// puts(s);
return 0;
success:
// puts("YES");
// puts("Yes");
// printf("%llu\n", result);
// puts("0");
// puts("First");
return 0;
fail:
// puts("NO");
// puts("No");
// puts("0");
puts("-1");
// puts("-1 -1 -1");
// puts("Second");
return 1;
}
int32_t main (void) {
int32_t i, j;
int32_t x, y;
// scanf("%lf%lf", &vda, &vdb, &vdc);
// scanf("%lld%lld", &vsa, &vsb, &vsc, &vsd);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud);
// scanf("%*llu%*llu");
// scanf("%llu%llu", &h, &w);
scanf("%llu%llu", &n, &m);
scanf("%llu", &k, &n, &m);
// scanf("%llu%llu", &vua, &vub, &vuc, &vud, &vue, &vuf);
// vua--;
// vub--;
// vuc--;
// vud--;
// scanf("%lld%lld", &vsa, &vsb, &vsc);
// scanf("%s", s);
// scanf("%s", t);
// scanf("%llu", &k);
// scanf("%llu", &q);
// for (i = 0; i < m; i++) {
// // scanf("%lld%lld", &xy[i].a, &xy[i].b);
// scanf("%lld", &a[i]);
// scanf("%lld", &b[i]);
// // scanf("%lld", &c[i]);
// // scanf("%lld", &t[i]);
// a[i]--;
// b[i]--;
// // c[i]--;
// }
// scanf("%llu%llu", &m, &k);
// for (i = 0; i < n; i++) {
// scanf("%llu", &b[i]);
// // b[i]--;
// }
// scanf("%llu", &q);
// for (i = 0; i < n; i++) {
// for (j = 0; j < n; j++) {
// scanf("%llu", &a[i][j]);
// }
// }
// for (i = 0; i < h; i++) {
// scanf("%s", &s[i]);
// }
// scanf("%llu", &k);
// scanf("%llu", &q);
solve();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220229/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220229/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu.\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%1d\00", align 1
@parent = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@rank = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@m = dso_local global i64 0, align 8
@n = dso_local global i64 0, align 8
@k = dso_local global i64 0, align 8
@.str.3 = private unnamed_addr constant [8 x i8] c"%.15lf\0A\00", align 1
@.str.5 = private unnamed_addr constant [9 x i8] c"%llu%llu\00", align 1
@.str.6 = private unnamed_addr constant [5 x i8] c"%llu\00", align 1
@h = dso_local local_unnamed_addr global i64 0, align 8
@w = dso_local local_unnamed_addr global i64 0, align 8
@q = dso_local local_unnamed_addr global i64 0, align 8
@vua = dso_local local_unnamed_addr global i64 0, align 8
@vub = dso_local local_unnamed_addr global i64 0, align 8
@vuc = dso_local local_unnamed_addr global i64 0, align 8
@vud = dso_local local_unnamed_addr global i64 0, align 8
@vue = dso_local local_unnamed_addr global i64 0, align 8
@vuf = dso_local local_unnamed_addr global i64 0, align 8
@vsa = dso_local local_unnamed_addr global i64 0, align 8
@vsb = dso_local local_unnamed_addr global i64 0, align 8
@vsc = dso_local local_unnamed_addr global i64 0, align 8
@vsd = dso_local local_unnamed_addr global i64 0, align 8
@vse = dso_local local_unnamed_addr global i64 0, align 8
@vsf = dso_local local_unnamed_addr global i64 0, align 8
@vra = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrb = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vrc = dso_local local_unnamed_addr global x86_fp80 0xK00000000000000000000, align 16
@vda = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdb = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@vdc = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@slen = dso_local local_unnamed_addr global i64 0, align 8
@tlen = dso_local local_unnamed_addr global i64 0, align 8
@ch = dso_local local_unnamed_addr global i8 0, align 1
@dh = dso_local local_unnamed_addr global i8 0, align 1
@a = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@b = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@t = dso_local local_unnamed_addr global [1000001 x i8] zeroinitializer, align 16
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umin(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umin.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @umax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.umax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smin(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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @smax(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %x, i64 %y)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #1 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%x.tr = phi i64 [ %x, %entry ], [ %y.tr, %tailrecurse.backedge ]
%y.tr = phi i64 [ %y, %entry ], [ %y.tr.be, %tailrecurse.backedge ]
%cmp = icmp ult i64 %x.tr, %y.tr
br i1 %cmp, label %tailrecurse.backedge, label %if.else
if.else: ; preds = %tailrecurse
%cmp1 = icmp eq i64 %y.tr, 0
br i1 %cmp1, label %return, label %if.else3
if.else3: ; preds = %if.else
%rem = urem i64 %x.tr, %y.tr
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.else3, %tailrecurse
%y.tr.be = phi i64 [ %rem, %if.else3 ], [ %x.tr, %tailrecurse ]
br label %tailrecurse
return: ; preds = %if.else
ret i64 %x.tr
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @bitpow(i64 noundef %a, i64 noundef %x, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%tobool.not12 = icmp eq i64 %x, 0
br i1 %tobool.not12, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end
%result.015 = phi i64 [ %result.1, %if.end ], [ 1, %entry ]
%a.addr.014 = phi i64 [ %rem3, %if.end ], [ %a, %entry ]
%x.addr.013 = phi i64 [ %div11, %if.end ], [ %x, %entry ]
%and = and i64 %x.addr.013, 1
%tobool1.not = icmp eq i64 %and, 0
br i1 %tobool1.not, label %if.end, label %if.then
if.then: ; preds = %while.body
%mul = mul i64 %result.015, %a.addr.014
%rem = urem i64 %mul, %modulo
br label %if.end
if.end: ; preds = %if.then, %while.body
%result.1 = phi i64 [ %rem, %if.then ], [ %result.015, %while.body ]
%div11 = lshr i64 %x.addr.013, 1
%mul2 = mul i64 %a.addr.014, %a.addr.014
%rem3 = urem i64 %mul2, %modulo
%tobool.not = icmp ult i64 %x.addr.013, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %if.end, %entry
%result.0.lcssa = phi i64 [ 1, %entry ], [ %result.1, %if.end ]
ret i64 %result.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @divide(i64 noundef %a, i64 noundef %b, i64 noundef %modulo) local_unnamed_addr #1 {
entry:
%sub = add i64 %modulo, -2
%tobool.not12.i = icmp eq i64 %sub, 0
br i1 %tobool.not12.i, label %bitpow.exit, label %while.body.i
while.body.i: ; preds = %entry, %if.end.i
%result.015.i = phi i64 [ %result.1.i, %if.end.i ], [ 1, %entry ]
%a.addr.014.i = phi i64 [ %rem3.i, %if.end.i ], [ %b, %entry ]
%x.addr.013.i = phi i64 [ %div11.i, %if.end.i ], [ %sub, %entry ]
%and.i = and i64 %x.addr.013.i, 1
%tobool1.not.i = icmp eq i64 %and.i, 0
br i1 %tobool1.not.i, label %if.end.i, label %if.then.i
if.then.i: ; preds = %while.body.i
%mul.i = mul i64 %a.addr.014.i, %result.015.i
%rem.i = urem i64 %mul.i, %modulo
br label %if.end.i
if.end.i: ; preds = %if.then.i, %while.body.i
%result.1.i = phi i64 [ %rem.i, %if.then.i ], [ %result.015.i, %while.body.i ]
%div11.i = lshr i64 %x.addr.013.i, 1
%mul2.i = mul i64 %a.addr.014.i, %a.addr.014.i
%rem3.i = urem i64 %mul2.i, %modulo
%tobool.not.i = icmp ult i64 %x.addr.013.i, 2
br i1 %tobool.not.i, label %bitpow.exit, label %while.body.i, !llvm.loop !5
bitpow.exit: ; preds = %if.end.i, %entry
%result.0.lcssa.i = phi i64 [ 1, %entry ], [ %result.1.i, %if.end.i ]
%mul = mul i64 %result.0.lcssa.i, %a
%rem = urem i64 %mul, %modulo
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @udiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not = icmp ult i64 %a, %b
%sub = sub i64 %a, %b
%sub1 = sub i64 %b, %a
%retval.0 = select i1 %cmp.not, i64 %sub1, i64 %sub
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @sdiff(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub = sub nsw i64 %a, %b
%retval.0 = tail call i64 @llvm.abs.i64(i64 %sub, i1 true)
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @printUquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 {
entry:
%div = udiv i64 %left, %right
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div)
%left.addr.0 = urem i64 %left, %right
%mul = mul i64 %left.addr.0, 10
%div1 = udiv i64 %mul, %right
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1)
%left.addr.0.1 = urem i64 %mul, %right
%mul.1 = mul i64 %left.addr.0.1, 10
%div1.1 = udiv i64 %mul.1, %right
%call2.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.1)
%left.addr.0.2 = urem i64 %mul.1, %right
%mul.2 = mul i64 %left.addr.0.2, 10
%div1.2 = udiv i64 %mul.2, %right
%call2.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.2)
%left.addr.0.3 = urem i64 %mul.2, %right
%mul.3 = mul i64 %left.addr.0.3, 10
%div1.3 = udiv i64 %mul.3, %right
%call2.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.3)
%left.addr.0.4 = urem i64 %mul.3, %right
%mul.4 = mul i64 %left.addr.0.4, 10
%div1.4 = udiv i64 %mul.4, %right
%call2.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.4)
%left.addr.0.5 = urem i64 %mul.4, %right
%mul.5 = mul i64 %left.addr.0.5, 10
%div1.5 = udiv i64 %mul.5, %right
%call2.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.5)
%left.addr.0.6 = urem i64 %mul.5, %right
%mul.6 = mul i64 %left.addr.0.6, 10
%div1.6 = udiv i64 %mul.6, %right
%call2.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.6)
%left.addr.0.7 = urem i64 %mul.6, %right
%mul.7 = mul i64 %left.addr.0.7, 10
%div1.7 = udiv i64 %mul.7, %right
%call2.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.7)
%left.addr.0.8 = urem i64 %mul.7, %right
%mul.8 = mul i64 %left.addr.0.8, 10
%div1.8 = udiv i64 %mul.8, %right
%call2.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.8)
%left.addr.0.9 = urem i64 %mul.8, %right
%mul.9 = mul i64 %left.addr.0.9, 10
%div1.9 = udiv i64 %mul.9, %right
%call2.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.9)
%left.addr.0.10 = urem i64 %mul.9, %right
%mul.10 = mul i64 %left.addr.0.10, 10
%div1.10 = udiv i64 %mul.10, %right
%call2.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.10)
%left.addr.0.11 = urem i64 %mul.10, %right
%mul.11 = mul i64 %left.addr.0.11, 10
%div1.11 = udiv i64 %mul.11, %right
%call2.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.11)
%left.addr.0.12 = urem i64 %mul.11, %right
%mul.12 = mul i64 %left.addr.0.12, 10
%div1.12 = udiv i64 %mul.12, %right
%call2.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.12)
%left.addr.0.13 = urem i64 %mul.12, %right
%mul.13 = mul i64 %left.addr.0.13, 10
%div1.13 = udiv i64 %mul.13, %right
%call2.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.13)
%left.addr.0.14 = urem i64 %mul.13, %right
%mul.14 = mul i64 %left.addr.0.14, 10
%div1.14 = udiv i64 %mul.14, %right
%call2.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.14)
%left.addr.0.15 = urem i64 %mul.14, %right
%mul.15 = mul i64 %left.addr.0.15, 10
%div1.15 = udiv i64 %mul.15, %right
%call2.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.15)
%left.addr.0.16 = urem i64 %mul.15, %right
%mul.16 = mul i64 %left.addr.0.16, 10
%div1.16 = udiv i64 %mul.16, %right
%call2.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.16)
%left.addr.0.17 = urem i64 %mul.16, %right
%mul.17 = mul i64 %left.addr.0.17, 10
%div1.17 = udiv i64 %mul.17, %right
%call2.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.17)
%left.addr.0.18 = urem i64 %mul.17, %right
%mul.18 = mul i64 %left.addr.0.18, 10
%div1.18 = udiv i64 %mul.18, %right
%call2.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.18)
%left.addr.0.19 = urem i64 %mul.18, %right
%mul.19 = mul i64 %left.addr.0.19, 10
%div1.19 = udiv i64 %mul.19, %right
%call2.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div1.19)
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %0)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @printSquotient(i64 noundef %left, i64 noundef %right) local_unnamed_addr #3 {
entry:
%mul = mul nsw i64 %right, %left
%cmp = icmp slt i64 %mul, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load ptr, ptr @stdout, align 8, !tbaa !7
%call.i = tail call noundef i32 @putc(i32 noundef 45, ptr noundef %0)
br label %if.end
if.end: ; preds = %if.then, %entry
%retval.0.i = tail call i64 @llvm.abs.i64(i64 %left, i1 true)
%retval.0.i5 = tail call i64 @llvm.abs.i64(i64 %right, i1 true)
tail call void @printUquotient(i64 noundef %retval.0.i, i64 noundef %retval.0.i5)
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @bitcount(i64 noundef %n) local_unnamed_addr #1 {
entry:
%tobool.not6 = icmp eq i64 %n, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%result.08 = phi i32 [ %spec.select, %while.body ], [ 0, %entry ]
%n.addr.07 = phi i64 [ %div5, %while.body ], [ %n, %entry ]
%0 = trunc i64 %n.addr.07 to i32
%1 = and i32 %0, 1
%spec.select = add i32 %1, %result.08
%div5 = lshr i64 %n.addr.07, 1
%tobool.not = icmp ult i64 %n.addr.07, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
%result.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.body ]
ret i32 %result.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pullcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp ult i64 %0, %1
%cmp1 = icmp ugt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @psllcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %left, align 8, !tbaa !12
%1 = load i64, ptr %right, align 8, !tbaa !12
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @pcharcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %left, align 1, !tbaa !14
%1 = load i8, ptr %right, align 1, !tbaa !14
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp sgt i8 %0, %1
%. = zext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @pstrcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #6 {
entry:
%0 = load ptr, ptr %left, align 8, !tbaa !7
%1 = load ptr, ptr %right, align 8, !tbaa !7
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #13
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllABcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @phwllREVcomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !15
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !15
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
%. = zext i1 %cmp13 to i32
br label %cleanup
cleanup: ; preds = %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ %., %if.end10 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ptriplecomp(ptr nocapture noundef readonly %left, ptr nocapture noundef readonly %right) local_unnamed_addr #5 {
entry:
%l.sroa.0.0.copyload = load i64, ptr %left, align 8, !tbaa.struct !17
%l.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 8
%l.sroa.5.0.copyload = load i64, ptr %l.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%l.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %left, i64 16
%l.sroa.7.0.copyload = load i64, ptr %l.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%r.sroa.0.0.copyload = load i64, ptr %right, align 8, !tbaa.struct !17
%r.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 8
%r.sroa.5.0.copyload = load i64, ptr %r.sroa.5.0..sroa_idx, align 8, !tbaa.struct !15
%r.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %right, i64 16
%r.sroa.7.0.copyload = load i64, ptr %r.sroa.7.0..sroa_idx, align 8, !tbaa.struct !16
%cmp = icmp slt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%cmp4 = icmp sgt i64 %l.sroa.0.0.copyload, %r.sroa.0.0.copyload
br i1 %cmp4, label %cleanup, label %if.end6
if.end6: ; preds = %if.end
%cmp8 = icmp slt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp8, label %cleanup, label %if.end10
if.end10: ; preds = %if.end6
%cmp13 = icmp sgt i64 %l.sroa.5.0.copyload, %r.sroa.5.0.copyload
br i1 %cmp13, label %cleanup, label %if.end15
if.end15: ; preds = %if.end10
%cmp17 = icmp slt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
br i1 %cmp17, label %cleanup, label %if.end19
if.end19: ; preds = %if.end15
%cmp22 = icmp sgt i64 %l.sroa.7.0.copyload, %r.sroa.7.0.copyload
%. = zext i1 %cmp22 to i32
br label %cleanup
cleanup: ; preds = %if.end19, %if.end15, %if.end10, %if.end6, %if.end, %entry
%retval.0 = phi i32 [ -1, %entry ], [ 1, %if.end ], [ -1, %if.end6 ], [ 1, %if.end10 ], [ -1, %if.end15 ], [ %., %if.end19 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp = icmp sle i64 %left, %x
%cmp1 = icmp sle i64 %x, %right
%0 = and i1 %cmp, %cmp1
ret i1 %0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local zeroext i1 @isinrange_soft(i64 noundef %left, i64 noundef %x, i64 noundef %right) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %left, %x
%cmp1.not = icmp sgt i64 %x, %right
%or.cond = or i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %lor.rhs, label %lor.end
lor.rhs: ; preds = %entry
%cmp2 = icmp sge i64 %left, %x
%cmp3 = icmp sge i64 %x, %right
%0 = and i1 %cmp2, %cmp3
br label %lor.end
lor.end: ; preds = %entry, %lor.rhs
%1 = phi i1 [ %0, %lor.rhs ], [ true, %entry ]
ret i1 %1
}
; Function Attrs: nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @uf_init(i64 noundef %n) local_unnamed_addr #8 {
entry:
%cmp6.not = icmp eq i64 %n, 0
br i1 %cmp6.not, label %for.cond.cleanup, label %for.body.preheader
for.body.preheader: ; preds = %entry
%0 = shl nuw i64 %n, 3
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @rank, i8 0, i64 %0, i1 false), !tbaa !12
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
%1 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %index
store <2 x i64> %vec.ind, ptr %1, align 16, !tbaa !12
%2 = getelementptr inbounds i64, ptr %1, i64 2
store <2 x i64> %step.add, ptr %2, align 16, !tbaa !12
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
ret void
for.body: ; preds = %for.body.preheader9, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader9 ]
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %i.07
store i64 %i.07, ptr %arrayidx, align 8, !tbaa !12
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !21
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @uf_find(i64 noundef %x) local_unnamed_addr #9 {
entry:
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %x
%0 = load i64, ptr %arrayidx, align 8, !tbaa !12
%cmp = icmp eq i64 %0, %x
br i1 %cmp, label %common.ret7, label %if.end
common.ret7: ; preds = %entry, %if.end
%common.ret7.op = phi i64 [ %call, %if.end ], [ %x, %entry ]
ret i64 %common.ret7.op
if.end: ; preds = %entry
%call = tail call i64 @uf_find(i64 noundef %0)
store i64 %call, ptr %arrayidx, align 8, !tbaa !12
br label %common.ret7
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @uf_union(i64 noundef %a, i64 noundef %b) local_unnamed_addr #10 {
entry:
%call = tail call i64 @uf_find(i64 noundef %a)
%call1 = tail call i64 @uf_find(i64 noundef %b)
%cmp = icmp eq i64 %call, %call1
br i1 %cmp, label %return, label %if.end
if.end: ; preds = %entry
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call
%0 = load i64, ptr %arrayidx, align 8, !tbaa !12
%arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %call1
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !12
%cmp3 = icmp ugt i64 %0, %1
%spec.select = select i1 %cmp3, i64 %call1, i64 %call
%spec.select29 = select i1 %cmp3, i64 %call, i64 %call1
%arrayidx8 = getelementptr inbounds [1000000 x i64], ptr @parent, i64 0, i64 %spec.select
store i64 %spec.select29, ptr %arrayidx8, align 8, !tbaa !12
%arrayidx9 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %spec.select
%2 = load i64, ptr %arrayidx9, align 8, !tbaa !12
%arrayidx10 = getelementptr inbounds [1000000 x i64], ptr @rank, i64 0, i64 %spec.select29
%3 = load i64, ptr %arrayidx10, align 8, !tbaa !12
%cmp11 = icmp eq i64 %2, %3
br i1 %cmp11, label %if.then12, label %return
if.then12: ; preds = %if.end
%inc = add i64 %2, 1
store i64 %inc, ptr %arrayidx10, align 8, !tbaa !12
br label %return
return: ; preds = %if.end, %if.then12, %entry
%retval.0 = phi i64 [ -1, %entry ], [ %spec.select29, %if.then12 ], [ %spec.select29, %if.end ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @solve() local_unnamed_addr #3 {
entry:
%0 = load i64, ptr @m, align 8, !tbaa !12
%sub = add i64 %0, -1
%conv = uitofp i64 %sub to double
%1 = load i64, ptr @n, align 8, !tbaa !12
%2 = load i64, ptr @k, align 8, !tbaa !12
%sub1 = sub i64 %1, %2
%conv2 = uitofp i64 %sub1 to double
%mul = fmul double %conv, %conv2
%tobool.not = icmp eq i64 %2, 0
%conv3 = select i1 %tobool.not, double 1.000000e+00, double 2.000000e+00
%mul4 = fmul double %conv3, %mul
%conv5 = uitofp i64 %1 to double
%mul7 = fmul double %conv5, %conv5
%div = fdiv double %mul4, %mul7
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %div)
ret i64 0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull @n, ptr noundef nonnull @m)
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef nonnull @k, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i64, ptr @m, align 8, !tbaa !12
%sub.i = add i64 %0, -1
%conv.i = uitofp i64 %sub.i to double
%1 = load i64, ptr @n, align 8, !tbaa !12
%2 = load i64, ptr @k, align 8, !tbaa !12
%sub1.i = sub i64 %1, %2
%conv2.i = uitofp i64 %sub1.i to double
%mul.i = fmul double %conv.i, %conv2.i
%tobool.not.i = icmp eq i64 %2, 0
%conv3.i = select i1 %tobool.not.i, double 1.000000e+00, double 2.000000e+00
%mul4.i = fmul double %conv3.i, %mul.i
%conv5.i = uitofp i64 %1 to double
%mul7.i = fmul double %conv5.i, %conv5.i
%div.i = fdiv double %mul4.i, %mul7.i
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %div.i)
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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #12
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress 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 #6 = { mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nofree nosync nounwind memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #13 = { 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 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !9, i64 0}
!14 = !{!9, !9, i64 0}
!15 = !{i64 0, i64 8, !12, i64 8, i64 8, !12}
!16 = !{i64 0, i64 8, !12}
!17 = !{i64 0, i64 8, !12, i64 8, i64 8, !12, i64 16, i64 8, !12}
!18 = distinct !{!18, !6, !19, !20}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !6, !20, !19}
|
#include <stdio.h>
#include <stdlib.h>
#define NIL NULL
typedef struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
}* Node;
void treeDelete(Node);
void insert(int);
void inorder(Node);
void preorder(Node);
Node root;
Node treeMinimum(Node x){
}
Node treeMaximum(Node x){
}
Node treeSearch(Node u, int key){
while(u!=NIL){
if(u->key == key) return u;
else if(u->key < key) u = u->right;
else u = u->left;
}
return NIL;
}
Node treeSuccessor(Node x){
}
int main(){
int n, i, x;
char elm[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", elm);
if ( elm[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( elm[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( elm[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( elm[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
}
void insert(int key){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = key;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y=x;
if(z->key < x->key){
x = x->left;// 左の子へ移動
}
else x = x->right;// 右の子へ移動
}
z->parent = y;
if(y==NIL){// T が空の場合
root=z;
}
else if(z->key < y->key){// z を y の左の子にする
y->left = z;
}
else y->right = z;// z を y の右の子にする
}
void inorder(Node u){
if(u->left!=NIL)inorder(u->left);
printf(" %d",u->key);
if(u->right!=NIL)inorder(u->right);
}
void preorder(Node u){
printf(" %d",u->key);
if(u->left!=NIL)preorder(u->left);
if(u->right!=NIL)preorder(u->right);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220272/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220272/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str.5 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noalias ptr @treeMinimum(ptr nocapture noundef readnone %x) local_unnamed_addr #0 {
entry:
ret ptr undef
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noalias ptr @treeMaximum(ptr nocapture noundef readnone %x) local_unnamed_addr #0 {
entry:
ret ptr undef
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %key) local_unnamed_addr #1 {
entry:
%cmp.not14 = icmp eq ptr %u, null
br i1 %cmp.not14, label %return, label %while.body
while.body: ; preds = %entry, %if.else
%u.addr.015 = phi ptr [ %u.addr.1, %if.else ], [ %u, %entry ]
%key1 = getelementptr inbounds %struct.node, ptr %u.addr.015, i64 0, i32 3
%0 = load i32, ptr %key1, align 8, !tbaa !5
%cmp2 = icmp eq i32 %0, %key
br i1 %cmp2, label %return, label %if.else
if.else: ; preds = %while.body
%cmp4 = icmp slt i32 %0, %key
%left = getelementptr inbounds %struct.node, ptr %u.addr.015, i64 0, i32 1
%u.addr.1.in = select i1 %cmp4, ptr %u.addr.015, ptr %left
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !11
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %return, label %while.body, !llvm.loop !12
return: ; preds = %while.body, %if.else, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %if.else ], [ %u.addr.015, %while.body ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local noalias ptr @treeSuccessor(ptr nocapture noundef readnone %x) local_unnamed_addr #0 {
entry:
ret ptr undef
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%elm = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %elm) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !14
%cmp60 = icmp sgt i32 %0, 0
br i1 %cmp60, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.061 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %elm)
%1 = load i8, ptr %elm, align 16, !tbaa !15
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !11
%3 = load i32, ptr %x, align 4, !tbaa !14
%cmp.not14.i = icmp eq ptr %2, null
br i1 %cmp.not14.i, label %if.else, label %while.body.i
while.body.i: ; preds = %if.then, %if.else.i
%u.addr.015.i = phi ptr [ %u.addr.1.i, %if.else.i ], [ %2, %if.then ]
%key1.i = getelementptr inbounds %struct.node, ptr %u.addr.015.i, i64 0, i32 3
%4 = load i32, ptr %key1.i, align 8, !tbaa !5
%cmp2.i = icmp eq i32 %4, %3
br i1 %cmp2.i, label %if.then8, label %if.else.i
if.else.i: ; preds = %while.body.i
%cmp4.i = icmp slt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.015.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp4.i, ptr %u.addr.015.i, ptr %left.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !11
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %while.body.i, !llvm.loop !12
if.then8: ; preds = %while.body.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.else.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !14
%6 = load ptr, ptr @root, align 8, !tbaa !11
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
%key1.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key1.i41, align 8, !tbaa !5
%cmp.not35.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not35.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.036.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key3.i = getelementptr inbounds %struct.node, ptr %x.036.i, i64 0, i32 3
%7 = load i32, ptr %key3.i, align 8, !tbaa !5
%cmp4.i43 = icmp sgt i32 %7, %5
%left5.i = getelementptr inbounds %struct.node, ptr %x.036.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp4.i43, ptr %left5.i, ptr %x.036.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !11
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !16
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.036.i, %while.body.i42 ]
%left14.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%parent38.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent38.i, align 8, !tbaa !17
store ptr %call.i, ptr %left14.sink.i, align 8, !tbaa !11
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !11
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !11
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
br label %for.inc
for.inc: ; preds = %if.then31, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.061, 1
%10 = load i32, ptr %n, align 4, !tbaa !14
%cmp = icmp slt i32 %inc, %10
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !18
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %elm) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %key) local_unnamed_addr #2 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !11
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
%key1 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %key, ptr %key1, align 8, !tbaa !5
%cmp.not35 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not35, label %if.then8, label %while.body
while.body: ; preds = %entry, %while.body
%x.036 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key3 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 3
%1 = load i32, ptr %key3, align 8, !tbaa !5
%cmp4 = icmp sgt i32 %1, %key
%left5 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 1
%x.1.in = select i1 %cmp4, ptr %left5, ptr %x.036
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !11
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else9, label %while.body, !llvm.loop !16
if.then8: ; preds = %entry
%parent38 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent38, align 8, !tbaa !17
br label %if.end18
if.else9: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.036, ptr %parent, align 8, !tbaa !17
%key11 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 3
%2 = load i32, ptr %key11, align 8, !tbaa !5
%cmp12 = icmp sgt i32 %2, %key
%left14 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 1
%spec.select = select i1 %cmp12, ptr %left14, ptr %x.036
br label %if.end18
if.end18: ; preds = %if.else9, %if.then8
%left14.sink = phi ptr [ @root, %if.then8 ], [ %spec.select, %if.else9 ]
store ptr %call, ptr %left14.sink, align 8, !tbaa !11
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr nocapture noundef readonly %u) local_unnamed_addr #2 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%u.tr = phi ptr [ %u, %entry ], [ %2, %if.end ]
%left = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !19
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
tail call void @inorder(ptr noundef nonnull %0)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%key = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %1)
%2 = load ptr, ptr %u.tr, align 8, !tbaa !20
%cmp2.not = icmp eq ptr %2, null
br i1 %cmp2.not, label %if.end5, label %tailrecurse
if.end5: ; preds = %if.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr nocapture noundef readonly %u) local_unnamed_addr #2 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%u.tr = phi ptr [ %u, %entry ], [ %2, %if.end ]
%key = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !19
%cmp.not = icmp eq ptr %1, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
tail call void @preorder(ptr noundef nonnull %1)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%2 = load ptr, ptr %u.tr, align 8, !tbaa !20
%cmp2.not = icmp eq ptr %2, null
br i1 %cmp2.not, label %if.end5, label %tailrecurse
if.end5: ; preds = %if.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @treeDelete(ptr nocapture noundef readnone %z) local_unnamed_addr #0 {
entry:
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !10, i64 24}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !10, i64 0}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !13}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !13}
!19 = !{!6, !7, i64 8}
!20 = !{!6, !7, i64 0}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x != NIL){
y = x;
if(z->key < x->key) x = x->left;
else x = x->right;
}
z->parent = y;
if(y == NIL) root = z;
else{
if(z->key < y->key) y->left = z;
else y->right = z;
}
}
Node treeSearch(Node u, int k){
while(u != NIL){
if(u->key == k) return u;
else if(u->key > k) u = u->left;
else u = u->right;
}
return NIL;
}
void inorder(Node u){
if(u == NIL) return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node u){
if(u == NIL) return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
}
else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220322/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220322/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\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
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #7
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !9
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !9
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !12
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !14
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !14
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !9
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #3 {
entry:
%cmp.not13 = icmp eq ptr %u, null
br i1 %cmp.not13, label %return, label %while.body
while.body: ; preds = %entry, %if.else
%u.addr.014 = phi ptr [ %u.addr.1, %if.else ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.014, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !9
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.else
if.else: ; preds = %while.body
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.addr.014, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %u.addr.014
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %return, label %while.body, !llvm.loop !15
return: ; preds = %while.body, %if.else, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %if.else ], [ %u.addr.014, %while.body ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !16
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !17
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #0 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !16
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !17
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !18
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.039 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !19
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !5
%3 = load i32, ptr %x, align 4, !tbaa !18
%cmp.not13.i = icmp eq ptr %2, null
br i1 %cmp.not13.i, label %if.else, label %while.body.i
while.body.i: ; preds = %if.then, %if.else.i
%u.addr.014.i = phi ptr [ %u.addr.1.i, %if.else.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.014.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !9
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.else.i
if.else.i: ; preds = %while.body.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.014.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %u.addr.014.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %while.body.i, !llvm.loop !15
if.then8: ; preds = %while.body.i
%puts31 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.else.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !18
%6 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #7
%key.i32 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i32, align 8, !tbaa !9
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i33
while.body.i33: ; preds = %if.then16, %while.body.i33
%x.035.i = phi ptr [ %x.1.i, %while.body.i33 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !9
%cmp3.i34 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i34, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i35 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i35, label %insert.exit, label %while.body.i33, !llvm.loop !12
insert.exit: ; preds = %while.body.i33, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i33 ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i33 ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !14
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !5
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !5
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !5
call void @preorder(ptr noundef %9)
%putchar30 = call i32 @putchar(i32 10)
br label %for.inc
for.inc: ; preds = %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.039, 1
%10 = load i32, ptr %n, align 4, !tbaa !18
%cmp = icmp slt i32 %inc, %10
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nofree nounwind }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 24}
!10 = !{!"node", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !6, i64 16}
!15 = distinct !{!15, !13}
!16 = !{!10, !6, i64 8}
!17 = !{!10, !6, i64 0}
!18 = !{!11, !11, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !13}
|
// Binary Search Tree II
#include <stdio.h>
#include <stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
Node root, nil;
// 木から key の値を持つノードを探す //
Node treeSearch(Node x, int k){
if(x == nil || k == x->key) return x;
if(k < x->key) treeSearch(x->left, k);
else treeSearch(x->right, k);
}
// ノード x から最小の key を探す //
Node treeMinimum(Node x){
while(x->left != nil)x = x->left;
return x;
}
// ノード x から最大の key を探す //
Node treeMaximum(Node x){
while(x->right != nil)x = x->right;
return x;
}
// 二分探索木へkを挿入 //
void insert(int k){
Node y = nil; // x の親
Node x = root; // T の根
Node z;
//z->parent = y;
z = (Node)malloc(sizeof(struct node));
z->key = k;
z->left = nil;
z->right = nil;
while(x != nil){
y = x; // 親を設定
if(z->key < x->key)x = x->left; // 左の子へ移動
else x = x->right; // 右の子へ移動
}
z->parent = y;
if(y == nil)root = z; // T が空の場合
else if(z->key < y->key)y->left = z; // z を y の左の子にする
else y->right = z; // z を y の右の子にする
}
// 再帰を使って中間順巡回(Inorder)で表示
void printInorder(Node u){
if(u == nil)return;
printInorder(u->left);
printf(" %d", u->key);
printInorder(u->right);
}
// 再帰を使って先行順巡回(Preorder)で表示
void printPreorder(Node u){
if(u == nil)return;
printf(" %d", u->key);
printPreorder(u->left);
printPreorder(u->right);
}
int main(){
int n, i, x;
char com[20];
Node t;
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != nil ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
printInorder(root);
printf("\n");
printPreorder(root);
printf("\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_220373/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_220373/source.c"
target datalayout = "e-m:e-p270: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.node = type { ptr, ptr, ptr, i32 }
@nil = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\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
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly returned %x, i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @nil, align 8, !tbaa !5
%cmp17 = icmp eq ptr %0, %x
br i1 %cmp17, label %if.end6, label %lor.lhs.false.preheader
lor.lhs.false.preheader: ; preds = %entry
%key.peel = getelementptr inbounds %struct.node, ptr %x, i64 0, i32 3
%1 = load i32, ptr %key.peel, align 8, !tbaa !9
%cmp1.peel.not = icmp eq i32 %1, %k
br i1 %cmp1.peel.not, label %if.end6, label %if.end.peel
if.end.peel: ; preds = %lor.lhs.false.preheader
%cmp3.peel = icmp sgt i32 %1, %k
%left.peel = getelementptr inbounds %struct.node, ptr %x, i64 0, i32 1
%spec.select = select i1 %cmp3.peel, ptr %left.peel, ptr %x
%x.tr.be.peel = load ptr, ptr %spec.select, align 8, !tbaa !5
%cmp.peel = icmp eq ptr %0, %x.tr.be.peel
br i1 %cmp.peel, label %if.end6, label %lor.lhs.false
lor.lhs.false: ; preds = %if.end.peel, %if.end
%x.tr18 = phi ptr [ %x.tr.be, %if.end ], [ %x.tr.be.peel, %if.end.peel ]
%key = getelementptr inbounds %struct.node, ptr %x.tr18, i64 0, i32 3
%2 = load i32, ptr %key, align 8, !tbaa !9
%cmp1 = icmp eq i32 %2, %k
br i1 %cmp1, label %if.end6, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %2, %k
%left = getelementptr inbounds %struct.node, ptr %x.tr18, i64 0, i32 1
%spec.select27 = select i1 %cmp3, ptr %left, ptr %x.tr18
%x.tr.be = load ptr, ptr %spec.select27, align 8, !tbaa !5
%cmp = icmp eq ptr %0, %x.tr.be
br i1 %cmp, label %if.end6, label %lor.lhs.false, !llvm.loop !12
if.end6: ; preds = %lor.lhs.false, %if.end, %lor.lhs.false.preheader, %if.end.peel, %entry
ret ptr %x
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @nil, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !14
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !15
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @nil, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%1 = load ptr, ptr %x.addr.0, align 8, !tbaa !17
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !18
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @nil, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #6
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !9
%left = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr %0, ptr %left, align 8, !tbaa !14
store ptr %0, ptr %call, align 8, !tbaa !17
%cmp.not34 = icmp eq ptr %1, %0
br i1 %cmp.not34, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %0, ptr %parent37, align 8, !tbaa !19
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %1, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key2, align 8, !tbaa !9
%cmp3 = icmp sgt i32 %2, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, %0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !19
%cmp6 = icmp eq ptr %x.035, %0
br i1 %cmp6, label %if.end17, label %if.else8
if.else8: ; preds = %while.end
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%3 = load i32, ptr %key10, align 8, !tbaa !9
%cmp11 = icmp sgt i32 %3, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %while.end, %while.end.thread
%left13.sink = phi ptr [ @root, %while.end.thread ], [ @root, %while.end ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @printInorder(ptr noundef readonly %u) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @nil, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !14
tail call void @printInorder(ptr noundef %1)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%2 = load i32, ptr %key, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%3 = load ptr, ptr %u.tr5, align 8, !tbaa !17
%4 = load ptr, ptr @nil, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @printPreorder(ptr noundef readonly %u) local_unnamed_addr #1 {
entry:
%0 = load ptr, ptr @nil, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%2 = load ptr, ptr %left, align 8, !tbaa !14
tail call void @printPreorder(ptr noundef %2)
%3 = load ptr, ptr %u.tr5, align 8, !tbaa !17
%4 = load ptr, ptr @nil, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !21
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.039 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !22
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then17
i8 112, label %if.then24
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !5
%3 = load i32, ptr %x, align 4, !tbaa !21
%4 = load ptr, ptr @nil, align 8, !tbaa !5
%cmp17.i = icmp eq ptr %4, %2
br i1 %cmp17.i, label %if.else, label %lor.lhs.false.preheader.i
lor.lhs.false.preheader.i: ; preds = %if.then
%key.peel.i = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 3
%5 = load i32, ptr %key.peel.i, align 8, !tbaa !9
%cmp1.peel.not.i = icmp eq i32 %5, %3
br i1 %cmp1.peel.not.i, label %if.then9, label %if.end.peel.i
if.end.peel.i: ; preds = %lor.lhs.false.preheader.i
%cmp3.peel.i = icmp sgt i32 %5, %3
%left.peel.i = getelementptr inbounds %struct.node, ptr %2, i64 0, i32 1
%spec.select.i = select i1 %cmp3.peel.i, ptr %left.peel.i, ptr %2
%x.tr.be.peel.i = load ptr, ptr %spec.select.i, align 8, !tbaa !5
%cmp.peel.i = icmp eq ptr %4, %x.tr.be.peel.i
br i1 %cmp.peel.i, label %if.then9, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.end.peel.i, %if.end.i
%x.tr18.i = phi ptr [ %x.tr.be.i, %if.end.i ], [ %x.tr.be.peel.i, %if.end.peel.i ]
%key.i = getelementptr inbounds %struct.node, ptr %x.tr18.i, i64 0, i32 3
%6 = load i32, ptr %key.i, align 8, !tbaa !9
%cmp1.i = icmp eq i32 %6, %3
br i1 %cmp1.i, label %if.then9, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %6, %3
%left.i = getelementptr inbounds %struct.node, ptr %x.tr18.i, i64 0, i32 1
%spec.select27.i = select i1 %cmp3.i, ptr %left.i, ptr %x.tr18.i
%x.tr.be.i = load ptr, ptr %spec.select27.i, align 8, !tbaa !5
%cmp.i = icmp eq ptr %4, %x.tr.be.i
br i1 %cmp.i, label %if.then9, label %lor.lhs.false.i, !llvm.loop !12
if.then9: ; preds = %if.end.i, %lor.lhs.false.i, %if.end.peel.i, %lor.lhs.false.preheader.i
%puts32 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then17: ; preds = %for.body
%call18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%7 = load i32, ptr %x, align 4, !tbaa !21
%8 = load ptr, ptr @nil, align 8, !tbaa !5
%9 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #6
%key.i33 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %7, ptr %key.i33, align 8, !tbaa !9
%left.i34 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
store ptr %8, ptr %left.i34, align 8, !tbaa !14
store ptr %8, ptr %call.i, align 8, !tbaa !17
%cmp.not34.i = icmp eq ptr %9, %8
br i1 %cmp.not34.i, label %while.end.thread.i, label %while.body.i
while.end.thread.i: ; preds = %if.then17
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %8, ptr %parent37.i, align 8, !tbaa !19
br label %insert.exit
while.body.i: ; preds = %if.then17, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %9, %if.then17 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%10 = load i32, ptr %key2.i, align 8, !tbaa !9
%cmp3.i35 = icmp sgt i32 %10, %7
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i35, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %x.1.i, %8
br i1 %cmp.not.i, label %while.end.i, label %while.body.i, !llvm.loop !20
while.end.i: ; preds = %while.body.i
%parent.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %x.035.i, ptr %parent.i, align 8, !tbaa !19
%cmp6.i = icmp eq ptr %x.035.i, %8
%spec.select = select i1 %cmp6.i, ptr @root, ptr %x.1.in.i
br label %insert.exit
insert.exit: ; preds = %while.end.i, %while.end.thread.i
%left13.sink.i = phi ptr [ @root, %while.end.thread.i ], [ %spec.select, %while.end.i ]
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !5
br label %for.inc
if.then24: ; preds = %for.body
%11 = load ptr, ptr @root, align 8, !tbaa !5
call void @printInorder(ptr noundef %11)
%putchar = call i32 @putchar(i32 10)
%12 = load ptr, ptr @root, align 8, !tbaa !5
call void @printPreorder(ptr noundef %12)
%putchar31 = call i32 @putchar(i32 10)
br label %for.inc
for.inc: ; preds = %for.body, %if.then9, %if.else, %if.then24, %insert.exit
%inc = add nuw nsw i32 %i.039, 1
%13 = load i32, ptr %n, align 4, !tbaa !21
%cmp = icmp slt i32 %inc, %13
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !23
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
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 @putchar(i32 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-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 allocsize(0) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 24}
!10 = !{!"node", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = !{!10, !6, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!10, !6, i64 0}
!18 = distinct !{!18, !16}
!19 = !{!10, !6, i64 16}
!20 = distinct !{!20, !16}
!21 = !{!11, !11, i64 0}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !16}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.